commit 617bd85cd0bd1d0a73d405d623ee3dd41c7e8a37 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sat Apr 6 11:17:49 2024 +0800 Correct typos in and omissions from earlier Android port changes * java/AndroidManifest.xml.in: Remove duplicate permissions. * java/org/gnu/emacs/EmacsWindowManager.java (removeWindowConsumer): Disregard isFinishing for non-initial activities. diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in index 563914fb02c..f1047ac41d8 100644 --- a/java/AndroidManifest.xml.in +++ b/java/AndroidManifest.xml.in @@ -31,7 +31,7 @@ along with GNU Emacs. If not, see . --> android:versionName="@version@"> + everything. --> @@ -95,8 +95,6 @@ along with GNU Emacs. If not, see . --> - - @@ -185,7 +183,6 @@ along with GNU Emacs. If not, see . --> - diff --git a/java/org/gnu/emacs/EmacsWindowManager.java b/java/org/gnu/emacs/EmacsWindowManager.java index a239fdc8ac2..41ea3a15809 100644 --- a/java/org/gnu/emacs/EmacsWindowManager.java +++ b/java/org/gnu/emacs/EmacsWindowManager.java @@ -221,11 +221,14 @@ && isWindowEligible (consumer, window)) { consumer.detachWindow (); - /* Though pruneWindows will likely remove the same windows, call - onActivityDetached anyway if isFinishing is set, as in - obscure circumstances pruneWindows will not remove frames - bound to the system-started task. */ - if (isFinishing) + /* Though pruneWindows will likely remove the same window(s), + call onActivityDetached anyway if isFinishing is set, if + CONSUMER not be a multitasking activity, as in obscure + circumstances pruneWindows will not remove frames bound to + the system-started task. */ + if (isFinishing + && (!(consumer instanceof EmacsMultitaskActivity) + || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)) window.onActivityDetached (); } commit 0286a11f3139dfd4bb9d3989ae860b8c128e12d0 Author: Stefan Monnier Date: Fri Apr 5 18:29:16 2024 -0400 (help-fns-function-description-header): Fix last change (bug#70209) * lisp/help-fns.el (help-fns-function-description-header): Don't make a button for the type if it's not a type. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 27011575333..cfe27077055 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1096,15 +1096,15 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (setq elts (cdr-safe elts))) (concat beg (if is-full "keymap" "sparse keymap")))) (t - (let ((type - (if (and (consp def) (symbolp (car def))) - (car def) - (or (oclosure-type def) (cl-type-of def))))) - (concat beg (format "%s" - (make-text-button - (symbol-name type) nil - 'type 'help-type - 'help-args (list type))))))))) + (concat beg (format "%s" + (if (and (consp def) (symbolp (car def))) + (car def) + (let ((type (or (oclosure-type def) + (cl-type-of def)))) + (make-text-button + (symbol-name type) nil + 'type 'help-type + 'help-args (list type)))))))))) (with-current-buffer standard-output (insert description)) commit aa356d03aeb13942ae6688ce919e0aa9fb4f1689 Author: Michael Albinus Date: Fri Apr 5 19:43:56 2024 +0200 Make sh-script-tests.el more robust * test/lisp/progmodes/sh-script-tests.el (test-sh-script-indentation) (test-basic-sh-indentation, test-indent-after-continuation): * test/lisp/progmodes/sh-script-resources/sh-indents.erts (Code): Skip if `sh-indent-supported-here' is nil. (Bug#70196) diff --git a/test/lisp/progmodes/sh-script-resources/sh-indents.erts b/test/lisp/progmodes/sh-script-resources/sh-indents.erts index 36f4e4c22ab..5a72df0e7ef 100644 --- a/test/lisp/progmodes/sh-script-resources/sh-indents.erts +++ b/test/lisp/progmodes/sh-script-resources/sh-indents.erts @@ -1,6 +1,10 @@ Code: (lambda () (shell-script-mode) + (unless sh-indent-supported-here + (ert-skip + '((skip-unless sh-indent-supported-here) + :form sh-indent-supported-here :value nil))) (indent-region (point-min) (point-max))) Name: sh-indents1 diff --git a/test/lisp/progmodes/sh-script-tests.el b/test/lisp/progmodes/sh-script-tests.el index e73d52399d3..45add34a111 100644 --- a/test/lisp/progmodes/sh-script-tests.el +++ b/test/lisp/progmodes/sh-script-tests.el @@ -30,6 +30,7 @@ (insert "relative-path/to/configure --prefix=$prefix\\ --with-x") (shell-script-mode) + (skip-unless sh-indent-supported-here) (goto-char (point-min)) (forward-line 1) (indent-for-tab-command) @@ -42,6 +43,7 @@ (with-temp-buffer (insert "myecho () {\necho foo\n}\n") (shell-script-mode) + (skip-unless sh-indent-supported-here) (indent-region (point-min) (point-max)) (should (equal (buffer-string) "myecho () { @@ -56,6 +58,7 @@ (with-temp-buffer (insert "for f \\\nin a; do \\\ntoto; \\\ndone\n") (shell-script-mode) + (skip-unless sh-indent-supported-here) (let ((sh-indent-for-continuation '++)) (let ((sh-indent-after-continuation t)) (indent-region (point-min) (point-max)) commit 4e22ad8cef0710bf5ce3bf99deb8dd6e30d4078c Author: Juri Linkov Date: Fri Apr 5 19:44:52 2024 +0300 Mark display-comint-buffer-action as obsolete after adding a category. * lisp/window.el (display-comint-buffer-action): Append '(category . comint)' to the default value. Mark as obsolete. (display-tex-shell-buffer-action): Append '(category . tex-shell)' to the default value. Mark as obsolete. (bug#69983) diff --git a/etc/NEWS b/etc/NEWS index 32cec82f970..375c27a03de 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -303,6 +303,13 @@ by adding '(category . symbol)' to the condition part of It specifies whether the window of the displayed buffer should be selected or deselected at the end of executing the current command. +--- +*** User option 'display-comint-buffer-action' is now obsolete. +You can use a '(category . comint)' condition in 'display-buffer-alist' +to match buffers displayed by comint-related commands. Another +user option 'display-tex-shell-buffer-action' is obsolete too +for which you can use '(category . tex-shell)'. + +++ *** New variable 'window-restore-killed-buffer-windows'. It specifies how 'set-window-configuration' and 'window-state-put' diff --git a/lisp/window.el b/lisp/window.el index 3867f6fa6ef..29e7310958b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8923,7 +8923,8 @@ currently selected window; otherwise it will be displayed in another window." (pop-to-buffer buffer display-buffer--same-window-action norecord)) -(defcustom display-comint-buffer-action display-buffer--same-window-action +(defcustom display-comint-buffer-action + (append display-buffer--same-window-action '((category . comint))) "`display-buffer' action for displaying comint buffers." :type display-buffer--action-custom-type :risky t @@ -8931,8 +8932,14 @@ another window." :group 'windows :group 'comint) +(make-obsolete-variable + 'display-comint-buffer-action + "use a `(category . comint)' condition in `display-buffer-alist'." + "30.1") + (defcustom display-tex-shell-buffer-action '(display-buffer-in-previous-window - (inhibit-same-window . t)) + (inhibit-same-window . t) + (category . tex-shell)) "`display-buffer' action for displaying TeX shell buffers." :type display-buffer--action-custom-type :risky t @@ -8940,6 +8947,11 @@ another window." :group 'windows :group 'tex-run) +(make-obsolete-variable + 'display-tex-shell-buffer-action + "use a `(category . tex-shell)' condition in `display-buffer-alist'." + "30.1") + (defun read-buffer-to-switch (prompt) "Read the name of a buffer to switch to, prompting with PROMPT. Return the name of the buffer as a string. commit 6480de5ea74b6b2eeebdaa3bcf9fa8e384ffbab1 Author: Juri Linkov Date: Fri Apr 5 19:27:45 2024 +0300 ; Use two dashes for internal function minibuffer-visible-completions--bind * lisp/minibuffer.el (minibuffer-visible-completions--bind): Rename from minibuffer-visible-completions-bind. (minibuffer-visible-completions-map): Rename minibuffer-visible-completions-bind to minibuffer-visible-completions--bind. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 0a844c538b4..b007320b110 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3180,7 +3180,7 @@ and `RET' accepts the input typed into the minibuffer." t)) cmd)))) -(defun minibuffer-visible-completions-bind (binding) +(defun minibuffer-visible-completions--bind (binding) "Use BINDING when completions are visible. Return an item that is enabled only when a window displaying the *Completions* buffer exists." @@ -3190,12 +3190,12 @@ displaying the *Completions* buffer exists." (defvar-keymap minibuffer-visible-completions-map :doc "Local keymap for minibuffer input with visible completions." - "" (minibuffer-visible-completions-bind #'minibuffer-previous-completion) - "" (minibuffer-visible-completions-bind #'minibuffer-next-completion) - "" (minibuffer-visible-completions-bind #'minibuffer-previous-line-completion) - "" (minibuffer-visible-completions-bind #'minibuffer-next-line-completion) - "RET" (minibuffer-visible-completions-bind #'minibuffer-choose-completion-or-exit) - "C-g" (minibuffer-visible-completions-bind #'minibuffer-hide-completions)) + "" (minibuffer-visible-completions--bind #'minibuffer-previous-completion) + "" (minibuffer-visible-completions--bind #'minibuffer-next-completion) + "" (minibuffer-visible-completions--bind #'minibuffer-previous-line-completion) + "" (minibuffer-visible-completions--bind #'minibuffer-next-line-completion) + "RET" (minibuffer-visible-completions--bind #'minibuffer-choose-completion-or-exit) + "C-g" (minibuffer-visible-completions--bind #'minibuffer-hide-completions)) ;;; Completion tables. commit 50fab7062d9edf1a2698f3d468dcbcd1c9a3ee9b Author: Juri Linkov Date: Fri Apr 5 19:23:08 2024 +0300 * lisp/tab-bar.el (tab-bar-mode-map): New keymap (bug#69578). (tab-bar-select-tab-modifiers): Call tab-bar--undefine-keys before set-default in :set of defcustom. (tab-bar--define-keys, tab-bar--undefine-keys): Change keybindings in tab-bar-mode-map instead of the global map. Move checking of global-key-binding to tab-bar-mode--tab-key-bind. (tab-bar-mode--tab-key-bind): New internal function. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 05631c3c8f3..cd076664faf 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -104,10 +104,11 @@ For easier selection of tabs by their numbers, consider customizing (const alt)) :initialize #'custom-initialize-default :set (lambda (sym val) + (when tab-bar-mode + (tab-bar--undefine-keys)) (set-default sym val) ;; Reenable the tab-bar with new keybindings (when tab-bar-mode - (tab-bar--undefine-keys) (tab-bar--define-keys))) :group 'tab-bar :version "27.1") @@ -115,21 +116,17 @@ For easier selection of tabs by their numbers, consider customizing (defun tab-bar--define-keys () "Install key bindings to switch between tabs if so configured." (when tab-bar-select-tab-modifiers - (global-set-key (vector (append tab-bar-select-tab-modifiers (list ?0))) - #'tab-recent) + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers (list ?0))) + #'tab-recent) (dotimes (i 8) - (global-set-key (vector (append tab-bar-select-tab-modifiers - (list (+ i 1 ?0)))) - #'tab-bar-select-tab)) - (global-set-key (vector (append tab-bar-select-tab-modifiers (list ?9))) - #'tab-last)) - ;; Don't override user customized key bindings - (unless (global-key-binding [(control tab)]) - (global-set-key [(control tab)] #'tab-next)) - (unless (global-key-binding [(control shift tab)]) - (global-set-key [(control shift tab)] #'tab-previous)) - (unless (global-key-binding [(control shift iso-lefttab)]) - (global-set-key [(control shift iso-lefttab)] #'tab-previous)) + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers + (list (+ i 1 ?0)))) + #'tab-bar-select-tab)) + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers (list ?9))) + #'tab-last)) ;; Replace default value with a condition that supports displaying ;; global-mode-string in the tab bar instead of the mode line. @@ -144,12 +141,18 @@ For easier selection of tabs by their numbers, consider customizing (defun tab-bar--undefine-keys () "Uninstall key bindings previously bound by `tab-bar--define-keys'." - (when (eq (global-key-binding [(control tab)]) 'tab-next) - (global-unset-key [(control tab)])) - (when (eq (global-key-binding [(control shift tab)]) 'tab-previous) - (global-unset-key [(control shift tab)])) - (when (eq (global-key-binding [(control shift iso-lefttab)]) 'tab-previous) - (global-unset-key [(control shift iso-lefttab)]))) + (when tab-bar-select-tab-modifiers + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers (list ?0))) + nil t) + (dotimes (i 8) + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers + (list (+ i 1 ?0)))) + nil t)) + (define-key tab-bar-mode-map + (vector (append tab-bar-select-tab-modifiers (list ?9))) + nil t))) (defun tab-bar--load-buttons () "Load the icons for the tab buttons." @@ -239,6 +242,20 @@ a list of frames to update." (if (and tab-bar-mode (eq tab-bar-show t)) 1 0)) (assq-delete-all 'tab-bar-lines default-frame-alist))))) +(defun tab-bar-mode--tab-key-bind (map key binding) + ;; Don't override user customized global key bindings + (define-key map key + `(menu-item "" ,binding + :filter ,(lambda (cmd) (unless (global-key-binding key) cmd))))) + +(defvar tab-bar-mode-map + (let ((map (make-sparse-keymap))) + (tab-bar-mode--tab-key-bind map [(control tab)] #'tab-next) + (tab-bar-mode--tab-key-bind map [(control shift tab)] #'tab-previous) + (tab-bar-mode--tab-key-bind map [(control shift iso-lefttab)] #'tab-previous) + map) + "Tab Bar mode map.") + (define-minor-mode tab-bar-mode "Toggle the tab bar in all graphical frames (Tab Bar mode)." :global t commit 4fc84cb23b6d671b44f18b8462e94c3bcfc3ee09 Author: Mattias EngdegÄrd Date: Fri Apr 5 15:54:30 2024 +0200 Only call set-text-conversion-style if it exists * lisp/auth-source.el (read-passwd): Guard call, as it was before the code was moved here. `set-text-conversion-style` is not present in all configurations. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index a8bd9855720..e6dbead7476 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2547,7 +2547,6 @@ Adapt also mode line." (read-passwd-toggle-visibility))) (defvar overriding-text-conversion-style) -(declare-function set-text-conversion-style "textconv.c") ;;;###autoload (defun read-passwd (prompt &optional confirm default) @@ -2605,7 +2604,8 @@ by doing (clear-string STRING)." ;; And of course, don't keep the sensitive data around. (erase-buffer) ;; Then restore the previous text conversion style. - (set-text-conversion-style text-conversion-style)))))))) + (when (fboundp 'set-text-conversion-style) + (set-text-conversion-style text-conversion-style))))))))) (provide 'auth-source) commit 200a0e5e7d589256d9aad79ff0e9b74b579e7f5e Author: Stefan Monnier Date: Fri Apr 5 07:41:42 2024 -0400 * lisp/help-fns.el (help-fns-function-description-header): Fix bug#70209 Replace the whimsical "" default by something actually useful. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index a291893e9a2..27011575333 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1086,13 +1086,6 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." ;; need to check macros before functions. (macrop function)) (concat beg "Lisp macro")) - ((atom def) - (let ((type (or (oclosure-type def) (cl-type-of def)))) - (concat beg (format "%s" - (make-text-button - (symbol-name type) nil - 'type 'help-type - 'help-args (list type)))))) ((keymapp def) (let ((is-full nil) (elts (cdr-safe def))) @@ -1102,7 +1095,16 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." elts nil)) (setq elts (cdr-safe elts))) (concat beg (if is-full "keymap" "sparse keymap")))) - (t "")))) + (t + (let ((type + (if (and (consp def) (symbolp (car def))) + (car def) + (or (oclosure-type def) (cl-type-of def))))) + (concat beg (format "%s" + (make-text-button + (symbol-name type) nil + 'type 'help-type + 'help-args (list type))))))))) (with-current-buffer standard-output (insert description)) commit 64e1cfb98cbad24fbc72502f6529725cbe202101 Author: Basil L. Contovounesios Date: Thu Apr 4 21:48:22 2024 +0200 ; Fix indentation in last change to windows.texi. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index d3d6b854461..b2c1b79780d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2652,7 +2652,7 @@ for example: display-buffer-alist)) (display-buffer (get-buffer-create "*my-shell*") - '(nil (category . comint))) + '(nil (category . comint))) @end group @end example