commit 4fa37dc426184811e39ce113f6af7f5b308f116b (HEAD, refs/remotes/origin/master) Merge: f09cf0efd6f ec00d292ec0 Author: Stefan Kangas Date: Mon Dec 5 06:30:21 2022 +0100 Merge from origin/emacs-29 ec00d292ec0 Improve treesit-fontify-with-override 4bcdb1cc65b Make killing a non-last client work the same no matter th... a27f61f6f48 Use the function 'window-system' on the tab-bar/tab-line ... 432b9655ae0 Restore font-lock-type-face for lisp mode &symbols commit f09cf0efd6f59c54f6bc776f1f09c7ea38f76a9c Merge: 9d5ec880b03 029988d4a51 Author: Stefan Kangas Date: Mon Dec 5 06:30:21 2022 +0100 ; Merge from origin/emacs-29 The following commit was skipped: 029988d4a51 Prevent a segfault when deleting a fullscreen frame on Ne... commit 9d5ec880b03eb0e779e4ceb0d447d924e0501401 Merge: 5be502a697c 3768b100777 Author: Stefan Kangas Date: Mon Dec 5 06:30:21 2022 +0100 Merge from origin/emacs-29 3768b100777 ; * lisp/pcomplete.el (pcomplete-allow-modifications): Fi... 84214578f5a Fix markup in ERC manual commit 5be502a697c4253270c9c3aa7536db239adc1572 Author: Sean Whitton Date: Sun Dec 4 15:56:35 2022 -0700 Improve passing user switches to Git log commands (bug#59414) * lisp/vc/vc-git.el (vc-git-log-switches): Revise docstring. (vc-git-shortlog-switches): New defcustom. (vc-git-print-log): Use vc-git-log-switches or vc-git-shortlog-switches depending on whether printing a shortlog. (vc-git-log-outgoing, vc-git-log-incoming): Use vc-git-shortlog-switches. (vc-git-log-search, vc-git-expanded-log-entry): Use vc-git-log-switches. * etc/NEWS: Document the new defcustom. diff --git a/etc/NEWS b/etc/NEWS index 9b8edde5155..8f5b17fb4af 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -41,6 +41,13 @@ connection. * Changes in Specialized Modes and Packages in Emacs 30.1 +** VC + +--- +*** New user option 'vc-git-shortlog-switches' +String or list of strings giving Git log switches for shortlogs, such +as 'C-x v L'. 'vc-git-log-switches' is no longer used for shortlogs. + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 38e9d5f9c91..59dfb6c1252 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -136,12 +136,19 @@ vc-git-annotate-switches ;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable (lambda (switches) (equal switches "-w"))) (defcustom vc-git-log-switches nil - "String or list of strings specifying switches for Git log under VC." + "String or list of strings giving Git log switches for non-shortlogs." :type '(choice (const :tag "None" nil) (string :tag "Argument String") (repeat :tag "Argument List" :value ("") string)) :version "28.1") +(defcustom vc-git-shortlog-switches nil + "String or list of strings giving Git log switches for shortlogs." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "30.1") + (defcustom vc-git-resolve-conflicts t "When non-nil, mark conflicted file as resolved upon saving. That is performed after all conflict markers in it have been @@ -1325,7 +1332,8 @@ vc-git-print-log ,(format "--pretty=tformat:%s" (car vc-git-root-log-format)) "--abbrev-commit")) - (ensure-list vc-git-log-switches) + (ensure-list + (if shortlog vc-git-shortlog-switches vc-git-log-switches)) (when (numberp limit) (list "-n" (format "%s" limit))) (when start-revision @@ -1340,16 +1348,16 @@ vc-git-print-log (defun vc-git-log-outgoing (buffer remote-location) (vc-setup-buffer buffer) - (vc-git-command - buffer 'async nil - "log" - "--no-color" "--graph" "--decorate" "--date=short" - (format "--pretty=tformat:%s" (car vc-git-root-log-format)) - "--abbrev-commit" - (concat (if (string= remote-location "") - "@{upstream}" - remote-location) - "..HEAD"))) + (apply #'vc-git-command buffer 'async nil + `("log" + "--no-color" "--graph" "--decorate" "--date=short" + ,(format "--pretty=tformat:%s" (car vc-git-root-log-format)) + "--abbrev-commit" + ,@(ensure-list vc-git-shortlog-switches) + ,(concat (if (string= remote-location "") + "@{upstream}" + remote-location) + "..HEAD")))) (defun vc-git-log-incoming (buffer remote-location) (vc-setup-buffer buffer) @@ -1359,15 +1367,15 @@ vc-git-log-incoming ;; so remove everything except a repository name. (replace-regexp-in-string "/.*" "" remote-location))) - (vc-git-command - buffer 'async nil - "log" - "--no-color" "--graph" "--decorate" "--date=short" - (format "--pretty=tformat:%s" (car vc-git-root-log-format)) - "--abbrev-commit" - (concat "HEAD.." (if (string= remote-location "") - "@{upstream}" - remote-location)))) + (apply #'vc-git-command buffer 'async nil + `("log" + "--no-color" "--graph" "--decorate" "--date=short" + ,(format "--pretty=tformat:%s" (car vc-git-root-log-format)) + "--abbrev-commit" + ,@(ensure-list vc-git-shortlog-switches) + ,(concat "HEAD.." (if (string= remote-location "") + "@{upstream}" + remote-location))))) (defun vc-git-log-search (buffer pattern) "Search the log of changes for PATTERN and output results into BUFFER. @@ -1378,6 +1386,7 @@ vc-git-log-search With a prefix argument, ask for a command to run that will output log entries." (let ((args `("log" "--no-color" "-i" + ,@(ensure-list vc-git-log-switches) ,(format "--grep=%s" (or pattern ""))))) (when current-prefix-arg (setq args (cdr (split-string @@ -1462,7 +1471,11 @@ vc-git-show-log-entry (defun vc-git-expanded-log-entry (revision) (with-temp-buffer - (apply #'vc-git-command t nil nil (list "log" revision "-1" "--no-color" "--")) + (apply #'vc-git-command t nil nil + `("log" + ,revision + "-1" "--no-color" ,@(ensure-list vc-git-log-switches) + "--")) (goto-char (point-min)) (unless (eobp) ;; Indent the expanded log entry. commit ec00d292ec02f34a0d879767c6737fadbe24ce20 (refs/remotes/origin/emacs-29) Author: Yuan Fu Date: Sun Dec 4 00:22:28 2022 -0800 Improve treesit-fontify-with-override This also fixes fontification problem with c-ts-mode--fontify-defun. Now treesit-fontify-with-override clips the fontification region for the user, so no need for (max start node-start) shenanigans anymore. More importantly it doesn't fontify unless the region between node-start and node-end intersects with the region between start and end, which fixes the problem with c-ts-mode--fontify-defun. * lisp/treesit.el (treesit-fontify-with-override): Add optional parameter BOUND-START and BOUND-END. Wrap the function body in a when-form. * lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator) (c-ts-mode--fontify-variable) (c-ts-mode--fontify-defun) (c-ts-fontify-error) * lisp/progmodes/js.el (js--fontify-template-string) * lisp/progmodes/python.el (python--treesit-fontify-string): Use the new signature. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index a8189a0f3da..1bd093cfa2d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -360,12 +360,11 @@ c-ts-mode--fontify-declarator override start end args)) ((or "identifier" "field_identifier") (treesit-fontify-with-override - (max (treesit-node-start node) start) - (min (treesit-node-end node) end) + (treesit-node-start node) (treesit-node-end node) (pcase (treesit-node-type (treesit-node-parent node)) ("function_declarator" 'font-lock-function-name-face) (_ 'font-lock-variable-name-face)) - override)))) + override start end)))) (defun c-ts-mode--fontify-variable (node override start end &rest _) "Fontify an identifier node. @@ -375,10 +374,8 @@ c-ts-mode--fontify-variable (treesit-node-parent node)) "call_expression")) (treesit-fontify-with-override - (max (treesit-node-start node) start) - (min (treesit-node-end node) end) - 'font-lock-variable-name-face - override))) + (treesit-node-start node) (treesit-node-end node) + 'font-lock-variable-name-face override start end))) (defun c-ts-mode--fontify-defun (node override start end &rest _) "Correctly fontify the DEFUN macro. @@ -405,21 +402,19 @@ c-ts-mode--fontify-defun (when (equal (treesit-node-text node t) ":") (treesit-fontify-with-override (treesit-node-start node) (treesit-node-end node) - 'default override))) + 'default override start end))) ;; Fix the parameter list. (while arg-list-2 (let ((type (and arg-list-2 (pop arg-list-2))) (arg (and arg-list-2 (pop arg-list-2)))) (when type (treesit-fontify-with-override - (max start (treesit-node-start type)) - (min end (treesit-node-end type)) - 'font-lock-type-face override)) + (treesit-node-start type) (treesit-node-end type) + 'font-lock-type-face override start end)) (when arg (treesit-fontify-with-override - (max start (treesit-node-start arg)) - (min end (treesit-node-end arg)) - 'default override)))))) + (treesit-node-start arg) (treesit-node-end arg) + 'default override start end)))))) (defun c-ts-fontify-error (node override start end &rest _) "Fontify the error nodes. @@ -428,8 +423,7 @@ c-ts-fontify-error (let ((parent (treesit-node-parent node)) (child (treesit-node-child node 0))) (treesit-fontify-with-override - (max start (treesit-node-start node)) - (min end (treesit-node-end node)) + (treesit-node-start node) (treesit-node-end node) (cond ;; This matches the case MACRO(struct a, b, c) ;; where struct is seen as error. @@ -439,7 +433,7 @@ c-ts-fontify-error '("struct" "long" "short" "enum" "union"))) 'font-lock-keyword-face) (t 'font-lock-warning-face)) - override))) + override start end))) (defun c-ts-mode--imenu-1 (node) "Helper for `c-ts-mode--imenu'. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 389096147ac..90ab7cc924b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3647,7 +3647,7 @@ js--fontify-template-string (setq font-beg (max start font-beg)) (when (< font-beg end) (treesit-fontify-with-override - font-beg font-end 'font-lock-string-face override))) + font-beg font-end 'font-lock-string-face override start end))) (setq font-beg (treesit-node-end child) child (treesit-node-next-sibling child))))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 4fc5d24e2fb..ebee703499a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1069,7 +1069,7 @@ python--treesit-fontify-string (when (eq (char-after string-beg) ?f) (cl-incf string-beg)) (treesit-fontify-with-override - (max start string-beg) (min end string-end) face override))) + string-beg string-end face override start end))) (defvar python--treesit-settings (treesit-font-lock-rules diff --git a/lisp/treesit.el b/lisp/treesit.el index f3c03daf7e0..eee6eee0c7f 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -774,25 +774,35 @@ treesit-font-lock-recompute-features ((memq feature remove-list) nil) (t current-value)))))) -(defun treesit-fontify-with-override (start end face override) +(defun treesit-fontify-with-override + (start end face override &optional bound-start bound-end) "Apply FACE to the region between START and END. OVERRIDE can be nil, t, `append', `prepend', or `keep'. -See `treesit-font-lock-rules' for their semantic." - (pcase override - ('nil (unless (text-property-not-all - start end 'face nil) - (put-text-property start end 'face face))) - ('t (put-text-property start end 'face face)) - ('append (font-lock-append-text-property +See `treesit-font-lock-rules' for their semantic. + +If BOUND-START and BOUND-END are non-nil, only fontify the region +in between them." + (when (or (null bound-start) (null bound-end) + (and bound-start bound-end + (<= bound-start end) + (>= bound-end start))) + (when (and bound-start bound-end) + (setq start (max bound-start start) + end (min bound-end end))) + (pcase override + ('nil (unless (text-property-not-all start end 'face nil) + (put-text-property start end 'face face))) + ('t (put-text-property start end 'face face)) + ('append (font-lock-append-text-property + start end 'face face)) + ('prepend (font-lock-prepend-text-property + start end 'face face)) + ('keep (font-lock-fillin-text-property start end 'face face)) - ('prepend (font-lock-prepend-text-property - start end 'face face)) - ('keep (font-lock-fillin-text-property - start end 'face face)) - (_ (signal 'treesit-font-lock-error - (list - "Unrecognized value of :override option" - override))))) + (_ (signal 'treesit-font-lock-error + (list + "Unrecognized value of :override option" + override)))))) (defun treesit--set-nonsticky (start end sym &optional remove) "Set `rear-nonsticky' property between START and END. commit 4bcdb1cc65bf779b6479f99a7aa767ab83b3bae1 Author: Jim Porter Date: Fri Dec 2 12:14:50 2022 -0800 Make killing a non-last client work the same no matter the auto-stop setting Previously, if 'server-stop-automatically' was configured for 'kill-terminal' or 'delete-frame', killing a client via 'save-buffers-kill-terminal' wouldn't prompt about the saving files in the client's buffer list (as it does when not using those settings). This change ensures that those settings only apply when killing the last client, as described in the manual (bug#51993). * lisp/server.el (server-save-buffers-kill-terminal): Handle 'server-stop-automatically' behavior in this function, rather than calling 'server-stop-automatically--handle-delete-frame'. diff --git a/lisp/server.el b/lisp/server.el index 1b027f88ce6..7e713eaecde 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1780,29 +1780,43 @@ server-save-buffers-kill-terminal If emacsclient was started with a list of filenames to edit, then only these files will be asked to be saved." - (if server-stop-automatically - (server-stop-automatically--handle-delete-frame (selected-frame)) - (let ((proc (frame-parameter nil 'client))) - (cond ((eq proc 'nowait) - ;; Nowait frames have no client buffer list. - (if (cdr (frame-list)) - (progn (save-some-buffers arg) - (delete-frame)) - ;; If we're the last frame standing, kill Emacs. - (save-buffers-kill-emacs arg))) - ((processp proc) - (let ((buffers (process-get proc 'buffers))) - (save-some-buffers - arg (if buffers - ;; Only files from emacsclient file list. - (lambda () (memq (current-buffer) buffers)) - ;; No emacsclient file list: don't override - ;; `save-some-buffers-default-predicate' (unless - ;; ARG is non-nil), since we're not killing - ;; Emacs (unlike `save-buffers-kill-emacs'). - (and arg t))) - (server-delete-client proc))) - (t (error "Invalid client frame")))))) + (let ((proc (frame-parameter nil 'client))) + (cond ((eq proc 'nowait) + ;; Nowait frames have no client buffer list. + (if (length> (frame-list) (if server-stop-automatically 2 1)) + ;; If there are any other frames, only delete this one. + ;; When `server-stop-automatically' is set, don't count + ;; the daemon frame. + (progn (save-some-buffers arg) + (delete-frame)) + ;; If we're the last frame standing, kill Emacs. + (save-buffers-kill-emacs arg))) + ((processp proc) + (if (or (not server-stop-automatically) + (length> server-clients 1) + (seq-some + (lambda (frame) + (when-let ((p (frame-parameter frame 'client))) + (not (eq proc p)))) + (frame-list))) + ;; If `server-stop-automatically' is not enabled, there + ;; are any other clients, or there are frames not owned + ;; by the current client (e.g. `nowait' frames), then + ;; we just want to delete this client. + (let ((buffers (process-get proc 'buffers))) + (save-some-buffers + arg (if buffers + ;; Only files from emacsclient file list. + (lambda () (memq (current-buffer) buffers)) + ;; No emacsclient file list: don't override + ;; `save-some-buffers-default-predicate' (unless + ;; ARG is non-nil), since we're not killing + ;; Emacs (unlike `save-buffers-kill-emacs'). + (and arg t))) + (server-delete-client proc)) + ;; Otherwise, we want to kill Emacs. + (save-buffers-kill-emacs arg))) + (t (error "Invalid client frame"))))) (defun server-stop-automatically--handle-delete-frame (frame) "Handle deletion of FRAME when `server-stop-automatically' is used." commit a27f61f6f48762b43810558b38cf6a6ab1ea7673 Author: Juri Linkov Date: Sun Dec 4 21:30:34 2022 +0200 Use the function 'window-system' on the tab-bar/tab-line (bug#59620) * lisp/tab-bar.el (tab-bar-separator) (tab-bar-format-align-right, tab-bar-auto-width): * lisp/tab-line.el (tab-line-format-template): Replace the variable 'window-system' with the function call '(window-system)'. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index dcda67e9c5b..162e63fe230 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -586,7 +586,7 @@ tab-bar-separator (defun tab-bar-separator () "Separator between tabs." - (or tab-bar-separator (if window-system " " "|"))) + (or tab-bar-separator (if (window-system) " " "|"))) (defcustom tab-bar-tab-name-function #'tab-bar-tab-name-current @@ -939,7 +939,7 @@ tab-bar-format-align-right (str (propertize " " 'display ;; The `right' spec doesn't work on TTY frames ;; when windows are split horizontally (bug#59620) - (if window-system + (if (window-system) `(space :align-to (- right (,hpos))) `(space :align-to (,(- (frame-inner-width) hpos))))))) `((align-right menu-item ,str ignore)))) @@ -1060,11 +1060,11 @@ tab-bar-auto-width (string-pixel-width non-tabs)) (length tabs))) (when tab-bar-auto-width-min - (setq width (max width (if window-system + (setq width (max width (if (window-system) (nth 0 tab-bar-auto-width-min) (nth 1 tab-bar-auto-width-min))))) (when tab-bar-auto-width-max - (setq width (min width (if window-system + (setq width (min width (if (window-system) (nth 0 tab-bar-auto-width-max) (nth 1 tab-bar-auto-width-max))))) (dolist (item tabs) diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 99a785ee3e3..c4e4a688720 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -504,7 +504,7 @@ tab-line-tab-name-format-default (defun tab-line-format-template (tabs) "Template of the format for displaying tab line for selected window. This is used by `tab-line-format'." - (let* ((separator (or tab-line-separator (if window-system " " "|"))) + (let* ((separator (or tab-line-separator (if (window-system) " " "|"))) (hscroll (window-parameter nil 'tab-line-hscroll)) (strings (mapcar commit 432b9655ae0f5426760cf99929384c689d7dfb82 Author: Tom Gillespie Date: Sat Dec 3 22:41:15 2022 -0800 Restore font-lock-type-face for lisp mode &symbols * lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2) (lisp-el-font-lock-keywords-2): Restore use of type face instead of builtin face for &symbol keywords. This fixes what appears to be a copy paste error that changed the face for common lisp and emacs lisp &symbol style keywords that was introduced in commit a498e5f83 by restoring the type face to font-lock-type-face as consistent with the comments. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 7e39a77aed5..bf879158188 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -514,7 +514,7 @@ lisp-mode--search-key (0 font-lock-builtin-face)) ;; ELisp and CLisp `&' keywords as types. (,(lambda (bound) (lisp-mode--search-key "&" bound)) - (0 font-lock-builtin-face)) + (0 font-lock-type-face)) ;; ELisp regexp grouping constructs (,(lambda (bound) (catch 'found @@ -567,7 +567,7 @@ lisp-mode--search-key (0 font-lock-builtin-face)) ;; ELisp and CLisp `&' keywords as types. (,(lambda (bound) (lisp-mode--search-key "&" bound)) - (0 font-lock-builtin-face)) + (0 font-lock-type-face)) ;; ELisp regexp grouping constructs ;; This is too general -- rms. ;; A user complained that he has functions whose names start with `do' commit 3e00e50ee3d54537b8390b8d386387d01ae7553d Author: Po Lu Date: Sun Dec 4 21:54:52 2022 +0800 Fix potential crash deselecting for property change notifications * src/xselect.c (x_cancel_selection_transfer): Catch errors around XSelectInput. diff --git a/src/xselect.c b/src/xselect.c index 120a5a163e2..121b17df1b0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -794,8 +794,16 @@ x_cancel_selection_transfer (struct transfer *transfer) transfer->requestor) /* This can be called from x_delete_display. */ && transfer->dpyinfo->display) - XSelectInput (transfer->dpyinfo->display, - transfer->requestor, NoEventMask); + { + /* Ignore errors generated by the change window request in case + the window has gone away. */ + block_input (); + x_ignore_errors_for_next_request (transfer->dpyinfo); + XSelectInput (transfer->dpyinfo->display, + transfer->requestor, NoEventMask); + x_stop_ignoring_errors (transfer->dpyinfo); + unblock_input (); + } cancel_atimer (transfer->timeout); xfree (transfer); commit 029988d4a518b9b255a15e2aae3a2ad6565db47d Author: Kai Ma Date: Sat Dec 3 18:17:26 2022 +0800 Prevent a segfault when deleting a fullscreen frame on NextStep. * nsterm.m ([EmacsView resetCursorRects:]): Be defensive when accessing FRAME_OUTPUT_DATA. [resetCursorRects:] can be called from the event loop after the frame is deleted. When this happens, emacsframe is NULL. This means there is an underlying leak of the EmacsView object! (Bug#59794) Do not merge to master. Copyright-paperwork-exempt: yes diff --git a/src/nsterm.m b/src/nsterm.m index 507f2a9e7da..c09f743ec7f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6703,8 +6703,16 @@ - (BOOL)acceptsFirstResponder - (void)resetCursorRects { - NSRect visible = [self visibleRect]; - NSCursor *currentCursor = FRAME_POINTER_TYPE (emacsframe); + NSRect visible; + NSCursor *currentCursor; + + /* On macOS 13, [resetCursorRects:] could be called even after the + window is closed. */ + if (! emacsframe || ! FRAME_OUTPUT_DATA (emacsframe)) + return; + + visible = [self visibleRect]; + currentCursor = FRAME_POINTER_TYPE (emacsframe); NSTRACE ("[EmacsView resetCursorRects]"); if (currentCursor == nil) commit a51743dbcb793d1c02f1f40b107e752c2a095ab0 Author: Manuel Giraud Date: Sat Dec 3 22:47:02 2022 +0100 Make a boxed menu bar have a shadow at its right end (bug#59778) * src/xdisp.c (display_menu_bar) [HAVE_X_WINDOWS]: Make a boxed menu bar have a shadow at its right end in non-toolkit X builds. diff --git a/src/xdisp.c b/src/xdisp.c index b7333dc1ee6..4e087bc39be 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -26312,9 +26312,8 @@ display_menu_bar (struct window *w) it.first_visible_x = 0; it.last_visible_x = FRAME_PIXEL_WIDTH (f); #elif defined (HAVE_X_WINDOWS) /* X without toolkit. */ - struct window *menu_window; - - menu_window = NULL; + struct window *menu_window = NULL; + struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); if (FRAME_WINDOW_P (f)) { @@ -26324,8 +26323,6 @@ display_menu_bar (struct window *w) init_iterator (&it, menu_window, -1, -1, menu_window->desired_matrix->rows, MENU_FACE_ID); - it.first_visible_x = 0; - it.last_visible_x = FRAME_PIXEL_WIDTH (f); } else #endif /* not USE_X_TOOLKIT and not USE_GTK */ @@ -26379,8 +26376,31 @@ display_menu_bar (struct window *w) /* Compute the total height of the lines. */ compute_line_metrics (&it); + it.glyph_row->full_width_p = true; + it.glyph_row->continued_p = false; + it.glyph_row->truncated_on_left_p = false; + it.glyph_row->truncated_on_right_p = false; #if defined (HAVE_X_WINDOWS) && !defined (USE_X_TOOLKIT) && !defined (USE_GTK) + /* Make a 3D menu bar have a shadow at its right end. */ + extend_face_to_end_of_line (&it); + if (face->box != FACE_NO_BOX) + { + struct glyph *last = (it.glyph_row->glyphs[TEXT_AREA] + + it.glyph_row->used[TEXT_AREA] - 1); + int box_thickness = face->box_vertical_line_width; + last->right_box_line_p = true; + /* Add back the space for the right box line we subtracted in + init_iterator, since the right_box_line_p flag will make the + glyph wider. We actually add only as much space as is + available for the last glyph of the menu bar and whatever + space is left beyond it, since that glyph could be only + partially visible. */ + if (box_thickness > 0) + last->pixel_width += max (0, (box_thickness + - (it.current_x - it.last_visible_x))); + } + /* With the non-toolkit version, modify the menu bar window height accordingly. */ if (FRAME_WINDOW_P (it.f) && menu_window) commit 3768b1007775d58c3cadb1b3198209e71afefc52 Author: Eli Zaretskii Date: Sun Dec 4 14:42:07 2022 +0200 ; * lisp/pcomplete.el (pcomplete-allow-modifications): Fix a typo. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index ef286b70fe0..8be026b5a82 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -193,7 +193,7 @@ pcomplete-allow-modifications "If non-nil, allow effects in `pcomplete-parse-arguments-function'. For the `pcomplete' command, it was common for functions in `pcomplete-parse-arguments-function' to make modifications to the -buffer, like expanding variables are such. +buffer, like expanding variables and such. For `completion-at-point-functions', this is not an option any more, so this variable is used to tell `pcomplete-parse-arguments-function' whether it can do the modifications like it used to, or whether commit 84214578f5a2ff0d45312d9385442583f6877fb5 Author: Eli Zaretskii Date: Sun Dec 4 14:31:50 2022 +0200 Fix markup in ERC manual * doc/misc/erc.texi (SASL): Use @table instead of simulating it with @indentedblock. Fix markup. (Bug#59815) diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index a8d1dd78235..5ad739a77e1 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -983,20 +983,17 @@ SASL @defopt erc-sasl-mechanism The name of an SASL subprotocol type as a @emph{lowercase} symbol. +The value can be one of the following: -@var{plain} and @var{scram} (``password-based''): - -@indentedblock +@table @asis +@item @code{plain} and @code{scram} (``password-based'') Here, ``password'' refers to your account password, which is usually your @samp{NickServ} password. To make this work, customize @code{erc-sasl-user} and @code{erc-sasl-password} or specify the @code{:user} and @code{:password} keyword arguments when invoking @code{erc-tls}. Note that @code{:user} cannot be given interactively. -@end indentedblock - -@var{external} (via Client TLS Certificate): -@indentedblock +@item @code{external} (via Client TLS Certificate) This works in conjunction with the @code{:client-certificate} keyword offered by @code{erc-tls}. Just ensure you've registered your fingerprint with the network beforehand. The fingerprint is usually a @@ -1018,11 +1015,8 @@ SASL the specific application or service, there's a remote chance your server has something else in mind. @end enumerate -@end indentedblock -@var{ecdsa-nist256p-challenge}: - -@indentedblock +@item @code{ecdsa-nist256p-challenge} This mechanism is quite complicated and currently requires the external @samp{openssl} executable, so please use something else if at all possible. Ignoring that, specify your key file (e.g., @@ -1036,7 +1030,7 @@ SASL @end example (You may be able to omit the @samp{property} subcommand.) -@end indentedblock +@end table @end defopt commit f96a9e10b108237e4aa192eca962ceb0ca07e431 Author: Po Lu Date: Sun Dec 4 20:01:31 2022 +0800 Make Emacs build with Xfixes support on old versions of the library * src/xterm.c (xfixes_toggle_visible_pointer): (x_toggle_visible_pointer): (XTtoggle_invisible_pointer, x_term_init): Disable code requiring fixes 4.0 or later when the fixes library is older. * src/xterm.h: Define missing types needed by other extensions when the fixes library is too old. * configure.ac: Allow building with any version of the Xfixes extension library. diff --git a/configure.ac b/configure.ac index b5867cf839e..9f431fc78b2 100644 --- a/configure.ac +++ b/configure.ac @@ -4704,7 +4704,7 @@ AC_DEFUN ### Use Xfixes (-lXfixes) if available HAVE_XFIXES=no if test "${HAVE_X11}" = "yes"; then - XFIXES_REQUIRED=4.0.0 + XFIXES_REQUIRED=1.0.0 XFIXES_MODULES="xfixes >= $XFIXES_REQUIRED" EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES]) if test $HAVE_XFIXES = no; then diff --git a/src/xterm.c b/src/xterm.c index 37b907ee9d2..d57830163cb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11578,7 +11578,7 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame) x_frame_rehighlight (dpyinfo); } -#ifdef HAVE_XFIXES +#if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 /* True if the display in DPYINFO supports a version of Xfixes sufficient for pointer blanking. */ @@ -11590,11 +11590,12 @@ x_fixes_pointer_blanking_supported (struct x_display_info *dpyinfo) && dpyinfo->xfixes_major >= 4); } -#endif /* HAVE_XFIXES */ +#endif /* HAVE_XFIXES && XFIXES_VERSION >= 40000 */ /* Toggle mouse pointer visibility on frame F using the XFixes extension. */ -#ifdef HAVE_XFIXES +#if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 + static void xfixes_toggle_visible_pointer (struct frame *f, bool invisible) @@ -11605,6 +11606,7 @@ xfixes_toggle_visible_pointer (struct frame *f, bool invisible) XFixesShowCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); f->pointer_invisible = invisible; } + #endif /* HAVE_XFIXES */ /* Create invisible cursor on the X display referred by DPYINFO. */ @@ -11653,7 +11655,7 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) if (dpyinfo->invisible_cursor == None) dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo); -#ifndef HAVE_XFIXES +#if !defined HAVE_XFIXES || XFIXES_VERSION < 40000 if (dpyinfo->invisible_cursor == None) invisible = false; #else @@ -11686,7 +11688,7 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) XTtoggle_invisible_pointer (struct frame *f, bool invisible) { block_input (); -#ifdef HAVE_XFIXES +#if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 if (FRAME_DISPLAY_INFO (f)->fixes_pointer_blanking && x_fixes_pointer_blanking_supported (FRAME_DISPLAY_INFO (f))) xfixes_toggle_visible_pointer (f, invisible); @@ -30327,7 +30329,7 @@ #define NUM_ARGV 10 1, 0, 1); dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo); -#ifdef HAVE_XFIXES +#if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 dpyinfo->fixes_pointer_blanking = egetenv ("EMACS_XFIXES"); #endif diff --git a/src/xterm.h b/src/xterm.h index 0b227cbdc09..fae40930e9b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -21,6 +21,22 @@ #define XTERM_H #include + +#ifdef HAVE_XFIXES +#include + +#if defined HAVE_XINPUT2 && XFIXES_MAJOR < 5 +/* XI2 headers need PointerBarrier, which is not defined in old + versions of the fixes library. Define that type here. */ +typedef XID PointerBarrier; +#endif +#if defined HAVE_XCOMPOSITE && XFIXES_MAJOR < 2 +/* Recent Composite headers need XserverRegion, which is not defined + in old versions of the fixes library. Define that type here. */ +typedef XID XserverRegion; +#endif +#endif + #include /* Include Xutil.h after keysym.h to work around a bug that prevents @@ -406,7 +422,7 @@ #define X_INVALID_WINDOW 0xffffffff Unused if this display supports Xfixes extension. */ Cursor invisible_cursor; -#ifdef HAVE_XFIXES +#if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 /* Whether or not to use Xfixes for pointer blanking. */ bool fixes_pointer_blanking; #endif