commit a4339190ec2c2356ab3c2ece974b436e40a5ab74 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sat Jul 23 15:00:12 2022 +0800 Fix PGTK DND after a source leaves without dropping anything * lisp/pgtk-dnd.el (pgtk-dnd-clear-data-on-motion): New flag. (pgtk-dnd-handle-gdk): Set flag upon drag-leave. Clear state upon drag-motion if it is set. diff --git a/lisp/pgtk-dnd.el b/lisp/pgtk-dnd.el index f9532269d6..b37bf9ba60 100644 --- a/lisp/pgtk-dnd.el +++ b/lisp/pgtk-dnd.el @@ -336,18 +336,32 @@ Currently XDND, Motif and old KDE 1.x protocols are recognized." (declare-function pgtk-update-drop-status "pgtkselect.c") (declare-function pgtk-drop-finish "pgtkselect.c") +(defvar pgtk-dnd-clear-data-on-motion nil + "Whether or not to obtain the new list of targets upon the next drag motion. +For more details, see the function `pgtk-dnd-handle-gdk'.") + (defun pgtk-dnd-handle-gdk (event frame window client-message) "Handle drag-n-drop EVENT on FRAME. WINDOW should be the window the event happened on top of. CLIENT-MESSAGE is the detailed description of the drag-and-drop message." (cond - ;; We can't handle `drag-leave' here, since that signal is also - ;; sent right before `drag-drop', and there is no reliable way to - ;; distinguish the two. + ;; We can't handle `drag-leave' immediately, since that signal is + ;; also sent right before `drag-drop', and there is no reliable way + ;; to distinguish a signal sent because the source left from one + ;; sent prior to a drop. Instead, set a flag that tells Emacs to + ;; clear the drag-and-drop state if anything other than a drop is + ;; received. + ((not client-message) ; drag-leave + (setq pgtk-dnd-clear-data-on-motion t)) ((eq (car client-message) 'lambda) ; drag-motion (let ((state (pgtk-dnd-get-state-for-frame frame))) - (unless (aref state 0) ;; This is actually an entry. + (unless (and (aref state 0) ;; This is actually an entry. + (not pgtk-dnd-clear-data-on-motion)) + (setq pgtk-dnd-clear-data-on-motion nil) + ;; Forget the drop first, or else the list of targets will not + ;; be cleared if it is nil. + (pgtk-dnd-forget-drop window) (pgtk-dnd-save-state window nil nil (pgtk-get-selection-internal (nth 1 client-message) 'TARGETS) commit 51f5c4b773e11dd50f9fc6887362324b6d4dc755 Author: Lars Ingebrigtsen Date: Sat Jul 23 08:55:20 2022 +0200 Fix off-by-one error in string-truncate-left * lisp/emacs-lisp/subr-x.el (string-truncate-left): Fix off-by-one error (bug#56685). diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 5037ae47e8..d5d7bfeb6f 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -107,12 +107,16 @@ characters; nil stands for the empty string." ;;;###autoload (defun string-truncate-left (string length) - "Truncate STRING to LENGTH, replacing initial surplus with \"...\"." + "If STRING is longer than LENGTH, return a truncated version. +When truncating, \"...\" is always prepended to the string, so +the resulting string may be longer than the original if LENGTH is +3 or smaller." (let ((strlen (length string))) (if (<= strlen length) string (setq length (max 0 (- length 3))) - (concat "..." (substring string (max 0 (- strlen 1 length))))))) + (concat "..." (substring string (min (1- strlen) + (max 0 (- strlen length)))))))) (defsubst string-blank-p (string) "Check whether STRING is either empty or only whitespace. diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 99c0e82215..7a3efe9db6 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el @@ -766,5 +766,10 @@ (should (equal (sort (hash-table-keys h) #'string<) '(a b c))) (should (equal (sort (hash-table-values h) #'<) '(1 2 3))))) +(ert-deftest test-string-truncate-left () + (should (equal (string-truncate-left "band" 3) "...d")) + (should (equal (string-truncate-left "band" 2) "...d")) + (should (equal (string-truncate-left "longstring" 8) "...tring"))) + (provide 'subr-x-tests) ;;; subr-x-tests.el ends here commit 33602132acdf0ff9148aaeea32423c683529f039 Author: Po Lu Date: Sat Jul 23 14:18:18 2022 +0800 Handle text scale and global text scale during DND wheel movement * lisp/x-dnd.el (x-dnd-mwheel-scroll): Handle `text-scale' and `global-text-scale' mwheel actions. diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index fa045d563c..ac78deaab6 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -778,7 +778,11 @@ has been pressed." (* 1 count)))) (unless (and (not mouse-wheel-tilt-scroll) (or (eq button 6) (eq button 7))) - (let ((function (cond ((eq button 4) + (let ((function (cond ((eq type 'text-scale) + #'text-scale-adjust) + ((eq type 'global-text-scale) + #'global-text-scale-adjust) + ((eq button 4) (if hscroll mwheel-scroll-right-function mwheel-scroll-down-function)) @@ -794,9 +798,17 @@ has been pressed." (if mouse-wheel-flip-direction mwheel-scroll-left-function mwheel-scroll-right-function))))) + ;; Button5 should decrease the text scale, not increase it. + (when (and (memq type '(text-scale global-text-scale)) + (eq button 5)) + (setq amt (- amt))) (when function (condition-case nil - (funcall function amt) + ;; Don't overwrite any echo-area message that might + ;; already be shown, since this can be called from + ;; `x-begin-drag'. + (let ((inhibit-message t)) + (funcall function amt)) ;; Do not error at buffer limits. Show a message instead. ;; This is especially important here because signalling an ;; error will mess up the drag-and-drop operation. commit 825f4fdb5159c0957d9749b69d3ec9d73ef9fe95 Author: Miha Rihtaršič Date: Sat Jul 23 08:02:48 2022 +0200 Fix mode line mouse-1 binding when showing only column numbers * lisp/bindings.el (mode-line-position): Fix the mouse-1 binding when showing only column numbers (bug#56694). diff --git a/lisp/bindings.el b/lisp/bindings.el index 1d795c7a30..2e32128274 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -517,31 +517,31 @@ mouse-1: Display Line and Column Mode Menu") 'help-echo "Size indication mode\n\ mouse-1: Display Line and Column Mode Menu"))) (line-number-mode - ((column-number-mode - (column-number-indicator-zero-based - (10 - (:propertize - mode-line-position-column-line-format - display (min-width (10.0)) - ,@mode-line-position--column-line-properties)) - (10 - (:propertize - (:eval (string-replace - "%c" "%C" (car mode-line-position-column-line-format))) - display (min-width (10.0)) - ,@mode-line-position--column-line-properties))) - (6 + (column-number-mode + (column-number-indicator-zero-based + (10 (:propertize - mode-line-position-line-format - display (min-width (6.0)) - ,@mode-line-position--column-line-properties)))) + mode-line-position-column-line-format + display (min-width (10.0)) + ,@mode-line-position--column-line-properties)) + (10 + (:propertize + (:eval (string-replace + "%c" "%C" (car mode-line-position-column-line-format))) + display (min-width (10.0)) + ,@mode-line-position--column-line-properties))) + (6 + (:propertize + mode-line-position-line-format + display (min-width (6.0)) + ,@mode-line-position--column-line-properties))) (column-number-mode (column-number-indicator-zero-based (6 (:propertize mode-line-position-column-format display (min-width (6.0)) - (,@mode-line-position--column-line-properties))) + ,@mode-line-position--column-line-properties)) (6 (:propertize (:eval (string-replace commit e00f882905db2ac6ffd1ae58b04fa335b38f489c Author: Lars Ingebrigtsen Date: Sat Jul 23 07:46:52 2022 +0200 Don't bug out in src when there's no srcset * lisp/net/shr.el (shr--preferred-image): Don't bug out when there's no srcset. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 52e4389954..248faeb223 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1740,13 +1740,14 @@ BASE is the URL of the HTML being rendered." shr-cookie-policy))) (defun shr--preferred-image (dom) - (let* ((srcset (shr--parse-srcset (dom-attr dom 'srcset) - (and (dom-attr dom 'width) - (string-to-number - (dom-attr dom 'width))))) + (let* ((srcset (and (dom-attr dom 'srcset) + (shr--parse-srcset (dom-attr dom 'srcset) + (and (dom-attr dom 'width) + (string-to-number + (dom-attr dom 'width)))))) (frame-width (frame-pixel-width)) candidate) - (when (length> srcset 0) + (when srcset ;; Choose the smallest picture that's bigger than the current ;; frame. (setq candidate (caar srcset)) commit 2ebede7d7534ef22816d973e2a42613cecfd5b53 Author: Lars Ingebrigtsen Date: Sat Jul 23 07:43:45 2022 +0200 Fix srcset parsing in shr * lisp/net/shr.el (shr--preferred-image): Factor out srcset parsing for easier testing. (shr--parse-srcset): Don't misparse URLs with commas in them. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 476c7017e6..52e4389954 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1740,35 +1740,13 @@ BASE is the URL of the HTML being rendered." shr-cookie-policy))) (defun shr--preferred-image (dom) - (let ((srcset (dom-attr dom 'srcset)) - (frame-width (frame-pixel-width)) - (width (string-to-number (or (dom-attr dom 'width) "100"))) - candidate) - (when (> (length srcset) 0) - ;; srcset consist of a series of URL/size specifications - ;; separated by the ", " string. - (setq srcset - (sort (mapcar - (lambda (elem) - (let ((spec (split-string elem "[\t\n\r ]+"))) - (cond - ((= (length spec) 1) - ;; Make sure it's well formed. - (list (car spec) 0)) - ((string-match "\\([0-9]+\\)x\\'" (cadr spec)) - ;; If we have an "x" form, then use the width - ;; spec to compute the real width. - (list (car spec) - (* width (string-to-number - (match-string 1 (cadr spec)))))) - (t - (list (car spec) - (string-to-number (cadr spec))))))) - (split-string (replace-regexp-in-string - "\\`[\t\n\r ]+\\|[\t\n\r ]+\\'" "" srcset) - "[\t\n\r ]*,[\t\n\r ]*")) - (lambda (e1 e2) - (> (cadr e1) (cadr e2))))) + (let* ((srcset (shr--parse-srcset (dom-attr dom 'srcset) + (and (dom-attr dom 'width) + (string-to-number + (dom-attr dom 'width))))) + (frame-width (frame-pixel-width)) + candidate) + (when (length> srcset 0) ;; Choose the smallest picture that's bigger than the current ;; frame. (setq candidate (caar srcset)) @@ -1778,6 +1756,42 @@ BASE is the URL of the HTML being rendered." (pop srcset))) (or candidate (dom-attr dom 'src)))) +(defun shr--parse-srcset (srcset &optional width) + (setq srcset (string-trim srcset) + width (or width 100)) + (when (> (length srcset) 0) + ;; srcset consists of a series of URL/size specifications separated + ;; by the " ," string. + (sort (mapcar + (lambda (elem) + (let ((spec (split-string elem "[\t\n\r ]+"))) + (cond + ((= (length spec) 1) + ;; Make sure it's well formed. + (list (car spec) 0)) + ((string-match "\\([0-9]+\\)x\\'" (cadr spec)) + ;; If we have an "x" form, then use the width + ;; spec to compute the real width. + (list (car spec) + (* width (string-to-number + (match-string 1 (cadr spec)))))) + (t + (list (car spec) + (string-to-number (cadr spec))))))) + (with-temp-buffer + (insert srcset) + (goto-char (point-min)) + (let ((bits nil)) + (while (re-search-forward "[^\t\n\r ]+[\t\n\r ]+[^\t\n\r ,]+" + nil t) + (push (match-string 0) bits) + (if (looking-at "[\t\n\r ]*,[\t\n\r ]*") + (goto-char (match-end 0)) + (goto-char (point-max)))) + bits))) + (lambda (e1 e2) + (> (cadr e1) (cadr e2)))))) + (defun shr-string-number (string) (if (null string) nil diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index 821ca5ca63..2254f9bc86 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -67,6 +67,21 @@ (should-not (shr--use-cookies-p "http://www.gnu.org" '("http://www.fsf.org"))))) +(ert-deftest shr-srcset () + (should (equal (shr--parse-srcset "") nil)) + + (should (equal (shr--parse-srcset "a 10w, b 20w") + '(("b" 20) ("a" 10)))) + + (should (equal (shr--parse-srcset "a 10w b 20w") + '(("a" 10)))) + + (should (equal (shr--parse-srcset "https://example.org/1\n\n 10w , https://example.org/2 20w ") + '(("https://example.org/2" 20) ("https://example.org/1" 10)))) + + (should (equal (shr--parse-srcset "https://example.org/1,2\n\n 10w , https://example.org/2 20w ") + '(("https://example.org/2" 20) ("https://example.org/1,2" 10))))) + (require 'shr) ;;; shr-tests.el ends here commit 792734a6e2cd5558debc8d9fe95d34cb3e809fa4 Author: Po Lu Date: Sat Jul 23 09:35:20 2022 +0800 Improve efficiency of DND tooltip movement * src/xterm.c (x_dnd_begin_drag_and_drop): Clear new flag. (x_dnd_update_tooltip_position): Save last tooltip X and Y somewhere, so we don't move it upon client lists being updated. diff --git a/src/xterm.c b/src/xterm.c index 8b12d92f18..45a81a3fdb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1390,6 +1390,12 @@ static int x_dnd_recursion_depth; initiating Motif drag-and-drop for the first time. */ static Lisp_Object x_dnd_selection_alias_cell; +/* The last known position of the tooltip window. */ +static int x_dnd_last_tooltip_x, x_dnd_last_tooltip_y; + +/* Whether or not those values are actually known yet. */ +static bool x_dnd_last_tooltip_valid; + /* Structure describing a single window that can be the target of drag-and-drop operations. */ struct x_client_list_window @@ -11670,6 +11676,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, x_dnd_run_unsupported_drop_function = false; x_dnd_use_toplevels = x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_client_list_stacking); + x_dnd_last_tooltip_valid = false; x_dnd_toplevels = NULL; x_dnd_allow_current_frame = allow_current_frame; x_dnd_movement_frame = NULL; @@ -15928,6 +15935,15 @@ x_dnd_update_tooltip_position (int root_x, int root_y) x_dnd_compute_tip_xy (&root_x, &root_y, x_dnd_monitors); + if (x_dnd_last_tooltip_valid + && root_x == x_dnd_last_tooltip_x + && root_y == x_dnd_last_tooltip_y) + return; + + x_dnd_last_tooltip_x = root_x; + x_dnd_last_tooltip_y = root_y; + x_dnd_last_tooltip_valid = true; + XMoveWindow (FRAME_X_DISPLAY (x_dnd_frame), tip_window, root_x, root_y); } commit df508ffd2bedf901996d8899c63183aaf327f887 Merge: f268cdc185 ae1ace1cf4 Author: Stefan Kangas Date: Sat Jul 23 01:37:59 2022 +0200 Merge from origin/emacs-28 ae1ace1cf4 Adjust help-fns.el tests for recent change 04bdcf4aaa * src/terminal.c (Fframe_terminal): Use active voice 7fa491a9e9 Improve 'terminal-live-p' docstring some more b9ac8c29ae Improve terminal-live-p docstring 0b4c81a152 * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): F... 8f8373170f * lisp/progmodes/cperl-mode.el: Don't mention obsolete arc... 25bc330a6d Make 'describe-function' say "byte-compiled" when appropriate 2b31e667be ;Improve documentation of locale-specific string comparison commit ae1ace1cf4a8b0624f72a8f76e702d78b643ea32 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Sat Jul 23 00:06:38 2022 +0200 Adjust help-fns.el tests for recent change * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun) (help-fns-test-lisp-defsubst): Adjust tests for recent change. diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 4002501dde..3132a59023 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -63,13 +63,13 @@ Return first line of the output of (describe-function-1 FUNC)." (ert-deftest help-fns-test-lisp-defun () (let ((regexp (if (featurep 'native-compile) - "a native compiled Lisp function in .+subr\\.el" - "a compiled Lisp function in .+subr\\.el")) + "a native-compiled Lisp function in .+subr\\.el" + "a byte-compiled Lisp function in .+subr\\.el")) (result (help-fns-tests--describe-function 'last))) (should (string-match regexp result)))) (ert-deftest help-fns-test-lisp-defsubst () - (let ((regexp "a compiled Lisp function in .+subr\\.el") + (let ((regexp "a byte-compiled Lisp function in .+subr\\.el") (result (help-fns-tests--describe-function 'posn-window))) (should (string-match regexp result)))) commit f268cdc185b5e98456434da0cfda963b614227fd Author: Lars Ingebrigtsen Date: Sat Jul 23 00:01:00 2022 +0200 Fix typo in error message in native-compile-prune-cache * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Fix typo (bug#56713). diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 04df4885de..5ee10fcbca 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4294,7 +4294,7 @@ of (commands) to run simultaneously." "Remove .eln files that aren't applicable to the current Emacs invocation." (interactive) (unless (featurep 'native-compile) - (user-error "This Emacs isn't build with native-compile support")) + (user-error "This Emacs isn't built with native-compile support")) (dolist (dir native-comp-eln-load-path) ;; If a directory is non absolute it is assumed to be relative to ;; `invocation-directory'. commit dd902c43f3a30baf614986b8126eb30f1e8c6163 Author: Lars Ingebrigtsen Date: Fri Jul 22 22:43:38 2022 +0200 Fix spacing in *Help* buttons * lisp/help-mode.el (help-xref--navigation-buttons): Fix spacing before single [forward] button. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index d8d76114f5..f49d20270c 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -678,9 +678,10 @@ that." (defun help-xref--navigation-buttons () (let ((inhibit-read-only t)) + (when (or help-xref-stack help-xref-forward-stack) + (ensure-empty-lines 1)) ;; Make a back-reference in this buffer if appropriate. (when help-xref-stack - (ensure-empty-lines 1) (help-insert-xref-button help-back-label 'help-back (current-buffer))) ;; Make a forward-reference in this buffer if appropriate. commit 963c8c35c3043aa6f20862b4eb9273587839f77a Author: Lars Ingebrigtsen Date: Fri Jul 22 21:55:23 2022 +0200 Give a better error message in native-compile-prune-cache * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Give a better error message in non-nativecomp builds. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 9a635a4776..04df4885de 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4293,6 +4293,8 @@ of (commands) to run simultaneously." (defun native-compile-prune-cache () "Remove .eln files that aren't applicable to the current Emacs invocation." (interactive) + (unless (featurep 'native-compile) + (user-error "This Emacs isn't build with native-compile support")) (dolist (dir native-comp-eln-load-path) ;; If a directory is non absolute it is assumed to be relative to ;; `invocation-directory'. commit 1767f796b0e0649219e37b6b205f4d414a4364c6 Author: Robert Pluim Date: Fri Jul 22 16:20:36 2022 +0200 ; * src/xdisp.c (set_vertical_scroll_bar): Fix typo diff --git a/src/xdisp.c b/src/xdisp.c index 629524eee4..e998df32a6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18943,7 +18943,7 @@ set_vertical_scroll_bar (struct window *w) struct text_pos start_pos; struct buffer *obuf = current_buffer; /* When we display the scroll bar of a mini-window, - current_buffer is not gauranteed to be the mini-window's + current_buffer is not guaranteed to be the mini-window's buffer, see the beginning of redisplay_window. */ set_buffer_internal_1 (XBUFFER (w->contents)); SET_TEXT_POS_FROM_MARKER (start_pos, w->start); commit 12a3137cd381cb743768033e789b900b015041d7 Author: Eli Zaretskii Date: Fri Jul 22 16:15:38 2022 +0300 Fix display of scroll-bar in mini-windows * src/xdisp.c (set_vertical_scroll_bar): Ensure current_buffer is set correctly when displaying scroll bar of a mini-window. (Bug#56692) diff --git a/src/xdisp.c b/src/xdisp.c index 88e2db8956..629524eee4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18930,28 +18930,30 @@ set_vertical_scroll_bar (struct window *w) && NILP (echo_area_buffer[0]))) { struct buffer *buf = XBUFFER (w->contents); - ptrdiff_t window_end_pos = w->window_end_pos; + + whole = BUF_ZV (buf) - BUF_BEGV (buf); + start = marker_position (w->start) - BUF_BEGV (buf); + end = BUF_Z (buf) - w->window_end_pos - BUF_BEGV (buf); /* If w->window_end_pos cannot be trusted, recompute it "the - hard way". Unless W is a minibuffer window, in which case - w->window_end_pos is specially set? (bug#56692) */ - if (!MINI_WINDOW_P (w) - && !w->window_end_valid) + hard way". */ + if (!MINI_WINDOW_P (w)) { struct it it; struct text_pos start_pos; - + struct buffer *obuf = current_buffer; + /* When we display the scroll bar of a mini-window, + current_buffer is not gauranteed to be the mini-window's + buffer, see the beginning of redisplay_window. */ + set_buffer_internal_1 (XBUFFER (w->contents)); SET_TEXT_POS_FROM_MARKER (start_pos, w->start); start_display (&it, w, start_pos); move_it_to (&it, -1, it.last_visible_x, window_box_height (w), -1, MOVE_TO_X | MOVE_TO_Y); - window_end_pos = BUF_Z (buf) - IT_CHARPOS (it); + end -= (BUF_Z (buf) - IT_CHARPOS (it)) - w->window_end_pos; + set_buffer_internal_1 (obuf); } - whole = BUF_ZV (buf) - BUF_BEGV (buf); - start = marker_position (w->start) - BUF_BEGV (buf); - end = BUF_Z (buf) - window_end_pos - BUF_BEGV (buf); - if (end < start) end = start; if (whole < (end - start)) commit 04bdcf4aaa46612e066f32fa6452d76e40eff8e8 Author: Robert Pluim Date: Fri Jul 22 14:19:04 2022 +0200 * src/terminal.c (Fframe_terminal): Use active voice diff --git a/src/terminal.c b/src/terminal.c index 4580d0b726..48d581e6ea 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -402,7 +402,7 @@ but if the second argument FORCE is non-nil, you may do so. */) DEFUN ("frame-terminal", Fframe_terminal, Sframe_terminal, 0, 1, 0, doc: /* Return the terminal that FRAME is displayed on. -If FRAME is nil, the selected frame is used. +If FRAME is nil, use the selected frame. The terminal device is represented by its integer identifier. */) (Lisp_Object frame) commit 7fa491a9e9ca00b21a290926c971ae861791824e Author: Robert Pluim Date: Fri Jul 22 14:03:01 2022 +0200 Improve 'terminal-live-p' docstring some more * terminal.c (Fterminal_live_p): Improve description of arguments and return value. diff --git a/src/terminal.c b/src/terminal.c index 39ba3925b7..4580d0b726 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -421,11 +421,12 @@ The terminal device is represented by its integer identifier. */) DEFUN ("terminal-live-p", Fterminal_live_p, Sterminal_live_p, 1, 1, 0, doc: /* Return non-nil if OBJECT is a terminal which has not been deleted. -Value is nil if OBJECT is not a live display terminal. Uses the -terminal of the currently selected frame if OBJECT is nil. -If object is a live display terminal, the return value indicates what -sort of output terminal it uses. See the documentation of `framep' for -possible return values. */) +Return nil if OBJECT is not a live display terminal. +OBJECT may be a terminal object, a frame, or nil (meaning the +selected frame's terminal). +If OBJECT is a live display terminal, return what sort of output +terminal it uses. See the documentation of `framep' for possible +return values. */) (Lisp_Object object) { struct terminal *t = decode_terminal (object); commit 82116a5ea382cf87138d8cde3e7d770e540a7d26 Author: Po Lu Date: Fri Jul 22 19:51:56 2022 +0800 Fix bug#56692 questionably * src/xdisp.c (set_vertical_scroll_bar): Don't recompute window end of a mini window. (bug#56692) diff --git a/src/xdisp.c b/src/xdisp.c index ebeaf2a3da..88e2db8956 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18933,8 +18933,10 @@ set_vertical_scroll_bar (struct window *w) ptrdiff_t window_end_pos = w->window_end_pos; /* If w->window_end_pos cannot be trusted, recompute it "the - hard way". */ - if (!w->window_end_valid) + hard way". Unless W is a minibuffer window, in which case + w->window_end_pos is specially set? (bug#56692) */ + if (!MINI_WINDOW_P (w) + && !w->window_end_valid) { struct it it; struct text_pos start_pos; commit 7220a5a09a1b881454816accd05d2297b1bc13ec Author: Michael Albinus Date: Fri Jul 22 13:31:38 2022 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index 6d4fce1237..a143550f03 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -81,7 +81,7 @@ by saying make -C leim generate-ja-dic JA_DIC_NO_REDUCTION_OPTION='' -after deleting lisp/leim/ja-dic/ja-dic.el. +after deleting "lisp/leim/ja-dic/ja-dic.el". +++ ** Emacs now supports being built with pure GTK. @@ -117,7 +117,7 @@ Emacs Sessions" node in the Emacs manual for more details. * Startup Changes in Emacs 29.1 +++ -** -batch and -script now adjusts the garbage collection levels. +** '--batch' and '--script' now adjust the garbage collection levels. These switches now set 'gc-cons-percentage' to 1.0 (up from the default of 0.1). This means that batch processes will typically use more memory than before, but use less time doing garbage collection. @@ -152,7 +152,7 @@ time. --- *** New command 'native-compile-prune-cache'. -This command deletes older .eln cache entries (but not the ones for +This command deletes older ".eln" cache entries (but not the ones for the current Emacs version). --- @@ -166,20 +166,30 @@ of 'user-emacs-directory'. * Incompatible changes in Emacs 29.1 +** Dired + --- -** 'w' ('dired-copy-filename-as-kill') has changed behaviour. +*** 'w' ('dired-copy-filename-as-kill') has changed behavior. If there are several files marked, file names containing space and quote characters will be quoted "like this". +--- +*** The 'd' command now more consistently skips dot files. +In previous Emacs versions, commands like 'C-u 10 d' would put the "D" +mark on the next ten files, no matter whether they were dot files +(i.e., "." and "..") or not, while marking the next ten lines with the +mouse (in 'transient-mark-mode') and then hitting 'd' would skip dot +files. These now work equivalently. + +++ ** Warning about "eager macro-expansion failure" is changed into an error. --- -** Previously, the X reverseVideo value at startup was heeded for all frames. -This meant that if you had a reverseVideo resource on the initial +** Previously, the X "reverseVideo" value at startup was heeded for all frames. +This meant that if you had a "reverseVideo" resource on the initial display, and then opened up a new frame on a display without any -explicit reverseVideo setting, it would get heeded there, too. (This -included terminal frames.) In Emacs 29, the reverseVideo X resource +explicit "reverseVideo" setting, it would get heeded there, too. (This +included terminal frames.) In Emacs 29, the "reverseVideo" X resource is handled like all the other X resources, and set on a per-frame basis. +++ @@ -187,21 +197,13 @@ is handled like all the other X resources, and set on a per-frame basis. Previously, this command did the same as 'e'. --- -** '/ a' in *Packages* now limits by package name(s) instead of regexp. +** '/ a' in "*Packages*" buffer now limits by package name(s) instead of regexp. +++ ** Setting the goal columns now also affects '' and ''. Previously, 'C-x C-n' only affected 'next-line' and 'previous-line', but it now also affects 'scroll-up-command' and 'scroll-down-command'. ---- -** The 'd' command in Dired now more consistently skip dot files. -In previous Emacs versions, commands like `C-u 10 d' would put the "D" -mark on the next ten files, no matter whether they were dot files -(i.e., "." and "..") or not, while marking the next ten lines with the -mouse (in 'transient-mark-mode') and then hitting 'd' would skip dot -files. These now work equivalently. - --- ** Isearch in "*Help*" and "*info*" now char-folds quote characters by default. This means that you can say 'C-s `foo' (GRAVE ACCENT) if the buffer @@ -338,10 +340,10 @@ Use something like 'M-x shell RET ssh RET' instead. The display of long lines has been optimized, and Emacs no longer chokes when a buffer on display contains long lines. If you still experience slowdowns while editing files with long lines, this is -either due to font locking, which you can turn off with M-x -font-lock-mode or C-u C-x x f, or to the current major mode or one of -the enabled minor modes, in which case you should open the the file -with M-x find-file-literally instead of C-x C-f. The variable +either due to font locking, which you can turn off with 'M-x +font-lock-mode' or 'C-u C-x x f', or to the current major mode or one +of the enabled minor modes, in which case you should open the the file +with 'M-x find-file-literally' instead of 'C-x C-f'. The variable 'long-line-threshold' controls whether and when these display optimizations are used. @@ -352,9 +354,9 @@ decrease it, type 'C-x C-M--'; to restore the font size, type 'C-x C-M-0'. The final key in these commands may be repeated without the leading 'C-x' and without the modifiers, e.g. 'C-x C-M-+ C-M-+ C-M-+' and 'C-x C-M-+ + +' increase the font size by three steps. When -mouse-wheel-mode is enabled, 'C-M-wheel-up' and 'C-M-wheel-down' also +'mouse-wheel-mode' is enabled, 'C-M-wheel-up' and 'C-M-wheel-down' also increase and decrease the font size globally. Additionally, the -variable 'global-text-scale-adjust-resizes-frames' controls whether +user option 'global-text-scale-adjust-resizes-frames' controls whether the frames are resized when the font size is changed. +++ @@ -396,7 +398,7 @@ between these modes while the user is inputting a command by hitting This command duplicates the current line the specified number of times. --- -** Files with the '.eld' extension are now visited in 'lisp-data-mode'. +** Files with the ".eld" extension are now visited in 'lisp-data-mode'. +++ ** New command 'find-sibling-file'. @@ -554,7 +556,7 @@ This controls the style of the pre-edit and status areas of X input methods. +++ -** New X resources: "highlightForeground" and "highlightBackground" +** New X resources: "highlightForeground" and "highlightBackground". Only in the Lucid build, this controls colors used for highlighted menu item widgets. @@ -701,19 +703,19 @@ or ':scream:'. ** Help --- -*** Variable values displayed by 'C-h v' in *Help* are now font-locked. +*** Variable values displayed by 'C-h v' in "*Help*" are now font-locked. +++ *** New user option 'help-clean-buttons'. -If non-nil, link buttons in *Help* will have any surrounding quotes +If non-nil, link buttons in "*Help*" will have any surrounding quotes removed. --- *** 'M-x apropos-variable' output now includes values of variables. +++ -*** New doc string syntax to indicate that symbols shouldn't be links. -When displaying doc strings in "*Help*" buffers, strings that are +*** New docstring syntax to indicate that symbols shouldn't be links. +When displaying docstrings in "*Help*" buffers, strings that are "`like-this'" are made into links (if they point to a bound function/variable). This can lead to false positives when talking about values that are symbols that happen to have the same names as @@ -923,7 +925,7 @@ option 'cycle-spacing-actions'. ** 'zap-to-char' and 'zap-up-to-char' are case-sensitive for upper-case chars. These commands now behave as case-sensitive for interactive calls when they are invoked with an uppercase character, regardless of the -`case-fold-search' value. +'case-fold-search' value. --- ** 'scroll-other-window' and 'scroll-other-window-down' now respect remapping. @@ -1084,21 +1086,21 @@ related user option 'dired-clean-confirm-killing-deleted-buffers' +++ *** 'dired-do-relsymlink' moved from dired-x to dired. -The corresponding key "Y" is now bound by default in Dired. +The corresponding key 'Y' is now bound by default in Dired. +++ *** 'dired-do-relsymlink-regexp' moved from dired-x to dired. -The corresponding key "% Y" is now bound by default in Dired. +The corresponding key '% Y' is now bound by default in Dired. --- *** 'M-G' is now bound to 'dired-goto-subdir'. -Before, that binding was only available if the 'dired-x' package was +Before, that binding was only available if the dired-x package was loaded. +++ *** 'dired-info' and 'dired-man' moved from dired-x to dired. The 'dired-info' and 'dired-man' commands have been moved from the -'dired-x' package to 'dired'. They have also been renamed to +dired-x package to dired. They have also been renamed to 'dired-do-info' and 'dired-do-man'; the old command names are obsolete aliases. @@ -1144,7 +1146,7 @@ This can be used to trigger actions based on the battery status. +++ *** New command 'enriched-toggle-markup'. This allows you to see the markup in 'enriched-mode' buffers (e.g., -the HELLO file). +the "HELLO" file). ** Shell Script Mode @@ -1206,7 +1208,7 @@ This command allows updating all packages without any queries. +++ *** New commands 'package-recompile' and 'package-recompile-all'. -These commands can be useful if the .elc files are out of date +These commands can be useful if the ".elc" files are out of date (invalid byte code and macros). +++ @@ -1225,7 +1227,7 @@ inadvertently delete the "*scratch*" buffer. ** Debugging --- -*** 'q' in a *Backtrace* buffer no longer clears the buffer. +*** 'q' in a "*Backtrace*" buffer no longer clears the buffer. Instead it just buries the buffer and switches the mode from 'debugger-mode' to 'backtrace-mode', since commands like 'e' are no longer available after exiting the recursive edit. @@ -1275,7 +1277,7 @@ files that have few newlines. +++ ** New minor mode 'word-wrap-whitespace-mode' for extending 'word-wrap'. This mode switches 'word-wrap' on, and breaks on all the whitespace -characters instead of just SPC and TAB. +characters instead of just 'SPC' and 'TAB'. --- ** New mode, 'emacs-news-mode', for editing the NEWS file. @@ -1336,9 +1338,9 @@ the completions if they are already visible. The default value 't' always hides the completion buffer after some completion is made. *** New commands to complete the minibuffer history. -'minibuffer-complete-history' ('C-x up') is like 'minibuffer-complete' +'minibuffer-complete-history' ('C-x ') is like 'minibuffer-complete' but completes on the history items instead of the default completion -table. 'minibuffer-complete-defaults' ('C-x down') completes +table. 'minibuffer-complete-defaults' ('C-x ') completes on the list of default items. +++ @@ -1566,7 +1568,7 @@ pre-defined toolbars. --- *** Gnus now uses a variable-pitch font in the headers by default. To get the monospace font back, you can put something like the -following in your .gnus file: +following in your ".gnus" file: (set-face-attribute 'gnus-header nil :inherit 'unspecified) @@ -1978,7 +1980,7 @@ This support has been obsolete since Emacs 25.1. The final version of the Galeon web browser was released in September, 2008. --- -*** Support for the "Mozilla" web browser is now obsolete. +*** Support for the Mozilla web browser is now obsolete. Note that this historical web browser is different from Mozilla Firefox; it is its predecessor. @@ -2046,8 +2048,8 @@ symlinks in the latter case). --- *** New user option 'shell-kill-buffer-on-exit'. -Enabling this will automatically kill a *shell* buffer as soon as the -shell session terminates. +Enabling this will automatically kill a "*shell*" buffer as soon as +the shell session terminates. ** Calc @@ -2098,7 +2100,7 @@ If non-nil, files untracked by a VCS are considered to be part of the project by a VC project based on that VCS. --- -*** 'recentf-mode' now uses shortened filenames by default. +*** 'recentf-mode' now uses abbreviated file names by default. This means that e.g. "/home/foo/bar" is now displayed as "~/bar". Customize the user option 'recentf-filename-handlers' to nil to get back the old behavior. @@ -2159,36 +2161,36 @@ Emacs buffers, like indentation and the like. The new ert function --- ** 'find-image' now uses 'create-image'. -This means that images found through 'find-image' also has +This means that images found through 'find-image' also have auto-scaling applied. (This only makes a difference on HiDPI displays.) +++ ** Changes to "raw" in-memory xbm images are specified. Some years back Emacs gained the ability to scale images, and you -could then specify :width and :height when using 'create-image' on all +could then specify ':width' and ':height' when using 'create-image' on all image types -- except xbm images, because this format already used the -:width and :height arguments to specify the width/height of the "raw" +':width' and ':height' arguments to specify the width/height of the "raw" in-memory format. This meant that if you used these specifications on, for instance, xbm files, Emacs would refuse to display them. This -has been changed, and :width/:height now works as with all other image +has been changed, and ':width'/':height' now works as with all other image formats, and the way to specify the width/height of the "raw" -in-memory format is now by using :data-width and :data-height. +in-memory format is now by using ':data-width' and ':data-height'. +++ -** loaddefs.el generation has been reimplemented. -The various loaddefs.el files in the Emacs tree (which contain +** "loaddefs.el" generation has been reimplemented. +The various "loaddefs.el" files in the Emacs tree (which contain information about autoloads, built-in packages and package prefixes) -used to be generated by functions in autoloads.el. These are now -generated by loaddefs-gen.el instead. This leads to functionally +used to be generated by functions in "autoloads.el". These are now +generated by "loaddefs-gen.el" instead. This leads to functionally equivalent loaddef files, but they do not use exactly the same syntax, so using 'M-x update-file-autoloads' no longer works. (This didn't work well in most files in the past, either, but it will now signal an error in any file.) In addition, files are scanned in a slightly different way. -Previously ;;;### specs inside a top-level form (i.e., something like -(when ... ;;;### ...) would be ignored. They are now parsed as +Previously ';;;###' specs inside a top-level form (i.e., something +like '(when ... ;;;### ...)' would be ignored. They are now parsed as normal. +++ @@ -2328,14 +2330,13 @@ It's been obsolete since Emacs-22.1, actually. 'chart-map', 'comint-dynamic-complete', 'comint-dynamic-complete-as-filename', 'comint-dynamic-simple-complete', 'command-history-map', -'compilation-parse-errors-function', -'completion-annotate-function', 'condition-case-no-debug', -'count-lines-region', 'data-debug-map', 'deferred-action-list', -'deferred-action-function', 'dired-x-submit-report', -'eieio-defgeneric', 'eieio-defmethod', 'emacs-lock-from-exiting', -'erc-complete-word', 'eshell-cmpl-suffix-list', 'eshell-for', -'font-lock-maximum-size', 'gnus-carpal', -'gnus-debug-exclude-variables', 'gnus-debug-files', +'compilation-parse-errors-function', 'completion-annotate-function', +'condition-case-no-debug', 'count-lines-region', 'data-debug-map', +'deferred-action-list', 'deferred-action-function', +'dired-x-submit-report', 'eieio-defgeneric', 'eieio-defmethod', +'emacs-lock-from-exiting', 'erc-complete-word', +'eshell-cmpl-suffix-list', 'eshell-for', 'font-lock-maximum-size', +'gnus-carpal', 'gnus-debug-exclude-variables', 'gnus-debug-files', 'gnus-local-domain', 'gnus-outgoing-message-group', 'gnus-secondary-servers', 'gnus-registry-user-format-function-M', 'image-extension-data', 'image-library-alist', @@ -2451,15 +2452,15 @@ If DATA is a string, then its text properties are searched for values for each specific data type while the selection is being converted. --- -** New eldoc function: 'elisp-eldoc-var-docstring-with-value'. +** New eldoc function 'elisp-eldoc-var-docstring-with-value'. This function includes the current value of the variable in eldoc display and can be used as a more detailed alternative to 'elisp-eldoc-var-docstring'. ** 'save-some-buffers' can now be extended to save other things. Traditionally, 'save-some-buffers' saved buffers, and also saved abbrevs. This has been generalized via the -'save-some-buffers-functions', and packages can now register things to -be saved. +'save-some-buffers-functions' variable, and packages can now register +things to be saved. ** Themes @@ -2499,7 +2500,7 @@ selecting some text into the clipboard or primary selection, and then delete the current frame, you will still be able to insert the contents of that selection into other programs as long as another frame is open on the same display. This behavior can be disabled by -setting the variable 'x-auto-preserve-selections' to nil. +setting the user option 'x-auto-preserve-selections' to nil. +++ ** New predicate 'char-uppercase-p'. @@ -2508,18 +2509,18 @@ This returns non-nil if its argument its an uppercase character. ** Byte compilation --- -*** Byte compilation will now warn about some quoting mistakes in doc strings. -When writing code snippets that contains the ' character (APOSTROPHE), +*** Byte compilation will now warn about some quoting mistakes in docstrings. +When writing code snippets that contains the "'" character (APOSTROPHE), that quote character has to be escaped to avoid Emacs displaying it as -’ (LEFT SINGLE QUOTATION MARK), which would make code examples like +"’" (LEFT SINGLE QUOTATION MARK), which would make code examples like (setq foo '(1 2 3)) invalid. Emacs will now warn during byte compilation if it seems something like that, and also warn about when using RIGHT/LEFT SINGLE QUOTATION MARK directly. In both these cases, if these characters -should really be present in the doc string, they should be quoted with -\=. +should really be present in the docstring, they should be quoted with +"\=". --- *** Byte compilation will now warn about some malformed 'defcustom' types. @@ -2772,7 +2773,7 @@ option. +++ *** 'where-is-internal' can now filter events marked as non key events. -If a command maps to a key binding like [some-event], and 'some-event' +If a command maps to a key binding like '[some-event]', and 'some-event' has a symbol plist containing a non-nil 'non-key-event' property, then that binding is ignored by 'where-is-internal'. commit 8434396fa362c6644ff23e1f48acace7b85ffe8f Author: Robert Pluim Date: Fri Jul 22 10:18:41 2022 +0200 Explain how to override Author with VC * CONTRIBUTE: Describe how to use Author header line and 'log-edit-setup-add-author'. diff --git a/CONTRIBUTE b/CONTRIBUTE index d624fe8524..94d757daaf 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -347,7 +347,10 @@ tests: If committing changes written by someone else, commit in their name, not yours. You can use 'git commit --author="AUTHOR"' to specify a -change's author. Note that the validity checks described in the +change's author. When using Emacs VC to commit, the author can be +specified in the log-edit buffer by adding an "Author: AUTHOR" header +line (set 'log-edit-setup-add-author' non-nil to have this header line +added automatically). Note that the validity checks described in the previous section are still applied, so you will have to correct any problems they uncover in the changes submitted by others. commit b9ac8c29aec90b31b044137e1e056daacd8fa1f2 Author: Robert Pluim Date: Fri Jul 22 10:14:45 2022 +0200 Improve terminal-live-p docstring * src/terminal.c (Fterminal_live_p): Explain what happens when the argument is nil. diff --git a/src/terminal.c b/src/terminal.c index 3674eccdbb..39ba3925b7 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -421,7 +421,8 @@ The terminal device is represented by its integer identifier. */) DEFUN ("terminal-live-p", Fterminal_live_p, Sterminal_live_p, 1, 1, 0, doc: /* Return non-nil if OBJECT is a terminal which has not been deleted. -Value is nil if OBJECT is not a live display terminal. +Value is nil if OBJECT is not a live display terminal. Uses the +terminal of the currently selected frame if OBJECT is nil. If object is a live display terminal, the return value indicates what sort of output terminal it uses. See the documentation of `framep' for possible return values. */) commit 0b4c81a1520aa126b1eab335e3601808c611a293 Author: Robert Pluim Date: Fri Jul 22 10:10:36 2022 +0200 * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): Fix grammar diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 4adc35bcb6..e0b786f015 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -87,7 +87,7 @@ ;; For hostname completion, information is retrieved from the zeroconf ;; daemon (for the "afp", "dav", "davs", and "sftp" methods). The ;; zeroconf daemon is pre-configured to discover services in the -;; "local" domain. If another domain shall be used for discovering +;; "local" domain. If another domain should be used for discovering ;; services, the user option `tramp-gvfs-zeroconf-domain' can be set ;; accordingly. @@ -949,7 +949,7 @@ The call will be traced by Tramp with trace level 6." "Current Tramp file name to be used, as vector. It is needed when D-Bus signals or errors arrive, because there is no information where to trace the message. -Globally, the value shall always be nil; it is bound where needed.") +The global value will always be nil; it is bound where needed.") (defun tramp-gvfs-dbus-event-error (event err) "Called when a D-Bus error message arrives, see `dbus-event-error-functions'." commit 51209fd735a0b1da641ae535490ded0259194646 Author: Eli Zaretskii Date: Fri Jul 22 10:58:59 2022 +0300 ; Improve doc strings of 2 outline-minor-mode options * lisp/outline.el (outline-minor-mode-use-buttons) (outline-minor-mode-buttons): Improve the doc strings. (Bug#56691) diff --git a/lisp/outline.el b/lisp/outline.el index 38a37fb74d..f6428db1a0 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -281,7 +281,8 @@ This option is only in effect when `outline-minor-mode-cycle' is non-nil." outline-5 outline-6 outline-7 outline-8]) (defcustom outline-minor-mode-use-buttons nil - "If non-nil, use clickable buttons on the headings. + "If non-nil, display clickable buttons on the headings. +These buttons can be used to hide and show the body under the heading. Note that this feature is not meant to be used in editing buffers (yet) -- that will be amended in a future version. @@ -294,7 +295,17 @@ buttons should look." (defcustom outline-minor-mode-buttons '(("▶️" "🔽" outline--valid-emoji-p) ("▶" "▼" outline--valid-char-p)) - "List of close/open pairs to use if using buttons." + "How to show open/close buttons on the headings. +Value should be a list of elements of the form (CLOSE OPEN TEST-FN), +where CLOSE and OPEN are strings to display as, respectively, the +close and open buttons, and TEST-FN is a function of one argument +which will be called with CLOSE or OPEN and should return non-nil if +the argument string can be displayed by the current frame's terminal. +The pair of buttons that will be actually used is the first pair +whose element in the list passes the test of TEST-FN for both the +CLOSE and OPEN strings. + +This is only used when `outline-minor-mode-use-buttons' is non-nil" :type 'sexp :version "29.1") commit f173028d156ae7edf08d15e1dbd36037e35068bc Author: Po Lu Date: Fri Jul 22 15:37:28 2022 +0800 Fix handling hscroll during drag-and-drop * lisp/x-dnd.el (x-dnd-hscroll-flags): Delete function. (x-dnd-get-modifiers, x-dnd-wheel-modifier-type): New functions. (x-dnd-mwheel-scroll): Use that to determine hscroll instead. * src/window.c (set_window_hscroll): Mark window as needing redisplay if the hscroll really changed. diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index a06563946c..fa045d563c 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -722,15 +722,27 @@ MODS is a single symbol, or a list of symbols such as `shift' or (setq mask (nth 2 virtual-modifiers))))) mask)) -(defun x-dnd-hscroll-flags () - "Return the event state of a button press that should result in hscroll. -Value is a mask of all the X modifier states that would normally -cause a button press event to perform horizontal scrolling." - (let ((i 0)) - (dolist (modifier mouse-wheel-scroll-amount) - (when (eq (cdr-safe modifier) 'hscroll) - (setq i (logior i (x-dnd-modifier-mask (car modifier)))))) - i)) +(defun x-dnd-get-modifiers () + "Obtain an X modifier mask containing all modifiers. +Value is an X modifier mask containing all modifiers that can +modify an Emacs keyboard or mouse event." + (let ((mods (x-get-modifier-masks)) + (mask 5)) ; ShiftMask | ControlMask + (dolist (mod mods) + (setq mask (logior mask mod))) + mask)) + +(defun x-dnd-wheel-modifier-type (flags) + "Return the modifier type of an X modifier mask. +FLAGS is the X modifier mask of a turn of the mouse wheel." + (let ((modifiers (x-dnd-get-modifiers))) + (catch 'type + (dolist (modifier mouse-wheel-scroll-amount) + (when (and (consp modifier) + (eq (x-dnd-modifier-mask (car modifier)) + (logand flags modifiers))) + (throw 'type (cdr modifier)))) + nil))) (defvar x-dnd-click-count nil "Alist of button numbers to click counters during drag-and-drop. @@ -760,19 +772,19 @@ Use MODIFIERS, an X modifier mask, to determine if any alternative operation (such as scrolling horizontally) should be taken. COUNT is the number of times in quick succession BUTTON has been pressed." - (let ((hscroll (not (zerop (logand modifiers - (x-dnd-hscroll-flags))))) - (amt (or (and (not mouse-wheel-progressive-speed) 1) - (* 1 count)))) + (let* ((type (x-dnd-wheel-modifier-type modifiers)) + (hscroll (eq type 'hscroll)) + (amt (or (and (not mouse-wheel-progressive-speed) 1) + (* 1 count)))) (unless (and (not mouse-wheel-tilt-scroll) (or (eq button 6) (eq button 7))) (let ((function (cond ((eq button 4) (if hscroll - mwheel-scroll-left-function + mwheel-scroll-right-function mwheel-scroll-down-function)) ((eq button 5) (if hscroll - mwheel-scroll-right-function + mwheel-scroll-left-function mwheel-scroll-up-function)) ((eq button 6) (if mouse-wheel-flip-direction diff --git a/src/window.c b/src/window.c index 8f88958558..3cd2f98a85 100644 --- a/src/window.c +++ b/src/window.c @@ -1275,7 +1275,10 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll) /* Prevent redisplay shortcuts when changing the hscroll. */ if (w->hscroll != new_hscroll) - XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true; + { + XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true; + wset_redisplay (w); + } w->hscroll = new_hscroll; w->suspend_auto_hscroll = true; commit 8f8373170f9da089caf823b321ce08ee7990f853 Author: Stefan Kangas Date: Thu Jul 21 10:42:24 2022 +0200 * lisp/progmodes/cperl-mode.el: Don't mention obsolete archive. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ae36789af8..04e4a62c60 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -32,11 +32,6 @@ ;; the MooseX::Declare CPAN module, as well as Perl 5.10 keyword ;; support. -;; The latest version is available from -;; https://github.com/jrockway/cperl-mode -;; -;; (perhaps in the moosex-declare branch) - ;; You can either fine-tune the bells and whistles of this mode or ;; bulk enable them by putting commit 25bc330a6da3e8f224289560aa59958f6b0f3148 Author: Eli Zaretskii Date: Thu Jul 21 10:18:30 2022 +0300 Make 'describe-function' say "byte-compiled" when appropriate * lisp/help-fns.el (help-fns-function-description-header): Say "byte-compiled" when describing byte-compiled functions. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index f78c6ab0df..6a7951d160 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -874,7 +874,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (aliased (format-message "an alias for `%s'" real-def)) ((subr-native-elisp-p def) - (concat beg "native compiled Lisp function")) + (concat beg "native-compiled Lisp function")) ((subrp def) (concat beg (if (eq 'unevalled (cdr (subr-arity def))) "special form" @@ -893,7 +893,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (macrop function)) (concat beg "Lisp macro")) ((byte-code-function-p def) - (concat beg "compiled Lisp function")) + (concat beg "byte-compiled Lisp function")) ((module-function-p def) (concat beg "module function")) ((eq (car-safe def) 'lambda) commit 2b31e667be95731d7e9ee328c8331eecf69b3831 Author: Eli Zaretskii Date: Thu Jul 21 09:53:45 2022 +0300 ;Improve documentation of locale-specific string comparison * doc/lispref/strings.texi (Text Comparison): Mention the Unicode collation rules and buffer-local case-tables. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index c9612e598a..89120575f5 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -564,11 +564,19 @@ equal with respect to collation rules. A collation rule is not only determined by the lexicographic order of the characters contained in @var{string1} and @var{string2}, but also further rules about relations between these characters. Usually, it is defined by the -@var{locale} environment Emacs is running with. - -For example, characters with different coding points but -the same meaning might be considered as equal, like different grave -accent Unicode characters: +@var{locale} environment Emacs is running with and by the Standard C +library against which Emacs was linked@footnote{ +For more information about collation rules and their locale +dependencies, see @uref{https://unicode.org/reports/tr10/, The Unicode +Collation Algorithm}. Some Standard C libraries, such as the +@acronym{GNU} C Library (a.k.a.@: @dfn{glibc}) implement large +portions of the Unicode Collation Algorithm and use the associated +locale data, Common Locale Data Repository, or @acronym{CLDR}. +}. + +For example, characters with different code points but the same +meaning, like different grave accent Unicode characters, might, in +some locales, be considered as equal: @example @group @@ -756,7 +764,8 @@ The strings are compared by the numeric values of their characters. For instance, @var{str1} is considered less than @var{str2} if its first differing character has a smaller numeric value. If @var{ignore-case} is non-@code{nil}, characters are converted to -upper-case before comparing them. Unibyte strings are converted to +upper-case, using the current buffer's case-table (@pxref{Case +Tables}), before comparing them. Unibyte strings are converted to multibyte for comparison (@pxref{Text Representations}), so that a unibyte string and its conversion to multibyte are always regarded as equal.