Merge from origin/emacs-29
1e36ad9458
; server-tests: remove CI debugging54633fcd76
; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#...8413e95138
; server-test CI debugging4b3eb928fe
Fix server-tests run noninteractively (bug#59742)1b567f5a67
Use file-name-nondirectory to determine default project-namef72cda2b82
Speed up auto-completion in 'sh-script-mode'e5b0141b0d
Fix error editing multisession variables (bug#59710)
This commit is contained in:
commit
dd7a7633be
5 changed files with 30 additions and 25 deletions
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue