commit 8b66adfe065e0f21ec99c88e3cbb1cb16a94c6cd (HEAD, refs/remotes/origin/master) Merge: 29157a9f88 73f28fbde8 Author: Stefan Kangas Date: Mon Mar 7 06:33:56 2022 +0100 Merge from origin/emacs-28 73f28fbde8 Add a comment for previous browse-url-of-dired-file change 9b74e84857 Restore documented Emacs 27.2 behaviour of browse-url-of-d... cd77fd3b85 Update to Org 9.5.2-24-g668205 commit 29157a9f88c957f26f29284a71dad63d70d40cfd Author: Manuel Giraud Date: Thu Mar 3 17:32:13 2022 +0100 Fix bookmark-bmenu-list sorting. Do not sort bookmarks in `bookmark-bmenu-list' if `bookmark-sort-flag' is nil. Also, make the default order of bookmark-bmenu-list be the LIFO order defined in `bookmark-sort-flag's documentation. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 2751731817..80fb1cdfc7 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1819,7 +1819,7 @@ Don't affect the buffer ring order." (list location))]) entries))) (tabulated-list-init-header) - (setq tabulated-list-entries entries)) + (setq tabulated-list-entries (reverse entries))) (tabulated-list-print t)) ;;;###autoload @@ -1907,7 +1907,8 @@ Bookmark names preceded by a \"*\" have annotations. ,@(if bookmark-bmenu-toggle-filenames '(("File" 0 bookmark-bmenu--file-predicate)))]) (setq tabulated-list-padding bookmark-bmenu-marks-width) - (setq tabulated-list-sort-key '("Bookmark" . nil)) + (when bookmark-sort-flag + (setq tabulated-list-sort-key '("Bookmark" . nil))) (add-hook 'tabulated-list-revert-hook #'bookmark-bmenu--revert nil t)' (setq revert-buffer-function 'bookmark-bmenu--revert) (tabulated-list-init-header)) commit 03b07fd62e831df2425676005bd962fef81ffc1d Author: Po Lu Date: Mon Mar 7 13:09:07 2022 +0800 Fix maximum selection size reporting * src/xselect.c (selection_quantum): Take into account extended request size. diff --git a/src/xselect.c b/src/xselect.c index 979f454948..a88c15aa95 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -98,7 +98,11 @@ static void lisp_data_to_selection_data (struct x_display_info *, Lisp_Object, static int selection_quantum (Display *display) { - long mrs = XMaxRequestSize (display); + long mrs = XExtendedMaxRequestSize (display); + + if (!mrs) + mrs = XMaxRequestSize (display); + return (mrs < MAX_SELECTION_QUANTUM / X_LONG_SIZE + 25 ? (mrs - 25) * X_LONG_SIZE : MAX_SELECTION_QUANTUM); commit 532472220268fb9852b65d60503a446c9e5e57ab Author: Lars Ingebrigtsen Date: Mon Mar 7 05:58:39 2022 +0100 Fix typo in previous browse-url-file-url change * lisp/net/browse-url.el (browse-url-file-url): Fix typo in previous change. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index ccb4e12a9f..17169fec0f 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -724,7 +724,7 @@ Use variable `browse-url-filename-alist' to map filenames to URLs." ;; reasons. (seq-find (lambda (match) (and (string-match-p (car match) file) - (not (string-match "\\`file:" (cadr match))))) + (not (string-match "\\`file:" (cdr match))))) browse-url-filename-alist)) (setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]")) ;; Encode all other file names properly. commit 73f28fbde8a2e29e340da2c51e6ccc24bd79b785 (refs/remotes/origin/emacs-28) Author: Lars Ingebrigtsen Date: Mon Mar 7 05:15:58 2022 +0100 Add a comment for previous browse-url-of-dired-file change * lisp/net/browse-url.el (browse-url-of-dired-file): Add a comment for previous change. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 55f41323dd..ccfbf51e48 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -836,7 +836,9 @@ If optional arg TEMP-FILE-NAME is non-nil, delete it instead." "In Dired, ask a WWW browser to display the file named on this line." (interactive) (let ((tem (dired-get-filename t t)) - (browse-url-default-handlers)) + ;; Some URL handlers open files in Emacs. We want to always + ;; open in a browser, so disable those. + (browse-url-default-handlers nil)) (if tem (browse-url-of-file (expand-file-name tem)) (error "No file on this line")))) commit 9b74e8485738913ddf220661097103f9a843ab45 Author: Lars Ingebrigtsen Date: Mon Mar 7 05:13:19 2022 +0100 Restore documented Emacs 27.2 behaviour of browse-url-of-dired-file * lisp/net/browse-url.el (browse-url-of-dired-file): Restore the documented behaviour -- open a web browser instead of passing to the various handlers. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 3aafbea7c3..55f41323dd 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -835,7 +835,8 @@ If optional arg TEMP-FILE-NAME is non-nil, delete it instead." (defun browse-url-of-dired-file () "In Dired, ask a WWW browser to display the file named on this line." (interactive) - (let ((tem (dired-get-filename t t))) + (let ((tem (dired-get-filename t t)) + (browse-url-default-handlers)) (if tem (browse-url-of-file (expand-file-name tem)) (error "No file on this line")))) commit 4405d730693e94486326379c687c87f2acec9508 Author: Lars Ingebrigtsen Date: Mon Mar 7 04:25:21 2022 +0100 Fix esh-proc-test/kill-pipeline-head loop syntax * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline-head): Fix syntax of loop. diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el index 8cd893ce57..7dc9d29cfe 100644 --- a/test/lisp/eshell/esh-proc-tests.el +++ b/test/lisp/eshell/esh-proc-tests.el @@ -71,7 +71,7 @@ write the exit status to the pipe. See bug#54136." (executable-find "sleep"))) (with-temp-eshell (eshell-insert-command - (concat "sh -c 'while true; sleep 1; done' | " + (concat "sh -c 'while true; do sleep 1; done' | " "sh -c 'while read NAME; do echo =${NAME}=; done'")) (let ((output-start (eshell-beginning-of-output))) (kill-process (eshell-head-process)) commit 231a1ba30f35774f44780f3658b3def8e95fc183 Author: Lars Ingebrigtsen Date: Mon Mar 7 04:09:27 2022 +0100 Inhibit extpipe tests on EMBA, because they apparently time out? https://emba.gnu.org/emacs/emacs/-/pipelines/16387 diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index a1d15fe73a..91c2fba479 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -71,6 +71,7 @@ (skip-unless shell-file-name) (skip-unless shell-command-switch) (skip-unless (executable-find shell-file-name)) + (skip-unless (not (getenv "EMACS_EMBA_CI"))) (let ((input ,input)) (with-temp-eshell ,@body))))) commit 3e5baffd033c0e7cb738d0762a66302f2d7d2214 Author: Po Lu Date: Mon Mar 7 10:54:48 2022 +0800 Fix clearing of scroll bars on builds with disabled double buffers * src/xterm.c (x_scroll_bar_clear): Use XClearArea if the scroll bar is not double-buffered. diff --git a/src/xterm.c b/src/xterm.c index d368c72323..0432bd78c6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9635,15 +9635,19 @@ x_scroll_bar_clear (struct frame *f) for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); bar = XSCROLL_BAR (bar)->next) { -#ifndef HAVE_XDBE - XClearArea (FRAME_X_DISPLAY (f), - XSCROLL_BAR (bar)->x_window, - 0, 0, 0, 0, True); -#else - XFillRectangle (FRAME_X_DISPLAY (f), - XSCROLL_BAR (bar)->x_drawable, - gc, 0, 0, XSCROLL_BAR (bar)->width, - XSCROLL_BAR (bar)->height); +#ifdef HAVE_XDBE + if (XSCROLL_BAR (bar)->x_window + == XSCROLL_BAR (bar)->x_drawable) +#endif + XClearArea (FRAME_X_DISPLAY (f), + XSCROLL_BAR (bar)->x_window, + 0, 0, 0, 0, True); +#ifdef HAVE_XDBE + else + XFillRectangle (FRAME_X_DISPLAY (f), + XSCROLL_BAR (bar)->x_drawable, + gc, 0, 0, XSCROLL_BAR (bar)->width, + XSCROLL_BAR (bar)->height); #endif } commit a185f2af968ecf1cc56c463dd89ba906a99807e4 Author: Lars Ingebrigtsen Date: Mon Mar 7 03:51:55 2022 +0100 Tweak how bibtex-mark-entry places point * lisp/textmodes/bibtex.el (bibtex-mark-entry): Make `C-M-h' behave like in other modes (with point at the beginning of the region) (bug#4717). diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index ab471db3dd..ab6a907c52 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -4119,11 +4119,11 @@ Optional arg POS is the position of the BibTeX entry to use." (goto-char pnt))))) (defun bibtex-mark-entry () - "Put mark at beginning, point at end of current BibTeX entry. + "Put mark at end, point at beginning of current BibTeX entry. Activate mark in Transient Mark mode." (interactive) - (push-mark (bibtex-beginning-of-entry) t t) - (bibtex-end-of-entry)) + (push-mark (bibtex-end-of-entry) t t) + (bibtex-beginning-of-entry)) (defun bibtex-count-entries (&optional count-string-entries) "Count number of entries in current buffer or region. commit e07a36f2672d25a9ca7974a0a34e95e565304227 Author: Lars Ingebrigtsen Date: Mon Mar 7 03:47:13 2022 +0100 Show SVN status on "." directories, too * lisp/vc/vc-svn.el (vc-svn-after-dir-status): Allow tracking state of the "." directory, too, since they may have modified properties (bug#7861). diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index b38a676acb..3cf692bfda 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -201,8 +201,8 @@ switches." ;; FIXME are there other possible combinations? (cond ((eq state 'edited) (setq state 'needs-merge)) ((not state) (setq state 'needs-update)))) - (when (and state (not (string= "." filename))) - (setq result (cons (list filename state) result))))) + (when state + (setq result (cons (list filename state) result))))) (funcall callback result))) ;; dir-status-files called from vc-dir, which loads vc, commit e06319b39d548571f19964b392be779aae7d298a Author: Lars Ingebrigtsen Date: Mon Mar 7 03:27:55 2022 +0100 Fix `W' in Dired with non-ASCII file names * lisp/net/browse-url.el (browse-url--file-name-coding-system): Factor out into own function. (browse-url-file-url): Property encode non-ASCII characters so that external browsers can understand them. (browse-url-emacs): Make `W' in Dired work with non-ASCII file names (bug#54271). diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index e4c485eccd..ccb4e12a9f 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -708,16 +708,29 @@ interactively. Turn the filename into a URL with function (browse-url (browse-url-file-url file)) (run-hooks 'browse-url-of-file-hook)) +(defun browse-url--file-name-coding-system () + (if (equal system-type 'windows-nt) + ;; W32 pretends that file names are UTF-8 encoded. + 'utf-8 + (or file-name-coding-system default-file-name-coding-system))) + (defun browse-url-file-url (file) "Return the URL corresponding to FILE. Use variable `browse-url-filename-alist' to map filenames to URLs." - (let ((coding (if (equal system-type 'windows-nt) - ;; W32 pretends that file names are UTF-8 encoded. - 'utf-8 - (and (or file-name-coding-system - default-file-name-coding-system))))) - (if coding (setq file (encode-coding-string file coding)))) - (setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]")) + (when-let ((coding (browse-url--file-name-coding-system))) + (setq file (encode-coding-string file coding))) + (if (and (file-remote-p file) + ;; We're applying special rules for FTP URLs for historical + ;; reasons. + (seq-find (lambda (match) + (and (string-match-p (car match) file) + (not (string-match "\\`file:" (cadr match))))) + browse-url-filename-alist)) + (setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]")) + ;; Encode all other file names properly. + (setq file (mapconcat #'url-hexify-string + (file-name-split file) + "/"))) (dolist (map browse-url-filename-alist) (when (and map (string-match (car map) file)) (setq file (replace-match (cdr map) t nil file)))) @@ -1213,10 +1226,12 @@ currently selected window instead." (require 'url-handlers) (let ((parsed (url-generic-parse-url url)) (func (if same-window 'find-file 'find-file-other-window))) - (if (and (equal (url-type parsed) "file") - (file-directory-p (url-filename parsed))) - ;; It's a directory; just open it. - (funcall func (url-filename parsed)) + (if (equal (url-type parsed) "file") + ;; It's a file; just open it. + (let ((file (url-unhex-string (url-filename parsed)))) + (when-let ((coding (browse-url--file-name-coding-system))) + (setq file (decode-coding-string file 'utf-8))) + (funcall func file)) (let ((file-name-handler-alist (cons (cons url-handler-regexp 'url-file-handler) file-name-handler-alist))) diff --git a/test/lisp/net/browse-url-tests.el b/test/lisp/net/browse-url-tests.el index 8f180f3d6b..c94719c97a 100644 --- a/test/lisp/net/browse-url-tests.el +++ b/test/lisp/net/browse-url-tests.el @@ -82,10 +82,13 @@ (ert-deftest browse-url-tests-file-url () (should (equal (browse-url-file-url "/foo") "file:///foo")) - (should (equal (browse-url-file-url "/foo:") "ftp://foo/")) - (should (equal (browse-url-file-url "/ftp@foo:") "ftp://foo/")) - (should (equal (browse-url-file-url "/anonymous@foo:") - "ftp://foo/"))) + (when (file-remote-p "/foo:") + (should (equal (browse-url-file-url "/foo:") "ftp://foo/"))) + (when (file-remote-p "/ftp@foo:") + (should (equal (browse-url-file-url "/ftp@foo:") "ftp://foo/"))) + (when (file-remote-p "/anonymous@foo:") + (should (equal (browse-url-file-url "/anonymous@foo:") + "ftp://foo/")))) (ert-deftest browse-url-tests-delete-temp-file () (ert-with-temp-file browse-url-temp-file-name commit cd77fd3b85f50b75d3fe24713a1ca4f622c110dd Author: Kyle Meyer Date: Sun Mar 6 20:18:26 2022 -0500 Update to Org 9.5.2-24-g668205 diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 945ea52980..bfead3aa5a 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -1453,7 +1453,8 @@ Of course, if exact position has been required, just put it there." (org-with-point-at pos (when org-capture-bookmark (let ((bookmark (plist-get org-bookmark-names-plist :last-capture))) - (when bookmark (with-demoted-errors (bookmark-set bookmark))))) + (when bookmark (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark))))) (move-marker org-capture-last-stored-marker (point)))))) (defun org-capture-narrow (beg end) diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 7952786607..9db1406b3f 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -396,31 +396,25 @@ still has an entry since one of its properties (`:title') does.") "Alist between element types and locations of secondary values.") (defconst org-element--pair-round-table - (let ((table (make-syntax-table))) + (let ((table (make-char-table 'syntax-table '(2)))) (modify-syntax-entry ?\( "()" table) (modify-syntax-entry ?\) ")(" table) - (dolist (char '(?\{ ?\} ?\[ ?\] ?\< ?\>) table) - (modify-syntax-entry char " " table))) - "Table used internally to pair only round brackets. -Other brackets are treated as spaces.") + table) + "Table used internally to pair only round brackets.") (defconst org-element--pair-square-table - (let ((table (make-syntax-table))) + (let ((table (make-char-table 'syntax-table '(2)))) (modify-syntax-entry ?\[ "(]" table) (modify-syntax-entry ?\] ")[" table) - (dolist (char '(?\{ ?\} ?\( ?\) ?\< ?\>) table) - (modify-syntax-entry char " " table))) - "Table used internally to pair only square brackets. -Other brackets are treated as spaces.") + table) + "Table used internally to pair only square brackets.") (defconst org-element--pair-curly-table - (let ((table (make-syntax-table))) + (let ((table (make-char-table 'syntax-table '(2)))) (modify-syntax-entry ?\{ "(}" table) (modify-syntax-entry ?\} "){" table) - (dolist (char '(?\[ ?\] ?\( ?\) ?\< ?\>) table) - (modify-syntax-entry char " " table))) - "Table used internally to pair only curly brackets. -Other brackets are treated as spaces.") + table) + "Table used internally to pair only curly brackets.") (defun org-element--parse-paired-brackets (char) "Parse paired brackets at point. diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el index 5dfffe7851..5ad73422ef 100644 --- a/lisp/org/org-refile.el +++ b/lisp/org/org-refile.el @@ -566,16 +566,16 @@ prefix argument (`C-u C-u C-u C-c C-w')." (let ((bookmark-name (plist-get org-bookmark-names-plist :last-refile))) (when bookmark-name - (with-demoted-errors - (bookmark-set bookmark-name)))) + (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark-name)))) ;; If we are refiling for capture, make sure that the ;; last-capture pointers point here (when (bound-and-true-p org-capture-is-refiling) (let ((bookmark-name (plist-get org-bookmark-names-plist :last-capture-marker))) (when bookmark-name - (with-demoted-errors - (bookmark-set bookmark-name)))) + (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark-name)))) (move-marker org-capture-last-stored-marker (point))) (when (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook))) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index badf0e4769..a38b79304e 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.5.2-22-g33543d")) + (let ((org-git-version "release_9.5.2-24-g668205")) org-git-version)) (provide 'org-version) commit 36b31d38cd9bde7ad1ec18c136854cddba0d6bbe Author: Po Lu Date: Mon Mar 7 08:53:50 2022 +0800 Get rid of a loop through all frames when processing events * src/xterm.c (handle_one_xevent): Just flip back buffer of f and any instead. (flush_dirty_back_buffer_on): New function. (flush_dirty_back_buffers): Delete function. diff --git a/src/xterm.c b/src/xterm.c index 8642345549..d368c72323 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9887,23 +9887,18 @@ x_net_wm_state (struct frame *f, Window window) store_frame_param (f, Qshaded, shaded ? Qt : Qnil); } -/* Flip back buffers on any frames with undrawn content. */ +/* Flip back buffers on FRAME if it has undrawn content. */ static void -flush_dirty_back_buffers (void) +flush_dirty_back_buffer_on (struct frame *f) { block_input (); - Lisp_Object tail, frame; - FOR_EACH_FRAME (tail, frame) - { - struct frame *f = XFRAME (frame); - if (FRAME_LIVE_P (f) && - FRAME_X_P (f) && - FRAME_X_WINDOW (f) && - !FRAME_GARBAGED_P (f) && - !buffer_flipping_blocked_p () && - FRAME_X_NEED_BUFFER_FLIP (f)) - show_back_buffer (f); - } + if (FRAME_LIVE_P (f) && + FRAME_X_P (f) && + FRAME_X_WINDOW (f) && + !FRAME_GARBAGED_P (f) && + !buffer_flipping_blocked_p () && + FRAME_X_NEED_BUFFER_FLIP (f)) + show_back_buffer (f); unblock_input (); } @@ -13490,9 +13485,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, count++; } - /* Sometimes event processing draws to the frame outside redisplay. - To ensure that these changes become visible, draw them here. */ - flush_dirty_back_buffers (); + /* Sometimes event processing draws to either F or ANY outside + redisplay. To ensure that these changes become visible, draw + them here. */ + + if (f) + flush_dirty_back_buffer_on (f); + + if (any && any != f) + flush_dirty_back_buffer_on (any); return count; } commit f70bf8a21dc1283a58367cbca31decef633c6dab Author: Gustaf Waldemarson Date: Sun Mar 6 22:56:04 2022 +0100 Display complex data types in gdb-mi * lisp/progmodes/gdb-mi.el (bindat): Require. (gdb-invalidate-locals): Use `-stack-list-variables` instead of the deprecated `-stack-list-locals`. Additionally, this allow function arguments to be displayed in the locals buffer. (gdb-locals-values-buffer, gdb-locals-values-buffer-name) (gdb-locals-simple-values-only, gdb-locals-values-table): New variables. (gdb-locals-values-handler-custom): Create a new gdb buffer for extracting local variable values. To extract the values for 'complex' data-types, the command `-stack-list-locals` is used with the `--all-values` flag. The extracted values are then stored in a hash-table for later use in the `gdb-locals-handler-custom` that performs the actual update of the Local variable buffer. All variable values are filtered to fit it into a single line, being truncated as necessary by the user customizable option `gdb-locals-value-limit`. The old behavior of hiding complex values can be restored using the customizable `gdb-locals-simple-values-only` option. Patch amended by William Xu . diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index ddccbe80e7..a35a7deb4b 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -90,6 +90,7 @@ (require 'gud) (require 'cl-lib) (require 'cl-seq) +(require 'bindat) (eval-when-compile (require 'pcase)) (declare-function speedbar-change-initial-expansion-list @@ -4288,7 +4289,7 @@ member." ;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards. (def-gdb-trigger-and-handler gdb-invalidate-locals - (concat (gdb-current-context-command "-stack-list-locals") + (concat (gdb-current-context-command "-stack-list-variables") " --simple-values") gdb-locals-handler gdb-locals-handler-custom '(start update)) @@ -4299,6 +4300,48 @@ member." 'gdb-locals-mode 'gdb-invalidate-locals) + +;; Retrieve the values of all variables before invalidating locals. +(def-gdb-trigger-and-handler + gdb-locals-values + (concat (gdb-current-context-command "-stack-list-variables") + " --all-values") + gdb-locals-values-handler gdb-locals-values-handler-custom + '(start update)) + +(gdb-set-buffer-rules + 'gdb-locals-values-buffer + 'gdb-locals-values-buffer-name + 'gdb-locals-mode + 'gdb-locals-values) + +(defun gdb-locals-values-buffer-name () + (gdb-current-context-buffer-name + (concat "local values of " (gdb-get-target-string)))) + +(defcustom gdb-locals-simple-values-only nil + "Only display simple values in the Locals buffer." + :type 'boolean + :group 'gud + :version "29.1") + +(defcustom gdb-locals-value-limit 100 + "Maximum length the value of a local variable is allowed to be." + :type 'integer + :group 'gud + :version "29.1") + +(defvar gdb-locals-values-table (make-hash-table :test #'equal) + "Mapping of local variable names to a string with their value.") + +(defun gdb-locals-values-handler-custom () + "Store the values of local variables in `gdb-locals-value-map'." + (let ((locals-list (bindat-get-field (gdb-mi--partial-output) 'variables))) + (dolist (local locals-list) + (let ((name (bindat-get-field local 'name)) + (value (bindat-get-field local 'value))) + (puthash name value gdb-locals-values-table))))) + (defvar gdb-locals-watch-map (let ((map (make-sparse-keymap))) (suppress-keymap map) @@ -4315,6 +4358,15 @@ member." map) "Keymap to edit value of a simple data type local variable.") +(defun gdb-locals-value-filter (value) + "Filter function for the local variable VALUE." + (let* ((no-nl (replace-regexp-in-string "\n" " " value)) + (str (replace-regexp-in-string "[[:space:]]+" " " no-nl)) + (limit gdb-locals-value-limit)) + (if (>= (length str) limit) + (concat (substring str 0 limit) "...") + str))) + (defun gdb-edit-locals-value (&optional event) "Assign a value to a variable displayed in the locals buffer." (interactive (list last-input-event)) @@ -4327,17 +4379,22 @@ member." (gud-basic-call (concat "-gdb-set variable " var " = " value))))) -;; Don't display values of arrays or structures. -;; These can be expanded using gud-watch. +;; Complex data types are looked up in `gdb-locals-values-table'. (defun gdb-locals-handler-custom () - (let ((locals-list (gdb-mi--field (gdb-mi--partial-output) 'locals)) + "Handler to rebuild the local variables table buffer." + (let ((locals-list (bindat-get-field (gdb-mi--partial-output) 'variables)) (table (make-gdb-table))) (dolist (local locals-list) (let ((name (gdb-mi--field local 'name)) (value (gdb-mi--field local 'value)) (type (gdb-mi--field local 'type))) (when (not value) - (setq value "")) + (setq value + (if gdb-locals-simple-values-only + "" + (gethash name gdb-locals-values-table "")))) + (setq value (gdb-locals-value-filter value)) + (if (or (not value) (string-match "0x" value)) (add-text-properties 0 (length name) @@ -4860,6 +4917,8 @@ file\" where the GDB session starts (see `gdb-main-file')." (expand-file-name gdb-default-window-configuration-file gdb-window-configuration-directory))) ;; Create default layout as before. + ;; Make sure that local values are updated before locals. + (gdb-get-buffer-create 'gdb-locals-values-buffer) (gdb-get-buffer-create 'gdb-locals-buffer) (gdb-get-buffer-create 'gdb-stack-buffer) (gdb-get-buffer-create 'gdb-breakpoints-buffer) commit 5b7ce98ea0fd368aa5a73d5f6e01cf8b0fd253c1 Author: Lars Ingebrigtsen Date: Sun Mar 6 19:34:54 2022 +0100 Fix syntax error in obsolete message function * lisp/gnus/message.el (message-send-mail-function): Fix syntax error. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 800c7dcea0..a5b3d40467 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -716,7 +716,7 @@ The function accepts 1 parameter which is the matched prefix." (defvar sendmail-program) (cond ((executable-find sendmail-program) #'message-send-mail-with-sendmail) - ((bound-and-true-p 'smtpmail-default-smtp-server) + ((bound-and-true-p smtpmail-default-smtp-server) #'message-smtpmail-send-it) (t #'message-send-mail-with-mailclient))) commit 75a15141303bcce89018820b1480bd84136c8df4 Author: Lars Ingebrigtsen Date: Sun Mar 6 19:02:45 2022 +0100 Fix url-interactive-p type * lisp/url/url-vars.el (url-interactive-pw): Fix typo in previous checkin (bug#54275). diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index 9e91bf0670..07a638f1cc 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -427,7 +427,7 @@ This should be set, e.g. by mail user agents rendering HTML to avoid (defun url-interactive-p () "Say whether the current request is from a interactive context." (not (or url-request-noninteractive - (bound-and-true-p 'url-http-noninteractive)))) + (bound-and-true-p url-http-noninteractive)))) ;; Obsolete commit 56bdfe78208149fa864842d47bfd08d1bc4d6d10 Author: Lars Ingebrigtsen Date: Sun Mar 6 17:41:18 2022 +0100 Fix problem with fetching images via Cloudflare * lisp/url/url-http.el (url-http): Factor out url-interactive-p. * lisp/url/url-auth.el (url-basic-auth): (url-basic-auth): (url-digest-prompt-creds): Use it to not query the user. * lisp/url/url-queue.el (url-queue-start-retrieve): Don't send a bogus empty Authorization header (bug#54246) -- this triggers Cloudflare's anti-attack software. Instead rely on url-request-noninteractive. * lisp/url/url-vars.el (url-interactive-p): New utility function. diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index 585010d21c..dd658b1b68 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -87,11 +87,13 @@ instead of the filename inheritance method." ((and prompt (not byserv)) (setq user (or (url-do-auth-source-search server type :user) - (read-string (url-auth-user-prompt href realm) - (or user (user-real-login-name)))) + (and (url-interactive-p) + (read-string (url-auth-user-prompt href realm) + (or user (user-real-login-name))))) pass (or (url-do-auth-source-search server type :secret) - (read-passwd "Password: " nil (or pass "")))) + (and (url-interactive-p) + (read-passwd "Password: " nil (or pass ""))))) (set url-basic-auth-storage (cons (list server (cons file @@ -117,11 +119,13 @@ instead of the filename inheritance method." (progn (setq user (or (url-do-auth-source-search server type :user) - (read-string (url-auth-user-prompt href realm) - (user-real-login-name))) + (and (url-interactive-p) + (read-string (url-auth-user-prompt href realm) + (user-real-login-name)))) pass (or (url-do-auth-source-search server type :secret) - (read-passwd "Password: ")) + (and (url-interactive-p) + (read-passwd "Password: "))) retval (base64-encode-string (format "%s:%s" user pass) t) byserv (assoc server (symbol-value url-basic-auth-storage))) (setcdr byserv @@ -233,11 +237,13 @@ CREDS is a plist that may have properties `:user' and `:secret'." ;; plist-put modify the same plist. (setq creds (plist-put creds :user - (read-string (url-auth-user-prompt url realm) - (or (plist-get creds :user) - (user-real-login-name))))) + (and (url-interactive-p) + (read-string (url-auth-user-prompt url realm) + (or (plist-get creds :user) + (user-real-login-name)))))) (plist-put creds :secret - (read-passwd "Password: " nil (plist-get creds :secret)))) + (and (url-interactive-p) + (read-passwd "Password: " nil (plist-get creds :secret))))) (defun url-digest-auth-directory-id-assoc (dirkey keylist) "Find the best match for DIRKEY in key alist KEYLIST. diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 16c3a6a1e6..daeba17031 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1304,9 +1304,7 @@ The return value of this function is the retrieval buffer." (cl-check-type url url "Need a pre-parsed URL.") (let* (;; (host (url-host (or url-using-proxy url))) ;; (port (url-port (or url-using-proxy url))) - (nsm-noninteractive (or url-request-noninteractive - (and (boundp 'url-http-noninteractive) - url-http-noninteractive))) + (nsm-noninteractive (not (url-interactive-p))) ;; The following binding is needed in url-open-stream, which ;; is called from url-http-find-free-connection. (url-current-object url) diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 152300bda5..b2e24607e1 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el @@ -161,11 +161,7 @@ The variable `url-queue-timeout' sets a timeout." (url-queue-context-buffer job) (current-buffer)) (let ((url-request-noninteractive t) - (url-allow-non-local-files t) - ;; This will disable querying the user for - ;; credentials if one of the things we're fetching - ;; in the background return a header requesting it. - (url-request-extra-headers '(("Authorization" . "")))) + (url-allow-non-local-files t)) (url-retrieve (url-queue-url job) #'url-queue-callback-function (list job) (url-queue-silentp job) diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index 83c089a930..9e91bf0670 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -424,6 +424,11 @@ Should be one of: This should be set, e.g. by mail user agents rendering HTML to avoid `bugs' which call home.") +(defun url-interactive-p () + "Say whether the current request is from a interactive context." + (not (or url-request-noninteractive + (bound-and-true-p 'url-http-noninteractive)))) + ;; Obsolete (defconst url-version "Emacs" "Version number of URL package.") commit 93c2daa33d3aac7c61f322c9d21f3ccab7bdcd4a Author: Stefan Monnier Date: Sun Mar 6 10:14:42 2022 -0500 (ecomplete-add-item): Preserve the more complete text Avoid replacing "John Doe " with "john@doe.ch". * lisp/ecomplete.el (ecomplete-add-item): Keep the longest text diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el index c39c6c2ff9..d5f3fc7756 100644 --- a/lisp/ecomplete.el +++ b/lisp/ecomplete.el @@ -103,7 +103,11 @@ string that was matched." (unless elems (push (setq elems (list type)) ecomplete-database)) (if (setq entry (assoc key (cdr elems))) - (setcdr entry (list (1+ (cadr entry)) now text)) + (pcase-let ((`(,_key ,count ,_time ,oldtext) entry)) + (setcdr entry (list (1+ count) now + ;; Preserve the "more complete" text. + (if (>= (length text) (length oldtext)) + text oldtext)))) (nconc elems (list (list key 1 now text)))))) (defun ecomplete-get-item (type key) commit 68cdb95019a24024e6000ae75de6aa974d9b4a23 Author: Alan Mackenzie Date: Sun Mar 6 13:37:30 2022 +0000 Restore call to byte-run-strip-symbol-positions in byte-compile-out Also increment a loop counter. This should fix bug #54248. * lisp/emacs-lisp/byte-run.el (byte-run--strip-vector/record): increment the loop counter 'i' in the main loop. * lisp/emacs-lisp/bytecomp.el (byte-compile-out): call byte-run-strip-symbol-positions on operands which are one-element lists. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index d7a2d8ceca..384e8cba88 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -80,7 +80,8 @@ This is done by destructively modifying ARG. Return ARG." ((consp elt) (byte-run--strip-list elt)) ((or (vectorp elt) (recordp elt)) - (byte-run--strip-vector/record elt)))))) + (byte-run--strip-vector/record elt))) + (setq i (1+ i))))) arg)) (defalias 'byte-run-strip-symbol-positions diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 432fd2ad9c..9be44a8d5a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5108,6 +5108,11 @@ OP and OPERAND are as passed to `byte-compile-out'." (- 1 operand)))) (defun byte-compile-out (op &optional operand) + "Push the operation onto `byte-compile-output'. +OP is an opcode, a symbol. OPERAND is either nil or a number or +a one-element list of a lisp form." + (when (and (consp operand) (null (cdr operand))) + (setq operand (byte-run-strip-symbol-positions operand))) (push (cons op operand) byte-compile-output) (if (eq op 'byte-return) ;; This is actually an unnecessary case, because there should be no commit 6eeab90632506348a58d264eb3304625756c8659 Author: Mattias EngdegÄrd Date: Sun Mar 6 10:50:27 2022 +0100 Don't accept whitespace or hex floats in rgbi: colour specs `color-values-from-color-spec` (new in Emacs 28) erroneously accepted leading whitespace and hex floats in rgbi: components. Reported by Philip Kaludercic. * src/xfaces.c (parse_float_color_comp): Disallow leading whitespace and hex floats. * test/src/xfaces-tests.el (xfaces-internal-color-values-from-color-spec): Add test cases. diff --git a/src/xfaces.c b/src/xfaces.c index 8100bdb157..1d2e2489de 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -888,6 +888,11 @@ parse_hex_color_comp (const char *s, const char *e, unsigned short *dst) static double parse_float_color_comp (const char *s, const char *e) { + /* Only allow decimal float literals without whitespace. */ + for (const char *p = s; p < e; p++) + if (!((*p >= '0' && *p <= '9') + || *p == '.' || *p == '+' || *p == '-' || *p == 'e' || *p == 'E')) + return -1; char *end; double x = strtod (s, &end); return (end == e && x >= 0 && x <= 1) ? x : -1; diff --git a/test/src/xfaces-tests.el b/test/src/xfaces-tests.el index 31c0f021b2..16f1653791 100644 --- a/test/src/xfaces-tests.el +++ b/test/src/xfaces-tests.el @@ -47,7 +47,10 @@ '(0 32768 6554))) (should (equal (color-values-from-color-spec "rgbi:1e-3/1.0e-2/1e0") '(66 655 65535))) - (should (equal (color-values-from-color-spec "rgbi:0/0.5/10") nil))) + (should (equal (color-values-from-color-spec "rgbi:0/0.5/10") nil)) + (should (equal (color-values-from-color-spec "rgbi:0/0/ 0") nil)) + (should (equal (color-values-from-color-spec "rgbi:0/0x0/0") nil)) + (should (equal (color-values-from-color-spec "rgbi:0/+0x1/0") nil))) (provide 'xfaces-tests) commit ea5a0142ced33884a370e9a47f8035f303382ba7 Author: Po Lu Date: Sun Mar 6 21:04:34 2022 +0800 Respect inhibit-double-buffering on non-toolkit scroll bars * src/xfns.c (x_set_inhibit_double_buffering): Force scroll bars to be re-created on builds without toolkit scroll bars. * src/xterm.c (x_scroll_bar_create): Don't initialize back buffer if double buffering is disabled for the frame. diff --git a/src/xfns.c b/src/xfns.c index 65218b3fc0..e288f797fb 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -818,7 +818,19 @@ x_set_inhibit_double_buffering (struct frame *f, and after any potential change. One of the calls will end up being a no-op. */ if (want_double_buffering != was_double_buffered) - font_drop_xrender_surfaces (f); + { + font_drop_xrender_surfaces (f); + + /* Scroll bars decide whether or not to use a back buffer + based on the value of this frame parameter, so destroy + all scroll bars. */ +#ifndef USE_TOOLKIT_SCROLL_BARS + if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f); + if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + FRAME_TERMINAL (f)->judge_scroll_bars_hook (f); +#endif + } if (FRAME_X_DOUBLE_BUFFERED_P (f) && !want_double_buffering) tear_down_x_back_buffer (f); else if (!FRAME_X_DOUBLE_BUFFERED_P (f) && want_double_buffering) diff --git a/src/xterm.c b/src/xterm.c index 1d68d4e939..8642345549 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8583,7 +8583,8 @@ x_scroll_bar_create (struct window *w, int top, int left, /* Attributes. */ mask, &a); #ifdef HAVE_XDBE - if (FRAME_DISPLAY_INFO (f)->supports_xdbe) + if (FRAME_DISPLAY_INFO (f)->supports_xdbe + && FRAME_X_DOUBLE_BUFFERED_P (f)) { x_catch_errors (FRAME_X_DISPLAY (f)); drawable = XdbeAllocateBackBufferName (FRAME_X_DISPLAY (f), commit 450f3f8725ff231aeda2738e25b4bb2cebe5a35b Author: Po Lu Date: Sun Mar 6 10:42:33 2022 +0000 Slightly fix mouse-highlight processing on Haiku * src/haikuterm.c (haiku_read_socket): If no corresponding frame was found for a keyboard event, clear mouse highlight. diff --git a/src/haikuterm.c b/src/haikuterm.c index c44b350c58..633e87fd43 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2780,8 +2780,6 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) struct haiku_key_event *b = buf; Mouse_HLInfo *hlinfo = &x_display_list->mouse_highlight; struct frame *f = haiku_window_to_frame (b->window); - if (!f) - continue; /* If mouse-highlight is an integer, input clears out mouse highlighting. */ @@ -2795,6 +2793,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) need_flush = 1; } + if (!f) + continue; + inev.code = b->keysym ? b->keysym : b->multibyte_char; if (b->keysym)