commit 3c94ae5a37eac0191fe5d8bd85164b190ac10244 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Mon Sep 1 00:57:44 2025 -0400 (completion-file-name-table): Refine last fix * lisp/minibuffer.el (completion-file-name-table): Don't hardcode Tramp knowledge here. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 64eb5d93fe6..914958a08a4 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3523,14 +3523,12 @@ same as `substitute-in-file-name'." (let ((comp ()) (pred (if (and (eq pred 'file-directory-p) - (not (string-match-p - (or (bound-and-true-p - tramp-completion-file-name-regexp) - (rx unmatchable)) - string))) + ;; File-name-handlers don't necessarily follow + ;; that convention (bug#79236). + (not (find-file-name-handler + realdir 'file-name-all-completions))) ;; Brute-force speed up for directory checking: ;; Discard strings which don't end in a slash. - ;; Unless it is a Tramp construct like "/ssh:". (lambda (s) (let ((len (length s))) (and (> len 0) (eq (aref s (1- len)) ?/)))) commit 1ba75cc6fc57e27c489d49f9fba0f7d6788e030b Author: Juri Linkov Date: Sun Aug 31 21:23:05 2025 +0300 New user option 'tab-line-define-keys' * lisp/tab-line.el (tab-line-define-keys): New defcustom. (tab-line--define-keys, tab-line--undefine-keys): New functions that explicitly bind commands from 'tab-line-mode-map' to 'ctl-x-map'. (tab-line-mode-map): Leave this keymap empty by default to avoid breaking 'ctl-x-map' (bug#79323). (global-tab-line-mode): Call either 'tab-line--define-keys' or 'tab-line--undefine-keys'. diff --git a/etc/NEWS b/etc/NEWS index 4bf5f1dee9c..02a556a557d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,12 @@ docstring for arguments passed to a help-text function. When non-nil, it truncates the tab bar, and therefore prevents wrapping and resizing the tab bar to more than one line. +--- +*** New user option 'tab-line-define-keys'. +When t, the default, it redefines window buffer switching keys +such as 'C-x ' and 'C-x ' to tab-line specific variants +for switching tabs. + --- *** New command 'tab-line-move-tab-forward' ('C-x M-'). Together with the new command 'tab-line-move-tab-backward' diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 7caae8bc2c1..fbf7f79eda8 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -1277,14 +1277,54 @@ However, return the correct mouse position list if EVENT is a (event-start event))) +(defcustom tab-line-define-keys t + "Define specific tab-line key bindings. +If t, the default, key mappings for switching and moving tabs +are defined. If nil, do not define any key mappings." + :type 'boolean + :initialize #'custom-initialize-default + :set (lambda (sym val) + (tab-line--undefine-keys) + (set-default sym val) + ;; Enable the new keybindings + (tab-line--define-keys)) + :group 'tab-line + :version "31.1") + +(defun tab-line--define-keys () + "Install key bindings to switch between tabs if so configured." + (when tab-line-define-keys + (when (eq (keymap-lookup ctl-x-map "") 'previous-buffer) + (keymap-set ctl-x-map "" #'tab-line-switch-to-prev-tab)) + (when (eq (keymap-lookup ctl-x-map "C-") 'previous-buffer) + (keymap-set ctl-x-map "C-" #'tab-line-switch-to-prev-tab)) + (unless (keymap-lookup ctl-x-map "M-") + (keymap-set ctl-x-map "M-" #'tab-line-move-tab-backward)) + (when (eq (keymap-lookup ctl-x-map "") 'next-buffer) + (keymap-set ctl-x-map "" #'tab-line-switch-to-next-tab)) + (when (eq (keymap-lookup ctl-x-map "C-") 'next-buffer) + (keymap-set ctl-x-map "C-" #'tab-line-switch-to-next-tab)) + (unless (keymap-lookup ctl-x-map "M-") + (keymap-set ctl-x-map "M-" #'tab-line-move-tab-forward)))) + +(defun tab-line--undefine-keys () + "Uninstall key bindings previously bound by `tab-line--define-keys'." + (when tab-line-define-keys + (when (eq (keymap-lookup ctl-x-map "") 'tab-line-switch-to-prev-tab) + (keymap-set ctl-x-map "" #'previous-buffer)) + (when (eq (keymap-lookup ctl-x-map "C-") 'tab-line-switch-to-prev-tab) + (keymap-set ctl-x-map "C-" #'previous-buffer)) + (when (eq (keymap-lookup ctl-x-map "M-") 'tab-line-move-tab-backward) + (keymap-set ctl-x-map "M-" nil)) + (when (eq (keymap-lookup ctl-x-map "") 'tab-line-switch-to-next-tab) + (keymap-set ctl-x-map "" #'next-buffer)) + (when (eq (keymap-lookup ctl-x-map "C-") 'tab-line-switch-to-next-tab) + (keymap-set ctl-x-map "C-" #'next-buffer)) + (when (eq (keymap-lookup ctl-x-map "M-") 'tab-line-move-tab-forward) + (keymap-set ctl-x-map "M-" nil)))) + (defvar-keymap tab-line-mode-map - :doc "Keymap for keys of `tab-line-mode'." - "C-x " #'tab-line-switch-to-prev-tab - "C-x C-" #'tab-line-switch-to-prev-tab - "C-x M-" #'tab-line-move-tab-backward - "C-x " #'tab-line-switch-to-next-tab - "C-x C-" #'tab-line-switch-to-next-tab - "C-x M-" #'tab-line-move-tab-forward) + :doc "Keymap for keys of `tab-line-mode'.") (defvar-keymap tab-line-switch-repeat-map :doc "Keymap to repeat tab/buffer cycling. Used in `repeat-mode'." @@ -1374,7 +1414,10 @@ of `tab-line-exclude', are exempt from `tab-line-mode'." (define-globalized-minor-mode global-tab-line-mode tab-line-mode tab-line-mode--turn-on :group 'tab-line - :version "27.1") + :version "27.1" + (if global-tab-line-mode + (tab-line--define-keys) + (tab-line--undefine-keys))) (global-set-key [tab-line down-mouse-3] 'tab-line-context-menu) commit 07adb8b59dee772b56612b90acd19e1a5a456628 Author: Juri Linkov Date: Sun Aug 31 20:30:18 2025 +0300 * doc/emacs/modes.texi (Choosing Modes): Document 'treesit-enabled-modes'. diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index c3008a48b04..4a9d753bf6f 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi @@ -507,6 +507,14 @@ predictable behavior, we recommend that you always customize this variable overrides any remapping that Emacs might decide to perform internally. +@vindex treesit-enabled-modes + For extra convenience of enabling major modes based on the tree-sitter, +the user option @code{treesit-enabled-modes} supports the value @code{t} +that enables all available tree-sitter based modes, or a list of mode +names to enable like @code{c-ts-mode}. After customizing this option, +it adds the corresponding mappings to @code{major-mode-remap-alist} such +as remapping from @code{c-mode} to @code{c-ts-mode}. + @findex normal-mode If you have changed the major mode of a buffer, you can return to the major mode Emacs would have chosen automatically, by typing diff --git a/etc/NEWS b/etc/NEWS index 09ef1d64647..4bf5f1dee9c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -769,6 +769,7 @@ the default UI you get, i.e., when 'register-use-preview' is 'traditional'. ** Tree-sitter ++++ *** New user option 'treesit-enabled-modes'. You can customize it either to t to enable all available ts-modes, or to select a list of ts-modes to enable. Depending on customization, commit 0cd0aaa14fc4b2279d3d8bb8afe0aaa647c8f272 Author: Sean Whitton Date: Sun Aug 31 16:37:11 2025 +0100 vc-revert: Fix calling vc-buffer-sync (bug#79319) * lisp/vc/vc.el (vc-revert): Don't call vc-buffer-sync on a non-file-visiting buffer (bug#79319). Don't try to use memq to compare strings. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 76ba024c209..229ec112bed 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3664,7 +3664,8 @@ to the working revision (except for keyword expansion)." ;; If any of the files is visited by the current buffer, make sure ;; buffer is saved. If the user says `no', abort since we cannot ;; show the changes and ask for confirmation to discard them. - (when (or (not files) (memq (buffer-file-name) files)) + (when-let* ((n (buffer-file-name)) + ((or (not files) (member n files)))) (vc-buffer-sync nil)) (save-some-buffers nil (lambda () (and-let* ((n (buffer-file-name))) commit 11dc1420e449dd936e31d77fe445cb7abac88fb8 Author: Sean Whitton Date: Sun Aug 31 16:32:48 2025 +0100 * lisp/vc/vc.el (vc-revert): Tighten up save-some-buffers predicate. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 9d0445fb50a..76ba024c209 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3667,7 +3667,8 @@ to the working revision (except for keyword expansion)." (when (or (not files) (memq (buffer-file-name) files)) (vc-buffer-sync nil)) (save-some-buffers nil (lambda () - (member (buffer-file-name) files))) + (and-let* ((n (buffer-file-name))) + (member n files)))) (let (needs-save) (dolist (file files) (let ((buf (get-file-buffer file))) commit 8c663618ce884cccf989d7834f822b7384ee5e83 Author: Eli Zaretskii Date: Sun Aug 31 09:54:17 2025 +0300 ; * etc/NEWS: Document the change that fixed bug#65897. diff --git a/etc/NEWS b/etc/NEWS index 8a139cb03ca..09ef1d64647 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -614,6 +614,14 @@ To use the ':foreground' or current text color ensure the 'fill' attribute in the SVG is set to 'currentcolor', or set the image spec's ':css' value to 'svg {fill: currentcolor;}'. +--- +** Errors signaled by 'emacsclient' connections can now enter the debugger. +If 'debug-on-error' is non-nil, errors signaled by Lisp programs +executed due to 'emacsclient' connections will now enter the Lisp +debugger and show the backtrace. If 'debug-on-error' is nil, these +errors will be sent to 'emacsclient', as before, and will be displayed +on the terminal from which 'emacsclient' was invoked. + * Editing Changes in Emacs 31.1 commit 98fbaacac23fd0de591092800a7565605ad67df1 Author: Spencer Baugh Date: Fri Aug 29 17:00:47 2025 -0400 Allow entering the debugger on error in emacsclient connections * lisp/server.el (server--process-filter-1): Use 'condition-case-unless-debug'. (Bug#65897) diff --git a/lisp/server.el b/lisp/server.el index 4415c45971e..70299d52f18 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1232,7 +1232,7 @@ The following commands are accepted by the client: (when prev (setq string (concat prev string)) (process-put proc 'previous-string nil))) - (condition-case err + (condition-case-unless-debug err (progn (server-add-client proc) ;; Send our pid commit 32d3c859f07a684ce1712f3a66d377ca94a829af Author: Eli Zaretskii Date: Sat Aug 30 19:50:22 2025 +0300 Fix EOL decoding in files extracted from ZIP archives * lisp/arc-mode.el (archive-set-buffer-as-visiting-file): Don't lose EOL conversion determined by 'decode-coding-region' from the extracted file's data. (Bug#79316) diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 8f6c71a4b74..0c5d3475aa6 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1067,8 +1067,19 @@ using `make-temp-file', and the generated name is returned." (setq coding (coding-system-change-text-conversion coding 'raw-text))) (unless (memq coding '(nil no-conversion)) + ;; If CODING specifies a certain EOL conversion, reset that, to + ;; force 'decode-coding-region' below determine EOL conversion + ;; from the file's data... + (if (numberp (coding-system-eol-type coding)) + (setq coding (coding-system-change-eol-conversion coding nil))) (decode-coding-region (point-min) (point-max) coding) - (setq last-coding-system-used coding)) + ;; ...then augment CODING with the actual EOL conversion + ;; determined from the file's data. + (let ((eol-type (coding-system-eol-type last-coding-system-used))) + (if (numberp eol-type) + (setq last-coding-system-used + (coding-system-change-eol-conversion coding eol-type)) + (setq last-coding-system-used coding)))) (set-buffer-modified-p nil) (kill-local-variable 'buffer-file-coding-system) (after-insert-file-set-coding (- (point-max) (point-min)))))) commit b73d92c8b124d2da03bf1206f15c320cbc5a1bd8 Author: Jeremy Bryant Date: Fri Aug 29 22:41:40 2025 +0100 * lisp/saveplace.el (save-places-to-alist): Add doc string. Replace previous comment and simplify wording by refering to the function 'save-place-to-alist' being called on all buffers. (Bug#79340) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 1f36196408a..51df1edeaa7 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -406,8 +406,8 @@ may have changed) back to `save-place-alist'." (file-error (message "Saving places: can't write %s" file))))))) (defun save-places-to-alist () - ;; go through buffer-list, saving places to alist if save-place-mode - ;; is non-nil, deleting them from alist if it is nil. + "Save all buffer filenames and positions to `save-place-alist'. +See `save-place-to-alist'." (let ((buf-list (buffer-list))) (while buf-list ;; put this into a save-excursion in case someone is counting on commit 8a284cbbc588d19d48ffbd159dfa506da468e351 Author: Sean Whitton Date: Sat Aug 30 15:54:32 2025 +0100 ; Fix `(emacs)Merge Bases' Intended to be included in previous commit. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index c96f21f0c83..41058aefce5 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -247,20 +247,13 @@ another (@code{vc-log-mergebase}). @c more than one branch for older VCS? This needs thinking through if @c any of our centalized VCS gain support for these commands. The @dfn{merge base} of two branches is the most recent revision that -exists on both branches. If neither of the branches were ever merged +exists on both branches. If neither of the branches was ever merged into the other (@pxref{Merging}), then the merge base is the revision that the older of the two branches was at when the newer branch was created from it (@pxref{Creating Branches}). If one of the branches was ever merged into the other, then the merge base is the most recent merge point. -With this understood, we can generalize the concept of a merge base from -branches to any two revisions. The merge base of two revisions is the -most recent revision that can be found in the revision history of both -of the two revisions.@footnote{In fact the concept generalizes to any -number of revisions, but Emacs's commands for merge bases work with only -two, so we limit ourselves to that.} - The commands described in this section are currently implemented only for decentralized version control systems (@pxref{VCS Repositories}). commit af4a5e2b4ad080ad5d3b714286e7aca9339288b0 Merge: e1af5d70e23 3d2a8186793 Author: Eli Zaretskii Date: Sat Aug 30 07:18:37 2025 -0400 Merge from origin/emacs-30 3d2a8186793 * doc/misc/efaq-w32.texi (UTF-8 encoding): New section (b... ec50d775acf ; * doc/misc/flymake.texi (Finding diagnostics): Fix a ty... 293e258a1b2 * doc/emacs/screen.texi (Mode Line): Fix reference. 8eb192c23df ; * admin/make-tarball.txt: Update the "Web pages" sectio... commit e1af5d70e23ca6c90c35afd5f6c3e4eeb3c1a932 Merge: b610f36d44d eabb5f450c8 Author: Eli Zaretskii Date: Sat Aug 30 07:18:36 2025 -0400 ; Merge from origin/emacs-30 The following commit was skipped: eabb5f450c8 Improve and clarify documentation of 'dired-click-to-sele... commit b610f36d44dda3beb5cf2b8b65bfb0d005afed5c Author: Spencer Baugh Date: Thu Aug 28 15:04:39 2025 -0400 Document and test 'let-alist' support for indexing * etc/NEWS: Announce 'let-alist' support for indexing. * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-numbers): Add a test for 'let-alist's support for indexing. * doc/lispref/lists.texi (Association Lists): Document indexing with 'let-alist'. (Bug#66509) diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 37a07421e94..81edcc63d5b 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -1934,6 +1934,19 @@ Nested association lists is supported: Nesting @code{let-alist} inside each other is allowed, but the code in the inner @code{let-alist} can't access the variables bound by the outer @code{let-alist}. + +Indexing into lists is also supported: + +@lisp +(setq colors '((rose . red) (lily . (yellow pink)))) +(let-alist colors .lily.1) + @result{} pink +@end lisp + +Note that forms like @samp{.0} or @samp{.3} are interpreted as numbers +rather than as symbols, so they won't be bound to the corresponding +values in ALIST. + @end defmac @node Property Lists diff --git a/etc/NEWS b/etc/NEWS index 3dc0e0a7677..8a139cb03ca 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2854,6 +2854,12 @@ function 'load-path-filter-cache-directory-files', calling 'load' will cache the directories it scans and their files, and the following lookups should be faster. ++++ +** 'let-alist' supports indexing into lists. +The macro 'let-alist' now interprets symbols containing numbers as list +indices. For example, '.key.0' looks up 'key' in the alist and then +returns its first element. + ** Lexical binding --- diff --git a/test/lisp/emacs-lisp/let-alist-tests.el b/test/lisp/emacs-lisp/let-alist-tests.el index 988b05b488c..b23178f5467 100644 --- a/test/lisp/emacs-lisp/let-alist-tests.el +++ b/test/lisp/emacs-lisp/let-alist-tests.el @@ -100,4 +100,15 @@ See Bug#24641." `[,(+ .a) ,(+ .a .b .b)]) [1 5]))) +(ert-deftest let-alist-numbers () + "Check that .num indexes into lists." + (should (equal + (let-alist + '(((a . val1) (b . (nil val2))) + (c . (val3))) + (list .0 .0.a .0.b.1 .c.0)) + ;; .0 is interpreted as a number, so we can't use `let-alist' + ;; to do indexing alone. Everything else works though. + '(0.0 val1 val2 val3)))) + ;;; let-alist-tests.el ends here commit 7efaa4657a10a0ec911a8fc8228260f30f1d7b55 Merge: 73aac05cfd7 29e673a77b1 Author: Eli Zaretskii Date: Sat Aug 30 13:46:34 2025 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 73aac05cfd78acf583d1fb6220f6796390246455 Author: Eli Zaretskii Date: Sat Aug 30 13:45:07 2025 +0300 Fix "C-u C-h C-n" * lisp/help.el (view-emacs-news): Widen the buffer before re-narrowing it again to a different version. (Bug#79324) diff --git a/lisp/help.el b/lisp/help.el index e6c5ea54812..4ba99868c4a 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -624,6 +624,7 @@ With argument, display info only for the selected version." (t (format "NEWS.%d" vn)))) res) (find-file (expand-file-name file data-directory)) + (widen) ; In case we already are visiting that NEWS file (emacs-news-view-mode) (goto-char (point-min)) (when (stringp version) commit 29e673a77b148f0c215af161342c123ba30e509c Author: Sean Whitton Date: Sun Aug 17 15:05:55 2025 +0100 New commands for outgoing diffs including uncommitted changes * lisp/vc/vc.el (vc-root-diff-outgoing-base) (vc-diff-outgoing-base): New commands (bug#62940). * lisp/vc/vc-hooks.el (vc-prefix-map): Bind them. * doc/emacs/vc1-xtra.texi (Outgoing Base Diffs): * etc/NEWS: Document them. * doc/emacs/emacs.texi (Outgoing Base Diffs): New node. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 4b625f99f52..b32c704bd12 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -869,6 +869,7 @@ Miscellaneous Commands and Features of VC * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. * Merge Bases:: The most recent revision existing on both branches. +* Outgoing Base Diffs:: Diffs including all outstanding changes on a branch. * Other Working Trees:: Multiple sets of workfiles. * Version Headers:: Inserting version control headers into working files. * Editing VC Commands:: Editing the VC shell commands that Emacs will run. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 8830b93c91a..c96f21f0c83 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -15,6 +15,7 @@ * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. * Merge Bases:: The most recent revision existing on both branches. +* Outgoing Base Diffs:: Diffs including all outstanding changes on a branch. * Other Working Trees:: Multiple sets of workfiles. * Version Headers:: Inserting version control headers into working files. * Editing VC Commands:: Editing the VC shell commands that Emacs will run. @@ -298,6 +299,90 @@ on the target branch if you were to merge the source branch into it, and @kbd{C-x v M L} shows you a log of the changes on the source branch not yet merged into the target branch. +@node Outgoing Base Diffs +@subsubsection Commands for diffs including all outstanding changes +@cindex outstanding changes + +@table @kbd +@item C-x v B = +Display diffs of changes to the VC fileset since the merge base of this +branch and its upstream counterpart (@code{vc-diff-outgoing-base}). + +@item C-x v B D +Display all changes since the merge base of this branch and its upstream +counterpart (@code{vc-root-diff-outgoing-base}). +@end table + +For decentralized version control systems (@pxref{VCS Repositories}), +these commands provide specialized versions of @kbd{C-x v M D} (see +@pxref{Merge Bases}) which also take into account the state of upstream +repositories. These commands are useful both when working on a single +branch and when developing features on a separate branch +(@pxref{Branches}). These two cases involve using the commands +differently, and so we will describe them separately. + +First, consider working on a single branch. @dfn{Outstanding changes} +are those which you haven't yet pushed upstream. This includes both +unpushed commits and uncommitted changes in your working tree. In many +cases the reason these changes are not pushed yet is that they are not +finished: the changes committed so far don't make sense in isolation. + +@kindex C-x v B = +@findex vc-diff-outgoing-base +@kindex C-x v B D +@findex vc-root-diff-outgoing-base +Type @kbd{C-x v B D} (@code{vc-root-diff-outgoing-base}) to display a +summary of all these changes, committed and uncommitted. This summary +is in the form of a diff of what committing and pushing (@pxref{Pulling +/ Pushing}) all these changes would do to the upstream repository. You +can use @kbd{C-x v B =} (@code{vc-diff-outgoing-base}) instead to limit +the display of changes to the current VC fileset. (The difference +between @w{@kbd{C-x v B D}} and @w{@kbd{C-x v B =}} is like the +difference between @kbd{C-x v D} and @kbd{C-x v =} (@pxref{Old +Revisions}).)@footnote{Another point of comparison is that these +commands are like @w{@kbd{C-x v O =}} (@code{vc-fileset-diff-outgoing}) +and @kbd{C-x v O D} (@code{vc-root-diff-outgoing}) except that they +include uncommitted changes in the reported diffs. Like those other +commands, you can use a prefix argument to specify a particular upstream +location.} + +Second, consider developing a feature on a separate branch. Call this +the @dfn{feature branch},@footnote{Many version control workflows +involve developing new features on isolated branches. However, the term +``feature branch'' is usually reserved for a particular kind of isolated +branch, one that other branches are repeatedly merged into. + +That doesn't matter to this explanation, so we use ``feature branch'' to +refer to the separate branch used for developing the feature even though +whether it is really a feature branch depends on other aspects of the +branching workflow in use.} and call the branch from which the feature +branch was originally created the @dfn{trunk} or @dfn{development +trunk}. + +In this case, outstanding changes is a more specific notion than just +unpushed and uncommitted changes on the feature branch. You're not +finished sharing changes with your collaborators until they have been +merged into the trunk, and pushed. Therefore, in this example, +outstanding changes are those which haven't yet been integrated into the +upstream repository's development trunk. That means committed changes +on the feature branch that haven't yet been merged into the trunk, plus +uncommitted changes. + +@cindex outgoing base, version control +The @dfn{outgoing base} is the upstream location for which the changes +are destined once they are no longer outstanding. In this case, that's +the upstream version of the trunk, to which you and your collaborators +push finished work. + +To display a summary of outgoing changes in this multi-branch example, +supply a prefix argument, by typing @w{@kbd{C-u C-x v B =}} or +@w{@kbd{C-u C-x v B D}}. When prompted, enter the outgoing base. +Exactly what you must supply here depends on the name of your +development trunk and the version control system in use. For example, +with Git, usually you will enter @kbd{origin/master}. We hope to +improve these commands such that no prefix argument is required in the +multi-branch case, too. + @node Other Working Trees @subsubsection Multiple Working Trees for One Repository diff --git a/etc/NEWS b/etc/NEWS index c9f30dc7ef7..3dc0e0a7677 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2173,6 +2173,14 @@ include were committed and will be pushed. 'vc-diff-incoming' and 'vc-diff-outgoing' are similar but limited to the current VC fileset. ++++ +*** New commands to report diffs of outstanding changes. +'C-x v B =' ('vc-diff-outgoing-base') and 'C-x v B D' +('vc-root-diff-outgoing-base') report diffs of changes since the merge +base with the remote branch, including uncommitted changes. +They are useful to view all outstanding (unmerged, unpushed) changes on +the current branch. + +++ *** New user option 'vc-use-incoming-outgoing-prefixes'. If this is customized to non-nil, 'C-x v I' and 'C-x v O' become prefix diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index cfca7b4662e..999bf279fba 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -952,6 +952,8 @@ In the latter case, VC mode is deactivated for this buffer." "O" #'vc-log-outgoing "M L" #'vc-log-mergebase "M D" #'vc-diff-mergebase + "B =" #'vc-diff-outgoing-base + "B D" #'vc-root-diff-outgoing-base "m" #'vc-merge "r" #'vc-retrieve-tag "s" #'vc-create-tag diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 9634b06a40e..9d0445fb50a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2575,6 +2575,9 @@ When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to. When called interactively with a prefix argument, prompt for REMOTE-LOCATION. In some version control systems REMOTE-LOCATION can be a remote branch name. +This command is like `vc-root-diff-outgoing-base' except that it does +not include uncommitted changes. + See `vc-use-incoming-outgoing-prefixes' regarding giving this command a global binding." (interactive (list (vc--maybe-read-remote-location))) @@ -2589,6 +2592,9 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION. In some version control systems REMOTE-LOCATION can be a remote branch name. When called from Lisp optional argument FILESET overrides the VC fileset. +This command is like `vc-diff-outgoing-base' except that it does not +include uncommitted changes. + See `vc-use-incoming-outgoing-prefixes' regarding giving this command a global binding." ;; For this command, for distributed VCS, we want to ignore @@ -2629,6 +2635,71 @@ global binding." (car fileset)) (called-interactively-p 'interactive)))) +;; For the following two commands, the default meaning for +;; REMOTE-LOCATION may become dependent on whether we are on a +;; shorter-lived or longer-lived ("trunk") branch. If we are on the +;; trunk then it will always be the place `vc-push' would push to. If +;; we are on a shorter-lived branch, it may instead become the remote +;; trunk branch from which the shorter-lived branch was branched. That +;; way you can use these commands to get a summary of all unmerged work +;; outstanding on the short-lived branch. +;; +;; The obstacle to doing this is that VC lacks any distinction between +;; shorter-lived and trunk branches. But we all work with both of +;; these, for almost any VCS workflow. E.g. modern workflows which +;; eschew traditional feature branches still have a long-lived trunk +;; plus shorter-lived local branches for merge requests or patch series. +;; --spwhitton + +;;;###autoload +(defun vc-root-diff-outgoing-base (&optional remote-location) + "Report diff of all changes since the merge base with REMOTE-LOCATION. +The merge base with REMOTE-LOCATION means the common ancestor of the +working revision and REMOTE-LOCATION. +Uncommitted changes are included in the diff. + +When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to. +This default meaning for REMOTE-LOCATION may change in a future release +of Emacs. + +When called interactively with a prefix argument, prompt for +REMOTE-LOCATION. In some version control systems, REMOTE-LOCATION can +be a remote branch name. + +This command is like `vc-root-diff-outgoing' except that it includes +uncommitted changes." + (interactive (list (vc--maybe-read-remote-location))) + (vc--with-backend-in-rootdir "VC root-diff" + (vc-diff-outgoing-base remote-location `(,backend (,rootdir))))) + +;;;###autoload +(defun vc-diff-outgoing-base (&optional remote-location fileset) + "Report changes to VC fileset since the merge base with REMOTE-LOCATION. + +The merge base with REMOTE-LOCATION means the common ancestor of the +working revision and REMOTE-LOCATION. +Uncommitted changes are included in the diff. + +When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to. +This default meaning for REMOTE-LOCATION may change in a future release +of Emacs. + +When called interactively with a prefix argument, prompt for +REMOTE-LOCATION. In some version control systems, REMOTE-LOCATION can +be a remote branch name. + +This command is like to `vc-fileset-diff-outgoing' except that it +includes uncommitted changes." + (interactive (list (vc--maybe-read-remote-location) nil)) + (let* ((fileset (or fileset (vc-deduce-fileset t))) + (backend (car fileset)) + (incoming (vc--incoming-revision backend + (or remote-location "")))) + (vc-diff-internal vc-allow-async-diff fileset + (vc-call-backend backend 'mergebase incoming) + nil + (called-interactively-p 'interactive)))) + (declare-function ediff-load-version-control "ediff" (&optional silent)) (declare-function ediff-vc-internal "ediff-vers" (rev1 rev2 &optional startup-hooks)) commit 14d20bff06a8832fb2ea465931e49caac5f4bc5c Author: Sean Whitton Date: Wed Aug 20 11:26:39 2025 +0100 Document C-x v M D and C-x v M L in the manual * doc/emacs/emacs.texi (Merge Bases): * doc/emacs/vc1-xtra.texi (Merge Bases): New node. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index b373dc092f8..4b625f99f52 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -868,6 +868,7 @@ Miscellaneous Commands and Features of VC * Change Logs and VC:: Generating a change log file from log entries. * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. +* Merge Bases:: The most recent revision existing on both branches. * Other Working Trees:: Multiple sets of workfiles. * Version Headers:: Inserting version control headers into working files. * Editing VC Commands:: Editing the VC shell commands that Emacs will run. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 3de00fe8684..5801604204c 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1815,7 +1815,7 @@ and so on, depending on the number of existing branches at that point. @kindex C-x v b c @findex vc-create-branch This procedure will not work for distributed version control systems -like git or Mercurial. For those systems you should use the command +like Git or Mercurial. For those systems you should use the command @code{vc-create-branch} (@w{@kbd{C-x v b c @var{branch-name} @key{RET}}}) instead. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 72e660a2def..8830b93c91a 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -14,6 +14,7 @@ * Change Logs and VC:: Generating a change log file from log entries. * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. +* Merge Bases:: The most recent revision existing on both branches. * Other Working Trees:: Multiple sets of workfiles. * Version Headers:: Inserting version control headers into working files. * Editing VC Commands:: Editing the VC shell commands that Emacs will run. @@ -227,6 +228,76 @@ an old tag, the renamed file is retrieved under its new name, which is not the name that the makefile expects. So the program won't really work as retrieved. +@node Merge Bases +@subsubsection Merge Bases +@cindex merge bases + +@table @kbd +@item C-x v M D +Report diffs of changes on a branch since it diverged from another +(@code{vc-diff-mergebase}). + +@item C-x v M L +Display log messages for revisions on a branch since it diverged from +another (@code{vc-log-mergebase}). +@end table + +@c This definition is possibly dVCS-specific -- can revisions exist on +@c more than one branch for older VCS? This needs thinking through if +@c any of our centalized VCS gain support for these commands. +The @dfn{merge base} of two branches is the most recent revision that +exists on both branches. If neither of the branches were ever merged +into the other (@pxref{Merging}), then the merge base is the revision +that the older of the two branches was at when the newer branch was +created from it (@pxref{Creating Branches}). If one of the branches was +ever merged into the other, then the merge base is the most recent merge +point. + +With this understood, we can generalize the concept of a merge base from +branches to any two revisions. The merge base of two revisions is the +most recent revision that can be found in the revision history of both +of the two revisions.@footnote{In fact the concept generalizes to any +number of revisions, but Emacs's commands for merge bases work with only +two, so we limit ourselves to that.} + +The commands described in this section are currently implemented only +for decentralized version control systems (@pxref{VCS Repositories}). + +@kindex C-x v M D +@findex vc-diff-mergebase +@kindex C-x v M L +@findex vc-log-mergebase +Merge bases are useful to make certain comparisons between branches, and +Emacs provides two commands for doing so. Each of @kbd{C-x v M D} +(@code{vc-diff-mergebase}) and @kbd{C-x v M L} (@code{vc-log-mergebase}) +prompts for two branches, finds their merge base, and then compares that +merge base with the second of the two branches. The commands report +diffs and display change history, respectively. + +The typical use case for these commands is when one of the branches was +originally created from the other and you or a collaborator have made +merges of one of the branches into the other at least once. Then you +can use these commands to see what changes on one branch have not yet +been merged into the other. + +Call the branch which has the changes you are interested in the ``source +branch'' and the branch into which these changes have not yet been +merged the ``target branch''. Specify the target branch when prompted +for the ``older revision'' and the source branch when prompted for the +``newer revision''.@footnote{The concept of merge bases generalizes from +branches to any two revisions. The merge base of two revisions is the +most recent revision that can be found in the revision history of both +of the two revisions. @kbd{C-x v M D} and @kbd{C-x v M L} accept any +two revisions, not just branches. Comparing two branches is the same as +comparing the revisions at the ends of the branches. + +(In fact the concept generalizes to any number of revisions, but Emacs's +commands for merge bases work with only two, so we limit ourselves to +that.)} Then @kbd{C-x v M D} shows you a preview of what would change +on the target branch if you were to merge the source branch into it, and +@kbd{C-x v M L} shows you a log of the changes on the source branch not +yet merged into the target branch. + @node Other Working Trees @subsubsection Multiple Working Trees for One Repository commit 53f5a07bebbf9fc880de88c8624ce3ed974b48ab Author: João Távora Date: Sat Aug 30 11:43:41 2025 +0100 Eglot: fix likely off-by-1 in LabelOffsetSupport feature (bug#79259) This feature was tweaked and last tested with a 2019 edition of the 'ccls' LSP. The spec does not clearly specify this number to be 0-indexed, but it would make sense that it would be so. So there's not need to 1+ - correct the numbers at all before using them in substring. This would fix the Haskell server use of this feature (which is bug#79259) * lisp/progmodes/eglot.el (eglot--sig-info): Fix likely off-by-1. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ee76d2fd5e4..475b5e13f1b 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3718,7 +3718,7 @@ for which LSP on-type-formatting should be requested." (let ((case-fold-search nil)) (and (search-forward parlabel (line-end-position) t) (list (match-beginning 0) (match-end 0)))) - (mapcar #'1+ (append parlabel nil))))) + (list (aref parlabel 0) (aref parlabel 1))))) (if (and beg end) (add-face-text-property beg end commit 467c75893cb3178db71f788eadaf1dd1ac70c093 Author: Eli Zaretskii Date: Sat Aug 30 13:22:05 2025 +0300 ; Fix defcustom type * lisp/files.el (lock-file-name-transforms): Fix the 'defcustom' type. (Bug#79322) diff --git a/lisp/files.el b/lisp/files.el index 3e85244e4e9..bd229673d8d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -555,9 +555,13 @@ if different users access the same file, using different lock file settings; if accessing files on a shared file system from different hosts, using a transform that puts the lock files on a local file system." :group 'files - :type '(repeat (list (regexp :tag "Regexp") + :type `(repeat (list (regexp :tag "Regexp") (string :tag "Replacement") - (boolean :tag "Uniquify"))) + (choice + (const :tag "Uniquify" t) + ,@(mapcar (lambda (algo) + (list 'const algo)) + (secure-hash-algorithms))))) :version "28.1") (defcustom remote-file-name-inhibit-locks nil commit 4ab16d701ecda72d8ed74cf0a5f0f63dfeeb087d Author: Steven Allen Date: Sat Aug 30 11:19:05 2025 +0100 Eglot: escape literal % characters in URIs Escape literal % characters in Eglot URIs Otherwise, a literal % in a file-name will be interpreted (by the language server) as if it were a part of a percent-encoded sequence. See Bug#78984 for context on why `url-path-allowed-chars' cannot be changed to escape literal % characters. * lisp/progmodes/eglot.el (eglot--uri-path-allowed-chars): Escape %, remove the redundant variable definition. * test/lisp/progmodes/eglot-tests.el (eglot-test-path-to-uri-escape): test it. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 29e6c269fdf..ee76d2fd5e4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -675,6 +675,7 @@ This can be useful when using docker to run a language server.") (defconst eglot--uri-path-allowed-chars (let ((vec (copy-sequence url-path-allowed-chars))) (aset vec ?: nil) ;; see github#639 + (aset vec ?% nil) ;; see bug#78984 vec) "Like `url-path-allowed-chars' but more restrictive.") @@ -2008,12 +2009,6 @@ If optional MARKER, return a marker instead" ;;; More helpers -(defconst eglot--uri-path-allowed-chars - (let ((vec (copy-sequence url-path-allowed-chars))) - (aset vec ?: nil) ;; see github#639 - vec) - "Like `url-path-allowed-chars' but more restrictive.") - (defun eglot--snippet-expansion-fn () "Compute a function to expand snippets. Doubles as an indicator of snippet support." diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 7fd4f0f0491..b01b7d269ec 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -1469,6 +1469,10 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of (should (string-suffix-p "c%3A/Users/Foo/bar.lisp" (eglot-path-to-uri "c:/Users/Foo/bar.lisp")))) +(ert-deftest eglot-test-path-to-uri-escape () + (should (equal "file:///path/with%20%25%20funny%20%3F%20characters" + (eglot-path-to-uri "/path/with % funny ? characters")))) + (ert-deftest eglot-test-same-server-multi-mode () "Check single LSP instance manages multiple modes in same project." (skip-unless (executable-find "clangd")) commit 8d301906e1f53b366316754d1f3ff2ad7f0f673c Author: Sergio Pastor Pérez Date: Sun Aug 24 20:27:06 2025 +0200 bug#79241: Fix incorrect handling of overlays in `vertical-motion' * src/indent.c (vertical-motion): If iterator is inside an overlay, reset it to the beginning of line before trying to reach goal column. This prevents point from being stuck at the beginning of overlay strings during upward motions. Copyright-paperwork-exempt: yes diff --git a/src/indent.c b/src/indent.c index b4f3c349dc5..95228b26825 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2506,6 +2506,9 @@ buffer, whether or not it is currently displayed in some window. */) an addition to the hscroll amount. */ if (!NILP (lcols)) { + if (it.method == GET_FROM_STRING && !NILP (it.from_overlay)) + reseat_at_previous_visible_line_start(&it); + move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); /* If we find ourselves in the middle of an overlay string which includes a newline after current string position, commit 98cd122776e0adddfdc5cd5f23df43c56df35647 Author: Eli Zaretskii Date: Sat Aug 30 12:35:18 2025 +0300 ; * doc/lispref/edebug.texi (Edebug Views): Fix wording of last change. diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 97909e2bb55..2f5e4d27c46 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -691,13 +691,10 @@ before returning to Edebug. With a prefix argument @var{n}, pause for @findex edebug-bounce-to-previous-value @item P Temporarily display the outside current buffer with the outside point -corresponding to the previous value -(@code{edebug-bounce-to-previous-value}). The previous value is what -Edebug has evaluated before its last stop point or what you have -evaluated in the context outside of Edebug, for example, with -@kbd{C-x C-e}. This command pauses for one second before returning to -Edebug. With a prefix argument @var{n}, it pauses for @var{n} seconds -instead. +corresponding to the previously-evaluated value +(@code{edebug-bounce-to-previous-value}), pausing for one second +before returning to Edebug. With a prefix argument @var{n}, pause for +@var{n} seconds instead. @findex edebug-where @item w @@ -735,7 +732,10 @@ and you would like to know where @code{beg} and @code{end} are located in the outside buffer. Then you could either evaluate these, for example, with @kbd{C-x C-e}, or step over them with @kbd{n}, and immediately after that press @kbd{P}, to bounce to the position you have -previously evaluated. +previously evaluated. The previous value for the purpose of the @kbd{P} +command is what Edebug has evaluated before its last stop point or what +you have evaluated in the context outside of Edebug, for example, with +@kbd{C-x C-e}. After moving point, you may wish to jump back to the stop point. You can do that with @kbd{w} from a source code buffer. You can jump commit fdc6bb2caf959ceafd1c516f4f7a0687eb292ea4 Author: Jens Schmidt Date: Thu Aug 21 20:58:42 2025 +0200 Add edebug-bounce-to-previous-value Command edebug-bounce-to-previous-value uses the previous value observed while single-stepping or evaluating an expression to bounce point in the outside current buffer to the buffer position corresponding to that value. * lisp/emacs-lisp/edebug.el (edebug-previous-value): Add variable. (edebug-compute-previous-result, edebug-eval-expression): Update it. (edebug-bounce-to-previous-value): Add command. (edebug-mode-map): Add keybinding for the new command, replacing the binding of "P" to edebug-view-outside. (edebug-mode-menus): Add menu entry for the new command. * doc/lispref/edebug.texi (Edebug Views): Add documentation. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-bounce-point): Add test code. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-bounce-outside-buffer) (edebug-tests-bounce-outside-point) (edebug-tests-bounce-outside-mark) (edebug-tests-bounce-record-outside-environment) (edebug-tests-should-have-bounced-to): Add infrastructure to test bounces. (edebug-tests-check-keymap): Update tests to new key bindings. (edebug-tests-bounce-point) (edebug-tests-bounce-to-previous-value) (edebug-tests-bounce-to-previous-non-position): Add tests. (edebug-tests-evaluation-of-current-buffer-bug-19611): Clean up side effects. (Bug#79288) diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index f16190b85c9..97909e2bb55 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -677,8 +677,7 @@ effect outside of Edebug. @table @kbd @findex edebug-view-outside -@item P -@itemx v +@item v Switch to viewing the outside window configuration (@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug. @@ -689,6 +688,17 @@ outside position (@code{edebug-bounce-point}), pausing for one second before returning to Edebug. With a prefix argument @var{n}, pause for @var{n} seconds instead. +@findex edebug-bounce-to-previous-value +@item P +Temporarily display the outside current buffer with the outside point +corresponding to the previous value +(@code{edebug-bounce-to-previous-value}). The previous value is what +Edebug has evaluated before its last stop point or what you have +evaluated in the context outside of Edebug, for example, with +@kbd{C-x C-e}. This command pauses for one second before returning to +Edebug. With a prefix argument @var{n}, it pauses for @var{n} seconds +instead. + @findex edebug-where @item w Move point back to the current stop point in the source code buffer @@ -713,6 +723,20 @@ source code buffer, you must use @kbd{C-x X W} from the global keymap. bounce to the point in the current buffer with @kbd{p}, even if it is not normally displayed. + You can also bounce to buffer positions other than the current point. +Suppose you are debugging the form + +@example +(make-overlay beg end) +@end example + +@noindent +and you would like to know where @code{beg} and @code{end} are located +in the outside buffer. Then you could either evaluate these, for +example, with @kbd{C-x C-e}, or step over them with @kbd{n}, and +immediately after that press @kbd{P}, to bounce to the position you have +previously evaluated. + After moving point, you may wish to jump back to the stop point. You can do that with @kbd{w} from a source code buffer. You can jump back to the stop point in the source code buffer from any buffer using diff --git a/etc/NEWS b/etc/NEWS index 37d38d0d91d..c9f30dc7ef7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2521,6 +2521,18 @@ If non-nil, FFAP always finds remote files in buffers with remote 'default-directory'. If nil, FFAP finds local files first for absolute file names in above buffers. The default is nil. +** Debugging + ++++ +*** New command 'edebug-bounce-to-previous-value' (bound to 'P') +This command temporarily displays the outside current buffer with the +outside point corresponding to the previous value, where the previous +value is what Edebug has evaluated before its last stop point or what +the user has evaluated in the context outside of Edebug. + +This replaces the binding of command 'edebug-view-outside' to 'P', which +is still available on 'v'. + --- ** Flymake diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 284e3acd959..fc349787c93 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2617,7 +2617,11 @@ when edebug becomes active." (defvar edebug-eval-list nil) ;; List of expressions to evaluate. -(defvar edebug-previous-result nil) ;; Last result returned. +;; Last value seen while single-stepping or evaluating in the outside +;; environment. +(defvar edebug-previous-value nil) +;; Last value seen while single-stepping, converted to a string. +(defvar edebug-previous-result nil) (defun edebug--display (value offset-index arg-mode) ;; edebug--display-1 is too big, we should split it. This function @@ -3113,6 +3117,37 @@ before returning. The default is one second." (sit-for arg) (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) +(defun edebug-bounce-to-previous-value (arg) + "Bounce point to previous value in the outside current buffer. +The previous value is what Edebug has evaluated before its last stop +point or what you have evaluated in the context outside of Edebug, for +example, by calling function `edebug-eval-expression', whatever comes +later. +If prefix argument ARG is supplied, sit for that many seconds before +returning. The default is one second." + (interactive "p") + (if (not edebug-active) + (error "Edebug is not active")) + (if (not (integer-or-marker-p edebug-previous-value)) + (error "Previous value not a number or marker")) + (save-excursion + ;; If the buffer's currently displayed, avoid set-window-configuration. + (save-window-excursion + (let ((point-info "")) + (edebug-pop-to-buffer edebug-outside-buffer) + (cond + ((< edebug-previous-value (point-min)) + (setq point-info (format " (< Point min: %s)" (point-min)))) + ((> edebug-previous-value (point-max)) + (setq point-info (format " (> Point max: %s)" (point-max)))) + ((invisible-p edebug-previous-value) + (setq point-info (format " (invisible)")))) + (goto-char edebug-previous-value) + (message "Current buffer: %s Point: %s%s" + (current-buffer) edebug-previous-value point-info) + (sit-for arg) + (edebug-pop-to-buffer edebug-buffer (car edebug-window-data)))))) + ;; Joe Wells, here is a start at your idea of adding a buffer to the internal ;; display list. Still need to use this list in edebug--display. @@ -3743,7 +3778,8 @@ Return the result of the last expression." (if edebug-unwrap-results (setq previous-value (edebug-unwrap* previous-value))) - (setq edebug-previous-result + (setq edebug-previous-value previous-value + edebug-previous-result (concat "Result: " (edebug-safe-prin1-to-string previous-value) (eval-expression-print-format previous-value)))) @@ -3785,6 +3821,8 @@ this is the prefix key.)" (values--store-value value) (concat (edebug-safe-prin1-to-string value) (eval-expression-print-format value))))) + ;; Provide a defined previous value also in case of an error. + (setq edebug-previous-value (if errored nil value)) (cond (errored (message "Error: %s" errored)) @@ -3901,9 +3939,9 @@ be installed in `emacs-lisp-mode-map'.") ;; views "w" #'edebug-where - "v" #'edebug-view-outside ; maybe obsolete?? + "v" #'edebug-view-outside "p" #'edebug-bounce-point - "P" #'edebug-view-outside ; same as v + "P" #'edebug-bounce-to-previous-value "W" #'edebug-toggle-save-windows ;; misc @@ -4517,6 +4555,7 @@ It is removed when you hit any char." ("Views" ["Where am I?" edebug-where t] ["Bounce to Current Point" edebug-bounce-point t] + ["Bounce to Previous Value" edebug-bounce-to-previous-value t] ["View Outside Windows" edebug-view-outside t] ["Previous Result" edebug-previous-result t] ["Show Backtrace" edebug-pop-to-backtrace t] diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el index 24981bb63cf..4e63732554f 100644 --- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el +++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el @@ -126,6 +126,16 @@ !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") !body!(format "current-buffer: %s" (current-buffer)))) +(defun edebug-test-code-bounce-point () + !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") + (erase-buffer) + (insert "123\n567\n9ab\n") + (narrow-to-region 5 9) + (goto-char 6)!goto-char! + (push-mark 1)!push-mark! + (set-mark nil)!clear-mark! + (+ 1)!1! (+ 6)!6! (+ 10)!10!)) + (defun edebug-test-code-use-destructuring-bind () (let ((two 2) (three 3)) (cl-destructuring-bind (x . y) (cons two three) (+ x!x! y!y!)))) diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 7daacea7925..4550f25f798 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -302,6 +302,29 @@ Then clear edebug-tests' saved messages." edebug-tests-messages)) (setq edebug-tests-messages "")) +(defvar edebug-tests-bounce-outside-buffer nil + "Outside buffer observed while bouncing.") +(defvar edebug-tests-bounce-outside-point nil + "Outside point observed while bouncing.") +(defvar edebug-tests-bounce-outside-mark nil + "Outside mark observed while bouncing.") + +(defun edebug-tests-bounce-record-outside-environment (&rest _) + "Record outside buffer, point, and mark while bouncing." + (setq edebug-tests-bounce-outside-buffer (current-buffer) + edebug-tests-bounce-outside-point (point) + edebug-tests-bounce-outside-mark (mark))) + +(defun edebug-tests-should-have-bounced-to (buffer-or-name point mark message) + "Require that a previous bounce bounced to BUFFER-OR-NAME, POINT, and MARK. +Ensure that the message generated by that bounce equals MESSAGE." + (should (equal edebug-tests-bounce-outside-buffer + (get-buffer buffer-or-name))) + (should (equal edebug-tests-bounce-outside-point point)) + (should (equal edebug-tests-bounce-outside-mark mark)) + (should (string-match-p (concat (regexp-quote message) "$") + edebug-tests-messages))) + (defun edebug-tests-locate-def (def-name) "Search for a definition of DEF-NAME from the start of the current buffer. Place point at the end of DEF-NAME in the buffer." @@ -419,9 +442,9 @@ test and possibly others should be updated." (verify-keybinding "\C-x\C-e" 'edebug-eval-last-sexp) (verify-keybinding "E" 'edebug-visit-eval-list) (verify-keybinding "w" 'edebug-where) - (verify-keybinding "v" 'edebug-view-outside) ;; maybe obsolete?? + (verify-keybinding "v" 'edebug-view-outside) (verify-keybinding "p" 'edebug-bounce-point) - (verify-keybinding "P" 'edebug-view-outside) ;; same as v + (verify-keybinding "P" 'edebug-bounce-to-previous-value) (verify-keybinding "W" 'edebug-toggle-save-windows) (verify-keybinding "?" 'edebug-help) (verify-keybinding "d" 'edebug-pop-to-backtrace) @@ -703,6 +726,95 @@ test and possibly others should be updated." edebug-tests-messages)) "g" (should (equal edebug-tests-@-result '(0 1)))))) +(ert-deftest edebug-tests-bounce-point () + "Edebug can bounce point." + (unwind-protect + (cl-letf* (((symbol-function 'sit-for) + #'edebug-tests-bounce-record-outside-environment)) + (edebug-tests-with-normal-env + (edebug-tests-setup-@ "bounce-point" nil t) + (edebug-tests-run-kbd-macro + "@" (edebug-tests-should-be-at + "bounce-point" "start") + (goto-char (edebug-tests-get-stop-point "bounce-point" "goto-char")) + "h" (edebug-tests-should-be-at + "bounce-point" "goto-char") + "p" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 6 nil + "Current buffer: *edebug-test-code-buffer* Point: 6 Mark: ") + "SPC SPC" (edebug-tests-should-be-at + "bounce-point" "push-mark") + "p" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 6 1 + "Current buffer: *edebug-test-code-buffer* Point: 6 Mark: 1") + "g"))) + (when (get-buffer "*edebug-test-code-buffer*") + (kill-buffer "*edebug-test-code-buffer*")))) + +(ert-deftest edebug-tests-bounce-to-previous-value () + "Edebug can bounce to previous value." + (unwind-protect + (cl-letf* (((symbol-function 'sit-for) + #'edebug-tests-bounce-record-outside-environment)) + (edebug-tests-with-normal-env + (edebug-tests-setup-@ "bounce-point" nil t) + (edebug-tests-run-kbd-macro + "@" (edebug-tests-should-be-at + "bounce-point" "start") + (goto-char (edebug-tests-get-stop-point "bounce-point" "clear-mark")) + "h" (edebug-tests-should-be-at + "bounce-point" "clear-mark") + ;; Bounce to previous values seen while single-stepping. + "SPC SPC" (edebug-tests-should-be-at "bounce-point" "1") + "P" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 5 nil + "Current buffer: *edebug-test-code-buffer* Point: 1 (< Point min: 5)") + "SPC SPC" (edebug-tests-should-be-at "bounce-point" "6") + "P" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 6 nil + "Current buffer: *edebug-test-code-buffer* Point: 6") + "SPC SPC" (edebug-tests-should-be-at "bounce-point" "10") + "P" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 9 nil + "Current buffer: *edebug-test-code-buffer* Point: 10 (> Point max: 9)") + ;; Bounce to previous value obtained through evaluation. + "e 7 RET" + "P" (edebug-tests-should-have-bounced-to + "*edebug-test-code-buffer*" 7 nil + "Current buffer: *edebug-test-code-buffer* Point: 7") + "g"))) + (when (get-buffer "*edebug-test-code-buffer*") + (kill-buffer "*edebug-test-code-buffer*")))) + +(ert-deftest edebug-tests-bounce-to-previous-non-position () + "Edebug does not bounce to previous non-position." + (edebug-tests-with-normal-env + (edebug-tests-setup-@ "fac" '(1) t) + (let* ((debug-on-error nil) + (edebug-on-error nil) + error-message + (command-error-function (lambda (&rest args) + (setq error-message (cadar args))))) + (edebug-tests-run-kbd-macro + "@" (edebug-tests-should-be-at "fac" "start") + ;; Bounce to previous non-position seen while single-stepping. + "SPC SPC SPC" + (edebug-tests-should-match-result-in-messages "t") + "P" (should (string-match-p "Previous value not a number or marker" + error-message)) + ;; The error stopped the keyboard macro. Start it again. + (should-not executing-kbd-macro) + (setq executing-kbd-macro t + error-message nil) + ;; Bounce to previous non-position obtained through evaluation. + "e nil RET" + "P" (should (string-match-p "Previous value not a number or marker" + error-message)) + (should-not executing-kbd-macro) + (setq executing-kbd-macro t + error-message nil) + "g")))) + (ert-deftest edebug-tests-step-into-function () "Edebug can step into a function." (edebug-tests-with-normal-env @@ -838,20 +950,23 @@ test and possibly others should be updated." (ert-deftest edebug-tests-evaluation-of-current-buffer-bug-19611 () "Edebug can evaluate `current-buffer' in correct context. (Bug#19611)." - (edebug-tests-with-normal-env - (edebug-tests-setup-@ "current-buffer" nil t) - (edebug-tests-run-kbd-macro - "@" (edebug-tests-should-be-at - "current-buffer" "start") - "SPC SPC SPC" (edebug-tests-should-be-at - "current-buffer" "body") - "e (current-buffer) RET" - ;; Edebug just prints the result without "Result:" - (should (string-match-p - (regexp-quote "*edebug-test-code-buffer*") - edebug-tests-messages)) - "g" (should (equal edebug-tests-@-result - "current-buffer: *edebug-test-code-buffer*"))))) + (unwind-protect + (edebug-tests-with-normal-env + (edebug-tests-setup-@ "current-buffer" nil t) + (edebug-tests-run-kbd-macro + "@" (edebug-tests-should-be-at + "current-buffer" "start") + "SPC SPC SPC" (edebug-tests-should-be-at + "current-buffer" "body") + "e (current-buffer) RET" + ;; Edebug just prints the result without "Result:" + (should (string-match-p + (regexp-quote "*edebug-test-code-buffer*") + edebug-tests-messages)) + "g" (should (equal edebug-tests-@-result + "current-buffer: *edebug-test-code-buffer*")))) + (when (get-buffer "*edebug-test-code-buffer*") + (kill-buffer "*edebug-test-code-buffer*")))) (ert-deftest edebug-tests-trivial-backquote () "Edebug can instrument a trivial backquote expression (Bug#23651)." commit 3d2a8186793043805fd3d71ef5aa70e0a3ccc603 (refs/remotes/origin/emacs-30) Author: Eli Zaretskii Date: Sat Aug 30 12:23:42 2025 +0300 * doc/misc/efaq-w32.texi (UTF-8 encoding): New section (bug#79296). diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index e50716ff654..5c24364286d 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -913,6 +913,7 @@ The doc string contains a list of the system sounds you can use. * Multilingual fonts:: * Font menu:: * Line ends:: +* UTF-8 encoding:: @end menu @node Font names @@ -1191,6 +1192,69 @@ recent versions of Emacs, this is seldom useful for existing files, but can still be used to influence the choice of line ends for newly created files. +@node UTF-8 encoding +@section Can I use UTF-8 as default encoding on MS-Windows? +@cindex UTF-8 as default encoding on Windows +@cindex codepage 65001 support in Emacs + +Recent versions of MS-Windows (Windows 10 since build 1803, and Windows +11 or later versions) allow to use UTF-8 (a.k.a.@: ``codepage 65001'') +as the default system codepage. As of this writing, this is still an +experimental feature, even in Windows 11, and is disabled by default. +On Windows 11 you can enable it as follows: + +@enumerate +@item +Open Settings. + +@item +Select ``Time & Language'', then ``Language & region''. + +@item +Click on ``Administrative language settings''. + +@item +On the dialog that pops up click ``Change system locale...'' + +@item +In the ``Region Settings'' dialog that pops up, check the check-box +labeled ``Beta: Use Unicode UTF-8 for worldwide language support'', then +confirm by clicking ``OK'' to both dialogs. +@end enumerate + +@cindex UCRT runtime library +@cindex MSVCRT runtime library +Emacs supports this feature starting from version 30.2, but only when +running on the versions of Windows that provide this feature, and only +if the Emacs executable was linked against the @samp{UCRT} library as +the Windows C runtime, not against the older @samp{MSVCRT}. This is +because the C functions that deal with non-ASCII characters, as +implemented by @samp{MSVCRT}, don't support UTF-8 as the multibyte +encoding of non-ASCII characters. (Which runtime to link against is +determined by the person who built your Emacs binary. Note that using +Emacs linked against @samp{UCRT} needs all of the libraries loaded by +Emacs dynamically, such as GnuTLS, image libraries like @samp{rsvg}, +Tree-sitter, and all the others, to be also linked against @samp{UCRT}, +otherwise subtle problems could happen when dealing with non-ASCII +characters and strings.) + +If you have an Emacs linked against @samp{UCRT}, and you turned on the +UTF-8 support in Windows as described above, you can customize Emacs to +use UTF-8 as your default encoding, e.g., by adding + +@lisp + (prefer-coding-system 'utf-8) +@end lisp + +@noindent +to your init file, or by using the @samp{UTF-8} language environment +(@pxref{Language Environments,,, emacs, The GNU Emacs Manual}) in your +Emacs sessions. + +Please be aware that, since this feature of Windows is still in beta, +there could be some subtle issues with it. So we do not yet recommend +to turn this on, unless you feel adventurous. + @c ------------------------------------------------------------ @node Printing @chapter Printing commit 34f3ac6c5b98d79e51bd9bbaf3c5bd89b2faaba3 Author: john muhl Date: Wed May 14 08:53:42 2025 -0500 Fontify all comment delimiters in 'lua-ts-mode' * lisp/progmodes/lua-ts-mode.el (lua-ts--comment-font-lock): Apply 'font-lock-comment-delimiter-face' to the entire span of initial dashes. In particular, this improves the appearance of LuaCATS and EmmyLua style annotations which use "---". * test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua: Add tests. (Bug#79258) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 1c1812a7c30..35700255ba4 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -168,10 +168,13 @@ values of OVERRIDE." (let* ((node-start (treesit-node-start node)) (node-end (treesit-node-end node)) (node-text (treesit-node-text node t)) - (delimiter-end (+ 2 node-start))) + (delimiter-end (progn + (goto-char node-start) + (while (looking-at-p "-") (forward-char)) + (point)))) (when (and (>= node-start start) (<= delimiter-end end) - (string-match "\\`--" node-text)) + (string-match "\\`---*" node-text)) (treesit-fontify-with-override node-start delimiter-end 'font-lock-comment-delimiter-face diff --git a/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua b/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua index 93d589e3825..5a36bcad10b 100644 --- a/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua +++ b/test/lisp/progmodes/lua-ts-mode-resources/font-lock.lua @@ -11,6 +11,11 @@ Multi-line comment -- <- font-lock-comment-face local line_comment = "comment" -- comment -- ^ font-lock-comment-face +---@alias MyNumber integer +-- <- font-lock-comment-delimiter-face +------Calculate new number +-- ^ font-lock-comment-delimiter-face +function calc() end -- Definition local function f1() end commit b0efe06551bfed447328c11d6711ffd9fc63dfe4 Author: Eli Zaretskii Date: Sat Aug 30 11:24:51 2025 +0300 ; * lisp/ehelp.el (ehelp-command): Fix the autoload form (bug#79289). diff --git a/lisp/ehelp.el b/lisp/ehelp.el index ed86f663100..611aa712628 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -433,7 +433,7 @@ will select it.)" (substitute-key-definition 'describe-syntax 'electric-describe-syntax map) map)) -;;;###(autoload 'ehelp-command "ehelp" "Prefix command for ehelp." t 'keymap) +;;;###autoload (autoload 'ehelp-command "ehelp" "Prefix command for ehelp." t 'keymap) (defalias 'ehelp-command ehelp-map) (put 'ehelp-command 'documentation "Prefix command for ehelp.") commit b85f9d6a97eb379bd7a461bc1b3499846eb1d933 Author: Sean Devlin Date: Sat Aug 2 10:51:18 2025 -0500 Fix recursive load when 'calc-always-load-extensions' is set * lisp/calc/calc.el (calc-create-buffer): Call 'calc-load-everything'. (calc-always-load-extensions): Delete erroneous stanza. (Bug#79157) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index d4fb8776c6c..6f4664dd6c4 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1468,7 +1468,8 @@ commands given here will actually operate on the *Calculator* stack." (calc-mode)) (setq max-lisp-eval-depth (max max-lisp-eval-depth 1000)) (when calc-always-load-extensions - (require 'calc-ext)) + (require 'calc-ext) + (calc-load-everything)) (when calc-language (require 'calc-ext) (calc-set-language calc-language calc-language-option t))) @@ -3522,11 +3523,6 @@ See Info node `(calc)Defining Functions'." (defcalcmodevar math-half-2-word-size 2147483648 "One-half of two to the power of `calc-word-size'.") -(when calc-always-load-extensions - (require 'calc-ext) - (calc-load-everything)) - - (run-hooks 'calc-load-hook) (provide 'calc) commit aa60f16e6651721aaa3b8f92549b50832f2d213c Author: Sean Devlin Date: Sat Aug 2 09:47:14 2025 -0500 Add user option to inhibit Calc startup message (bug#79143) * doc/misc/calc.texi (Customizing Calc): Document the new option. * etc/NEWS: Document the new option. * lisp/calc/calc.el (calc-inhibit-startup-message): New option to inhibit Calc’s startup message. (calc): Respect the option in Calc’s startup code. * test/lisp/calc/calc-tests.el (ert): Require ert-x for 'ert-with-message-capture'. (calc-inhibit-startup-message): Test the new user option. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index eda442ecb38..9b7cdd8b37f 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -35714,6 +35714,14 @@ The default value of @code{calc-string-maximum-character} is @code{0xFF} or 255. @end defvar +@defvar calc-inhibit-startup-message +The variable @code{calc-inhibit-startup-message} controls display of a +welcome message when starting Calc. If it is @code{nil} (the default), +Calc will print a brief message listing key bindings to get help or to +quit. If it is non-@code{nil}, Calc will start without printing +anything. +@end defvar + @node Reporting Bugs @appendix Reporting Bugs diff --git a/etc/NEWS b/etc/NEWS index af6dd0c2151..37d38d0d91d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2605,6 +2605,11 @@ Latin-1 range 0-255. This hard-coded maximum is replaced by the display of matching vectors as Unicode strings. The default value is 0xFF or 255 to preserve the existing behavior. ++++ +*** New user option 'calc-inhibit-startup-message'. +If it is non-nil, inhibit Calc from printing its startup message. The +default value is nil to preserve the existing behavior. + ** Time *** New user option 'world-clock-sort-order'. diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index a350419b320..d4fb8776c6c 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1473,6 +1473,11 @@ commands given here will actually operate on the *Calculator* stack." (require 'calc-ext) (calc-set-language calc-language calc-language-option t))) +(defcustom calc-inhibit-startup-message nil + "If non-nil, inhibit the Calc startup message." + :version "31.1" + :type 'boolean) + (defcustom calc-make-windows-dedicated nil "If non-nil, windows displaying Calc buffers will be marked dedicated. See `window-dedicated-p' for what that means." @@ -1524,9 +1529,10 @@ See `window-dedicated-p' for what that means." (with-current-buffer (calc-trail-buffer) (and calc-display-trail (calc-trail-display 1 t))) - (message (substitute-command-keys - (concat "Welcome to the GNU Emacs Calculator! \\" - "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))) + (unless calc-inhibit-startup-message + (message (substitute-command-keys + (concat "Welcome to the GNU Emacs Calculator! \\" + "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit")))) (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) @@ -1534,10 +1540,11 @@ See `window-dedicated-p' for what that means." (and calc-make-windows-dedicated (set-window-dedicated-p nil t)) (calc-check-defines) - (when (and calc-said-hello interactive) - (sit-for 2) - (message "")) - (setq calc-said-hello t))))) + (unless calc-inhibit-startup-message + (when (and calc-said-hello interactive) + (sit-for 2) + (message "")) + (setq calc-said-hello t)))))) ;;;###autoload (defun full-calc (&optional interactive) diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 2fd6a6be45e..49762e146a5 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -26,6 +26,7 @@ (require 'cl-lib) (require 'ert) +(require 'ert-x) (require 'calc) (require 'calc-ext) (require 'calc-units) @@ -946,5 +947,19 @@ an error in the comparison." (should-error (math-vector-is-string cplx-vec) :type 'wrong-type-argument)))) +(ert-deftest calc-inhibit-startup-message () + "Test user option `calc-inhibit-startup-message'." + (let ((welcome-message "Welcome to the GNU Emacs Calculator!")) + (ert-with-message-capture messages + (let ((calc-inhibit-startup-message t)) + (calc)) + (should-not (string-match-p welcome-message messages)) + (calc-quit)) + (ert-with-message-capture messages + (let ((calc-inhibit-startup-message nil)) + (calc)) + (should (string-match-p welcome-message messages)) + (calc-quit)))) + (provide 'calc-tests) ;;; calc-tests.el ends here commit ec50d775acf6efa6e11347efecaa93d039cc5700 Author: Eli Zaretskii Date: Thu Aug 28 08:58:17 2025 +0300 ; * doc/misc/flymake.texi (Finding diagnostics): Fix a typo (bug#79325). diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 54835767928..65c10588f39 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -152,7 +152,7 @@ variables}) @cindex next and previous diagnostic If the diagnostics are outside the visible region of the buffer, -@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are +@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} let you navigate to the next/previous erroneous regions, respectively. It might be a good idea to map them to @kbd{M-n} and @kbd{M-p} in @code{flymake-mode}, by adding to your init file: commit 293e258a1b26830e75259b9dbb4f29961ffb402c Author: Michael Albinus Date: Wed Aug 27 12:08:12 2025 +0200 * doc/emacs/screen.texi (Mode Line): Fix reference. diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index ca3690edb9a..e2546ce132d 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -234,7 +234,7 @@ current buffer is on a remote machine, @samp{@@} is displayed instead. @var{d} appears if the window is dedicated to its current buffer. It appears as @samp{D} for strong dedication and @samp{d} for other forms of dedication. If the window is not dedicated, @var{d} does not -appear. @xref{Dedicated Windows,, elisp, The Emacs Lisp Reference +appear. @xref{Dedicated Windows,,, elisp, The Emacs Lisp Reference Manual}. @var{fr} gives the selected frame name (@pxref{Frames}). It appears commit 8eb192c23dfea36bc78460032f465c47bbbf4416 Author: Eli Zaretskii Date: Tue Aug 26 15:18:29 2025 +0300 ; * admin/make-tarball.txt: Update the "Web pages" section (bug#79315). diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 61d19e54b8e..3257dc6ce46 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -380,12 +380,14 @@ As soon as possible after a release, the Emacs web pages at should be updated. (See admin/notes/www for general information.) -The pages to update are: - -emacs.html (for a new major release, a more thorough update is needed) -history.html -add the new NEWS file as news/NEWS.xx.y -Copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE +The pages and files to update are: + + . emacs.html (see below; for a new major release, a more thorough + update is needed) + . history.html (add a line for the new release) + . add the new NEWS file as news/NEWS.xx.y + . copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE + . possibly/rarely also download.html (see below) For every new release, a banner is displayed on top of the emacs.html page. Uncomment the release banner in emacs.html. Keep it on the page commit eabb5f450c85afead99d7613d621dbd402d9e914 Author: Eli Zaretskii Date: Sat Aug 23 16:33:45 2025 +0300 Improve and clarify documentation of 'dired-click-to-select-mode' * lisp/dired.el (dired-click-to-select-mode) (dired-post-do-command): * doc/emacs/dired.texi (Marks vs Flags): Improve documentation of 'dired-click-to-select-mode'. (cherry picked from commit 90c44826f545f71f0f7621c33eff0e5ec5ec4ffc) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 8882049dae1..53cbcd65c10 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -693,14 +693,14 @@ the directory. @kindex touchscreen-hold @r{(Dired)} @findex dired-click-to-select-mode @findex dired-enable-click-to-select-mode -Enter a ``click to select'' mode, where using the mouse button -@kbd{mouse-2} on a file name will cause its mark to be toggled. This -mode is useful when performing file management using a touch screen -device. - -It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is -detected over a file name, and is automatically disabled once a Dired -command operates on the marked files. +Enter a ``click to select'' mode (@code{dired-click-to-select-mode}), +where using the mouse button @kbd{mouse-2} on a file name will cause its +mark to be toggled. This mode is useful when performing file management +using a touch screen device. + +It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is detected +over a file name, and is automatically disabled once a Dired command +that operates on the marked files finishes. @end table @node Operating on Files diff --git a/lisp/dired.el b/lisp/dired.el index 0a07339e146..cca6fb2e6ea 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3982,7 +3982,10 @@ non-empty directories is allowed." (message "(No deletions requested)"))))) (defun dired-post-do-command () - "Disable `dired-click-to-select-mode' after an operation." + "Disable `dired-click-to-select-mode' if enabled.. +This is called after Dired finishes an operation on marked files, and it +disables `dired-click-to-select-mode' that is automatically enabled +by the \"hold\" touch-screen gestures." (when dired-click-to-select-mode (dired-click-to-select-mode -1))) @@ -5308,12 +5311,14 @@ When this minor mode is enabled, using `mouse-2' on a file name within a Dired buffer will toggle its mark instead of going to it within another window. -Disabling this minor mode will unmark all files within the Dired -buffer. - -`dired-click-to-select-mode' is automatically disabled after any -Dired operation (command whose name starts with `dired-do') -completes." +This minor mode is intended to be used when performing file management +using a touch-screen device. The mode is automatically enabled when a +\"hold\" gesture over a file name is received, and is therefore +automatically disabled after any Dired operation on the marked +files (any command whose name starts with \"dired-do-\" and which +performs some operation on the marked files) completes. When the mode +is automatically disabled, it unmarks all the marked files in the Dired +buffer." :group 'dired :lighter " Click-To-Select" (unless (derived-mode-p '(dired-mode wdired-mode))