emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dd7a7633be 3/3: Merge from origin/emacs-29


From: Stefan Kangas
Subject: master dd7a7633be 3/3: Merge from origin/emacs-29
Date: Sat, 3 Dec 2022 00:47:02 -0500 (EST)

branch: master
commit dd7a7633bebc4db5caca3898bf318721f1f370c8
Merge: 98327e3719 1e36ad9458
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Merge from origin/emacs-29
    
    1e36ad9458 ; server-tests: remove CI debugging
    54633fcd76 ; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#...
    8413e95138 ; server-test CI debugging
    4b3eb928fe Fix server-tests run noninteractively (bug#59742)
    1b567f5a67 Use file-name-nondirectory to determine default project-name
    f72cda2b82 Speed up auto-completion in 'sh-script-mode'
    e5b0141b0d Fix error editing multisession variables (bug#59710)
---
 lisp/emacs-lisp/multisession.el |  5 +++--
 lisp/progmodes/project.el       |  4 ++--
 lisp/progmodes/sh-script.el     | 30 ++++++++++++++----------------
 lisp/subr.el                    |  2 +-
 test/lisp/server-tests.el       | 14 ++++++++++----
 5 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/lisp/emacs-lisp/multisession.el b/lisp/emacs-lisp/multisession.el
index 9d6e8c0d88..78d4137317 100644
--- a/lisp/emacs-lisp/multisession.el
+++ b/lisp/emacs-lisp/multisession.el
@@ -447,8 +447,9 @@ storage method to list."
   (let* ((object (or
                   ;; If the multisession variable already exists, use
                   ;; it (so that we update it).
-                  (and (intern-soft (cdr id))
-                       (bound-and-true-p (intern (cdr id))))
+                  (if-let (sym (intern-soft (cdr id)))
+                      (and (boundp sym) (symbol-value sym))
+                    nil)
                   ;; Create a new object.
                   (make-multisession
                    :package (car id)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 3f4a5fb04b..38d4fdad5f 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,7 +1,7 @@
 ;;; project.el --- Operations on the current project  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2015-2022 Free Software Foundation, Inc.
-;; Version: 0.9.1
+;; Version: 0.9.2
 ;; Package-Requires: ((emacs "26.1") (xref "1.4.0"))
 
 ;; This is a GNU ELPA :core package.  Avoid using functionality that
@@ -278,7 +278,7 @@ headers search path, load path, class path, and so on."
 (cl-defgeneric project-name (project)
   "A human-readable name for the project.
 Nominally unique, but not enforced."
-  (file-name-base (directory-file-name (project-root project))))
+  (file-name-nondirectory (directory-file-name (project-root project))))
 
 (cl-defgeneric project-ignores (_project _dir)
   "Return the list of glob patterns to ignore inside DIR.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 408ebfc045..e170d18afe 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1688,19 +1688,17 @@ This adds rules for comments and assignments."
 ;; (defun sh--var-completion-table (string pred action)
 ;;   (complete-with-action action (sh--vars-before-point) string pred))
 
-(defun sh--cmd-completion-table (string pred action)
-  (let ((cmds
-         (append (when (fboundp 'imenu--make-index-alist)
-                   (mapcar #'car
-                           (condition-case nil
-                               (imenu--make-index-alist)
-                             (imenu-unavailable nil))))
-                 (mapcar (lambda (v) (concat v "="))
-                         (sh--vars-before-point))
-                 (locate-file-completion-table
-                  exec-path exec-suffixes string pred t)
-                 sh--completion-keywords)))
-    (complete-with-action action cmds string pred)))
+(defun sh--cmd-completion-table-gen (string)
+  (append (when (fboundp 'imenu--make-index-alist)
+            (mapcar #'car
+                    (condition-case nil
+                        (imenu--make-index-alist)
+                      (imenu-unavailable nil))))
+          (mapcar (lambda (v) (concat v "="))
+                  (sh--vars-before-point))
+          (locate-file-completion-table
+           exec-path exec-suffixes string nil t)
+          sh--completion-keywords))
 
 (defun sh-completion-at-point-function ()
   (save-excursion
@@ -1713,14 +1711,14 @@ This adds rules for comments and assignments."
         (list start end (sh--vars-before-point)
               :company-kind (lambda (_) 'variable)))
        ((sh-smie--keyword-p)
-        (list start end #'sh--cmd-completion-table
+        (list start end
+              (completion-table-with-cache #'sh--cmd-completion-table-gen)
               :company-kind
               (lambda (s)
                 (cond
                  ((member s sh--completion-keywords) 'keyword)
                  ((string-suffix-p "=" s) 'variable)
-                 (t 'function)))
-              ))))))
+                 (t 'function)))))))))
 
 ;;; Indentation and navigation with SMIE.
 
diff --git a/lisp/subr.el b/lisp/subr.el
index cfce5b18c5..1566216279 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -5435,7 +5435,7 @@ and replace a sub-expression, e.g.
       (apply #'concat (nreverse matches)))))
 
 (defsubst string-equal-ignore-case (string1 string2)
-  "Like `string-equal', but case-insensitive.
+  "Compare STRING1 and STRING2 case-insensitively.
 Upper-case and lower-case letters are treated as equal.
 Unibyte strings are converted to multibyte for comparison."
   (declare (pure t) (side-effect-free t))
diff --git a/test/lisp/server-tests.el b/test/lisp/server-tests.el
index f8ecd046f2..ebf84481c6 100644
--- a/test/lisp/server-tests.el
+++ b/test/lisp/server-tests.el
@@ -21,9 +21,11 @@
 
 (require 'ert)
 (require 'server)
+(require 'cl-lib)
 
 (defconst server-tests/can-create-frames-p
-  (not (memq system-type '(windows-nt ms-dos)))
+  (and (not (memq system-type '(windows-nt ms-dos)))
+       (not (member (getenv "TERM") '("dumb" "" nil))))
   "Non-nil if we can create a new frame in the tests.
 Some tests below need to create new frames for the emacsclient.
 However, this doesn't work on all platforms.  In particular,
@@ -188,8 +190,9 @@ tests that `server-force-stop' doesn't delete frames (and 
even
 then, requires a few tricks to run as a regression test).  So
 long as this works, the problem in bug#58877 shouldn't occur."
   (skip-unless server-tests/can-create-frames-p)
-  (let ((starting-frame-count (length (frame-list)))
-        terminal)
+  (let* ((starting-frames (frame-list))
+         (starting-frame-count (length starting-frames))
+         terminal)
     (unwind-protect
         (server-tests/with-server
           (server-tests/with-client emacsclient '("-c") 'exit
@@ -214,6 +217,9 @@ long as this works, the problem in bug#58877 shouldn't 
occur."
       (when (and terminal
                  (eq (terminal-live-p terminal) t)
                  (not (eq system-type 'windows-nt)))
-        (delete-terminal terminal)))))
+        (delete-terminal terminal)))
+    ;; Delete the created frame.
+    (delete-frame (car (cl-set-difference (frame-list) starting-frames))
+                  t)))
 
 ;;; server-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]