Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

This commit is contained in:
Michael Albinus 2023-12-09 10:25:58 +01:00
commit ca709f9c06
4 changed files with 25 additions and 8 deletions

View file

@ -653,8 +653,8 @@ is t by default.
*** New value 'historical' for user option 'completions-sort'.
When 'completions-sort' is set to 'historical', completion candidates
will be sorted by their chronological order in the minibuffer history,
with more recent candidates appearing first.
will be first sorted alphabetically, and then re-sorted by their order
in the minibuffer history, with more recent candidates appearing first.
** Pcomplete

View file

@ -189,10 +189,24 @@ Completion Preview mode avoids updating the preview after these commands.")
"Return property PROP of the completion preview overlay."
(overlay-get completion-preview--overlay prop))
(defun completion-preview--window-selection-change (window)
"Hide completion preview in WINDOW after switching to another window.
Completion Preview mode adds this function to
`window-selection-change-functions', which see."
(unless (or (eq window (selected-window))
(eq window (minibuffer-selected-window)))
(with-current-buffer (window-buffer window)
(completion-preview-active-mode -1))))
(define-minor-mode completion-preview-active-mode
"Mode for when the completion preview is shown."
:interactive nil
(unless completion-preview-active-mode (completion-preview-hide)))
(if completion-preview-active-mode
(add-hook 'window-selection-change-functions
#'completion-preview--window-selection-change nil t)
(remove-hook 'window-selection-change-functions
#'completion-preview--window-selection-change t)
(completion-preview-hide)))
(defun completion-preview--try-table (table beg end props)
"Check TABLE for a completion matching the text between BEG and END.

View file

@ -503,10 +503,6 @@ identify a package as a VC package later on), building
documentation and marking the package as installed."
(let ((pkg-spec (package-vc--desc->spec pkg-desc))
missing)
;; Remove any previous instance of PKG-DESC from `package-alist'
(let ((pkgs (assq (package-desc-name pkg-desc) package-alist)))
(when pkgs
(setf (cdr pkgs) (seq-remove #'package-vc-p (cdr pkgs)))))
;; In case the package was installed directly from source, the
;; dependency list wasn't know beforehand, and they might have
@ -576,6 +572,11 @@ documentation and marking the package as installed."
(dolist (doc-file (ensure-list (plist-get pkg-spec :doc)))
(package-vc--build-documentation pkg-desc doc-file))))
;; Remove any previous instance of PKG-DESC from `package-alist'
(let ((pkgs (assq (package-desc-name pkg-desc) package-alist)))
(when pkgs
(setf (cdr pkgs) (seq-remove #'package-vc-p (cdr pkgs)))))
;; Update package-alist.
(let ((new-desc (package-load-descriptor pkg-dir)))
;; Activation has to be done before compilation, so that if we're

View file

@ -1323,7 +1323,9 @@ If it's nil, sorting is disabled.
If it's the symbol `alphabetical', candidates are sorted by
`minibuffer-sort-alphabetically'.
If it's the symbol `historical', candidates are sorted by
`minibuffer-sort-by-history'.
`minibuffer-sort-by-history', which first sorts alphabetically,
and then rearranges the order according to the order of the
candidates in the minibuffer history.
If it's a function, the function is called to sort the candidates.
The sorting function takes a list of completion candidate
strings, which it may modify; it should return a sorted list,