commit b31f7e67de52c276dd1bcb6fbd048ef12435a327 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Tue Apr 9 09:43:55 2024 +0300 Fix window-point-context-set and window-point-context-use (bug#33871) * lisp/window.el (window-point-context-set) (window-point-context-use): Add 'window-buffer' for 'buffer-name'. diff --git a/lisp/window.el b/lisp/window.el index 29e7310958b..cdc6f690bab 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -10867,7 +10867,8 @@ Remember the returned context in the window parameter `context'." (window-buffer w))) ((functionp fn)) (context (funcall fn w))) - (set-window-parameter w 'context (cons (buffer-name) context)))) + (set-window-parameter + w 'context (cons (buffer-name (window-buffer w)) context)))) 'nomini)) (defun window-point-context-use () @@ -10885,7 +10886,7 @@ found by the provided context." (window-buffer w))) ((functionp fn)) (context (window-parameter w 'context)) - ((equal (buffer-name) (car context)))) + ((equal (buffer-name (window-buffer w)) (car context)))) (funcall fn w (cdr context)) (set-window-parameter w 'context nil))) 'nomini)) commit 677bc276998de0a467803b35134925d833d1ab9d Author: Eli Zaretskii Date: Tue Apr 9 06:28:49 2024 +0300 ; * etc/NEWS: Announce new ls-lisp options. (Bug#70721) diff --git a/etc/NEWS b/etc/NEWS index b2543ae77d9..3bce7686869 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1566,6 +1566,14 @@ buffer method is the default, which preserves previous behavior. *** New user option 'xwidget-webkit-disable-javascript'. This allows disabling JavaScript in xwidget Webkit sessions. +** ls-lisp + +--- +*** 'ls-lisp--insert-directory' supports more long options of 'ls'. +'ls-lisp--insert-directory', the ls-lisp implementation of +'insert-directory', now supports the '--time=TIME' and '--sort=time' +options of GNU 'ls'. + * New Modes and Packages in Emacs 30.1 commit 93576969c2b53ff9d0d7b08768782e770f0cb0f4 Author: Eli Zaretskii Date: Tue Apr 9 06:21:38 2024 +0300 ; Fix the test in last change. diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el index 81e3e163c9c..beecac22afc 100644 --- a/test/lisp/ls-lisp-tests.el +++ b/test/lisp/ls-lisp-tests.el @@ -45,6 +45,7 @@ (dired-internal-noselect dir "-la --time=ctime") (setq buf (current-buffer) str (format-time-string "%H:%M" ts)) + (goto-char (point-min)) (should (search-forward-regexp str nil t)) (kill-buffer)) (setq ts (- (float-time) 60)) @@ -53,6 +54,7 @@ (dired-internal-noselect dir "-la --sort=time") (setq buf (current-buffer) str (format-time-string "%H:%M" ts)) + (goto-char (point-min)) (should (search-forward-regexp str nil t)) (kill-buffer)) (setq ts (- (float-time) 120)) @@ -61,6 +63,7 @@ (dired-internal-noselect dir "-la --time=atime") (setq buf (current-buffer) str (format-time-string "%H:%M" ts)) + (goto-char (point-min)) (should (search-forward-regexp str nil t)) (kill-buffer))) (when (buffer-live-p buf) (kill-buffer buf)))))) commit a4c766e057b9b05685433db010b6536148f29f1d Author: Lin Sun Date: Mon Apr 8 06:59:21 2024 +0000 Support more long time options in 'ls-lisp' * lisp/ls-lisp.el (ls-lisp--sanitize-switches): Support '--time' and '--sort=time'. (Bug#70271) * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug70271): New test case. diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index d09b53b1cc3..ae4a43797f0 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -873,6 +873,7 @@ The l switch is assumed to be always present and cannot be turned off." (let ((lsflags '(("-a" . "--all") ("-A" . "--almost-all") ("-B" . "--ignore-backups") + ("-c" . "--time=ctime") ("-C" . "--color") ("-F" . "--classify") ("-G" . "--no-group") @@ -883,7 +884,9 @@ The l switch is assumed to be always present and cannot be turned off." ("-r" . "--reverse") ("-R" . "--recursive") ("-s" . "--size") + ("-t" . "--sort=time") ("-S" . "--sort.*[ \\\t]") + ("-u" . "--time=atime") ("" . "--group-directories-first") ("" . "--author") ("" . "--escape") diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el index 77046871ea7..81e3e163c9c 100644 --- a/test/lisp/ls-lisp-tests.el +++ b/test/lisp/ls-lisp-tests.el @@ -29,6 +29,42 @@ (require 'ls-lisp) (require 'dired) +(ert-deftest ls-lisp-test-bug70271 () + "Test for https://debbugs.gnu.org/70271 ." + (ert-with-temp-file + fpath + :suffix "bug70271" + (let* ((dir (file-name-directory fpath)) + (attributes (file-attributes fpath)) + (dired-find-subdir t) + ls-lisp-use-insert-directory-program buf ts) + (unwind-protect + (progn + (setq ts (file-attribute-access-time attributes)) + (with-current-buffer + (dired-internal-noselect dir "-la --time=ctime") + (setq buf (current-buffer) + str (format-time-string "%H:%M" ts)) + (should (search-forward-regexp str nil t)) + (kill-buffer)) + (setq ts (- (float-time) 60)) + (set-file-times fpath ts) + (with-current-buffer + (dired-internal-noselect dir "-la --sort=time") + (setq buf (current-buffer) + str (format-time-string "%H:%M" ts)) + (should (search-forward-regexp str nil t)) + (kill-buffer)) + (setq ts (- (float-time) 120)) + (set-file-times fpath ts) + (with-current-buffer + (dired-internal-noselect dir "-la --time=atime") + (setq buf (current-buffer) + str (format-time-string "%H:%M" ts)) + (should (search-forward-regexp str nil t)) + (kill-buffer))) + (when (buffer-live-p buf) (kill-buffer buf)))))) + (ert-deftest ls-lisp-test-bug27762 () "Test for https://debbugs.gnu.org/27762 ." (let* ((dir source-directory) commit 64eb4ce0af80b840c7b1da137e4323a3d06062fa Author: Po Lu Date: Tue Apr 9 10:37:47 2024 +0800 Improve treatment of aborted touch events in Speedbar and elsewhere * lisp/dframe.el (dframe-popup-kludge): Mark as a mouse-1-menu-command. * lisp/touch-screen.el (touch-screen-handle-point-up): New argument CANCELED. Implement specific responses to cancellation for each tool state. (touch-screen-handle-touch): Adjust to match. diff --git a/lisp/dframe.el b/lisp/dframe.el index 4031e0784c2..8e664c0204a 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -684,6 +684,8 @@ Must be bound to event E." (sit-for 0) (popup-menu (mouse-menu-major-mode-map) e))) +(put 'dframe-popup-kludge 'mouse-1-menu-command t) + ;;; Interactive user functions for the mouse ;; (defun dframe-mouse-event-p (event) diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el index c8de1d8ee31..037386112d3 100644 --- a/lisp/touch-screen.el +++ b/lisp/touch-screen.el @@ -1254,17 +1254,20 @@ response to the minibuffer being closed." (cancel-timer minibuffer-on-screen-keyboard-timer) (setq minibuffer-on-screen-keyboard-timer nil))))) -(defun touch-screen-handle-point-up (point prefix) +(defun touch-screen-handle-point-up (point prefix canceled) "Notice that POINT has been removed from the screen. POINT should be the point currently tracked as `touch-screen-current-tool'. PREFIX should be a virtual function key used to look up key bindings. +CANCELED should indicate whether the touch point was removed by +window-system intervention rather than user action. If an ancillary touch point is being observed, transfer touch information from `touch-screen-aux-tool' to -`touch-screen-current-tool' and set it to nil, thereby resuming -gesture recognition with that tool replacing the tool removed. +`touch-screen-current-tool' and set the former to nil, thereby +resuming gesture recognition with that tool replacing the tool +removed. Otherwise: @@ -1315,136 +1318,144 @@ is not read-only." ;; hasn't been moved, translate the sequence into a ;; regular mouse click. (eq what 'restart-drag)) - (when (windowp (posn-window posn)) - (setq point (posn-point posn) - window (posn-window posn)) - ;; Select the window that was tapped given that it - ;; isn't an inactive minibuffer window. - (when (or (not (eq window - (minibuffer-window - (window-frame window)))) - (minibuffer-window-active-p window)) - (select-window window)) - ;; Now simulate a mouse click there. If there is a - ;; link or a button, use mouse-2 to push it. - (let* ((event (list (if (or (mouse-on-link-p posn) - (and point (button-at point))) - 'mouse-2 - 'mouse-1) - posn)) - ;; Look for the command bound to this event. - (command (key-binding (if prefix - (vector prefix - (car event)) - (vector (car event))) - t nil posn))) - (deactivate-mark) - (when point - ;; This is necessary for following links. - (goto-char point)) - ;; Figure out if the on screen keyboard needs to be - ;; displayed. - (when command - (if (memq command touch-screen-set-point-commands) - (if touch-screen-translate-prompt - ;; Forgo displaying the virtual keyboard - ;; should touch-screen-translate-prompt be - ;; set, for then the key won't be delivered - ;; to the command loop, but rather to a - ;; caller of read-key-sequence such as - ;; describe-key. - (throw 'input-event event) - (if (and (or (not buffer-read-only) - touch-screen-display-keyboard) - ;; Detect the splash screen and - ;; avoid displaying the on screen - ;; keyboard there. - (not (equal (buffer-name) "*GNU Emacs*"))) - ;; Once the on-screen keyboard has been - ;; opened, add - ;; `touch-screen-window-selection-changed' - ;; as a window selection change function - ;; This then prevents it from being - ;; hidden after exiting the minibuffer. - (progn - (add-hook - 'window-selection-change-functions - #'touch-screen-window-selection-changed) - (frame-toggle-on-screen-keyboard - (selected-frame) nil)) - ;; Otherwise, hide the on screen keyboard - ;; now. - (frame-toggle-on-screen-keyboard (selected-frame) - t)) - ;; But if it's being called from `describe-key' - ;; or some such, return it as a key sequence. - (throw 'input-event event))) - ;; If not, return the event. - (throw 'input-event event))))) + ;; Don't attempt to execute commands bound to mouse events + ;; if the touch sequence has been canceled. + (unless canceled + (when (windowp (posn-window posn)) + (setq point (posn-point posn) + window (posn-window posn)) + ;; Select the window that was tapped given that it + ;; isn't an inactive minibuffer window. + (when (or (not (eq window + (minibuffer-window + (window-frame window)))) + (minibuffer-window-active-p window)) + (select-window window)) + ;; Now simulate a mouse click there. If there is a + ;; link or a button, use mouse-2 to push it. + (let* ((event (list (if (or (mouse-on-link-p posn) + (and point (button-at point))) + 'mouse-2 + 'mouse-1) + posn)) + ;; Look for the command bound to this event. + (command (key-binding (if prefix + (vector prefix + (car event)) + (vector (car event))) + t nil posn))) + (deactivate-mark) + (when point + ;; This is necessary for following links. + (goto-char point)) + ;; Figure out if the on screen keyboard needs to be + ;; displayed. + (when command + (if (memq command touch-screen-set-point-commands) + (if touch-screen-translate-prompt + ;; Forgo displaying the virtual keyboard + ;; should touch-screen-translate-prompt be + ;; set, for then the key won't be delivered + ;; to the command loop, but rather to a + ;; caller of read-key-sequence such as + ;; describe-key. + (throw 'input-event event) + (if (and (or (not buffer-read-only) + touch-screen-display-keyboard) + ;; Detect the splash screen and + ;; avoid displaying the on screen + ;; keyboard there. + (not (equal (buffer-name) "*GNU Emacs*"))) + ;; Once the on-screen keyboard has been + ;; opened, add + ;; `touch-screen-window-selection-changed' + ;; as a window selection change function + ;; This then prevents it from being + ;; hidden after exiting the minibuffer. + (progn + (add-hook + 'window-selection-change-functions + #'touch-screen-window-selection-changed) + (frame-toggle-on-screen-keyboard + (selected-frame) nil)) + ;; Otherwise, hide the on screen keyboard + ;; now. + (frame-toggle-on-screen-keyboard (selected-frame) + t)) + ;; But if it's being called from `describe-key' + ;; or some such, return it as a key sequence. + (throw 'input-event event))) + ;; If not, return the event. + (throw 'input-event event)))))) ((eq what 'mouse-drag) ;; Generate a corresponding `mouse-1' event. - (let* ((new-window (posn-window posn)) - (new-point (posn-point posn)) - (old-posn (nth 4 touch-screen-current-tool)) - (old-window (posn-window posn)) - (old-point (posn-point posn))) - (throw 'input-event - ;; If the position of the touch point hasn't - ;; changed, or it doesn't start or end on a - ;; window... - (if (and (not old-point) (not new-point)) - ;; Should old-point and new-point both equal - ;; nil, compare the posn areas and nominal - ;; column position. If either are - ;; different, generate a drag event. - (let ((new-col-row (posn-col-row posn)) - (new-area (posn-area posn)) - (old-col-row (posn-col-row old-posn)) - (old-area (posn-area old-posn))) - (if (and (equal new-col-row old-col-row) - (eq new-area old-area)) - ;; ... generate a mouse-1 event... - (list 'mouse-1 posn) - ;; ... otherwise, generate a - ;; drag-mouse-1 event. - (list 'drag-mouse-1 old-posn posn))) - (if (and (eq new-window old-window) - (eq new-point old-point) - (windowp new-window) - (windowp old-window)) - ;; ... generate a mouse-1 event... - (list 'mouse-1 posn) - ;; ... otherwise, generate a drag-mouse-1 - ;; event. - (list 'drag-mouse-1 old-posn posn)))))) + ;; Alternatively, quit if the touch sequence was canceled. + (if canceled + (keyboard-quit) + (let* ((new-window (posn-window posn)) + (new-point (posn-point posn)) + (old-posn (nth 4 touch-screen-current-tool)) + (old-window (posn-window posn)) + (old-point (posn-point posn))) + (throw 'input-event + ;; If the position of the touch point hasn't + ;; changed, or it doesn't start or end on a + ;; window... + (if (and (not old-point) (not new-point)) + ;; Should old-point and new-point both equal + ;; nil, compare the posn areas and nominal + ;; column position. If either are + ;; different, generate a drag event. + (let ((new-col-row (posn-col-row posn)) + (new-area (posn-area posn)) + (old-col-row (posn-col-row old-posn)) + (old-area (posn-area old-posn))) + (if (and (equal new-col-row old-col-row) + (eq new-area old-area)) + ;; ... generate a mouse-1 event... + (list 'mouse-1 posn) + ;; ... otherwise, generate a + ;; drag-mouse-1 event. + (list 'drag-mouse-1 old-posn posn))) + (if (and (eq new-window old-window) + (eq new-point old-point) + (windowp new-window) + (windowp old-window)) + ;; ... generate a mouse-1 event... + (list 'mouse-1 posn) + ;; ... otherwise, generate a drag-mouse-1 + ;; event. + (list 'drag-mouse-1 old-posn posn))))))) ((eq what 'mouse-1-menu) ;; Generate a `down-mouse-1' event at the position the tap - ;; took place. - (throw 'input-event - (list 'down-mouse-1 - (nth 4 touch-screen-current-tool)))) + ;; took place, unless the touch sequence was canceled. + (unless canceled + (throw 'input-event + (list 'down-mouse-1 + (nth 4 touch-screen-current-tool))))) ((or (eq what 'drag) ;; Merely initiating a drag is sufficient to select a ;; word if word selection is enabled. (eq what 'held)) - ;; Display the on screen keyboard if the region is now - ;; active. Check this within the window where the tool - ;; was first place. - (setq window (nth 1 touch-screen-current-tool)) - (when window - (with-selected-window window - (when (and (region-active-p) - (not buffer-read-only)) - ;; Once the on-screen keyboard has been opened, add - ;; `touch-screen-window-selection-changed' as a - ;; window selection change function. This then - ;; prevents it from being hidden after exiting the - ;; minibuffer. - (progn - (add-hook 'window-selection-change-functions - #'touch-screen-window-selection-changed) - (frame-toggle-on-screen-keyboard (selected-frame) - nil)))))))))) + (unless canceled + ;; Display the on screen keyboard if the region is now + ;; active. Check this within the window where the tool + ;; was first place. + (setq window (nth 1 touch-screen-current-tool)) + (when window + (with-selected-window window + (when (and (region-active-p) + (not buffer-read-only)) + ;; Once the on-screen keyboard has been opened, add + ;; `touch-screen-window-selection-changed' as a + ;; window selection change function. This then + ;; prevents it from being hidden after exiting the + ;; minibuffer. + (progn + (add-hook 'window-selection-change-functions + #'touch-screen-window-selection-changed) + (frame-toggle-on-screen-keyboard (selected-frame) + nil))))))))))) (defun touch-screen-handle-touch (event prefix &optional interactive) "Handle a single touch EVENT, and perform associated actions. @@ -1684,16 +1695,12 @@ functions undertaking event management themselves to call (setq touch-screen-current-timer nil)) (let ((old-aux-tool touch-screen-aux-tool)) (unwind-protect - ;; Don't perform any actions associated with releasing the - ;; tool if the touch sequence was intercepted by another - ;; program. - (if (caddr event) - (setq touch-screen-current-tool nil) - (touch-screen-handle-point-up (cadr event) prefix)) + (touch-screen-handle-point-up (cadr event) prefix + (caddr event)) ;; If an ancillary tool is present the function call above - ;; will merely transfer information from it into the current - ;; tool list, thereby rendering it the new current tool, - ;; until such time as it too is released. + ;; will simply transfer information from it into the current + ;; tool list, rendering the new current tool, until such + ;; time as it too is released. (when (not (and old-aux-tool (not touch-screen-aux-tool))) ;; Make sure the tool list is cleared even if ;; `touch-screen-handle-point-up' throws. commit 9e22cd30ebd68326c26a6e511d3722bdb5b9164c Author: Po Lu Date: Tue Apr 9 10:00:42 2024 +0800 Disable tab-bar by default in Speedbar frames * lisp/speedbar.el (speedbar-frame-parameters): Set tab-bar-lines to 0. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 2ed97986fe7..c13c977938b 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -294,6 +294,7 @@ A nil value means don't show the file in the list." (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) + (tab-bar-lines . 0) (unsplittable . t) (left-fringe . 0) ) @@ -304,7 +305,8 @@ attached to and added to this list before the new frame is initialized." :group 'speedbar :type '(repeat (cons :format "%v" (symbol :tag "Parameter") - (sexp :tag "Value")))) + (sexp :tag "Value"))) + :version "30.1") (defcustom speedbar-use-imenu-flag t "Non-nil means use imenu for file parsing, nil to use etags. commit f30801a20338cdc7716c3eff1443f1be603aa94e Author: Daniel Mendler Date: Thu Apr 4 07:19:58 2024 +0200 (completion-hilit-commonality): Support `completion-lazy-hilit` * lisp/minibuffer.el (completion-hilit-commonality): Support lazy completion candidate highlighting via `completion-lazy-hilit`. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index b007320b110..41b20174be1 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2375,34 +2375,38 @@ This adds the face `completions-common-part' to the first It returns a list with font-lock properties applied to each element, and with BASE-SIZE appended as the last element." (when completions - (let ((com-str-len (- prefix-len (or base-size 0)))) - (nconc - (mapcar - (lambda (elem) - (let ((str - ;; Don't modify the string itself, but a copy, since the - ;; string may be read-only or used for other purposes. - ;; Furthermore, since `completions' may come from - ;; display-completion-list, `elem' may be a list. - (if (consp elem) - (car (setq elem (cons (copy-sequence (car elem)) - (cdr elem)))) - (setq elem (copy-sequence elem))))) - (font-lock-prepend-text-property - 0 - ;; If completion-boundaries returns incorrect - ;; values, all-completions may return strings - ;; that don't contain the prefix. - (min com-str-len (length str)) - 'face 'completions-common-part str) - (if (> (length str) com-str-len) - (font-lock-prepend-text-property com-str-len (1+ com-str-len) - 'face - 'completions-first-difference - str))) - elem) - completions) - base-size)))) + (let* ((com-str-len (- prefix-len (or base-size 0))) + (hilit-fn + (lambda (str) + (font-lock-prepend-text-property + 0 + ;; If completion-boundaries returns incorrect values, + ;; all-completions may return strings that don't contain + ;; the prefix. + (min com-str-len (length str)) + 'face 'completions-common-part str) + (when (> (length str) com-str-len) + (font-lock-prepend-text-property + com-str-len (1+ com-str-len) + 'face 'completions-first-difference str)) + str))) + (if completion-lazy-hilit + (setq completion-lazy-hilit-fn hilit-fn) + (setq completions + (mapcar + (lambda (elem) + ;; Don't modify the string itself, but a copy, since + ;; the string may be read-only or used for other + ;; purposes. Furthermore, since `completions' may come + ;; from display-completion-list, `elem' may be a list. + (funcall hilit-fn + (if (consp elem) + (car (setq elem (cons (copy-sequence (car elem)) + (cdr elem)))) + (setq elem (copy-sequence elem)))) + elem) + completions))) + (nconc completions base-size)))) (defun display-completion-list (completions &optional common-substring group-fun) "Display the list of completions, COMPLETIONS, using `standard-output'. commit 6c9855d3364b4e9b18d436aa1d6490e004d05d7b Author: Eli Zaretskii Date: Mon Apr 8 21:02:01 2024 +0300 Improve documentation of Text Mode * doc/emacs/text.texi (Text Mode): Improve indexing. Document 'text-mode-ispell-word-completion'. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index cb347d59948..f5e31fd277f 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -943,12 +943,15 @@ situations where you shouldn't change the major mode---in mail composition, for instance. @kindex M-TAB @r{(Text mode)} +@findex completion-at-point@r{, in Text Mode} +@vindex text-mode-ispell-word-completion The command @kbd{M-@key{TAB}} (@code{completion-at-point}) performs completion of the partial word in the buffer before point, using the spelling dictionary as the space of possible words by default. @xref{Spelling}. If your window manager defines @kbd{M-@key{TAB}} to switch windows, you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} -instead. +instead. To disable this completion, customize the variable +@code{text-mode-ispell-word-completion} to the @code{nil} value. @vindex text-mode-hook Entering Text mode runs the mode hook @code{text-mode-hook} commit dc5fe95a48f5bff5dfac8841d05c66b300b09aab Author: Stefan Monnier Date: Mon Apr 8 13:59:33 2024 -0400 (cl--describe-class): Improve based on dicussion in bug#70077 * lisp/emacs-lisp/cl-extra.el (cl--describe-class): Move docstring after the class' slots. (cl--describe-class-slots): Buttonize the types. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 437dea2d6a9..4660d94ea90 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -807,13 +807,19 @@ Call `cl--find-class' to get TYPE's propname `cl--class'" (insert (substitute-command-keys (if ch "', " "'")))) (insert ".\n"))) + ;; Describe all the slots in this class. + ;; Put it before the docstring, since the docstring may want + ;; to refer to the slots. + (cl--describe-class-slots class) + ;; Type's documentation. (let ((doc (cl--class-docstring class))) (when doc - (insert "\n" doc "\n\n"))) - - ;; Describe all the slots in this class. - (cl--describe-class-slots class) + (insert (if (save-excursion + (or (< (skip-chars-backward "\n") -1) (bobp))) + "" + "\n") + doc "\n\n"))) ;; Describe all the methods specific to this class. (let ((generics (cl-generic-all-functions type))) @@ -910,7 +916,12 @@ Outputs to the current buffer." (mapcar (lambda (slot) (list (cl-prin1-to-string (cl--slot-descriptor-name slot)) - (cl-prin1-to-string (cl--slot-descriptor-type slot)) + (let ((type (cl--slot-descriptor-type slot))) + (if (and type (symbolp type) (cl--find-class type)) + (make-text-button (symbol-name type) nil + 'type 'help-type + 'help-args (list type)) + (cl-prin1-to-string type))) (cl-prin1-to-string (cl--slot-descriptor-initform slot)) (let ((doc (alist-get :documentation (cl--slot-descriptor-props slot)))) commit 600ac35cc6597b63306786bffd0d762f70555322 Author: Arash Esbati Date: Sun Apr 7 21:12:05 2024 +0200 ; * lisp/align.el: Remove unnecessary :group keywords. (bug#70262) diff --git a/lisp/align.el b/lisp/align.el index 0e77a857585..6c393f7ee26 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -126,15 +126,13 @@ (defcustom align-load-hook nil "Hook that gets run after the aligner has been loaded." - :type 'hook - :group 'align) + :type 'hook) (make-obsolete-variable 'align-load-hook "use `with-eval-after-load' instead." "28.1") (defcustom align-indent-before-aligning nil "If non-nil, indent the marked region before aligning it." - :type 'boolean - :group 'align) + :type 'boolean) (defcustom align-default-spacing 1 "An integer that represents the default amount of padding to use. @@ -142,14 +140,12 @@ If `align-to-tab-stop' is non-nil, this will represent the number of tab stops to use for alignment, rather than the number of spaces. Each alignment rule can optionally override both this variable and `align-to-tab-stop'. See `align-rules-list'." - :type 'integer - :group 'align) + :type 'integer) (defcustom align-to-tab-stop 'indent-tabs-mode "If non-nil, alignments will always fall on a tab boundary. It may also be a symbol, whose value will be taken." - :type '(choice (const nil) symbol) - :group 'align) + :type '(choice (const nil) symbol)) (defcustom align-region-heuristic 500 "If non-nil, used as a heuristic by `align-current'. @@ -160,66 +156,55 @@ point we should search in looking for a region separator. Larger values can mean slower performance in large files, although smaller values may cause unexpected behavior at times." :type '(choice (const :tag "Don't use heuristic when aligning a region" nil) - integer) - :group 'align) + integer)) (defcustom align-highlight-change-face 'highlight "The face to highlight with if changes are necessary. Used by the `align-highlight-rule' command." - :type 'face - :group 'align) + :type 'face) (defcustom align-highlight-nochange-face 'secondary-selection "The face to highlight with if no changes are necessary. Used by the `align-highlight-rule' command." - :type 'face - :group 'align) + :type 'face) (defcustom align-large-region 10000 "If an integer, defines what constitutes a \"large\" region. If nil, then no messages will ever be printed to the minibuffer." - :type '(choice (const :tag "Align a large region silently" nil) integer) - :group 'align) + :type '(choice (const :tag "Align a large region silently" nil) integer)) (defcustom align-c++-modes '( c++-mode c-mode java-mode) "A list of modes whose syntax resembles C/C++." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-perl-modes '(perl-mode) "A list of modes where Perl syntax is to be seen." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-lisp-modes '(emacs-lisp-mode lisp-interaction-mode lisp-mode scheme-mode) "A list of modes whose syntax resembles Lisp." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-tex-modes '(tex-mode plain-tex-mode latex-mode slitex-mode) "A list of modes whose syntax resembles TeX (and family)." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-text-modes '(text-mode outline-mode) "A list of modes whose content is plain text." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-dq-string-modes (append align-lisp-modes align-c++-modes align-perl-modes '(python-base-mode vhdl-mode)) "A list of modes where double quoted strings should be excluded." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-sq-string-modes (append align-perl-modes '(python-base-mode)) "A list of modes where single quoted strings should be excluded." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-open-comment-modes (append align-lisp-modes align-c++-modes align-perl-modes @@ -227,8 +212,7 @@ If nil, then no messages will ever be printed to the minibuffer." "A list of modes with a single-line comment syntax. These are comments as in Lisp, which have a beginning, but end with the line (i.e., `comment-end' is an empty string)." - :type '(repeat symbol) - :group 'align) + :type '(repeat symbol)) (defcustom align-region-separate "^\\s-*[{}]?\\s-*$" "Select the method by which alignment sections will be separated. @@ -317,11 +301,10 @@ The possible settings for `align-region-separate' are: :type '(choice (const :tag "Entire region is one section" entire) (const :tag "Align by contiguous groups" group) -; (const largest) + ;; (const largest) (regexp :tag "Regexp defines section boundaries") (function :tag "Function defines section boundaries")) - :risky t - :group 'align) + :risky t) (defvar align-rules-list-type '(repeat @@ -714,8 +697,7 @@ The following attributes are meaningful: (see the documentation of that variable for possible values), and any separation argument passed to `align'." :type align-rules-list-type - :risky t - :group 'align) + :risky t) (defvar align-exclude-rules-list-type '(repeat @@ -784,8 +766,7 @@ The following attributes are meaningful: "A list describing text that should be excluded from alignment. See the documentation for `align-rules-list' for more info." :type align-exclude-rules-list-type - :risky t - :group 'align) + :risky t) ;;; Internal Variables: @@ -836,8 +817,7 @@ See the variable `align-exclude-rules-list' for more details.") (regexp . "\\(\\s-+\\)use\\s-+entity"))) "Alignment rules for `vhdl-mode'. See `align-rules-list' for more info." :type align-rules-list-type - :risky t - :group 'align) + :risky t) (make-obsolete-variable 'align-vhdl-rules-list "no longer used." "27.1") (defun align-set-vhdl-rules () commit 9506b9392e8c3548b769d9951a1c9d4abad9ee21 Author: Stefan Monnier Date: Mon Apr 8 08:18:31 2024 -0400 (define-globalized-minor-mode): Fix bug#69431 * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When `after-change-major-mode-hook` runs, enable the mode only in the current buffer and not in other pending buffers. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 4fa05008dd8..095bd5faa03 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -493,6 +493,8 @@ on if the hook has explicitly disabled it. (extra-keywords nil) (MODE-variable mode) (MODE-buffers (intern (concat global-mode-name "-buffers"))) + (MODE-enable-in-buffer + (intern (concat global-mode-name "-enable-in-buffer"))) (MODE-enable-in-buffers (intern (concat global-mode-name "-enable-in-buffers"))) (MODE-check-buffers @@ -559,10 +561,10 @@ Disable the mode if ARG is a negative number.\n\n" (if ,global-mode (progn (add-hook 'after-change-major-mode-hook - #',MODE-enable-in-buffers) + #',MODE-enable-in-buffer) (add-hook 'find-file-hook #',MODE-check-buffers) (add-hook 'change-major-mode-hook #',MODE-cmhh)) - (remove-hook 'after-change-major-mode-hook #',MODE-enable-in-buffers) + (remove-hook 'after-change-major-mode-hook #',MODE-enable-in-buffer) (remove-hook 'find-file-hook #',MODE-check-buffers) (remove-hook 'change-major-mode-hook #',MODE-cmhh)) @@ -609,6 +611,36 @@ list." ;; List of buffers left to process. (defvar ,MODE-buffers nil) + ;; The function that calls TURN-ON in the current buffer. + (defun ,MODE-enable-in-buffer () + ;; Remove ourselves from the list of pending buffers. + (setq ,MODE-buffers (delq (current-buffer) ,MODE-buffers)) + (unless ,MODE-set-explicitly + (unless (eq ,MODE-major-mode major-mode) + (if ,MODE-variable + (progn + (,mode -1) + (funcall ,turn-on-function)) + (funcall ,turn-on-function)))) + (setq ,MODE-major-mode major-mode)) + (put ',MODE-enable-in-buffer 'definition-name ',global-mode) + + ;; In the normal case, major modes run `after-change-major-mode-hook' + ;; which will have called `MODE-enable-in-buffer' for us. But some + ;; major modes don't use `run-mode-hooks' (customarily used via + ;; `define-derived-mode') and thus fail to run + ;; `after-change-major-mode-hook'. + ;; The functions below try to handle those major modes, with + ;; a combination of ugly hacks to try and catch those corner + ;; cases by listening to `change-major-mode-hook' to discover + ;; potential candidates and then checking in `post-command-hook' + ;; and `find-file-hook' if some of those still haven't run + ;; `after-change-major-mode-hook'. FIXME: We should try and get + ;; rid of this ugly hack and rely purely on + ;; `after-change-major-mode-hook' because they can (and do) end + ;; up running `MODE-enable-in-buffer' too early (when the major + ;; isn't yet fully setup) in some cases (see bug#58888). + ;; The function that calls TURN-ON in each buffer. (defun ,MODE-enable-in-buffers () (let ((buffers ,MODE-buffers)) @@ -618,15 +650,8 @@ list." (setq ,MODE-buffers nil) (dolist (buf buffers) (when (buffer-live-p buf) - (with-current-buffer buf - (unless ,MODE-set-explicitly - (unless (eq ,MODE-major-mode major-mode) - (if ,MODE-variable - (progn - (,mode -1) - (funcall ,turn-on-function)) - (funcall ,turn-on-function)))) - (setq ,MODE-major-mode major-mode)))))) + (with-current-buffer buf + (,MODE-enable-in-buffer)))))) (put ',MODE-enable-in-buffers 'definition-name ',global-mode) (defun ,MODE-check-buffers () commit b9b2bc7192e75e0208c064e44cb4afc418ec3d28 Author: Stephen Berman Date: Mon Apr 8 13:56:56 2024 +0200 Update INSTALL for native compilation of Lisp files * INSTALL: Add section "Native compilation of Lisp files" under ADDITIONAL DISTRIBUTION FILES and correspondingly augment item 6 of DETAILED BUILDING AND INSTALLATION. In the latter also note differences between in-source-tree and out-of-tree builds for running 'src/emacs' uninstalled. diff --git a/INSTALL b/INSTALL index 90ae622f340..59a8063ba19 100644 --- a/INSTALL +++ b/INSTALL @@ -273,6 +273,25 @@ to force GTK+ to run under Broadway, start Emacs like this: The GNUstep build also supports the Wayland window system. If that is what you want, see nextstep/INSTALL. +* Native compilation of Lisp files + +In addition to byte-compiling files of Lisp code, Emacs can also produce +"native code", which usually runs several times faster than the +corresponding byte-compiled code. To build Emacs with this feature, +your system must have not only GCC (the C compiler) and Binutils (the +assembler and linker) but also the 'libgccjit' shared library, which is +part of the GCC distribution. If these components are available, +building Emacs will automatically produce natively compiled Lisp code. + +By default, Emacs natively compiles only pre-loaded Lisp files during +the build process; other Lisp files are natively compiled +"just-in-time", i.e., the first time they are loaded into the running +Emacs. If you want Emacs to natively compile all Lisp files during the +build ("ahead of time"), use the 'configure' option +'--with-native-compilation=aot'. If you do not want natively compiled +Lisp code even if your system satisfies the build requirements, use the +'configure' option '--with-native-compilation=no'. + DETAILED BUILDING AND INSTALLATION: (This is for a Unix or Unix-like system. For GNUstep and macOS, @@ -568,10 +587,18 @@ need to create them if you have nothing to put in them. wish to add to various termcap entries. (This is unlikely to be necessary.) 6) Run 'make' in the top directory of the Emacs distribution to finish -building Emacs in the standard way. The final executable file is -named 'src/emacs'. You can execute this file "in place" without -copying it, if you wish; then it automatically uses the sibling -directories ../lisp, ../lib-src, ../info. +building Emacs in the standard way. The final executable file is named +'src/emacs'. You can execute this file "in place" without copying it, +if you wish; then it automatically uses the sibling directories ../lisp, +../lib-src, ../info, ../native-lisp (if built with support for native +compilation). + +If you build Emacs in a directory separate from the source directory +("out-of-tree"), run 'make' in the build directory. Then you can +execute the 'src/emacs' file under that directory "in place". However, +in this case the Emacs executable, while still using the ../lisp and +../info subdirectories of the source tree, will use the ../lib-src and +../native-lisp subdirectories from the build tree. Or you can "install" the executable and the other files into their installed locations, with 'make install'. By default, Emacs's files @@ -589,6 +616,13 @@ are installed in the following directories: at the same time; in particular, you don't have to make Emacs unavailable while installing a new version. +'/usr/local/lib/emacs/VERSION/native-lisp' holds the natively compiled + pre-loaded Emacs Lisp files. If the build used the + 'configure' option '--with-native-compilation=aot', then + this directory holds all natively compiled Lisp files. + +'~/.emacs.d/eln-cache/' holds the just-in-time natively compiled Lisp files. + '/usr/local/share/emacs/VERSION/etc' holds the Emacs tutorial, the DOC file, and other architecture-independent files Emacs might need while running. commit c9d7721db6eeda8efa7b5a49c9a4bcaacd078791 Author: Andrea Corallo Date: Mon Apr 8 11:21:37 2024 +0200 * Make comp ignore EIEIO classes (bug#70141) * lisp/emacs-lisp/comp-cstr.el (comp--all-classes): Ignore EIEIO classes. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index cbfb9540f03..d6cb887759f 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -89,7 +89,10 @@ Integer values are handled in the `range' slot.") "Return all non built-in type names currently defined." (let (res) (mapatoms (lambda (x) - (when (cl-find-class x) + (when-let ((class (cl-find-class x)) + ;; Ignore EIEIO classes as they can be + ;; redefined at runtime. + (gate (not (eq 'eieio--class (type-of class))))) (push x res))) obarray) res)) commit 4d486bd378b409c2a96b3e9af36534aa8eb5b3af Author: Andrea Corallo Date: Mon Apr 8 10:46:50 2024 +0200 * Fix out of date comp pass names in comp-tests.el * test/src/comp-tests.el (comp-tests-tco, comp-tests-fw-prop-1) (comp-tests-pure): Update out of date pass names. diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index b2fd2f68826..5deff03fd84 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -865,8 +865,8 @@ Return a list of results." (let ((native-comp-speed 3) ;; Disable ipa-pure otherwise `comp-tests-tco-f' gets ;; optimized-out. - (comp-disabled-passes '(comp-ipa-pure)) - (comp-post-pass-hooks '((comp-tco comp-tests-tco-checker) + (comp-disabled-passes '(comp--ipa-pure)) + (comp-post-pass-hooks '((comp--tco comp-tests-tco-checker) (comp-final comp-tests-tco-checker)))) (eval '(defun comp-tests-tco-f (a b count) (if (= count 0) @@ -893,7 +893,7 @@ Return a list of results." (comp-deftest fw-prop-1 () "Some tests for forward propagation." (let ((native-comp-speed 2) - (comp-post-pass-hooks '((comp-final comp-tests-fw-prop-checker-1)))) + (comp-post-pass-hooks '((comp--final comp-tests-fw-prop-checker-1)))) (eval '(defun comp-tests-fw-prop-1-f () (let* ((a "xxx") (b "yyy") @@ -1550,8 +1550,8 @@ folded." (comp-deftest pure () "Some tests for pure functions optimization." (let ((native-comp-speed 3) - (comp-post-pass-hooks '((comp-final comp-tests-pure-checker-1 - comp-tests-pure-checker-2)))) + (comp-post-pass-hooks '((comp--final comp-tests-pure-checker-1 + comp-tests-pure-checker-2)))) (load (native-compile (ert-resource-file "comp-test-pure.el"))) (declare-function comp-tests-pure-caller-f nil) (declare-function comp-tests-pure-fibn-entry-f nil)