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

This commit is contained in:
Michael Albinus 2026-04-10 12:47:33 +02:00
commit 247f46d5e4
8 changed files with 71 additions and 43 deletions

View file

@ -16979,11 +16979,10 @@ The command invoked by the keys is @code{compare-windows}. Note that
@code{compare-windows} is preceded by a single-quote; otherwise, Emacs @code{compare-windows} is preceded by a single-quote; otherwise, Emacs
would first try to evaluate the symbol to determine its value. would first try to evaluate the symbol to determine its value.
These three things, the double quotation marks, the backslash before These two things, the double quotation marks and the single-quote, are
the @samp{C}, and the single-quote are necessary parts of necessary parts of key binding that I tend to forget. Fortunately, I
key binding that I tend to forget. Fortunately, I have come to have come to remember that I should look at my existing @file{.emacs}
remember that I should look at my existing @file{.emacs} file, and file, and adapt what is there.
adapt what is there.
As for the key binding itself: @kbd{C-c w}. This combines the prefix As for the key binding itself: @kbd{C-c w}. This combines the prefix
key, @kbd{C-c}, with a single character, in this case, @kbd{w}. This key, @kbd{C-c}, with a single character, in this case, @kbd{w}. This

View file

@ -4520,9 +4520,17 @@ singleton list.
--- ---
** Support macOS Accessibility Zoom focus tracking. ** Support macOS Accessibility Zoom focus tracking.
This is an important change for visually-impaired users. If macOS This is an important change for visually-impaired users. If macOS
Accessibility Zoom is enabled (System Settings, Accessibility, Zoom) Accessibility Zoom is enabled via (System Settings, Accessibility,
with keyboard focus tracking (Advanced...), Zoom is informed of updated Zoom...) with keyboard focus tracking (Advanced...), Zoom is informed
cursor positions during each redisplay cycle. of updated cursor positions during each redisplay cycle.
---
** New macOS function 'ns-process-is-accessibility-trusted'.
This function returns t if the macOS Accessibility Framework trusts the
Emacs. This is a necessary condition for Accessibility Zoom and other
accessibility features. Enable Emacs via (System Settings, Privacy &
Security, Accessibility...) and add the Emacs.app installed directory to
the enabled application list.
--- ---
** Process execution has been optimized on Android. ** Process execution has been optimized on Android.

View file

