commit f6e6585f5751852dbdc972fef8fc5a3ccc6e4573 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Fri Feb 7 09:47:41 2025 +0200 * lisp/progmodes/sh-script.el (bash-ts-mode): Improve treesit settings. Add 'list' and 'sentence' things to treesit-thing-settings, and move mistakenly added 'sentence' to 'text' (bug#73404). Set 'treesit-defun-name-function' and 'treesit-simple-imenu-settings'. Reset 'outline-regexp'. diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 3a41ef297ef..c4b7d0837a4 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1646,10 +1646,45 @@ not written in Bash or sh." sh-mode--treesit-settings) (setq-local treesit-thing-settings `((bash - (sentence ,(regexp-opt '("comment" - "heredoc_start" - "heredoc_body")))))) + (list + ,(rx bos (or "do_group" + "if_statement" + "case_statement" + "compound_statement" + "subshell" + "test_command" + "parenthesized_expression" + "arithmetic_expansion" + "brace_expression" + "string" + "array" + "expansion" ;; but not "simple_expansion" + "command_substitution" + "process_substitution") + eos)) + (sentence + ,(rx bos (or "redirected_statement" + "declaration_command" + "unset_command" + "command" + "variable_assignment") + eos)) + (text + ,(rx bos (or "comment" + "heredoc_body") + eos))))) (setq-local treesit-defun-type-regexp "function_definition") + (setq-local treesit-defun-name-function + (lambda (node) + (treesit-node-text + (treesit-node-child-by-field-name node "name") + t))) + (setq-local treesit-simple-imenu-settings + '((nil "\\`function_definition\\'" nil nil))) + ;; Override regexp-based outline variable from `sh-base-mode' + ;; to use `treesit-simple-imenu-settings' for outlines: + (kill-local-variable 'outline-regexp) + (treesit-major-mode-setup))) (derived-mode-add-parents 'bash-ts-mode '(sh-mode)) commit 1751739152149608d28853782ce53b0b9a749bb2 Author: Po Lu Date: Fri Feb 7 11:11:51 2025 +0800 Prevent crash when requesting storage permissions on Android * java/org/gnu/emacs/EmacsService.java (requestStorageAccess30): Handle ActivityNotFoundException. diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 04563590dc4..5225337a826 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -54,6 +54,7 @@ import android.app.PendingIntent; import android.app.Service; +import android.content.ActivityNotFoundException; import android.content.ClipboardManager; import android.content.Context; import android.content.ContentResolver; @@ -2092,7 +2093,15 @@ In addition, arbitrary runtime exceptions (such as /* Now request these permissions. */ - activity.startActivity (intent); + try + { + activity.startActivity (intent); + } + catch (ActivityNotFoundException exception) + { + Log.w (TAG, "Failed to request storage access permissions: "); + exception.printStackTrace (); + } } }; commit be316dc1c74fc547fe83c0426fdec3ffd4e5fb1f Author: Tassilo Horn Date: Thu Feb 6 20:07:09 2025 +0100 ; Use an uninterned symbol in the inhibit-auto-revert expansion. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 315100885be..e6a12d37ad1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -781,22 +781,23 @@ If the buffer needs to be reverted, do it now." "Deactivate auto-reverting of current buffer temporarily. Run BODY." (declare (indent 0) (debug (body))) - `(progn - ;; Cleanup. - (dolist (buf inhibit-auto-revert-buffers) - (unless (buffer-live-p buf) - (setq inhibit-auto-revert-buffers - (delq buf inhibit-auto-revert-buffers)))) - (let ((iar-buf - (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) - (current-buffer)))) - (unwind-protect - (progn - (when iar-buf (add-to-list 'inhibit-auto-revert-buffers iar-buf)) - ,@body) - (when iar-buf + (let ((buf (make-symbol "buf"))) + `(progn + ;; Cleanup. + (dolist (,buf inhibit-auto-revert-buffers) + (unless (buffer-live-p ,buf) (setq inhibit-auto-revert-buffers - (delq iar-buf inhibit-auto-revert-buffers)))))))) + (delq ,buf inhibit-auto-revert-buffers)))) + (let ((,buf + (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) + (current-buffer)))) + (unwind-protect + (progn + (when ,buf (add-to-list 'inhibit-auto-revert-buffers ,buf)) + ,@body) + (when ,buf + (setq inhibit-auto-revert-buffers + (delq ,buf inhibit-auto-revert-buffers))))))))) (defun auto-revert-active-p () "Check if auto-revert is active in current buffer." commit 811d575336942b1cd1e1c6fb50620babdf9cc82c Author: Michael Albinus Date: Thu Feb 6 16:56:07 2025 +0100 ; Rename internal variable in inhibit-auto-revert * lisp/autorevert.el (inhibit-auto-revert): Call internal variable `iar-buf' in order not to mismatch with variables outside the macro. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index aeb80ff7884..315100885be 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -787,15 +787,16 @@ Run BODY." (unless (buffer-live-p buf) (setq inhibit-auto-revert-buffers (delq buf inhibit-auto-revert-buffers)))) - (let ((buf (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) - (current-buffer)))) + (let ((iar-buf + (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) + (current-buffer)))) (unwind-protect (progn - (when buf (add-to-list 'inhibit-auto-revert-buffers buf)) + (when iar-buf (add-to-list 'inhibit-auto-revert-buffers iar-buf)) ,@body) - (when buf + (when iar-buf (setq inhibit-auto-revert-buffers - (delq buf inhibit-auto-revert-buffers)))))))) + (delq iar-buf inhibit-auto-revert-buffers)))))))) (defun auto-revert-active-p () "Check if auto-revert is active in current buffer."