@ -774,7 +774,9 @@ be used instead.
;; be any need to font-lock-flush all the Elisp buffers. ;; be any need to font-lock-flush all the Elisp buffers.
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
(with-current-buffer buf (with-current-buffer buf
(when (derived-mode-p 'emacs-lisp-mode) (when (and (derived-mode-p 'emacs-lisp-mode)
;; Don't flush if it refontifies the whole buffer eagerly.
font-lock-support-mode)
;; So as to take into account new macros that may have been defined ;; So as to take into account new macros that may have been defined
;; by the just-loaded file. ;; by the just-loaded file.
(font-lock-flush)))))) (font-lock-flush))))))
@ -868,29 +870,30 @@ use of `macroexpand-all' as a way to find the \"underlying raw code\".")
(defun elisp--local-variables () (defun elisp--local-variables ()
"Return a list of locally let-bound variables at point." "Return a list of locally let-bound variables at point."
(save-excursion (let* ((sexp
(skip-syntax-backward "w_") (save-excursion
(let* ((ppss (syntax-ppss)) (skip-syntax-backward "w_")
(txt (buffer-substring-no-properties (or (car (nth 9 ppss)) (point)) (let* ((ppss (syntax-ppss))
(or (nth 8 ppss) (point)))) (txt (buffer-substring-no-properties
(closer ())) (or (car (nth 9 ppss)) (point))
(dolist (p (nth 9 ppss)) (or (nth 8 ppss) (point))))
(push (cdr (syntax-after p)) closer)) (closer
(setq closer (apply #'string closer)) (nreverse (mapcar (lambda (p) (cdr (syntax-after p)))
(let* ((sexp (condition-case nil (nth 9 ppss)))))
(car (read-from-string (condition-case nil
(concat txt "elisp--witness--lisp" closer))) (car (read-from-string
((invalid-read-syntax end-of-file) nil))) (concat txt "elisp--witness--lisp" closer)))
(vars (elisp--local-variables-1 ((invalid-read-syntax end-of-file) nil)))))
nil (elisp--safe-macroexpand-all sexp)))) (vars (elisp--local-variables-1
(delq nil nil (elisp--safe-macroexpand-all sexp))))
(mapcar (lambda (var) (delq nil
(and (symbolp var) (mapcar (lambda (var)
(not (string-match (symbol-name var) "\\`[&_]")) (and (symbolp var)
;; Eliminate uninterned vars. (not (string-match (symbol-name var) "\\`[&_]"))
(intern-soft var) ;; Eliminate uninterned vars.
var)) (intern-soft var)
vars)))))) var))
vars))))
(defconst elisp--local-variables-completion-table (defconst elisp--local-variables-completion-table
(let ((lastpos nil) (lastvars nil)) (let ((lastpos nil) (lastvars nil))

View file

@ -1806,7 +1806,7 @@ See also `current-global-map'.")
(defun listify-key-sequence (key) (defun listify-key-sequence (key)
"Convert a key sequence to a list of events." "Convert a key sequence to a list of events."
(declare (side-effect-free t)) (declare (side-effect-free t))
(if (vectorp key) (if (or (vectorp key) (multibyte-string-p key))
(append key nil) (append key nil)
(mapcar (lambda (c) (mapcar (lambda (c)
(if (> c 127) (if (> c 127)

View file

@ -1276,7 +1276,7 @@ Return the result of evaluating FORM."
(dolist (file ,flist) (dolist (file ,flist)
(dolist (setting ,settings) (dolist (setting ,settings)
(let ((property (car setting))) (let ((property (car setting)))
(unless (memq property ,vc-touched-properties) (unless (memq property vc-touched-properties)
(put (intern file vc-file-prop-obarray) (put (intern file vc-file-prop-obarray)
property (cdr setting)))))))))) property (cdr setting))))))))))
@ -2230,7 +2230,8 @@ have changed; continue with old fileset?" (current-buffer))))
(dolist (file files) (dolist (file files)
(let ((file (expand-file-name file))) (let ((file (expand-file-name file)))
(vc-file-setprop file 'display-state "committing") (vc-file-setprop file 'display-state "committing")
(vc-dir-resynch-file file) (when vc-dir-buffers
(vc-dir-resynch-file file))
(push file to-remove-props))) (push file to-remove-props)))
(vc-exec-after #'remove-props-done-msg nil proc)) (vc-exec-after #'remove-props-done-msg nil proc))
ret) ret)

View file

@ -3755,6 +3755,27 @@ The position is returned as a cons cell (X . Y) of the
return Qnil; return Qnil;
} }
DEFUN ("ns-process-is-accessibility-trusted",
Fns_process_is_accessibility_trusted,
Sns_process_is_accessibility_trusted,
0, 0, 0,
doc: /* Return non-nil if Emacs is trusted by macOS Accessibility.
Return nil otherwise or if the OS is not macOS.
This is necessary for Emacs to support Zoom and related accessibility
features. Authorize Emacs for accessibility via System
Settings... Privacy & Security... Accessibility... and add the Emacs.app
installed directory to the enabled application list. */)
(void)
{
#ifdef NS_IMPL_COCOA
if (AXIsProcessTrusted())
return Qt;
#endif
return Qnil;
}
DEFUN ("ns-badge", Fns_badge, Sns_badge, 1, 1, 0, DEFUN ("ns-badge", Fns_badge, Sns_badge, 1, 1, 0,
doc: /* Set the app icon badge to BADGE. doc: /* Set the app icon badge to BADGE.
BADGE should be a string short enough to display nicely in the short BADGE should be a string short enough to display nicely in the short
@ -4248,6 +4269,7 @@ - (Lisp_Object)lispString
defsubr (&Sns_set_mouse_absolute_pixel_position); defsubr (&Sns_set_mouse_absolute_pixel_position);
defsubr (&Sns_mouse_absolute_pixel_position); defsubr (&Sns_mouse_absolute_pixel_position);
defsubr (&Sns_show_character_palette); defsubr (&Sns_show_character_palette);
defsubr (&Sns_process_is_accessibility_trusted);
defsubr (&Sns_badge); defsubr (&Sns_badge);
defsubr (&Sns_request_user_attention); defsubr (&Sns_request_user_attention);
defsubr (&Sns_progress_indicator); defsubr (&Sns_progress_indicator);

View file

@ -6517,14 +6517,6 @@ - (void)applicationDidFinishLaunching: (NSNotification *)notification
} }
#endif #endif
#ifdef NS_IMPL_COCOA
/* Is accessibility enabled for this process/bundle? */
if (AXIsProcessTrusted())
NSLog (@"Emacs is macOS AXIsProcessTrusted");
else
NSLog (@"Emacs is not macOS AXIsProcessTrusted");
#endif
ns_send_appdefined (-2); ns_send_appdefined (-2);
} }

View file

@ -433,6 +433,9 @@
(should (eq (global-key-binding "x") 'self-insert-command)) (should (eq (global-key-binding "x") 'self-insert-command))
(should-not (global-key-binding [f12]))) (should-not (global-key-binding [f12])))
(ert-deftest subr-listify-key-sequence ()
(should (equal (listify-key-sequence "ŕ°") '( ))))
;;;; Mode hooks. ;;;; Mode hooks.