commit 9394027fd64b26f9a7b9db5128180638d98af13a (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed May 25 14:54:47 2022 +0800 Improve atom interning in `x-change-window-property' * src/xfns.c (Fx_change_window_property): Improve doc string and use `x_intern_cached_atom'. * src/xterm.c (x_intern_cached_atom): New argument `predefined_only'. All callers changed. * src/xterm.h: Update prototypes. diff --git a/src/xfns.c b/src/xfns.c index 912af0fa5a..47321a1d6b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7246,19 +7246,28 @@ converted to an atom and the value of the atom is used. If an element is a cons, it is converted to a 32 bit number where the car is the 16 top bits and the cdr is the lower 16 bits. -FRAME nil or omitted means use the selected frame. -If TYPE is given and non-nil, it is the name of the type of VALUE. - If TYPE is not given or nil, the type is STRING. -FORMAT gives the size in bits of each element if VALUE is a list. - It must be one of 8, 16 or 32. - If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. -If OUTER-P is non-nil, the property is changed for the outer X window of - FRAME. Default is to change on the edit X window. -If WINDOW-ID is non-nil, change the property of that window instead - of FRAME's X window; the number 0 denotes the root window. This argument - is separate from FRAME because window IDs are not unique across X - displays or screens on the same display, so FRAME provides context - for the window ID. */) +FRAME nil or omitted means use the selected frame. If TYPE is given +and non-nil, it is the name of the type of VALUE. If TYPE is not +given or nil, the type is STRING. + +FORMAT gives the size in bits of each element if VALUE is a list. It +must be one of 8, 16 or 32. + +If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to +8. If OUTER-P is non-nil, the property is changed for the outer X +window of FRAME. Default is to change on the edit X window. + +If WINDOW-ID is non-nil, change the property of that window instead of +FRAME's X window; the number 0 denotes the root window. This argument +is separate from FRAME because window IDs are not unique across X +displays or screens on the same display, so FRAME provides context for +the window ID. + +If VALUE is a string and FORMAT is 32, then the format of VALUE is +system-specific. VALUE must contain unsigned integer data in native +endian-ness in multiples of the size of the C type 'long': the low 32 +bits of each such number are used as the value of each element of the +property. */) (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p, Lisp_Object window_id) @@ -7271,6 +7280,8 @@ If WINDOW-ID is non-nil, change the property of that window instead int nelements; Window target_window; #ifdef USE_XCB + bool intern_prop; + bool intern_target; xcb_intern_atom_cookie_t prop_atom_cookie; xcb_intern_atom_cookie_t target_type_cookie; xcb_intern_atom_reply_t *reply; @@ -7341,41 +7352,62 @@ If WINDOW-ID is non-nil, change the property of that window instead block_input (); #ifndef USE_XCB - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (prop), false); if (! NILP (type)) { CHECK_STRING (type); - target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); + target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (type), false); } #else rc = true; - prop_atom_cookie - = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection, - 0, SBYTES (prop), SSDATA (prop)); + intern_target = true; + intern_prop = true; + + prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (prop), true); + + if (prop_atom != None) + intern_prop = false; + else + prop_atom_cookie + = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection, + 0, SBYTES (prop), SSDATA (prop)); if (!NILP (type)) { CHECK_STRING (type); - target_type_cookie - = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection, - 0, SBYTES (type), SSDATA (type)); - } - reply = xcb_intern_atom_reply (FRAME_DISPLAY_INFO (f)->xcb_connection, - prop_atom_cookie, &generic_error); + target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (type), true); - if (reply) - { - prop_atom = (Atom) reply->atom; - free (reply); + if (target_type) + intern_target = false; + else + target_type_cookie + = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection, + 0, SBYTES (type), SSDATA (type)); } - else + + if (intern_prop) { - free (generic_error); - rc = false; + reply = xcb_intern_atom_reply (FRAME_DISPLAY_INFO (f)->xcb_connection, + prop_atom_cookie, &generic_error); + + if (reply) + { + prop_atom = (Atom) reply->atom; + free (reply); + } + else + { + free (generic_error); + rc = false; + } } - if (!NILP (type)) + if (!NILP (type) && intern_target) { reply = xcb_intern_atom_reply (FRAME_DISPLAY_INFO (f)->xcb_connection, target_type_cookie, &generic_error); @@ -7439,7 +7471,7 @@ Value is PROP. */) block_input (); prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), - SSDATA (prop)); + SSDATA (prop), false); x_catch_errors (FRAME_X_DISPLAY (f)); XDeleteProperty (FRAME_X_DISPLAY (f), target_window, prop_atom); @@ -7575,11 +7607,11 @@ if PROP has no value of TYPE (always a string in the MS Windows case). */) target_type = AnyPropertyType; else target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), - SSDATA (type)); + SSDATA (type), false); } prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), - SSDATA (prop)); + SSDATA (prop), false); prop_value = x_window_property_intern (f, target_window, prop_atom, @@ -7651,7 +7683,7 @@ Otherwise, the return value is a vector with the following fields: x_catch_errors (FRAME_X_DISPLAY (f)); prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), - SSDATA (prop)); + SSDATA (prop), false); rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, prop_atom, 0, 0, False, AnyPropertyType, &actual_type, &actual_format, &actual_size, diff --git a/src/xterm.c b/src/xterm.c index 5c8221201b..ae2f4528af 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23599,10 +23599,11 @@ x_destroy_window (struct frame *f) } /* Intern NAME in DPYINFO, but check to see if the atom was already - interned, and use that instead. */ + interned, and use that instead. If PREDEFINED_ONLY, return None if + the atom was not already interned at connection setup. */ Atom x_intern_cached_atom (struct x_display_info *dpyinfo, - const char *name) + const char *name, bool predefined_only) { int i; char *ptr; @@ -23649,6 +23650,9 @@ x_intern_cached_atom (struct x_display_info *dpyinfo, } } + if (predefined_only) + return None; + return XInternAtom (dpyinfo->display, name, False); } diff --git a/src/xterm.h b/src/xterm.h index 5780f88bbc..fba775d96b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1536,7 +1536,8 @@ extern Lisp_Object x_timestamp_for_selection (struct x_display_info *, Lisp_Object); extern void x_set_pending_dnd_time (Time); extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object); -extern Atom x_intern_cached_atom (struct x_display_info *, const char *); +extern Atom x_intern_cached_atom (struct x_display_info *, const char *, + bool); #ifdef USE_GTK extern bool xg_set_icon (struct frame *, Lisp_Object); commit 822350d1984bf478becee57e8eede297ac3753d0 Author: Po Lu Date: Wed May 25 02:17:46 2022 +0000 Fix cursor color adjustment on Haiku * src/haikufns.c (haiku_set_foreground_color): Maybe set cursor color correctly if it was equal to the old foreground color. diff --git a/src/haikufns.c b/src/haikufns.c index a08b43879e..cf64eff702 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -639,14 +639,8 @@ haiku_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval if (FRAME_HAIKU_WINDOW (f)) { - if (output->cursor_color.pixel == old_fg) - { - output->cursor_color.pixel = old_fg; - output->cursor_color.red = RED_FROM_ULONG (old_fg); - output->cursor_color.green = GREEN_FROM_ULONG (old_fg); - output->cursor_color.blue = BLUE_FROM_ULONG (old_fg); - } + haiku_query_color (fg, &output->cursor_color); update_face_from_frame_parameter (f, Qforeground_color, arg); commit abd3411827d77edee6f2a38d9fc1c3a61fba88ed Author: Lars Ingebrigtsen Date: Wed May 25 03:50:36 2022 +0200 Don't have edebug bug out if C-x is rebound * lisp/emacs-lisp/edebug.el (edebug-global-prefix): Don't bug out if C-x has been rebound (bug#55607). diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index f350aef8fb..9dc5a1315e 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3865,7 +3865,10 @@ be installed in `emacs-lisp-mode-map'.") (define-obsolete-variable-alias 'global-edebug-prefix 'edebug-global-prefix "28.1") -(defvar edebug-global-prefix "\^XX" +(defvar edebug-global-prefix + (when-let ((binding + (car (where-is-internal 'Control-X-prefix (list global-map))))) + (concat binding [?X])) "Prefix key for global edebug commands, available from any buffer.") (define-obsolete-variable-alias 'global-edebug-map commit 458d8db7e825a48867a02ae277334fc6f01670a3 Author: Po Lu Date: Wed May 25 09:38:20 2022 +0800 Add more atoms that don't need a roundtrip to intern * src/xterm.c (x_intern_cached_atom): Handle dpyinfo atoms that depend on the screen number and common selection atoms. diff --git a/src/xterm.c b/src/xterm.c index 3fe8107881..5c8221201b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23608,6 +23608,35 @@ x_intern_cached_atom (struct x_display_info *dpyinfo, char *ptr; Atom *atom; + /* Special atoms that depend on the screen number. */ + char xsettings_atom_name[sizeof "_XSETTINGS_S%d" - 2 + + INT_STRLEN_BOUND (int)]; + char cm_atom_name[sizeof "_NET_WM_CM_S%d" - 2 + + INT_STRLEN_BOUND (int)]; + + sprintf (xsettings_atom_name, "_XSETTINGS_S%d", + XScreenNumberOfScreen (dpyinfo->screen)); + sprintf (cm_atom_name, "_NET_WM_CM_S%d", + XScreenNumberOfScreen (dpyinfo->screen)); + + if (!strcmp (name, xsettings_atom_name)) + return dpyinfo->Xatom_xsettings_sel; + + if (!strcmp (name, cm_atom_name)) + return dpyinfo->Xatom_NET_WM_CM_Sn; + + /* Now do some common predefined atoms. */ + if (!strcmp (name, "PRIMARY")) + return XA_PRIMARY; + if (!strcmp (name, "SECONDARY")) + return XA_SECONDARY; + if (!strcmp (name, "STRING")) + return XA_STRING; + if (!strcmp (name, "INTEGER")) + return XA_INTEGER; + if (!strcmp (name, "ATOM")) + return XA_ATOM; + for (i = 0; i < ARRAYELTS (x_atom_refs); ++i) { ptr = (char *) dpyinfo; commit 9f1cae8cb0e38d0ec495a0de029a673fa9d9a285 Author: Lars Ingebrigtsen Date: Wed May 25 03:35:12 2022 +0200 Update edebug comments * lisp/emacs-lisp/edebug.el: Update function name in comments (bug#55607). diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index d8b0a13c30..f350aef8fb 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -41,7 +41,7 @@ ;; See the Emacs Lisp Reference Manual for more details. ;; If you wish to change the default edebug global command prefix, change: -;; (setq global-edebug-prefix "\C-xX") +;; (setq edebug-global-prefix "\C-xX") ;; Edebug was written by ;; Daniel LaLiberte commit 4d60dcd87c72f7b96cac04233ffb253bd79f5bb1 Author: F. Jason Park Date: Tue May 24 06:41:40 2022 -0700 ; Fix inevitable failure in erc-dcc test * test/lisp/erc/erc-dcc-tests.el (erc-dcc-tests--dcc-handle-ctcp-send): Shadow hook to prevent the erc-button module from interfering with tests that use this helper. diff --git a/test/lisp/erc/erc-dcc-tests.el b/test/lisp/erc/erc-dcc-tests.el index a10cbfc02c..a1dfbab9dc 100644 --- a/test/lisp/erc/erc-dcc-tests.el +++ b/test/lisp/erc/erc-dcc-tests.el @@ -49,43 +49,45 @@ ;; `erc-dcc-do-LIST-command' (defun erc-dcc-tests--dcc-handle-ctcp-send (turbo) - (with-current-buffer (get-buffer-create "fake-server") - (erc-mode) - (setq erc-server-process - (start-process "fake" (current-buffer) "sleep" "10") - erc-input-marker (make-marker) - erc-insert-marker (make-marker) - erc-server-current-nick "dummy") - (set-process-query-on-exit-flag erc-server-process nil) - (should-not erc-dcc-list) - (erc-ctcp-query-DCC erc-server-process - "tester" - "~tester" - "fake.irc" - "dummy" - (concat "DCC " (if turbo "TSEND" "SEND") - " foo 2130706433 9899 1405135128")) - (should-not (cdr erc-dcc-list)) - (should (equal (plist-put (car erc-dcc-list) :parent 'fake) - `(:nick "tester!~tester@fake.irc" - :type GET - :peer nil - :parent fake - :ip "127.0.0.1" - :port "9899" - :file "foo" - :size 1405135128 - :turbo ,(and turbo t) - :secure nil))) - (goto-char (point-min)) - (should (search-forward "file foo offered by tester" nil t)) - (erc-dcc-do-LIST-command erc-server-process) - (should (search-forward-regexp (concat - "GET +no +1405135128 +foo" - (and turbo " +(T)") "$") - nil t)) - (when noninteractive - (let (erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) + (let (erc-send-completed-hook + erc-insert-modify-hook + erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook) + (with-current-buffer (get-buffer-create "fake-server") + (erc-mode) + (setq erc-server-process + (start-process "fake" (current-buffer) "sleep" "10") + erc-input-marker (make-marker) + erc-insert-marker (make-marker) + erc-server-current-nick "dummy") + (set-process-query-on-exit-flag erc-server-process nil) + (should-not erc-dcc-list) + (erc-ctcp-query-DCC erc-server-process + "tester" + "~tester" + "fake.irc" + "dummy" + (concat "DCC " (if turbo "TSEND" "SEND") + " foo 2130706433 9899 1405135128")) + (should-not (cdr erc-dcc-list)) + (should (equal (plist-put (car erc-dcc-list) :parent 'fake) + `(:nick "tester!~tester@fake.irc" + :type GET + :peer nil + :parent fake + :ip "127.0.0.1" + :port "9899" + :file "foo" + :size 1405135128 + :turbo ,(and turbo t) + :secure nil))) + (goto-char (point-min)) + (should (search-forward "file foo offered by tester" nil t)) + (erc-dcc-do-LIST-command erc-server-process) + (should (search-forward-regexp (concat + "GET +no +1405135128 +foo" + (and turbo " +(T)") "$") + nil t)) + (when noninteractive (kill-buffer)))) ;; `erc-dcc-list' is global; must leave it empty (should erc-dcc-list) commit 0f1e1a94a0957da6a8551d48f43336060e46fa87 Author: Lars Ingebrigtsen Date: Wed May 25 03:25:19 2022 +0200 Regenerated ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 95cec5a34c..ed133cd55d 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -25385,6 +25385,13 @@ Update package NAME if a newer version exists. \(fn NAME)" t nil) +(autoload 'package-update-all "package" "\ +Upgrade all packages. +If QUERY, ask the user before updating packages. When called +interactively, QUERY is always true. + +\(fn &optional QUERY)" t nil) + (autoload 'package-install-from-buffer "package" "\ Install a package from the current buffer. The current buffer is assumed to be a single .el or .tar file or commit 7c4cad323090acd09604c511a31a35c99452f5ce Author: Lars Ingebrigtsen Date: Wed May 25 03:24:52 2022 +0200 Fix ert-run-tests-batch-and-exit doc string typo * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Fix doc string typo. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 0451be272a..82722add42 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1533,7 +1533,7 @@ Returns the stats object." "Like `ert-run-tests-batch', but exits Emacs when done. The exit status will be 0 if all test results were as expected, 1 -son unexpected results, or 2 if the tool detected an error outside +on unexpected results, or 2 if the tool detected an error outside of the tests (e.g. invalid SELECTOR or bug in the code that runs the tests)." (or noninteractive commit f474ad4ed1932ee01e43fa5be206d0a0c144bd1d Author: Lars Ingebrigtsen Date: Wed May 25 03:23:50 2022 +0200 Autoload package-update-all * lisp/emacs-lisp/package.el (package-update-all): Autoload and tweak querying so that -f works. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8ddaa9f41d..1cebab36f2 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2164,11 +2164,12 @@ to install it but still mark it as selected." (package-desc-priority-version (cadr available)))))) package-alist))) +;;;###autoload (defun package-update-all (&optional query) "Upgrade all packages. If QUERY, ask the user before updating packages. When called interactively, QUERY is always true." - (interactive (list t)) + (interactive (list (not noninteractive))) (let ((updateable (package--updateable-packages))) (if (not updateable) (message "No packages to update") commit fcf80d7e62edb5a5ac0da346ac4d189671be2abf Author: Po Lu Date: Wed May 25 08:49:14 2022 +0800 Fix compilation on GTK when Xrandr is not present * src/xterm.c (x_term_init): Make term always present on GTK. diff --git a/src/xterm.c b/src/xterm.c index 261fa807d0..3fe8107881 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -24679,17 +24679,20 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ; #endif -#ifdef HAVE_XRANDR +#if defined HAVE_XRANDR || defined USE_GTK Lisp_Object term; -#ifndef USE_GTK - dpyinfo->last_monitor_attributes_list = Qnil; + XSETTERMINAL (term, terminal); #endif + +#ifdef HAVE_XRANDR dpyinfo->xrandr_supported_p = XRRQueryExtension (dpy, &dpyinfo->xrandr_event_base, &dpyinfo->xrandr_error_base); - XSETTERMINAL (term, terminal); +#ifndef USE_GTK + dpyinfo->last_monitor_attributes_list = Qnil; +#endif if (dpyinfo->xrandr_supported_p) { commit c00ffe263d9ffeb4d2a5e13cc124c786152137db Author: Lars Ingebrigtsen Date: Tue May 24 21:13:59 2022 +0200 Fix comp-mvar doc string quoting * lisp/emacs-lisp/comp.el (comp-mvar): Fix quoting of symbol in doc string. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 83a81a1bad..ff4abf3ef1 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -944,7 +944,7 @@ CFG is mutated by a pass.") :documentation "Unique id when in SSA form.") (slot nil :type (or fixnum symbol) :documentation "Slot number in the array if a number or - 'scratch' for scratch slot.")) + `scratch' for scratch slot.")) (defun comp-mvar-type-hint-match-p (mvar type-hint) "Match MVAR against TYPE-HINT. commit 71178fbdc6a1124131dc3a760bde9d79d34ecec2 Author: Mattias Engdegård Date: Tue May 24 20:08:05 2022 +0200 Remove f90-mode regexp ambiguity (bug#17222) * lisp/progmodes/f90.el (f90-font-lock-keywords-2): Modify regexp to be better-behaved. diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 342fcb27b3..dcd74f0369 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -612,7 +612,7 @@ and variable-name parts, respectively." '("^[ \t0-9]*\\(?:pure\\|elemental\\)?[ \t]*\ \\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|\ enumerator\\|generic\\|procedure\\|logical\\|double[ \t]*precision\\)\ -\\(.*::\\|[ \t]*(.*)\\)?\\(\\(?:[^&!\n]*\\(?:&\n\\)?\\)+\\)" +\\(.*::\\|[ \t]*(.*)\\)?\\([^&!\n]*\\(?:&\n[^&!\n]*\\)*\\)" (1 font-lock-type-face t) (4 font-lock-variable-name-face append)) ;; Derived type/class variables. ;; TODO ? If we just highlighted the "type" part, rather than commit 5f6e64a316adc6cd6ea140453718160643c6cd93 Author: Lars Ingebrigtsen Date: Tue May 24 19:02:06 2022 +0200 Don't use `format-message' to make doc strings in erc-backend * lisp/erc/erc-backend.el (define-erc-response-handler): Use `format' here instead of `format-message' since Emacs will expand the doc string later when the user asks for help about the symbols defined. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 4b21711da4..4c13f4c419 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1192,7 +1192,7 @@ Would expand to: aliases)) (let* ((hook-name (intern (format "erc-server-%s-functions" name))) (fn-name (intern (format "erc-server-%s" name))) - (hook-doc (format-message "\ + (hook-doc (format "\ %sHook called upon receiving a %%s server response. Each function is called with two arguments, the process associated with the response and the parsed response. If the function returns @@ -1203,7 +1203,7 @@ See also `%s'." (concat extra-var-doc "\n\n") "") fn-name)) - (fn-doc (format-message "\ + (fn-doc (format "\ %sHandler for a %s server response. PROC is the server process which returned the response. PARSED is the actual response as an `erc-response' struct. commit 5b767273d6069f8dcd2af1dfadaf9a147847d504 Author: Lars Ingebrigtsen Date: Tue May 24 18:52:58 2022 +0200 Fix a byte compilation warning in electric.el * lisp/electric.el (electric-quote-mode): Quote a naked ‘ character. diff --git a/lisp/electric.el b/lisp/electric.el index b953305647..0cf3a299cf 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -620,7 +620,7 @@ This requotes when a quoting key is typed." (define-minor-mode electric-quote-mode "Toggle on-the-fly requoting (Electric Quote mode). -When enabled, as you type this replaces \\=` with ‘, \\=' with \\=’, +When enabled, as you type this replaces \\=` with \\=‘, \\=' with \\=’, \\=`\\=` with “, and \\='\\=' with ”. This occurs only in comments, strings, and text paragraphs, and these are selectively controlled with `electric-quote-comment', `electric-quote-string', and commit 2701cd59b521989530a7eb7489540c64177e0f69 Author: Lars Ingebrigtsen Date: Tue May 24 18:48:39 2022 +0200 Make byte compilation warn about wrong quoting in doc strings * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-length-warn): Made into obsolete alias. (byte-compile-docstring-style-warn): Also warn about other stylistic issues. (byte-compile-file-form-autoload, byte-compile-file-form-defvar) (byte-compile-file-form-defvar-function, byte-compile-lambda) (byte-compile-defvar, byte-compile-file-form-defalias): Adjust callers. diff --git a/etc/NEWS b/etc/NEWS index 0adb4e289a..857f300384 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1911,6 +1911,20 @@ 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), +that quote character has to be escaped to avoid Emacs displaying it as +’ (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 +\=. + --- *** Byte compilation will now warn about some malformed 'defcustom' types. It's very common to write 'defcustom' types on the form: diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 61382d6989..87798288fb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -325,7 +325,8 @@ Elements of the list may be: constants let-binding of, or assignment to, constants/nonvariables. docstrings docstrings that are too wide (longer than `byte-compile-docstring-max-column' or - `fill-column' characters, whichever is bigger). + `fill-column' characters, whichever is bigger) or + have other stylistic issues. suspicious constructs that usually don't do what the coder wanted. If the list begins with `not', then the remaining elements specify warnings to @@ -1729,8 +1730,12 @@ value, it will override this variable." :safe #'integerp :version "28.1") -(defun byte-compile-docstring-length-warn (form) - "Warn if documentation string of FORM is too wide. +(define-obsolete-function-alias 'byte-compile-docstring-length-warn + 'byte-compile-docstring-style-warn "29.1") + +(defun byte-compile-docstring-style-warn (form) + "Warn if there are stylistic problems with the docstring in FORM. +Warn if documentation string of FORM is too wide. It is too wide if it has any lines longer than the largest of `fill-column' and `byte-compile-docstring-max-column'." (when (byte-compile-warning-enabled-p 'docstrings) @@ -1750,12 +1755,24 @@ It is too wide if it has any lines longer than the largest of (when (and (consp name) (eq (car name) 'quote)) (setq name (cadr name))) (setq name (if name (format " `%s' " name) "")) - (when (and kind docs (stringp docs) - (byte-compile--wide-docstring-p docs col)) - (byte-compile-warn-x - name - "%s%sdocstring wider than %s characters" - kind name col)))) + (when (and kind docs (stringp docs)) + (when (byte-compile--wide-docstring-p docs col) + (byte-compile-warn-x + name + "%s%sdocstring wider than %s characters" + kind name col)) + ;; There's a "naked" ' character before a symbol/list, so it + ;; should probably be quoted with \=. + (when (string-match-p "\\( \"\\|[ \t]\\|^\\)'[a-z(]" docs) + (byte-compile-warn-x + name "%s%sdocstring has wrong usage of unescaped single quotes (use \\= or different quoting)" + kind name)) + ;; There's a "Unicode quote" in the string -- it should probably + ;; be an ASCII one instead. + (when (string-match-p "\\( \"\\|[ \t]\\|^\\)[‘’]" docs) + (byte-compile-warn-x + name "%s%sdocstring has wrong usage of \"fancy\" single quotation marks" + kind name))))) form) ;; If we have compiled any calls to functions which are not known to be @@ -2617,7 +2634,7 @@ list that represents a doc string reference. (if (stringp (nth 3 form)) (prog1 form - (byte-compile-docstring-length-warn form)) + (byte-compile-docstring-style-warn form)) ;; No doc string, so we can compile this as a normal form. (byte-compile-keep-pending form 'byte-compile-normal-call))) @@ -2649,7 +2666,7 @@ list that represents a doc string reference. (if (and (null (cddr form)) ;No `value' provided. (eq (car form) 'defvar)) ;Just a declaration. nil - (byte-compile-docstring-length-warn form) + (byte-compile-docstring-style-warn form) (setq form (copy-sequence form)) (when (consp (nth 2 form)) (setcar (cdr (cdr form)) @@ -2674,7 +2691,7 @@ list that represents a doc string reference. (byte-compile-warn-x newname "Alias for `%S' should be declared before its referent" newname))))) - (byte-compile-docstring-length-warn form) + (byte-compile-docstring-style-warn form) (byte-compile-keep-pending form)) (put 'custom-declare-variable 'byte-hunk-handler @@ -3066,7 +3083,7 @@ lambda-expression." (setq fun (cons 'lambda fun)) (unless (eq 'lambda (car-safe fun)) (error "Not a lambda list: %S" fun))) - (byte-compile-docstring-length-warn fun) + (byte-compile-docstring-style-warn fun) (byte-compile-check-lambda-list (nth 1 fun)) (let* ((arglist (nth 1 fun)) (arglistvars (byte-run-strip-symbol-positions @@ -4942,7 +4959,7 @@ binding slots have been popped." (nth 1 form) "global/dynamic var `%s' lacks a prefix" (nth 1 form))) - (byte-compile-docstring-length-warn form) + (byte-compile-docstring-style-warn form) (let ((fun (nth 0 form)) (var (nth 1 form)) (value (nth 2 form)) @@ -5018,7 +5035,7 @@ binding slots have been popped." ;; - `arg' is the expression to which it is defined. ;; - `rest' is the rest of the arguments. (`(,_ ',name ,arg . ,rest) - (byte-compile-docstring-length-warn form) + (byte-compile-docstring-style-warn form) (pcase-let* ;; `macro' is non-nil if it defines a macro. ;; `fun' is the function part of `arg' (defaults to `arg'). commit d036891967aebcf9cb7ef468d8e8f2019ffde6e2 Author: Lars Ingebrigtsen Date: Tue May 24 18:42:30 2022 +0200 Fix the final divergent single quote usages in doc strings * lisp/view.el (view-mode-map): * lisp/repeat.el (repeat-is-really-this-command): * lisp/help.el (substitute-command-keys): * lisp/electric.el (electric-quote-mode): * lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring): * lisp/cedet/semantic/sort.el (semantic-orphaned-member-metaparent-type): Audit usages of single quotes in doc strings. diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el index 1503a766dc..756b949c0d 100644 --- a/lisp/cedet/semantic/sort.el +++ b/lisp/cedet/semantic/sort.el @@ -310,7 +310,7 @@ may re-organize the list with side-effects." ;; class tag. ;; (defvar-local semantic-orphaned-member-metaparent-type "class" - "In `semantic-adopt-external-members', the type of 'type for metaparents. + "In `semantic-adopt-external-members', the type of `type' for metaparents. A metaparent is a made-up type semantic token used to hold the child list of orphaned members of a named type.") diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el index 50b0e150ff..c297429e40 100644 --- a/lisp/cedet/srecode/texi.el +++ b/lisp/cedet/srecode/texi.el @@ -246,7 +246,7 @@ that class. class => @code{class} @xref{class} unknown => @code{unknown} \"text\" => \\=`\\=`text\\='\\=' - 'quoteme => @code{quoteme} + \\='quoteme => @code{quoteme} non-nil => non-@code{nil} t => @code{t} :tag => @code{:tag} diff --git a/lisp/electric.el b/lisp/electric.el index 3d3f65c2da..b953305647 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -620,7 +620,7 @@ This requotes when a quoting key is typed." (define-minor-mode electric-quote-mode "Toggle on-the-fly requoting (Electric Quote mode). -When enabled, as you type this replaces \\=` with ‘, \\=' with ’, +When enabled, as you type this replaces \\=` with ‘, \\=' with \\=’, \\=`\\=` with “, and \\='\\=' with ”. This occurs only in comments, strings, and text paragraphs, and these are selectively controlled with `electric-quote-comment', `electric-quote-string', and diff --git a/lisp/help.el b/lisp/help.el index ae65cc07df..1faebdf461 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1102,10 +1102,10 @@ KEYBINDING and use the `help-key-binding' face. Each substring of the form \\\\={MAPVAR} is replaced by a summary of the value of MAPVAR as a keymap. This summary is similar to -the one produced by ‘describe-bindings’. This will normally +the one produced by `describe-bindings'. This will normally exclude menu bindings, but if the optional INCLUDE-MENUS argument is non-nil, also include menu bindings. The summary ends in two -newlines (used by the helper function ‘help-make-xrefs’ to find +newlines (used by the helper function `help-make-xrefs' to find the end of the summary). Each substring of the form \\\\= specifies the use of MAPVAR @@ -1113,7 +1113,7 @@ as the keymap for future \\\\=[COMMAND] substrings. Each grave accent \\=` is replaced by left quote, and each apostrophe \\=' is replaced by right quote. Left and right quote characters are -specified by ‘text-quoting-style’. +specified by `text-quoting-style'. \\\\== quotes the following character and is discarded; thus, \\\\==\\\\== puts \\\\== into the output, \\\\==\\[ puts \\[ into the output, and \\\\==\\=` puts \\=` into the diff --git a/lisp/repeat.el b/lisp/repeat.el index aaccc22784..ea4e3d0bd8 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -176,7 +176,7 @@ that variable on the theory they're doing more good than harm; `repeat' does that, and usually does do more good than harm. However, like all do-gooders, sometimes `repeat' gets surprising results from its altruism. The value of this function is always whether the value of `this-command' would've been -'repeat if `repeat' hadn't modified it." +`repeat' if `repeat' hadn't modified it." (= repeat-num-input-keys-at-repeat num-input-keys)) ;; An example of the use of (repeat-is-really-this-command) may still be diff --git a/lisp/view.el b/lisp/view.el index bfc0341b2a..3343136c1c 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -146,7 +146,7 @@ This is local in each buffer, once it is used.") ;; Some redundant "less"-like key bindings below have been commented out. (defvar-keymap view-mode-map - :doc "Keymap for ‘view-mode’." + :doc "Keymap for `view-mode'." "C" #'View-kill-and-leave "c" #'View-leave "Q" #'View-quit-all commit 881aa943e58abb338375d30789373506726c28ba Author: Alan Mackenzie Date: Tue May 24 16:33:20 2022 +0000 CC Mode: Fix interplay between string fences and electric-pair-mode. This is an amendment to the fix for bug #55230. * lisp/progmodes/cc-defs.el: (c-with-string-fences): Add an edebug spec. * lisp/progmodes/cc-cmds.el: (c-electric-pound, c-electric-brace) (c-electric-slash, c-electric-star, c-electric-semi&comma, c-electric-colon) (c-electric-lt-gt, c-electric-paren): Put the final c--call-post-self-insert-hook-more-safely outside of the functions' c-with-string-fences. (c-electric-brace, c-electric-lt-gt, c-electric-paren): Put the calls to electric-pair-post-self-insert-function outside of c-with-string-fences. diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index e3f2bd152b..e9cc63709e 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -527,7 +527,8 @@ function to control that." (defmacro c--call-post-self-insert-hook-more-safely () ;; Call post-self-insert-hook, if such exists. See comment for - ;; `c--call-post-self-insert-hook-more-safely-1'. + ;; `c--call-post-self-insert-hook-more-safely-1'. This macro should be + ;; invoked OUTSIDE of `c-with-string-fences'. (if (boundp 'post-self-insert-hook) '(c--call-post-self-insert-hook-more-safely-1) '(progn))) @@ -561,9 +562,8 @@ inside a literal or a macro, nothing special happens." (delete-horizontal-space) (insert (c-last-command-char)) (and (not bolp) - (goto-char (- (point-max) pos))) - )) - (c--call-post-self-insert-hook-more-safely))) + (goto-char (- (point-max) pos)))))) + (c--call-post-self-insert-hook-more-safely)) (defun c-point-syntax () ;; Return the syntactic context of the construct at point. (This is NOT @@ -891,16 +891,16 @@ reindented unless `c-syntactic-indentation' is nil. settings of `c-cleanup-list' are done." (interactive "*P") - (c-with-string-fences - (let (safepos literal - ;; We want to inhibit blinking the paren since this would be - ;; most disruptive. We'll blink it ourselves later on. - (old-blink-paren blink-paren-function) - blink-paren-function case-fold-search - (at-eol (looking-at "[ \t]*\\\\?$")) - (active-region (and (fboundp 'use-region-p) (use-region-p))) - got-pair-} electric-pair-deletion) + (let (safepos literal + ;; We want to inhibit blinking the paren since this would be + ;; most disruptive. We'll blink it ourselves later on. + (old-blink-paren blink-paren-function) + blink-paren-function case-fold-search + (at-eol (looking-at "[ \t]*\\\\?$")) + (active-region (and (fboundp 'use-region-p) (use-region-p))) + got-pair-} electric-pair-deletion) + (c-with-string-fences (c-save-buffer-state () (setq safepos (c-safe-position (point) (c-parse-state)) literal (c-in-literal safepos))) @@ -909,19 +909,20 @@ settings of `c-cleanup-list' are done." ;; the line here if there's a preceding "else" or something. (let (post-self-insert-hook) ; the only way to get defined functionality ; from `self-insert-command'. - (self-insert-command (prefix-numeric-value arg))) - - ;; Emulate `electric-pair-mode'. - (when (and (boundp 'electric-pair-mode) - electric-pair-mode) - (let ((size (buffer-size)) - post-self-insert-hook) - (electric-pair-post-self-insert-function) - (setq got-pair-} (and at-eol - (eq (c-last-command-char) ?{) - (eq (char-after) ?})) - electric-pair-deletion (< (buffer-size) size)))) - + (self-insert-command (prefix-numeric-value arg)))) + + ;; Emulate `electric-pair-mode', outside of `c-with-string-fences'. + (when (and (boundp 'electric-pair-mode) + electric-pair-mode) + (let ((size (buffer-size)) + post-self-insert-hook) + (electric-pair-post-self-insert-function) + (setq got-pair-} (and at-eol + (eq (c-last-command-char) ?{) + (eq (char-after) ?})) + electric-pair-deletion (< (buffer-size) size)))) + + (c-with-string-fences ;; Perform any required CC Mode electric actions. (cond ((or literal arg (not c-electric-flag) active-region)) @@ -944,8 +945,8 @@ settings of `c-cleanup-list' are done." (save-excursion (c-save-buffer-state nil (c-backward-syntactic-ws safepos)) - (funcall old-blink-paren))) - (c--call-post-self-insert-hook-more-safely)))) + (funcall old-blink-paren))))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-slash (arg) "Insert a slash character. @@ -998,8 +999,8 @@ is inhibited." (let (post-self-insert-hook) ; Disable random functionality. (self-insert-command (prefix-numeric-value arg))) (if indentp - (indent-according-to-mode)) - (c--call-post-self-insert-hook-more-safely)))) + (indent-according-to-mode)))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-star (arg) "Insert a star character. @@ -1029,8 +1030,8 @@ this indentation is inhibited." (skip-chars-backward " \t") (bolp)))) (let (c-echo-syntactic-information-p) ; shut this up - (indent-according-to-mode))) - (c--call-post-self-insert-hook-more-safely))) + (indent-according-to-mode)))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-semi&comma (arg) "Insert a comma or semicolon. @@ -1103,8 +1104,8 @@ settings of `c-cleanup-list'." (setq add-newline-p (not (eq answer 'stop))) )) (if add-newline-p - (c-newline-and-indent))))) - (c--call-post-self-insert-hook-more-safely)))) + (c-newline-and-indent))))))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-colon (arg) "Insert a colon. @@ -1207,8 +1208,8 @@ reindented unless `c-syntactic-indentation' is nil. ;; does a newline go after the colon? (if (and (memq 'after (cdr-safe newlines)) (not is-scope-op)) - (c-newline-and-indent)))) - (c--call-post-self-insert-hook-more-safely)))) + (c-newline-and-indent)))))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-lt-gt (arg) "Insert a \"<\" or \">\" character. @@ -1222,12 +1223,11 @@ finishes a C++ style stream operator in C++ mode. Exceptions are when a numeric argument is supplied, or the point is inside a literal." (interactive "*P") - (c-with-string-fences - (let ((literal (c-save-buffer-state () (c-in-literal))) - template-delim include-delim - (c-echo-syntactic-information-p nil) - final-pos found-delim case-fold-search) + (let (template-delim include-delim + (c-echo-syntactic-information-p nil) + final-pos found-delim case-fold-search) + (c-with-string-fences (let (post-self-insert-hook) ; Disable random functionality. (self-insert-command (prefix-numeric-value arg))) (setq final-pos (point)) @@ -1236,7 +1236,8 @@ numeric argument is supplied, or the point is inside a literal." ;;;; property on the new < or > and its mate (if any) when they are template ;;;; parens. This is now done in an after-change function. - (when (and (not arg) (not literal)) + (when (and (not arg) + (not (c-save-buffer-state () (c-in-literal)))) ;; Have we got a delimiter on a #include directive? (beginning-of-line) (setq include-delim @@ -1283,24 +1284,24 @@ numeric argument is supplied, or the point is inside a literal." (goto-char final-pos) (when found-delim - (indent-according-to-mode))) - - ;; On the off chance that < and > are configured as pairs in - ;; electric-pair-mode. - (when (and (boundp 'electric-pair-mode) electric-pair-mode - (or template-delim include-delim)) - (let (post-self-insert-hook) - (electric-pair-post-self-insert-function)))) - - (when found-delim - (when (and (eq (char-before) ?>) - (not executing-kbd-macro) - blink-paren-function) - ;; From now (2016-01-01), the syntax-table text properties on < and > - ;; are applied in an after-change function, not during redisplay. Hence - ;; we no longer need to call (sit-for 0) for blink paren to work. - (funcall blink-paren-function)))) - (c--call-post-self-insert-hook-more-safely))) + (indent-according-to-mode))))) + + ;; On the off chance that < and > are configured as pairs in + ;; electric-pair-mode. + (when (and (boundp 'electric-pair-mode) electric-pair-mode + (or template-delim include-delim)) + (let (post-self-insert-hook) + (electric-pair-post-self-insert-function))) + + (when found-delim + (when (and (eq (char-before) ?>) + (not executing-kbd-macro) + blink-paren-function) + ;; From now (2016-01-01), the syntax-table text properties on < and > + ;; are applied in an after-change function, not during redisplay. Hence + ;; we no longer need to call (sit-for 0) for blink paren to work. + (funcall blink-paren-function)))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-paren (arg) "Insert a parenthesis. @@ -1315,21 +1316,22 @@ removed; see the variable `c-cleanup-list'. Also, if `c-electric-flag' and `c-auto-newline' are both non-nil, some newline cleanups are done if appropriate; see the variable `c-cleanup-list'." (interactive "*P") - (c-with-string-fences - (let ((literal (c-save-buffer-state () (c-in-literal))) - ;; shut this up - (c-echo-syntactic-information-p nil) - case-fold-search) - (let (post-self-insert-hook) ; The only way to get defined functionality + (let ((literal (c-save-buffer-state () + (c-with-string-fences (c-in-literal)))) + ;; shut this up + (c-echo-syntactic-information-p nil) + case-fold-search) + (let (post-self-insert-hook) ; The only way to get defined functionality ; from `self-insert-command'. - (self-insert-command (prefix-numeric-value arg))) - - (if (and (not arg) (not literal)) - (let* (;; We want to inhibit blinking the paren since this will - ;; be most disruptive. We'll blink it ourselves - ;; afterwards. - (old-blink-paren blink-paren-function) - blink-paren-function) + (self-insert-command (prefix-numeric-value arg))) + + (if (and (not arg) (not literal)) + (let* (;; We want to inhibit blinking the paren since this will + ;; be most disruptive. We'll blink it ourselves + ;; afterwards. + (old-blink-paren blink-paren-function) + blink-paren-function) + (c-with-string-fences (if (and c-syntactic-indentation c-electric-flag) (indent-according-to-mode)) @@ -1369,14 +1371,15 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'." nil t) (not (c-save-buffer-state () (c-in-literal)))) (delete-region (match-beginning 0) (match-end 0)) - (insert-and-inherit "} catch ("))) + (insert-and-inherit "} catch (")))) - ;; Apply `electric-pair-mode' stuff. - (when (and (boundp 'electric-pair-mode) - electric-pair-mode) - (let (post-self-insert-hook) - (electric-pair-post-self-insert-function))) + ;; Apply `electric-pair-mode' stuff. + (when (and (boundp 'electric-pair-mode) + electric-pair-mode) + (let (post-self-insert-hook) + (electric-pair-post-self-insert-function))) + (c-with-string-fences ;; Check for clean-ups at function calls. These two DON'T need ;; `c-electric-flag' or `c-syntactic-indentation' set. ;; Point is currently just after the inserted paren. @@ -1411,17 +1414,17 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'." (skip-chars-backward " \t") (setq beg (point)) (c-on-identifier))))) - (delete-region beg end)))) - (and (eq last-input-event ?\)) - (not executing-kbd-macro) - old-blink-paren - (funcall old-blink-paren))) - - ;; Apply `electric-pair-mode' stuff inside a string or comment. - (when (and (boundp 'electric-pair-mode) electric-pair-mode) - (let (post-self-insert-hook) - (electric-pair-post-self-insert-function)))) - (c--call-post-self-insert-hook-more-safely)))) + (delete-region beg end))))) + (and (eq last-input-event ?\)) + (not executing-kbd-macro) + old-blink-paren + (funcall old-blink-paren))) + + ;; Apply `electric-pair-mode' stuff inside a string or comment. + (when (and (boundp 'electric-pair-mode) electric-pair-mode) + (let (post-self-insert-hook) + (electric-pair-post-self-insert-function))))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-continued-statement () "Reindent the current line if appropriate. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 54bedb4d9c..9edaf46534 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -1574,6 +1574,7 @@ with value CHAR in the region [FROM to)." ;; properties. This includes all calls to `c-parse-state'. This macro will ;; be invoked recursively; however the `c-string-fences-set-flag' mechanism ;; should ensure consistency, when this happens. + (declare (debug t)) `(unwind-protect (progn (unless c-string-fences-set-flag commit 5c1c614940c35432d048d3879abdcab39c4d4229 Author: Stefan Monnier Date: Tue May 24 12:29:54 2022 -0400 Make `yank-transform-functions` a proper hook * lisp/subr.el (insert-for-yank): Use `run-hook-wrapped` to run `yank-transform-functions`. * lisp/simple.el (yank-transform-functions): Adjust accordingly. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3a05005fb5..8ddaa9f41d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4284,7 +4284,7 @@ activations need to be changed, such as when `package-load-list' is modified." (locate-library (package--autoloads-file-name pkg)))) (pfile (prin1-to-string file))) (insert "(let ((load-true-file-name " pfile ")\ -(load-file-name " pfile "))\n") +\(load-file-name " pfile "))\n") (insert-file-contents file) ;; Fixup the special #$ reader form and throw away comments. (while (re-search-forward "#\\$\\|^;\\(.*\n\\)" nil 'move) diff --git a/lisp/simple.el b/lisp/simple.el index 1efd900030..3318ac4731 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5947,14 +5947,14 @@ See also `yank-handled-properties'." :version "24.3") (defcustom yank-transform-functions nil - "List of functions to run on strings to be yanked. + "Hook run on strings to be yanked. Each function in this list will be called (in order) with the string to be yanked as the sole argument, and should return the (possibly) transformed string. The functions will be called with the destination buffer as the current buffer, and with point at the place where the string is to be inserted." - :type '(repeat function) + :type 'hook :version "29.1" :group 'killing) diff --git a/lisp/subr.el b/lisp/subr.el index adcbd94744..0b415d8b2c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4083,8 +4083,8 @@ This function is like `insert', except it honors the variables It also runs the string through `yank-transform-functions'." ;; Allow altering the yank string. - (dolist (func yank-transform-functions) - (setq string (funcall func string))) + (run-hook-wrapped 'yank-transform-functions + (lambda (f) (setq string (funcall f string)))) (let (to) (while (setq to (next-single-property-change 0 'yank-handler string)) (insert-for-yank-1 (substring string 0 to)) commit 6232932f4bb0630ef4656ed2f8e977fd7fb59952 Author: Lars Ingebrigtsen Date: Tue May 24 17:24:20 2022 +0200 Fix issue with nativecomp tests leaving files behind in /tmp * test/src/comp-tests.el (comp-deftest): Ensure that no files are left behind (bug#55611). diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 212d9e999f..e7b534d00e 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -51,7 +51,14 @@ (doc-string 3)) `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args :tags '(:nativecomp) - ,@docstring-and-body)) + ,@(and (stringp (car docstring-and-body)) + (list (pop docstring-and-body))) + ;; Some of the tests leave spill files behind -- so create a + ;; sub-dir where native-comp can do its work, and then delete it + ;; at the end. + (ert-with-temp-directory dir + (let ((temporary-file-directory dir)) + ,@docstring-and-body)))) commit ed1045613e2cc5de5bba8bad05d7ebdf070ffe86 Merge: 609c9c5cd9 aea843c3d6 Author: Eli Zaretskii Date: Tue May 24 17:12:26 2022 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 609c9c5cd9cae1d6fced971cd66f39530ab93136 Author: समीर सिंह Sameer Singh Date: Tue May 24 17:05:32 2022 +0530 Add support for the Buhid and Tagbanwa scripts (bug#55610) * lisp/language/philippine.el ("Buhid"): New language environment. ("Tagbanwa"): New language environment. Add input methods for Buhid and Tagbanwa. Add sample text for Tagbanwa. * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Support Buhid and Tagbanwa. * lisp/leim/quail/philippine.el ("buhid"): New input method. ("tagbanwa"): New input method. * etc/HELLO: Add a Tagbanwa greeting. * etc/NEWS: Announce the new language environments and their input methods. diff --git a/etc/HELLO b/etc/HELLO index b87dae90b2..a9653a4164 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -92,6 +92,7 @@ Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ) ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀ Tamil (தமிழ்) வணக்கம் Telugu (తెలుగు) నమస్కారం Tagalog (ᜊᜌ᜔ᜊᜌᜒᜈ᜔) ᜃᜓᜋᜓᜐ᜔ᜆ +Tagbanwa (ᝦᝪᝯ) ᝫᝩᝬᝥ ᝣᝮᝧᝯ TaiViet (ꪁꪫꪱꪣ ꪼꪕ) ꪅꪰꪙꫂ ꪨꪮꫂ ꪁꪫꪱ / ꪅꪽ ꪨꪷ ꪁꪫꪱ Thai (ภาษาไทย) สวัสดีครับ / สวัสดีค่ะ Tibetan (བོད་སྐད་) བཀྲ་ཤིས་བདེ་ལེགས༎ diff --git a/etc/NEWS b/etc/NEWS index 1fa2d086b9..0adb4e289a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -820,6 +820,8 @@ corresponding language environments are: **** Modi script and language environment **** Baybayin script and Tagalog language environment **** Hanunoo script and language environment +**** Buhid script and language environment +**** Tagbanwa script and language environment --- *** The "Oriya" language environment was renamed to "Odia". diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 08a0101a5e..5967648f36 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -184,6 +184,8 @@ (runic #x16A0) (tagalog #x1700) (hanunoo #x1720) + (buhid #x1740) + (tagbanwa #x1760) (khmer #x1780) (mongolian #x1826) (tai-le #x1950) @@ -752,6 +754,8 @@ runic tagalog hanunoo + buhid + tagbanwa symbol braille yi diff --git a/lisp/language/philippine.el b/lisp/language/philippine.el index 2a4b17a1c7..e52ad6912c 100644 --- a/lisp/language/philippine.el +++ b/lisp/language/philippine.el @@ -46,6 +46,23 @@ this language environment."))) (documentation . "\ Philippine Language Hanunoo is supported in this language environment."))) +(set-language-info-alist + "Buhid" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "buhid") + (documentation . "\ +Philippine Language Buhid is supported in this language environment."))) + +(set-language-info-alist + "Tagbanwa" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "tagbanwa") + (sample-text . "Tagbanwa (ᝦᝪᝯ) ᝫᝩᝬᝥ ᝣᝮᝧᝯ") + (documentation . "\ +Philippine Languages Tagbanwa are supported in this language environment."))) + ;; Tagalog composition rules (let ((akshara "[\x1700-\x1711\x171F]") (vowel "[\x1712\x1713]") diff --git a/lisp/leim/quail/philippine.el b/lisp/leim/quail/philippine.el index b9dcccea28..9afbdc354e 100644 --- a/lisp/leim/quail/philippine.el +++ b/lisp/leim/quail/philippine.el @@ -92,5 +92,61 @@ ("N" ?ᜥ) ("m" ?ᜫ)) +(quail-define-package + "buhid" "Buhid" "ᝊᝓ" nil "Buhid phonetic input method." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?₱) + ("w" ?ᝏ) + ("r" ?ᝍ) + ("t" ?ᝆ) + ("y" ?ᝌ) + ("u" ?ᝓ) + ("U" ?ᝂ) + ("i" ?ᝒ) + ("I" ?ᝁ) + ("p" ?ᝉ) + ("a" ?ᝀ) + ("s" ?ᝐ) + ("d" ?ᝇ) + ("g" ?ᝄ) + ("h" ?ᝑ) + ("j" ?᜵) + ("J" ?᜶) + ("k" ?ᝃ) + ("l" ?ᝎ) + ("b" ?ᝊ) + ("n" ?ᝈ) + ("N" ?ᝅ) + ("m" ?ᝋ)) + +(quail-define-package + "tagbanwa" "Tagbanwa" "ᝦ" nil "Tagbanwa phonetic input method." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?₱) + ("w" ?ᝯ) + ("t" ?ᝦ) + ("y" ?ᝬ) + ("u" ?ᝳ) + ("U" ?ᝢ) + ("i" ?ᝲ) + ("I" ?ᝡ) + ("p" ?ᝩ) + ("a" ?ᝠ) + ("s" ?ᝰ) + ("d" ?ᝧ) + ("g" ?ᝤ) + ("j" ?᜵) + ("J" ?᜶) + ("k" ?ᝣ) + ("l" ?ᝮ) + ("b" ?ᝪ) + ("n" ?ᝨ) + ("N" ?ᝥ) + ("m" ?ᝫ)) + (provide 'philippine) ;;; philippine.el ends here commit aea843c3d69000faa5b84fb3ac1fd3883f800de3 Author: Lars Ingebrigtsen Date: Tue May 24 16:11:01 2022 +0200 Clean up a test file in /tmp * test/src/buffer-tests.el (test-restore-buffer-modified-p): Clean up autosave file in /tmp. diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index f6a18acaa6..13d48b31a4 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -1515,7 +1515,11 @@ with parameters from the *Messages* buffer modification." (should (eq (buffer-modified-p) 'autosaved)) (insert "zot") (restore-buffer-modified-p 'autosaved) - (should (eq (buffer-modified-p) 'autosaved)))) + (should (eq (buffer-modified-p) 'autosaved)) + + ;; Clean up. + (when (file-exists-p buffer-auto-save-file-name) + (delete-file buffer-auto-save-file-name)))) (ert-with-temp-file file (with-current-buffer (find-file file) commit 6f3925eace76a39850c0c108a9e1fd0c010e803d Author: Po Lu Date: Tue May 24 21:20:46 2022 +0800 Add more error checking to some X functions * src/xfns.c (Fx_change_window_property, Fx_delete_window_property) (Fx_window_property, Fx_window_property_attributes): Check for errors in case the window is invalid. Also use better function for interning prop names. * src/xterm.c (struct x_atom_ref): New structure. (x_atom_refs): New list. Extract from x_term_init. (x_intern_cached_atom): New function. Use it in several places to avoid interning common atoms. (x_term_init): Adjust accordingly. * src/xterm.h: Update prototypes. diff --git a/src/xfns.c b/src/xfns.c index e1f8947d55..912af0fa5a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7396,16 +7396,17 @@ If WINDOW-ID is non-nil, change the property of that window instead error ("Failed to intern type or property atom"); #endif + x_catch_errors (FRAME_X_DISPLAY (f)); XChangeProperty (FRAME_X_DISPLAY (f), target_window, prop_atom, target_type, element_format, PropModeReplace, data, nelements); if (CONSP (value)) xfree (data); + x_check_errors (FRAME_X_DISPLAY (f), + "Couldn't change window property: %s"); + x_uncatch_errors_after_check (); - /* Make sure the property is set when we return. */ - XFlush (FRAME_X_DISPLAY (f)); unblock_input (); - return value; } @@ -7437,13 +7438,16 @@ Value is PROP. */) } block_input (); - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (prop)); + + x_catch_errors (FRAME_X_DISPLAY (f)); XDeleteProperty (FRAME_X_DISPLAY (f), target_window, prop_atom); + x_check_errors (FRAME_X_DISPLAY (f), + "Couldn't delete window property: %s"); + x_uncatch_errors_after_check (); - /* Make sure the property is removed when we return. */ - XFlush (FRAME_X_DISPLAY (f)); unblock_input (); - return prop; } @@ -7570,10 +7574,12 @@ if PROP has no value of TYPE (always a string in the MS Windows case). */) if (strcmp ("AnyPropertyType", SSDATA (type)) == 0) target_type = AnyPropertyType; else - target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); + target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (type)); } - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (prop)); prop_value = x_window_property_intern (f, target_window, prop_atom, @@ -7644,7 +7650,8 @@ Otherwise, the return value is a vector with the following fields: block_input (); x_catch_errors (FRAME_X_DISPLAY (f)); - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f), + SSDATA (prop)); rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, prop_atom, 0, 0, False, AnyPropertyType, &actual_type, &actual_format, &actual_size, diff --git a/src/xterm.c b/src/xterm.c index fe1b317dcf..261fa807d0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -784,6 +784,137 @@ static int current_finish; static struct input_event *current_hold_quit; #endif +struct x_atom_ref +{ + /* Atom name. */ + const char *name; + + /* Offset of atom in the display info structure. */ + int offset; +}; + +/* List of all atoms that should be interned when connecting to a + display. */ +static const struct x_atom_ref x_atom_refs[] = + { +#define ATOM_REFS_INIT(string, member) \ + { string, offsetof (struct x_display_info, member) }, + ATOM_REFS_INIT ("WM_PROTOCOLS", Xatom_wm_protocols) + ATOM_REFS_INIT ("WM_TAKE_FOCUS", Xatom_wm_take_focus) + ATOM_REFS_INIT ("WM_SAVE_YOURSELF", Xatom_wm_save_yourself) + ATOM_REFS_INIT ("WM_DELETE_WINDOW", Xatom_wm_delete_window) + ATOM_REFS_INIT ("WM_CHANGE_STATE", Xatom_wm_change_state) + ATOM_REFS_INIT ("WM_STATE", Xatom_wm_state) + ATOM_REFS_INIT ("WM_CONFIGURE_DENIED", Xatom_wm_configure_denied) + ATOM_REFS_INIT ("WM_MOVED", Xatom_wm_window_moved) + ATOM_REFS_INIT ("WM_CLIENT_LEADER", Xatom_wm_client_leader) + ATOM_REFS_INIT ("WM_TRANSIENT_FOR", Xatom_wm_transient_for) + ATOM_REFS_INIT ("Editres", Xatom_editres) + ATOM_REFS_INIT ("CLIPBOARD", Xatom_CLIPBOARD) + ATOM_REFS_INIT ("TIMESTAMP", Xatom_TIMESTAMP) + ATOM_REFS_INIT ("TEXT", Xatom_TEXT) + ATOM_REFS_INIT ("COMPOUND_TEXT", Xatom_COMPOUND_TEXT) + ATOM_REFS_INIT ("UTF8_STRING", Xatom_UTF8_STRING) + ATOM_REFS_INIT ("DELETE", Xatom_DELETE) + ATOM_REFS_INIT ("MULTIPLE", Xatom_MULTIPLE) + ATOM_REFS_INIT ("INCR", Xatom_INCR) + ATOM_REFS_INIT ("_EMACS_TMP_", Xatom_EMACS_TMP) + ATOM_REFS_INIT ("EMACS_SERVER_TIME_PROP", Xatom_EMACS_SERVER_TIME_PROP) + ATOM_REFS_INIT ("TARGETS", Xatom_TARGETS) + ATOM_REFS_INIT ("NULL", Xatom_NULL) + ATOM_REFS_INIT ("ATOM", Xatom_ATOM) + ATOM_REFS_INIT ("ATOM_PAIR", Xatom_ATOM_PAIR) + ATOM_REFS_INIT ("CLIPBOARD_MANAGER", Xatom_CLIPBOARD_MANAGER) + ATOM_REFS_INIT ("_XEMBED_INFO", Xatom_XEMBED_INFO) + ATOM_REFS_INIT ("_MOTIF_WM_HINTS", Xatom_MOTIF_WM_HINTS) + /* For properties of font. */ + ATOM_REFS_INIT ("PIXEL_SIZE", Xatom_PIXEL_SIZE) + ATOM_REFS_INIT ("AVERAGE_WIDTH", Xatom_AVERAGE_WIDTH) + ATOM_REFS_INIT ("_MULE_BASELINE_OFFSET", Xatom_MULE_BASELINE_OFFSET) + ATOM_REFS_INIT ("_MULE_RELATIVE_COMPOSE", Xatom_MULE_RELATIVE_COMPOSE) + ATOM_REFS_INIT ("_MULE_DEFAULT_ASCENT", Xatom_MULE_DEFAULT_ASCENT) + /* Ghostscript support. */ + ATOM_REFS_INIT ("DONE", Xatom_DONE) + ATOM_REFS_INIT ("PAGE", Xatom_PAGE) + ATOM_REFS_INIT ("SCROLLBAR", Xatom_Scrollbar) + ATOM_REFS_INIT ("HORIZONTAL_SCROLLBAR", Xatom_Horizontal_Scrollbar) + ATOM_REFS_INIT ("_XEMBED", Xatom_XEMBED) + /* EWMH */ + ATOM_REFS_INIT ("_NET_WM_STATE", Xatom_net_wm_state) + ATOM_REFS_INIT ("_NET_WM_STATE_FULLSCREEN", Xatom_net_wm_state_fullscreen) + ATOM_REFS_INIT ("_NET_WM_STATE_MAXIMIZED_HORZ", + Xatom_net_wm_state_maximized_horz) + ATOM_REFS_INIT ("_NET_WM_STATE_MAXIMIZED_VERT", + Xatom_net_wm_state_maximized_vert) + ATOM_REFS_INIT ("_NET_WM_STATE_STICKY", Xatom_net_wm_state_sticky) + ATOM_REFS_INIT ("_NET_WM_STATE_SHADED", Xatom_net_wm_state_shaded) + ATOM_REFS_INIT ("_NET_WM_STATE_HIDDEN", Xatom_net_wm_state_hidden) + ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE", Xatom_net_window_type) + ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE_TOOLTIP", + Xatom_net_window_type_tooltip) + ATOM_REFS_INIT ("_NET_WM_ICON_NAME", Xatom_net_wm_icon_name) + ATOM_REFS_INIT ("_NET_WM_NAME", Xatom_net_wm_name) + ATOM_REFS_INIT ("_NET_SUPPORTED", Xatom_net_supported) + ATOM_REFS_INIT ("_NET_SUPPORTING_WM_CHECK", Xatom_net_supporting_wm_check) + ATOM_REFS_INIT ("_NET_WM_WINDOW_OPACITY", Xatom_net_wm_window_opacity) + ATOM_REFS_INIT ("_NET_ACTIVE_WINDOW", Xatom_net_active_window) + ATOM_REFS_INIT ("_NET_FRAME_EXTENTS", Xatom_net_frame_extents) + ATOM_REFS_INIT ("_NET_CURRENT_DESKTOP", Xatom_net_current_desktop) + ATOM_REFS_INIT ("_NET_WORKAREA", Xatom_net_workarea) + ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST", Xatom_net_wm_sync_request) + ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter) + ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn) + ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time) + ATOM_REFS_INIT ("_NET_WM_USER_TIME_WINDOW", Xatom_net_wm_user_time_window) + ATOM_REFS_INIT ("_NET_CLIENT_LIST_STACKING", Xatom_net_client_list_stacking) + /* Session management */ + ATOM_REFS_INIT ("SM_CLIENT_ID", Xatom_SM_CLIENT_ID) + ATOM_REFS_INIT ("_XSETTINGS_SETTINGS", Xatom_xsettings_prop) + ATOM_REFS_INIT ("MANAGER", Xatom_xsettings_mgr) + ATOM_REFS_INIT ("_NET_WM_STATE_SKIP_TASKBAR", Xatom_net_wm_state_skip_taskbar) + ATOM_REFS_INIT ("_NET_WM_STATE_ABOVE", Xatom_net_wm_state_above) + ATOM_REFS_INIT ("_NET_WM_STATE_BELOW", Xatom_net_wm_state_below) + ATOM_REFS_INIT ("_NET_WM_OPAQUE_REGION", Xatom_net_wm_opaque_region) + ATOM_REFS_INIT ("_NET_WM_PING", Xatom_net_wm_ping) + ATOM_REFS_INIT ("_NET_WM_PID", Xatom_net_wm_pid) +#ifdef HAVE_XKB + ATOM_REFS_INIT ("Meta", Xatom_Meta) + ATOM_REFS_INIT ("Super", Xatom_Super) + ATOM_REFS_INIT ("Hyper", Xatom_Hyper) + ATOM_REFS_INIT ("ShiftLock", Xatom_ShiftLock) + ATOM_REFS_INIT ("Alt", Xatom_Alt) +#endif + /* DND source. */ + ATOM_REFS_INIT ("XdndAware", Xatom_XdndAware) + ATOM_REFS_INIT ("XdndSelection", Xatom_XdndSelection) + ATOM_REFS_INIT ("XdndTypeList", Xatom_XdndTypeList) + ATOM_REFS_INIT ("XdndActionCopy", Xatom_XdndActionCopy) + ATOM_REFS_INIT ("XdndActionMove", Xatom_XdndActionMove) + ATOM_REFS_INIT ("XdndActionLink", Xatom_XdndActionLink) + ATOM_REFS_INIT ("XdndActionAsk", Xatom_XdndActionAsk) + ATOM_REFS_INIT ("XdndActionPrivate", Xatom_XdndActionPrivate) + ATOM_REFS_INIT ("XdndActionList", Xatom_XdndActionList) + ATOM_REFS_INIT ("XdndActionDescription", Xatom_XdndActionDescription) + ATOM_REFS_INIT ("XdndProxy", Xatom_XdndProxy) + ATOM_REFS_INIT ("XdndEnter", Xatom_XdndEnter) + ATOM_REFS_INIT ("XdndPosition", Xatom_XdndPosition) + ATOM_REFS_INIT ("XdndStatus", Xatom_XdndStatus) + ATOM_REFS_INIT ("XdndLeave", Xatom_XdndLeave) + ATOM_REFS_INIT ("XdndDrop", Xatom_XdndDrop) + ATOM_REFS_INIT ("XdndFinished", Xatom_XdndFinished) + /* Motif drop protocol support. */ + ATOM_REFS_INIT ("_MOTIF_DRAG_WINDOW", Xatom_MOTIF_DRAG_WINDOW) + ATOM_REFS_INIT ("_MOTIF_DRAG_TARGETS", Xatom_MOTIF_DRAG_TARGETS) + ATOM_REFS_INIT ("_MOTIF_DRAG_AND_DROP_MESSAGE", + Xatom_MOTIF_DRAG_AND_DROP_MESSAGE) + ATOM_REFS_INIT ("_MOTIF_DRAG_INITIATOR_INFO", + Xatom_MOTIF_DRAG_INITIATOR_INFO) + ATOM_REFS_INIT ("_MOTIF_DRAG_RECEIVER_INFO", + Xatom_MOTIF_DRAG_RECEIVER_INFO) + ATOM_REFS_INIT ("XmTRANSFER_SUCCESS", Xatom_XmTRANSFER_SUCCESS) + ATOM_REFS_INIT ("XmTRANSFER_FAILURE", Xatom_XmTRANSFER_FAILURE) + }; + enum { X_EVENT_NORMAL, @@ -23467,6 +23598,31 @@ x_destroy_window (struct frame *f) dpyinfo->reference_count--; } +/* Intern NAME in DPYINFO, but check to see if the atom was already + interned, and use that instead. */ +Atom +x_intern_cached_atom (struct x_display_info *dpyinfo, + const char *name) +{ + int i; + char *ptr; + Atom *atom; + + for (i = 0; i < ARRAYELTS (x_atom_refs); ++i) + { + ptr = (char *) dpyinfo; + + if (!strcmp (x_atom_refs[i].name, name)) + { + atom = (Atom *) (ptr + x_atom_refs[i].offset); + + return *atom; + } + } + + return XInternAtom (dpyinfo->display, name, False); +} + /* Setting window manager hints. */ @@ -24655,131 +24811,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) XScreenNumberOfScreen (dpyinfo->screen)); { - static const struct - { - const char *name; - int offset; - } atom_refs[] = { -#define ATOM_REFS_INIT(string, member) \ - { string, offsetof (struct x_display_info, member) }, - ATOM_REFS_INIT ("WM_PROTOCOLS", Xatom_wm_protocols) - ATOM_REFS_INIT ("WM_TAKE_FOCUS", Xatom_wm_take_focus) - ATOM_REFS_INIT ("WM_SAVE_YOURSELF", Xatom_wm_save_yourself) - ATOM_REFS_INIT ("WM_DELETE_WINDOW", Xatom_wm_delete_window) - ATOM_REFS_INIT ("WM_CHANGE_STATE", Xatom_wm_change_state) - ATOM_REFS_INIT ("WM_STATE", Xatom_wm_state) - ATOM_REFS_INIT ("WM_CONFIGURE_DENIED", Xatom_wm_configure_denied) - ATOM_REFS_INIT ("WM_MOVED", Xatom_wm_window_moved) - ATOM_REFS_INIT ("WM_CLIENT_LEADER", Xatom_wm_client_leader) - ATOM_REFS_INIT ("WM_TRANSIENT_FOR", Xatom_wm_transient_for) - ATOM_REFS_INIT ("Editres", Xatom_editres) - ATOM_REFS_INIT ("CLIPBOARD", Xatom_CLIPBOARD) - ATOM_REFS_INIT ("TIMESTAMP", Xatom_TIMESTAMP) - ATOM_REFS_INIT ("TEXT", Xatom_TEXT) - ATOM_REFS_INIT ("COMPOUND_TEXT", Xatom_COMPOUND_TEXT) - ATOM_REFS_INIT ("UTF8_STRING", Xatom_UTF8_STRING) - ATOM_REFS_INIT ("DELETE", Xatom_DELETE) - ATOM_REFS_INIT ("MULTIPLE", Xatom_MULTIPLE) - ATOM_REFS_INIT ("INCR", Xatom_INCR) - ATOM_REFS_INIT ("_EMACS_TMP_", Xatom_EMACS_TMP) - ATOM_REFS_INIT ("EMACS_SERVER_TIME_PROP", Xatom_EMACS_SERVER_TIME_PROP) - ATOM_REFS_INIT ("TARGETS", Xatom_TARGETS) - ATOM_REFS_INIT ("NULL", Xatom_NULL) - ATOM_REFS_INIT ("ATOM", Xatom_ATOM) - ATOM_REFS_INIT ("ATOM_PAIR", Xatom_ATOM_PAIR) - ATOM_REFS_INIT ("CLIPBOARD_MANAGER", Xatom_CLIPBOARD_MANAGER) - ATOM_REFS_INIT ("_XEMBED_INFO", Xatom_XEMBED_INFO) - ATOM_REFS_INIT ("_MOTIF_WM_HINTS", Xatom_MOTIF_WM_HINTS) - /* For properties of font. */ - ATOM_REFS_INIT ("PIXEL_SIZE", Xatom_PIXEL_SIZE) - ATOM_REFS_INIT ("AVERAGE_WIDTH", Xatom_AVERAGE_WIDTH) - ATOM_REFS_INIT ("_MULE_BASELINE_OFFSET", Xatom_MULE_BASELINE_OFFSET) - ATOM_REFS_INIT ("_MULE_RELATIVE_COMPOSE", Xatom_MULE_RELATIVE_COMPOSE) - ATOM_REFS_INIT ("_MULE_DEFAULT_ASCENT", Xatom_MULE_DEFAULT_ASCENT) - /* Ghostscript support. */ - ATOM_REFS_INIT ("DONE", Xatom_DONE) - ATOM_REFS_INIT ("PAGE", Xatom_PAGE) - ATOM_REFS_INIT ("SCROLLBAR", Xatom_Scrollbar) - ATOM_REFS_INIT ("HORIZONTAL_SCROLLBAR", Xatom_Horizontal_Scrollbar) - ATOM_REFS_INIT ("_XEMBED", Xatom_XEMBED) - /* EWMH */ - ATOM_REFS_INIT ("_NET_WM_STATE", Xatom_net_wm_state) - ATOM_REFS_INIT ("_NET_WM_STATE_FULLSCREEN", Xatom_net_wm_state_fullscreen) - ATOM_REFS_INIT ("_NET_WM_STATE_MAXIMIZED_HORZ", - Xatom_net_wm_state_maximized_horz) - ATOM_REFS_INIT ("_NET_WM_STATE_MAXIMIZED_VERT", - Xatom_net_wm_state_maximized_vert) - ATOM_REFS_INIT ("_NET_WM_STATE_STICKY", Xatom_net_wm_state_sticky) - ATOM_REFS_INIT ("_NET_WM_STATE_SHADED", Xatom_net_wm_state_shaded) - ATOM_REFS_INIT ("_NET_WM_STATE_HIDDEN", Xatom_net_wm_state_hidden) - ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE", Xatom_net_window_type) - ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE_TOOLTIP", - Xatom_net_window_type_tooltip) - ATOM_REFS_INIT ("_NET_WM_ICON_NAME", Xatom_net_wm_icon_name) - ATOM_REFS_INIT ("_NET_WM_NAME", Xatom_net_wm_name) - ATOM_REFS_INIT ("_NET_SUPPORTED", Xatom_net_supported) - ATOM_REFS_INIT ("_NET_SUPPORTING_WM_CHECK", Xatom_net_supporting_wm_check) - ATOM_REFS_INIT ("_NET_WM_WINDOW_OPACITY", Xatom_net_wm_window_opacity) - ATOM_REFS_INIT ("_NET_ACTIVE_WINDOW", Xatom_net_active_window) - ATOM_REFS_INIT ("_NET_FRAME_EXTENTS", Xatom_net_frame_extents) - ATOM_REFS_INIT ("_NET_CURRENT_DESKTOP", Xatom_net_current_desktop) - ATOM_REFS_INIT ("_NET_WORKAREA", Xatom_net_workarea) - ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST", Xatom_net_wm_sync_request) - ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter) - ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn) - ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time) - ATOM_REFS_INIT ("_NET_WM_USER_TIME_WINDOW", Xatom_net_wm_user_time_window) - ATOM_REFS_INIT ("_NET_CLIENT_LIST_STACKING", Xatom_net_client_list_stacking) - /* Session management */ - ATOM_REFS_INIT ("SM_CLIENT_ID", Xatom_SM_CLIENT_ID) - ATOM_REFS_INIT ("_XSETTINGS_SETTINGS", Xatom_xsettings_prop) - ATOM_REFS_INIT ("MANAGER", Xatom_xsettings_mgr) - ATOM_REFS_INIT ("_NET_WM_STATE_SKIP_TASKBAR", Xatom_net_wm_state_skip_taskbar) - ATOM_REFS_INIT ("_NET_WM_STATE_ABOVE", Xatom_net_wm_state_above) - ATOM_REFS_INIT ("_NET_WM_STATE_BELOW", Xatom_net_wm_state_below) - ATOM_REFS_INIT ("_NET_WM_OPAQUE_REGION", Xatom_net_wm_opaque_region) - ATOM_REFS_INIT ("_NET_WM_PING", Xatom_net_wm_ping) - ATOM_REFS_INIT ("_NET_WM_PID", Xatom_net_wm_pid) -#ifdef HAVE_XKB - ATOM_REFS_INIT ("Meta", Xatom_Meta) - ATOM_REFS_INIT ("Super", Xatom_Super) - ATOM_REFS_INIT ("Hyper", Xatom_Hyper) - ATOM_REFS_INIT ("ShiftLock", Xatom_ShiftLock) - ATOM_REFS_INIT ("Alt", Xatom_Alt) -#endif - /* DND source. */ - ATOM_REFS_INIT ("XdndAware", Xatom_XdndAware) - ATOM_REFS_INIT ("XdndSelection", Xatom_XdndSelection) - ATOM_REFS_INIT ("XdndTypeList", Xatom_XdndTypeList) - ATOM_REFS_INIT ("XdndActionCopy", Xatom_XdndActionCopy) - ATOM_REFS_INIT ("XdndActionMove", Xatom_XdndActionMove) - ATOM_REFS_INIT ("XdndActionLink", Xatom_XdndActionLink) - ATOM_REFS_INIT ("XdndActionAsk", Xatom_XdndActionAsk) - ATOM_REFS_INIT ("XdndActionPrivate", Xatom_XdndActionPrivate) - ATOM_REFS_INIT ("XdndActionList", Xatom_XdndActionList) - ATOM_REFS_INIT ("XdndActionDescription", Xatom_XdndActionDescription) - ATOM_REFS_INIT ("XdndProxy", Xatom_XdndProxy) - ATOM_REFS_INIT ("XdndEnter", Xatom_XdndEnter) - ATOM_REFS_INIT ("XdndPosition", Xatom_XdndPosition) - ATOM_REFS_INIT ("XdndStatus", Xatom_XdndStatus) - ATOM_REFS_INIT ("XdndLeave", Xatom_XdndLeave) - ATOM_REFS_INIT ("XdndDrop", Xatom_XdndDrop) - ATOM_REFS_INIT ("XdndFinished", Xatom_XdndFinished) - /* Motif drop protocol support. */ - ATOM_REFS_INIT ("_MOTIF_DRAG_WINDOW", Xatom_MOTIF_DRAG_WINDOW) - ATOM_REFS_INIT ("_MOTIF_DRAG_TARGETS", Xatom_MOTIF_DRAG_TARGETS) - ATOM_REFS_INIT ("_MOTIF_DRAG_AND_DROP_MESSAGE", - Xatom_MOTIF_DRAG_AND_DROP_MESSAGE) - ATOM_REFS_INIT ("_MOTIF_DRAG_INITIATOR_INFO", - Xatom_MOTIF_DRAG_INITIATOR_INFO) - ATOM_REFS_INIT ("_MOTIF_DRAG_RECEIVER_INFO", - Xatom_MOTIF_DRAG_RECEIVER_INFO) - ATOM_REFS_INIT ("XmTRANSFER_SUCCESS", Xatom_XmTRANSFER_SUCCESS) - ATOM_REFS_INIT ("XmTRANSFER_FAILURE", Xatom_XmTRANSFER_FAILURE) - }; - int i; - enum { atom_count = ARRAYELTS (atom_refs) }; + enum { atom_count = ARRAYELTS (x_atom_refs) }; /* 1 for _XSETTINGS_SN. */ enum { total_atom_count = 2 + atom_count }; Atom atoms_return[total_atom_count]; @@ -24789,7 +24822,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) + INT_STRLEN_BOUND (int)]; for (i = 0; i < atom_count; i++) - atom_names[i] = (char *) atom_refs[i].name; + atom_names[i] = (char *) x_atom_refs[i].name; /* Build _XSETTINGS_SN atom name. */ sprintf (xsettings_atom_name, xsettings_fmt, @@ -24801,7 +24834,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) False, atoms_return); for (i = 0; i < atom_count; i++) - *(Atom *) ((char *) dpyinfo + atom_refs[i].offset) = atoms_return[i]; + *(Atom *) ((char *) dpyinfo + x_atom_refs[i].offset) = atoms_return[i]; /* Manually copy last two atoms. */ dpyinfo->Xatom_xsettings_sel = atoms_return[i]; diff --git a/src/xterm.h b/src/xterm.h index 724caf9e75..5780f88bbc 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1536,6 +1536,7 @@ extern Lisp_Object x_timestamp_for_selection (struct x_display_info *, Lisp_Object); extern void x_set_pending_dnd_time (Time); extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object); +extern Atom x_intern_cached_atom (struct x_display_info *, const char *); #ifdef USE_GTK extern bool xg_set_icon (struct frame *, Lisp_Object); commit 7c4a780721a64bf429bc87557922a46870a924c5 Author: Po Lu Date: Tue May 24 21:01:14 2022 +0800 Prevent errors when Lisp code asks for props of invalid windows * src/xfns.c (Fx_window_property): (Fx_window_property_attributes): Catch X errors. diff --git a/src/xfns.c b/src/xfns.c index 94077e0af4..e1f8947d55 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -7563,6 +7563,8 @@ if PROP has no value of TYPE (always a string in the MS Windows case). */) } block_input (); + x_catch_errors (FRAME_X_DISPLAY (f)); + if (STRINGP (type)) { if (strcmp ("AnyPropertyType", SSDATA (type)) == 0) @@ -7593,6 +7595,9 @@ if PROP has no value of TYPE (always a string in the MS Windows case). */) &found); } + x_check_errors (FRAME_X_DISPLAY (f), + "Can't retrieve window property: %s"); + x_uncatch_errors_after_check (); unblock_input (); return prop_value; @@ -7638,6 +7643,7 @@ Otherwise, the return value is a vector with the following fields: block_input (); + x_catch_errors (FRAME_X_DISPLAY (f)); prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, prop_atom, 0, 0, False, AnyPropertyType, @@ -7668,6 +7674,10 @@ Otherwise, the return value is a vector with the following fields: make_fixnum (bytes_remaining / (actual_format >> 3))); } + x_check_errors (FRAME_X_DISPLAY (f), + "Can't retrieve window property: %s"); + x_uncatch_errors_after_check (); + unblock_input (); return prop_attr; } commit d63d633a68a0ce1dd3bb8650346b27148ac67329 Author: Po Lu Date: Tue May 24 20:58:52 2022 +0800 Handle invalid NEWS files during describe-function * src/help-fns.el (help-fns--first-release): Don't error if searching for a heading fails. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 45308e6e9c..f200077fae 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -799,21 +799,23 @@ the C sources, too." (erase-buffer) (insert-file-contents f) (goto-char (point-min)) - (search-forward "\n*") - (while (re-search-forward re nil t) - (let ((pos (match-beginning 0))) - (save-excursion - ;; Almost all entries are of the form "* ... in Emacs NN.MM." - ;; but there are also a few in the form "* Emacs NN.MM is a bug - ;; fix release ...". - (if (not (re-search-backward "^\\* .* Emacs \\([0-9.]+[0-9]\\)" - nil t)) - (message "Ref found in non-versioned section in %S" - (file-name-nondirectory f)) - (let ((version (match-string 1))) - (when (or (null first) (version< version first)) - (setq place (list f pos)) - (setq first version))))))))) + ;; Failed git merges can leave empty files that look like NEWS + ;; in etc. Don't error here. + (when (search-forward "\n*" nil t) + (while (re-search-forward re nil t) + (let ((pos (match-beginning 0))) + (save-excursion + ;; Almost all entries are of the form "* ... in Emacs NN.MM." + ;; but there are also a few in the form "* Emacs NN.MM is a bug + ;; fix release ...". + (if (not (re-search-backward "^\\* .* Emacs \\([0-9.]+[0-9]\\)" + nil t)) + (message "Ref found in non-versioned section in %S" + (file-name-nondirectory f)) + (let ((version (match-string 1))) + (when (or (null first) (version< version first)) + (setq place (list f pos)) + (setq first version)))))))))) (when first (make-text-button first nil 'type 'help-news 'help-args place)))) commit a49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d Author: Jim Porter Date: Sun May 22 17:27:48 2022 -0700 Keep subcommands in pipelines from clobbering the head/tail processes * lisp/eshell/esh-cmd.el (eshell-execute-pipeline): Use 'make-symbol' for headproc and tailproc. (eshell-do-pipelines, eshell-do-pipelines-synchronously): Adapt to the above. * test/lisp/eshell/eshell-tests.el (eshell-test/pipe-subcommand) (eshell-test/pipe-subcommand-with-pipe): New test. * doc/misc/eshell.texi (Bugs and ideas): Remove item about piping to process from loop; this commit fixes it (bug#55590). diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index d35a642b62..85e5a4933f 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1758,14 +1758,6 @@ alias arg=blah function arg () @{ blah $* @} @end example -@item @samp{for i in 1 2 3 @{ grep -q a b && *echo has it @} | wc -l} outputs result after prompt - -In fact, piping to a process from a looping construct doesn't work in -general. If I change the call to @code{eshell-copy-handles} in -@code{eshell-rewrite-for-command} to use @code{eshell-protect}, it seems -to work, but the output occurs after the prompt is displayed. The whole -structured command thing is too complicated at present. - @item Pcomplete sometimes gets stuck You press @key{TAB}, but no completions appear, even though the diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 42616e7037..73c250632c 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -827,8 +827,8 @@ This macro calls itself recursively, with NOTFIRST non-nil." ((cdr pipeline) t) (t (quote 'last))))) (let ((proc ,(car pipeline))) - (setq headproc (or proc headproc)) - (setq tailproc (or tailproc proc)) + (set headproc (or proc (symbol-value headproc))) + (set tailproc (or (symbol-value tailproc) proc)) proc)))))) (defmacro eshell-do-pipelines-synchronously (pipeline) @@ -861,7 +861,7 @@ This is used on systems where async subprocesses are not supported." (let ((result ,(car pipeline))) ;; tailproc gets the result of the last successful process in ;; the pipeline. - (setq tailproc (or result tailproc)) + (set tailproc (or result (symbol-value tailproc))) ,(if (cdr pipeline) `(eshell-do-pipelines-synchronously (quote ,(cdr pipeline)))) result)))) @@ -870,7 +870,11 @@ This is used on systems where async subprocesses are not supported." (defmacro eshell-execute-pipeline (pipeline) "Execute the commands in PIPELINE, connecting each to one another." - `(let ((eshell-in-pipeline-p t) headproc tailproc) + `(let ((eshell-in-pipeline-p t) + (headproc (make-symbol "headproc")) + (tailproc (make-symbol "tailproc"))) + (set headproc nil) + (set tailproc nil) (progn ,(if (fboundp 'make-process) `(eshell-do-pipelines ,pipeline) @@ -880,7 +884,8 @@ This is used on systems where async subprocesses are not supported." (car (aref eshell-current-handles ,eshell-error-handle)) nil))) (eshell-do-pipelines-synchronously ,pipeline))) - (eshell-process-identity (cons headproc tailproc))))) + (eshell-process-identity (cons (symbol-value headproc) + (symbol-value tailproc)))))) (defmacro eshell-as-subcommand (command) "Execute COMMAND using a temp buffer. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 7cdeb017e4..c0affed80a 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -114,6 +114,22 @@ e.g. \"{(+ 1 2)} 3\" => 3" (eshell-wait-for-subprocess) (eshell-match-result "OLLEH\n"))) +(ert-deftest eshell-test/pipe-subcommand () + "Check that piping with an asynchronous subcommand works" + (skip-unless (and (executable-find "echo") + (executable-find "cat"))) + (with-temp-eshell + (eshell-command-result-p "echo ${*echo hi} | *cat" + "hi"))) + +(ert-deftest eshell-test/pipe-subcommand-with-pipe () + "Check that piping with an asynchronous subcommand with its own pipe works" + (skip-unless (and (executable-find "echo") + (executable-find "cat"))) + (with-temp-eshell + (eshell-command-result-p "echo ${*echo hi | *cat} | *cat" + "hi"))) + (ert-deftest eshell-test/redirect-buffer () "Check that piping to a buffer works" (with-temp-buffer commit be17333acee2086d1c729197dfe64432f6ad6625 Author: Lars Ingebrigtsen Date: Tue May 24 14:54:40 2022 +0200 Tweak remapping fix for set-transient-map * lisp/subr.el (set-transient-map): The remapping doesn't have to be in this map. diff --git a/lisp/subr.el b/lisp/subr.el index 137e298cd8..adcbd94744 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6052,7 +6052,7 @@ to deactivate this transient map, regardless of KEEP-PRED." ;; We may have a remapped command, so chase ;; down that. (when (and mc (symbolp mc)) - (setq mc (or (command-remapping mc nil map) mc))) + (setq mc (or (command-remapping mc) mc))) ;; If the key is unbound `this-command` is ;; nil and so is `mc`. (and mc (eq this-command mc)))) commit 8420d7cce72b7e6c69265e60c10a0ea4e420934c Author: Štěpán Němec Date: Tue May 24 14:49:42 2022 +0200 Add elisp-eldoc-var-docstring-with-value function * lisp/progmodes/elisp-mode.el (elisp-eldoc-var-docstring-with-value): New function (bug#55096). diff --git a/etc/NEWS b/etc/NEWS index 9794807441..1fa2d086b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1868,6 +1868,9 @@ functions. * Lisp Changes in Emacs 29.1 +--- +** New eldoc function: 'elisp-eldoc-var-docstring-with-value'. + ** '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 diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 70826b4c3a..84b7938bf0 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1763,7 +1763,8 @@ Intended for `eldoc-documentation-functions' (which see)." (defun elisp-eldoc-var-docstring (callback &rest _ignored) "Document variable at point. -Intended for `eldoc-documentation-functions' (which see)." +Intended for `eldoc-documentation-functions' (which see). +Also see `elisp-eldoc-var-docstring-with-value'." (let* ((sym (elisp--current-symbol)) (docstring (and sym (elisp-get-var-docstring sym)))) (when docstring @@ -1771,6 +1772,32 @@ Intended for `eldoc-documentation-functions' (which see)." :thing sym :face 'font-lock-variable-name-face)))) +(defun elisp-eldoc-var-docstring-with-value (callback &rest _) + "Document variable at point. +Intended for `eldoc-documentation-functions' (which see). +Also see `elisp-eldoc-var-docstring-with-value'." + (when-let ((cs (elisp--current-symbol))) + (when (and (boundp cs) + ;; nil and t are boundp! + (not (null cs)) + (not (eq cs t))) + (funcall callback + (format "%.100S %s" + (symbol-value cs) + (let* ((doc (documentation-property + cs 'variable-documentation t)) + (more (- (length doc) 1000))) + (concat (propertize + (string-limit (if (string= doc "nil") + "Undocumented." + doc) + 1000) + 'face 'font-lock-doc-face) + (when (> more 0) + (format "[%sc more]" more))))) + :thing cs + :face 'font-lock-variable-name-face)))) + (defun elisp-get-fnsym-args-string (sym &optional index) "Return a string containing the parameter list of the function SYM. If SYM is a subr and no arglist is obtainable from the docstring commit 388e0c18f489fc7d4bee8278e21852eefa1dcf19 Author: Lars Ingebrigtsen Date: Tue May 24 14:06:38 2022 +0200 Make the nativecomp test eln directory more reliably be removed * lisp/startup.el (startup-redirect-eln-cache, normal-top-level): Don't create the nativecomp directory here, because this led to brittle deletions of the directory -- there would be several instances of the directory left over after a test run. * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Create the nativecomp directory. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 00da5c718c..0451be272a 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1533,23 +1533,33 @@ Returns the stats object." "Like `ert-run-tests-batch', but exits Emacs when done. The exit status will be 0 if all test results were as expected, 1 -on unexpected results, or 2 if the tool detected an error outside +son unexpected results, or 2 if the tool detected an error outside of the tests (e.g. invalid SELECTOR or bug in the code that runs the tests)." (or noninteractive (user-error "This function is only for use in batch mode")) - ;; Better crash loudly than attempting to recover from undefined - ;; behavior. - (setq attempt-stack-overflow-recovery nil - attempt-orderly-shutdown-on-fatal-signal nil) - (unwind-protect - (let ((stats (ert-run-tests-batch selector))) - (kill-emacs (if (zerop (ert-stats-completed-unexpected stats)) 0 1))) + (let ((eln-dir (and (featurep 'native-compile) + (make-temp-file "test-nativecomp-cache-" t)))) + (when eln-dir + (startup-redirect-eln-cache eln-dir)) + ;; Better crash loudly than attempting to recover from undefined + ;; behavior. + (setq attempt-stack-overflow-recovery nil + attempt-orderly-shutdown-on-fatal-signal nil) (unwind-protect - (progn - (message "Error running tests") - (backtrace)) - (kill-emacs 2)))) + (let ((stats (ert-run-tests-batch selector))) + (when eln-dir + (ignore-errors + (delete-directory eln-dir t))) + (kill-emacs (if (zerop (ert-stats-completed-unexpected stats)) 0 1))) + (unwind-protect + (progn + (message "Error running tests") + (backtrace)) + (when eln-dir + (ignore-errors + (delete-directory eln-dir t))) + (kill-emacs 2))))) (defvar ert-load-file-name nil "The name of the loaded ERT test file, a string. diff --git a/lisp/startup.el b/lisp/startup.el index 433a58bf2c..4b42cd236c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -557,25 +557,12 @@ to `user-emacs-directory'. For best results, call this function in your early-init file, so that the rest of initialization and package loading uses the updated value." - (let ((tmp-dir (and (equal (getenv "HOME") "/nonexistent") - (file-writable-p (expand-file-name - (or temporary-file-directory ""))) - (car native-comp-eln-load-path)))) - (if tmp-dir - (setq native-comp-eln-load-path - (cdr native-comp-eln-load-path))) - ;; Remove the original eln-cache. - (setq native-comp-eln-load-path - (cdr native-comp-eln-load-path)) - ;; Add the new eln-cache. - (push (expand-file-name (file-name-as-directory cache-directory) - user-emacs-directory) - native-comp-eln-load-path) - (when tmp-dir - ;; Recompute tmp-dir, in case user-emacs-directory affects it. - (setq tmp-dir (make-temp-file "emacs-testsuite-" t)) - (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) - (push tmp-dir native-comp-eln-load-path)))) + ;; Remove the original eln-cache. + (setq native-comp-eln-load-path (cdr native-comp-eln-load-path)) + ;; Add the new eln-cache. + (push (expand-file-name (file-name-as-directory cache-directory) + user-emacs-directory) + native-comp-eln-load-path)) (defun startup--update-eln-cache () "Update the user eln-cache directory due to user customizations." @@ -619,18 +606,7 @@ It is the default value of the variable `top-level'." (unless (string= "" path) (push path native-comp-eln-load-path))))) (push (expand-file-name "eln-cache/" user-emacs-directory) - native-comp-eln-load-path) - ;; When $HOME is set to '/nonexistent' means we are running the - ;; testsuite, add a temporary folder in front to produce there - ;; new compilations. - (when (and (equal (getenv "HOME") "/nonexistent") - ;; We may be running in a chroot environment where we - ;; can't write anything. - (file-writable-p (expand-file-name - (or temporary-file-directory "")))) - (let ((tmp-dir (make-temp-file "emacs-testsuite-" t))) - (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) - (push tmp-dir native-comp-eln-load-path)))) + native-comp-eln-load-path)) ;; Look in each dir in load-path for a subdirs.el file. If we ;; find one, load it, which will add the appropriate subdirs of diff --git a/src/emacs.c b/src/emacs.c index a9126e7be8..9197a19f36 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2961,6 +2961,10 @@ shut_down_emacs (int sig, Lisp_Object stuff) check_message_stack (); } +#ifdef HAVE_NATIVE_COMP + eln_load_path_final_clean_up (); +#endif + #ifdef MSDOS dos_cleanup (); #endif commit 533500522d8deb84e85e40427c0d71761d620f5a Author: Lars Ingebrigtsen Date: Tue May 24 13:22:06 2022 +0200 Regenerated ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 95ad2f78cf..95cec5a34c 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -5613,9 +5613,15 @@ If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight the matching section of the visited source line; the default is to use the global value of `compilation-highlight-regexp'. +If CONTINUE is non-nil, the buffer won't be emptied before +compilation is started. This can be useful if you wish to +combine the output from several compilation commands in the same +buffer. The new output will be at the end of the buffer, and +point is not changed. + Returns the compilation buffer created. -\(fn COMMAND &optional MODE NAME-FUNCTION HIGHLIGHT-REGEXP)" nil nil) +\(fn COMMAND &optional MODE NAME-FUNCTION HIGHLIGHT-REGEXP CONTINUE)" nil nil) (autoload 'compilation-mode "compile" "\ Major mode for compilation log buffers. @@ -8483,10 +8489,15 @@ String to indent at the start if the header line. This is used in `header-line-indent-mode', and buffers that have this switched on should have a `header-line-format' that look like: - (\"\" header-line-indent THE-REST...)") + (\"\" header-line-indent THE-REST...) + +Also see `header-line-indent-width'.") (defvar header-line-indent-width 0 "\ -The width of the current line numbers displayed.") +The width of the current line numbers displayed. +This is updated when `header-line-indent-mode' is switched on. + +Also see `header-line-indent'.") (autoload 'header-line-indent-mode "display-line-numbers" "\ Mode to indent the header line in `display-line-numbers-mode' buffers. @@ -8500,6 +8511,12 @@ Buffers that have this switched on should have a (\"\" header-line-indent THE-REST...) +The `header-line-indent-width' variable is also kept updated, and +has the width of `header-line-format'. This can be used, for +instance, in `:align-to' specs, like: + + (space :align-to (+ header-line-indent-width 10)) + This is a minor mode. If called interactively, toggle the `Header-Line-Indent mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable @@ -11169,7 +11186,7 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. ;;;### (autoloads nil "erc-lang" "erc/erc-lang.el" (0 0 0 0)) ;;; Generated autoloads from erc/erc-lang.el -(register-definition-prefixes "erc-lang" '("erc-cmd-LANG" "iso-638-languages" "language")) +(register-definition-prefixes "erc-lang" '("erc-cmd-LANG" "iso-639-1-languages" "language")) ;;;*** @@ -13484,6 +13501,13 @@ The commands `flymake-goto-next-error' and `flymake-goto-prev-error' can be used to navigate among Flymake diagnostics annotated in the buffer. +By default, `flymake-mode' doesn't override the \\[next-error] command, but +if you're using Flymake a lot (and don't use the regular compilation +mechanisms that often), it can be useful to put something like +the following in your init file: + + (setq next-error-function \\='flymake-goto-next-error) + The visual appearance of each type of diagnostic can be changed by setting properties `flymake-overlay-control', `flymake-bitmap' and `flymake-severity' on the symbols of diagnostic types (like @@ -14219,7 +14243,7 @@ Interactively, reads the register using `register-read-with-preview'. ;;;### (autoloads nil "fringe" "fringe.el" (0 0 0 0)) ;;; Generated autoloads from fringe.el -(unless (fboundp 'define-fringe-bitmap) (defun define-fringe-bitmap (_bitmap _bits &optional _height _width _align) "Define fringe bitmap BITMAP from BITS of size HEIGHT x WIDTH.\nBITMAP is a symbol identifying the new fringe bitmap.\nBITS is either a string or a vector of integers.\nHEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS.\nWIDTH must be an integer between 1 and 16, or nil which defaults to 8.\nOptional fifth arg ALIGN may be one of ‘top’, ‘center’, or ‘bottom’,\nindicating the positioning of the bitmap relative to the rows where it\nis used; the default is to center the bitmap. Fifth arg may also be a\nlist (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap\nshould be repeated.\nIf BITMAP already exists, the existing definition is replaced.")) +(unless (fboundp 'define-fringe-bitmap) (defun define-fringe-bitmap (_bitmap _bits &optional _height _width _align) "Define fringe bitmap BITMAP from BITS of size HEIGHT x WIDTH.\nBITMAP is a symbol identifying the new fringe bitmap.\nBITS is either a string or a vector of integers.\nHEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS.\nWIDTH must be an integer between 1 and 16, or nil which defaults to 8.\nOptional fifth arg ALIGN may be one of `top', `center', or `bottom',\nindicating the positioning of the bitmap relative to the rows where it\nis used; the default is to center the bitmap. Fifth arg may also be a\nlist (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap\nshould be repeated.\nIf BITMAP already exists, the existing definition is replaced.")) (register-definition-prefixes "fringe" '("fringe-" "set-fringe-")) @@ -22273,11 +22297,14 @@ The characters copied are inserted in the buffer before point. (autoload 'zap-up-to-char "misc" "\ Kill up to, but not including ARGth occurrence of CHAR. +When run interactively, the argument INTERACTIVE is non-nil. Case is ignored if `case-fold-search' is non-nil in the current buffer. Goes backward if ARG is negative; error if CHAR not found. Ignores CHAR at point. +If called interactively, do a case sensitive search if CHAR +is an upper-case character. -\(fn ARG CHAR)" t nil) +\(fn ARG CHAR &optional INTERACTIVE)" t nil) (autoload 'mark-beginning-of-buffer "misc" "\ Set mark at the beginning of the buffer." t nil) @@ -30334,7 +30361,7 @@ Major mode for editing Bovine grammars. \(fn)" t nil) -(register-definition-prefixes "semantic/bovine/grammar" '("bovine-")) +(register-definition-prefixes "semantic/bovine/grammar" '("bovine-" "semantic-grammar-")) ;;;*** @@ -30475,7 +30502,7 @@ Major mode for editing Wisent grammars. \(fn)" t nil) -(register-definition-prefixes "semantic/wisent/grammar" '("wisent-")) +(register-definition-prefixes "semantic/wisent/grammar" '("semantic-grammar-" "wisent-")) ;;;*** @@ -35757,7 +35784,7 @@ Discard Tramp from loading remote files." (interactive) (ignore-errors (unload-f (defvar tramp-archive-enabled (featurep 'dbusbind) "\ Non-nil when file archive support is available.") -(defconst tramp-archive-suffixes '("7z" "apk" "ar" "cab" "CAB" "cpio" "crate" "deb" "depot" "exe" "iso" "jar" "lzh" "LZH" "msu" "MSU" "mtree" "odb" "odf" "odg" "odp" "ods" "odt" "pax" "rar" "rpm" "shar" "tar" "tbz" "tgz" "tlz" "txz" "tzst" "warc" "xar" "xpi" "xps" "zip" "ZIP") "\ +(defconst tramp-archive-suffixes '("7z" "apk" "ar" "cab" "CAB" "cpio" "crate" "deb" "depot" "epub" "exe" "iso" "jar" "lzh" "LZH" "msu" "MSU" "mtree" "odb" "odf" "odg" "odp" "ods" "odt" "pax" "rar" "rpm" "shar" "tar" "tbz" "tgz" "tlz" "txz" "tzst" "warc" "xar" "xpi" "xps" "zip" "ZIP") "\ List of suffixes which indicate a file archive. It must be supported by libarchive(3).") @@ -40452,45 +40479,46 @@ Zone out, completely." t nil) ;;;;;; "language/georgian.el" "language/greek.el" "language/hebrew.el" ;;;;;; "language/indian.el" "language/japanese.el" "language/khmer.el" ;;;;;; "language/korean.el" "language/lao.el" "language/misc-lang.el" -;;;;;; "language/romanian.el" "language/sinhala.el" "language/slovak.el" -;;;;;; "language/tai-viet.el" "language/thai.el" "language/tibetan.el" -;;;;;; "language/utf-8-lang.el" "language/vietnamese.el" "ldefs-boot.el" -;;;;;; "leim/ja-dic/ja-dic.el" "leim/leim-list.el" "leim/quail/4Corner.el" -;;;;;; "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el" "leim/quail/CTLau-b5.el" -;;;;;; "leim/quail/CTLau.el" "leim/quail/ECDICT.el" "leim/quail/ETZY.el" -;;;;;; "leim/quail/PY-b5.el" "leim/quail/PY.el" "leim/quail/Punct-b5.el" -;;;;;; "leim/quail/Punct.el" "leim/quail/QJ-b5.el" "leim/quail/QJ.el" -;;;;;; "leim/quail/SW.el" "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el" -;;;;;; "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/cham.el" -;;;;;; "leim/quail/compose.el" "leim/quail/croatian.el" "leim/quail/cyril-jis.el" -;;;;;; "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/emoji.el" -;;;;;; "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el" -;;;;;; "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el" -;;;;;; "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" -;;;;;; "leim/quail/latin-post.el" "leim/quail/latin-pre.el" "leim/quail/persian.el" -;;;;;; "leim/quail/programmer-dvorak.el" "leim/quail/py-punct.el" -;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" "leim/quail/quick-cns.el" -;;;;;; "leim/quail/rfc1345.el" "leim/quail/sami.el" "leim/quail/sgml-input.el" -;;;;;; "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" "leim/quail/tamil-dvorak.el" -;;;;;; "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" "leim/quail/vntelex.el" -;;;;;; "leim/quail/vnvni.el" "leim/quail/welsh.el" "loadup.el" "mail/blessmail.el" -;;;;;; "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" "minibuffer.el" -;;;;;; "mouse.el" "newcomment.el" "obarray.el" "org/ob-core.el" -;;;;;; "org/ob-lob.el" "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" -;;;;;; "org/ol-bbdb.el" "org/ol-irc.el" "org/ol.el" "org/org-archive.el" -;;;;;; "org/org-attach.el" "org/org-clock.el" "org/org-colview.el" -;;;;;; "org/org-compat.el" "org/org-datetree.el" "org/org-duration.el" -;;;;;; "org/org-element.el" "org/org-feed.el" "org/org-footnote.el" -;;;;;; "org/org-goto.el" "org/org-id.el" "org/org-indent.el" "org/org-install.el" -;;;;;; "org/org-keys.el" "org/org-lint.el" "org/org-list.el" "org/org-macs.el" -;;;;;; "org/org-mobile.el" "org/org-num.el" "org/org-plot.el" "org/org-refile.el" -;;;;;; "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" -;;;;;; "org/ox-html.el" "org/ox-icalendar.el" "org/ox-latex.el" -;;;;;; "org/ox-md.el" "org/ox-odt.el" "org/ox-org.el" "org/ox-publish.el" -;;;;;; "org/ox-texinfo.el" "org/ox.el" "paren.el" "progmodes/elisp-mode.el" -;;;;;; "progmodes/prog-mode.el" "ps-mule.el" "register.el" "replace.el" -;;;;;; "rfn-eshadow.el" "select.el" "simple.el" "startup.el" "subdirs.el" -;;;;;; "subr.el" "tab-bar.el" "textmodes/fill.el" "textmodes/makeinfo.el" +;;;;;; "language/philippine.el" "language/romanian.el" "language/sinhala.el" +;;;;;; "language/slovak.el" "language/tai-viet.el" "language/thai.el" +;;;;;; "language/tibetan.el" "language/utf-8-lang.el" "language/vietnamese.el" +;;;;;; "ldefs-boot.el" "leim/ja-dic/ja-dic.el" "leim/leim-list.el" +;;;;;; "leim/quail/4Corner.el" "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el" +;;;;;; "leim/quail/CTLau-b5.el" "leim/quail/CTLau.el" "leim/quail/ECDICT.el" +;;;;;; "leim/quail/ETZY.el" "leim/quail/PY-b5.el" "leim/quail/PY.el" +;;;;;; "leim/quail/Punct-b5.el" "leim/quail/Punct.el" "leim/quail/QJ-b5.el" +;;;;;; "leim/quail/QJ.el" "leim/quail/SW.el" "leim/quail/TONEPY.el" +;;;;;; "leim/quail/ZIRANMA.el" "leim/quail/ZOZY.el" "leim/quail/arabic.el" +;;;;;; "leim/quail/cham.el" "leim/quail/compose.el" "leim/quail/croatian.el" +;;;;;; "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" "leim/quail/czech.el" +;;;;;; "leim/quail/emoji.el" "leim/quail/georgian.el" "leim/quail/greek.el" +;;;;;; "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el" +;;;;;; "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" +;;;;;; "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" "leim/quail/latin-pre.el" +;;;;;; "leim/quail/persian.el" "leim/quail/philippine.el" "leim/quail/programmer-dvorak.el" +;;;;;; "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" +;;;;;; "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el" +;;;;;; "leim/quail/sgml-input.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" +;;;;;; "leim/quail/tamil-dvorak.el" "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" +;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el" +;;;;;; "loadup.el" "mail/blessmail.el" "mail/undigest.el" "menu-bar.el" +;;;;;; "mh-e/mh-gnus.el" "minibuffer.el" "mouse.el" "newcomment.el" +;;;;;; "obarray.el" "org/ob-core.el" "org/ob-lob.el" "org/ob-matlab.el" +;;;;;; "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el" "org/ol-irc.el" +;;;;;; "org/ol.el" "org/org-archive.el" "org/org-attach.el" "org/org-clock.el" +;;;;;; "org/org-colview.el" "org/org-compat.el" "org/org-datetree.el" +;;;;;; "org/org-duration.el" "org/org-element.el" "org/org-feed.el" +;;;;;; "org/org-footnote.el" "org/org-goto.el" "org/org-id.el" "org/org-indent.el" +;;;;;; "org/org-install.el" "org/org-keys.el" "org/org-lint.el" +;;;;;; "org/org-list.el" "org/org-macs.el" "org/org-mobile.el" "org/org-num.el" +;;;;;; "org/org-plot.el" "org/org-refile.el" "org/org-table.el" +;;;;;; "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" "org/ox-html.el" +;;;;;; "org/ox-icalendar.el" "org/ox-latex.el" "org/ox-md.el" "org/ox-odt.el" +;;;;;; "org/ox-org.el" "org/ox-publish.el" "org/ox-texinfo.el" "org/ox.el" +;;;;;; "paren.el" "progmodes/elisp-mode.el" "progmodes/prog-mode.el" +;;;;;; "ps-mule.el" "register.el" "replace.el" "rfn-eshadow.el" +;;;;;; "select.el" "simple.el" "startup.el" "subdirs.el" "subr.el" +;;;;;; "tab-bar.el" "textmodes/fill.el" "textmodes/makeinfo.el" ;;;;;; "textmodes/page.el" "textmodes/paragraphs.el" "textmodes/reftex-auc.el" ;;;;;; "textmodes/reftex-cite.el" "textmodes/reftex-dcr.el" "textmodes/reftex-global.el" ;;;;;; "textmodes/reftex-index.el" "textmodes/reftex-parse.el" "textmodes/reftex-ref.el" commit b2bce107b15d6e0c2b773704179c6bf463525459 Author: Lars Ingebrigtsen Date: Tue May 24 13:17:53 2022 +0200 Further audits of single quotes in Lisp doc strings * test/manual/etags/el-src/emacs/lisp/progmodes/etags.el (tags-apropos-additional-actions): * lisp/window.el (delete-window-choose-selected): * lisp/vc/ediff-merg.el (ediff-combination-pattern): * lisp/vc/diff.el (diff-no-select): * lisp/tab-bar.el (tab-bar-new-tab-choice): * lisp/simple.el (next-error-message-highlight): (backward-delete-char-untabify): * lisp/ses.el (ses-jump-cell-name-function): * lisp/org/org.el (org-latex-to-html-convert-command): * lisp/org/org-agenda.el (org-agenda-sorting-strategy): * lisp/net/tramp.el (tramp-default-file-modes): * lisp/net/newst-treeview.el (newsticker-treeview-use-feed-name-from-url-list-in-treeview): * lisp/net/eww.el (eww-auto-rename-buffer): * lisp/mwheel.el (mouse-wheel-scroll-amount): * lisp/mail/rmail.el (rmail-re-abbrevs): * lisp/info.el (Info-history-forward-menu): * lisp/gnus/nnselect.el (nnselect-retrieve-headers-override-function): * lisp/gnus/gnus-start.el (gnus-subscribe-hierarchical-interactive): * lisp/fringe.el (fboundp): * lisp/eshell/esh-var.el (eshell-variable-aliases-list): * lisp/emacs-lisp/checkdoc.el (checkdoc-column-zero-backslash-before-paren): * lisp/dired-aux.el (dired-confirm-shell-command): * lisp/calendar/calendar.el (calendar-time-zone-style): * lisp/ansi-color.el (ansi-color-faces-vector): (ansi-color-names-vector): Audit use of various single quotes in Lisp doc strings. diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index b273e1f634..d5db9ecfed 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -234,7 +234,7 @@ This vector holds the faces used for SGR control sequence parameters 0 to 7. This variable is obsolete. To customize the display of faces used by -ansi-color, change 'ansi-color-FACE', e.g. `ansi-color-bold'. To +ansi-color, change `ansi-color-FACE', e.g. `ansi-color-bold'. To customize the actual faces used (e.g. to temporarily display SGR control sequences differently), use `ansi-color-basic-faces-vector'." :type '(vector face face face face face face face face) @@ -249,7 +249,7 @@ This vector holds the colors used for SGR control sequence parameters 30 to 37 (foreground colors) and 40 to 47 (background colors). This variable is obsolete. To customize the display of colors used by -ansi-color, change 'ansi-color-COLOR', e.g. `ansi-color-red'. To +ansi-color, change `ansi-color-COLOR', e.g. `ansi-color-red'. To customize the actual faces used (e.g. to temporarily display SGR control sequences differently), use `ansi-color-normal-colors-vector'." :type '(vector (choice color (cons color color)) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 7804ce0ee9..9a77ae72d0 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1066,7 +1066,7 @@ calendar." ;; fixme should have a :set that changes calendar-standard-time-zone-name etc. (defcustom calendar-time-zone-style 'symbolic "Your preferred style for time zones. -If 'numeric, use numeric time zones like \"+0100\". +If `numeric', use numeric time zones like \"+0100\". Otherwise, use symbolic time zones like \"CET\"." :type '(choice (const numeric) (other symbolic)) :version "28.1" diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index d87d617ed7..4faf9431aa 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -797,7 +797,7 @@ offer a smarter default choice of shell command." ;;;###autoload (defcustom dired-confirm-shell-command t - "Whether to prompt for confirmation for ‘dired-do-shell-command’. + "Whether to prompt for confirmation for `dired-do-shell-command'. If non-nil, prompt for confirmation if the command contains potentially dangerous characters. If nil, never prompt for confirmation." :type 'boolean diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 2554948890..346c20c590 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -327,7 +327,7 @@ This should be set in an Emacs Lisp file's local variables." ;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p) (defcustom checkdoc-column-zero-backslash-before-paren t - "Non-nil means to warn if there is no '\\' before '(' in column zero. + "Non-nil means to warn if there is no \"\\\" before \"(\" in column zero. This backslash is no longer needed on Emacs 27.1 or later. See Info node `(elisp) Documentation Tips' for background." diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 1c28d24af1..186f6358bc 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -185,7 +185,7 @@ list of the indices that was used in the reference, and whether the user is requesting the length of the ultimate element. For example, a reference of `$NAME[10][20]' would result in the function for alias `NAME' being called (assuming it were aliased to a function), and the -arguments passed to this function would be the list '(10 20)', and +arguments passed to this function would be the list `(10 20)', and nil. If the value is a string, return the value for the variable with that diff --git a/lisp/fringe.el b/lisp/fringe.el index 1cfcce4542..2fcdc9be07 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el @@ -314,7 +314,7 @@ BITMAP is a symbol identifying the new fringe bitmap. BITS is either a string or a vector of integers. HEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS. WIDTH must be an integer between 1 and 16, or nil which defaults to 8. -Optional fifth arg ALIGN may be one of ‘top’, ‘center’, or ‘bottom’, +Optional fifth arg ALIGN may be one of `top', `center', or `bottom', indicating the positioning of the bitmap relative to the rows where it is used; the default is to center the bitmap. Fifth arg may also be a list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index dd9c277805..7b5721fafb 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -329,10 +329,10 @@ with the subscription method in this variable." "If non-nil, Gnus will offer to subscribe hierarchically. When a new hierarchy appears, Gnus will ask the user: -'alt.binaries': Do you want to subscribe to this hierarchy? ([d]ys): +Descend hierarchy alt.binaries? ([y]nsq): -If the user pressed `d', Gnus will descend the hierarchy, `y' will -subscribe to all newsgroups in the hierarchy and `s' will skip this +If the user pressed `y', Gnus will descend the hierarchy, `s' will +subscribe to all newsgroups in the hierarchy and `n' will skip this hierarchy in its entirety." :group 'gnus-group-new :type 'boolean) diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index b081b1c8f9..9b8333a7c6 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -260,7 +260,7 @@ as `(keyfunc member)' and the corresponding element is just (defcustom nnselect-retrieve-headers-override-function nil "A function that retrieves article headers for ARTICLES from GROUP. The retrieved headers should populate the `nntp-server-buffer'. -Returns either the retrieved header format 'nov or 'headers. +Returns either the retrieved header format `nov' or `headers'. If this variable is nil, or if the provided function returns nil, `gnus-retrieve-headers' will be called instead." diff --git a/lisp/info.el b/lisp/info.el index e51f0b9537..f9d63b0f32 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4236,7 +4236,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." (Info-history-menu e "Back in history" Info-history 'Info-history-back)) (defun Info-history-forward-menu (e) - "Pop up the menu with a list of Info nodes visited with ‘Info-history-back’." + "Pop up the menu with a list of Info nodes visited with `Info-history-back'." (interactive "e" Info-mode) (Info-history-menu e "Forward in history" Info-history-forward 'Info-history-forward)) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 8cde590bc0..adb61aa09d 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -537,7 +537,7 @@ Examples: ;; Note: this is matched with case-fold-search bound to t. (defcustom rmail-re-abbrevs "\\(RE\\|رد\\|回复\\|回覆\\|SV\\|Antw\\|VS\\|REF\\|AW\\|ΑΠ\\|ΣΧΕΤ\\|השב\\|Vá\\|R\\|RIF\\|BLS\\|RES\\|Odp\\|YNT\\|ATB\\)" - "Regexp with localized 'Re:' abbreviations in various languages." + "Regexp with localized \"Re:\" abbreviations in various languages." :version "28.1" :type 'regexp) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ee00f96b52..8287007d32 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -902,10 +902,10 @@ If the value is t, the *Completions* buffer is displayed whenever completion is requested but cannot be done. If the value is `lazy', the *Completions* buffer is only displayed after the second failed attempt to complete. -If the value is 'always', the *Completions* buffer is always shown +If the value is `always', the *Completions* buffer is always shown after a completion attempt, and the list of completions is updated if already visible. -If the value is 'visible', the *Completions* buffer is displayed +If the value is `visible', the *Completions* buffer is displayed whenever completion is requested but cannot be done for the first time, but remains visible thereafter, and the list of completions in it is updated for subsequent attempts to complete.." diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 55d3c7a5d8..be493b3653 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -124,10 +124,10 @@ screen. It can also be a floating point number, specifying the fraction of a full screen to scroll. A near full screen is `next-screen-context-lines' less than a full screen. -If AMOUNT is the symbol 'hscroll', this means that with MODIFIER, +If AMOUNT is the symbol `hscroll', this means that with MODIFIER, the mouse wheel will scroll horizontally instead of vertically. -If AMOUNT is the symbol 'text-scale', this means that with +If AMOUNT is the symbol `text-scale', this means that with MODIFIER, the mouse wheel will change the face height instead of scrolling." :group 'mouse diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 21f6e33b0d..8f02be12ff 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -192,7 +192,7 @@ determine the renaming scheme, as follows: user-defined function: (defun my-eww-rename-buffer () - (when (eq major-mode 'eww-mode) + (when (eq major-mode \\='eww-mode) (when-let ((string (or (plist-get eww-data :title) (plist-get eww-data :url)))) (format \"*%s*\" string)))) diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index 21e5a02da3..b429a33dec 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -106,13 +106,13 @@ applies to newsticker only." (defcustom newsticker-treeview-use-feed-name-from-url-list-in-treeview t - "Use the feed names from 'newsticker-url-list' for display in treeview." + "Use the feed names from `newsticker-url-list' for display in treeview." :version "28.1" :type 'boolean) (defcustom newsticker-treeview-use-feed-name-from-url-list-in-itemview t - "Use feed names from 'newsticker-url-list' in itemview." + "Use feed names from `newsticker-url-list' in itemview." :version "28.1" :type 'boolean) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b06147599c..ef1e4206b6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2483,7 +2483,7 @@ For definition of that list see `tramp-set-completion-function'." (defun tramp-default-file-modes (filename &optional flag) "Return file modes of FILENAME as integer. -If optional FLAG is ‘nofollow’, do not follow FILENAME if it is a +If optional FLAG is `nofollow', do not follow FILENAME if it is a symbolic link. If the file modes of FILENAME cannot be determined, return the value of `default-file-modes', without execute permissions." diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index dfd5d829db..a43b083d53 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -1615,7 +1615,7 @@ alpha-down Sort headlines alphabetically, reversed. The different possibilities will be tried in sequence, and testing stops if one comparison returns a \"not-equal\". For example, the default - '(time-up category-keep priority-down) + `(time-up category-keep priority-down)' means: Pull out all entries having a specified time of day and sort them, in order to make a time schedule for the current day the first thing in the agenda listing for the day. Of the entries without a time indication, keep diff --git a/lisp/org/org.el b/lisp/org/org.el index 8294e57732..0dfd53a3a7 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -3301,7 +3301,7 @@ Replace format-specifiers in the command as noted below and use %i: The LaTeX fragment to be converted. For example, this could be used with LaTeXML as -\"latexmlc 'literal:%i' --profile=math --preload=siunitx.sty 2>/dev/null\"." +\"latexmlc \\='literal:%i\\=' --profile=math --preload=siunitx.sty 2>/dev/null\"." :group 'org-latex :package-version '(Org . "9.4") :type '(choice diff --git a/lisp/ses.el b/lisp/ses.el index 7a9b35d749..ba965ff8a5 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -108,9 +108,9 @@ Each function is called with ARG=1." :type 'hook) (defcustom ses-jump-cell-name-function #'upcase - "Function to process the string passed to function ‘ses-jump’. -Set it to 'identity to make no change. -Set it to 'upcase to make cell name change case isensitive. + "Function to process the string passed to function `ses-jump'. +Set it to `identity' to make no change. +Set it to `upcase' to make cell name change case isensitive. May return @@ -119,8 +119,8 @@ Set it to 'upcase to make cell name change case isensitive. :type 'function) (defcustom ses-jump-prefix-function #'ses-jump-prefix - "Function that takes the prefix argument passed to function ‘ses-jump’. -It may return the same sort of thing as ‘ses-jump-cell-name-function’." + "Function that takes the prefix argument passed to function `ses-jump'. +It may return the same sort of thing as `ses-jump-cell-name-function'." :type 'function) diff --git a/lisp/simple.el b/lisp/simple.el index fb1bf3fa74..1efd900030 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -512,7 +512,7 @@ buffer causes automatic display of the corresponding source code location." (error t)))) (defun next-error-message-highlight (error-buffer) - "Highlight the current error message in the ‘next-error’ buffer." + "Highlight the current error message in the `next-error' buffer." (when next-error-message-highlight (with-current-buffer error-buffer (when (and next-error--message-highlight-overlay @@ -6304,7 +6304,7 @@ Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. If Transient Mark mode is enabled, the mark is active, and ARG is 1, delete the text in the region and deactivate the mark instead. -To disable this, set option ‘delete-active-region’ to nil. +To disable this, set option `delete-active-region' to nil. Interactively, ARG is the prefix arg (default 1) and KILLP is t if a prefix arg was specified." diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index ddab71c52c..705b072501 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -476,7 +476,7 @@ that was current before calling the command that adds a new tab (this is the same what `make-frame' does by default). If the value is the symbol `window', then keep the selected window as a single window on the new tab, and keep all its -window parameters except 'window-atom' and 'window-side'. +window parameters except `window-atom' and `window-side'. If the value is a string, use it as a buffer name to switch to if such buffer exists, or switch to a buffer visiting the file or directory that the string specifies. If the value is a function, diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 926993eebb..3e35a3329b 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -153,7 +153,7 @@ Possible values are: ;; Noninteractive helper for creating and reverting diff buffers "Compare the OLD and NEW file/buffer. If the optional SWITCHES is nil, the switches specified in the -variable ‘diff-switches’ are passed to the diff command, +variable `diff-switches' are passed to the diff command, otherwise SWITCHES is used. SWITCHES can be a string or a list of strings. diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el index de8c587b1c..aae6ad549e 100644 --- a/lisp/vc/ediff-merg.el +++ b/lisp/vc/ediff-merg.el @@ -54,7 +54,7 @@ Valid values are the symbols `default-A', `default-B', and `combined'." The value must be a list of the form \(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4) where bufspec is the symbol A, B, or Ancestor. For instance, if the value is -'(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the +`(STRING1 A STRING2 Ancestor STRING3 B STRING4)' then the combined text will look like this: STRING1 diff --git a/lisp/window.el b/lisp/window.el index 585c64e687..7f1265b9ac 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4181,8 +4181,8 @@ another live window on that frame to serve as its selected window. This option allows to control which window gets selected instead. -The possible choices are 'mru' (the default) to select the most -recently used window on that frame, and 'pos' to choose the +The possible choices are `mru' (the default) to select the most +recently used window on that frame, and `pos' to choose the window at the frame coordinates of point of the previously selected window. If this is nil, choose the frame's first window instead. A window with a non-nil `no-other-window' parameter is diff --git a/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el b/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el index e589263dc3..9ae8014955 100644 --- a/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el +++ b/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el @@ -171,7 +171,7 @@ is the symbol being selected. Example value: - '((\"Emacs Lisp\" Info-goto-emacs-command-node obarray) + \\='((\"Emacs Lisp\" Info-goto-emacs-command-node obarray) (\"Common Lisp\" common-lisp-hyperspec common-lisp-hyperspec-obarray) (\"SCWM\" scwm-documentation scwm-obarray))" :group 'etags commit ed34cbeae7e2246b2a5f7578da3d1ccc6984f7ca Author: Lars Ingebrigtsen Date: Tue May 24 12:36:41 2022 +0200 Audit symbol quoting in Lisp doc strings * lisp/vc/vc-svn.el (vc-svn-dir-status-files): * lisp/so-long.el (so-long-mode-maintain-preserved-variables): * lisp/help-fns.el (help-fns--most-relevant-active-keymap): * lisp/gnus/nnselect.el (nnselect-get-artlist): (nnselect-store-artlist): * lisp/forms.el (forms-enumerate): * lisp/ffap.el (ffap-string-at-point): * lisp/emacs-lisp/byte-run.el (define-obsolete-variable-alias): Audit symbol quoting in Lisp doc strings. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 0113051c8e..92c2699c6e 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -534,7 +534,7 @@ made obsolete, for example a date or a release number. This macro evaluates all its parameters, and both OBSOLETE-NAME and CURRENT-NAME should be symbols, so a typical usage would look like: - (define-obsolete-variable-alias 'foo-thing 'bar-thing \"28.1\") + (define-obsolete-variable-alias \\='foo-thing \\='bar-thing \"28.1\") This macro uses `defvaralias' and `make-obsolete-variable' (which see). See the Info node `(elisp)Variable Aliases' for more details. diff --git a/lisp/ffap.el b/lisp/ffap.el index 30a9577d38..ae86e55490 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1229,13 +1229,13 @@ If the region is active, return a string from the region. If the point is in a comment, ensure that the returned string does not contain the comment start characters (especially for major modes that -have '//' as comment start characters). +have \"//\" as comment start characters). Set the variables `ffap-string-at-point' and `ffap-string-at-point-region'. When the region is active and larger than `ffap-max-region-length', -return an empty string, and set `ffap-string-at-point-region' to '(1 1)." +return an empty string, and set `ffap-string-at-point-region' to `(1 1)'." (let* (dir-separator (args (cdr diff --git a/lisp/forms.el b/lisp/forms.el index 8bfeaad1c1..fdc44b5214 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -2009,7 +2009,7 @@ It returns the highest number. Usage: (setq forms-number-of-fields (forms-enumerate - '(field1 field2 field2 ...)))" + \\='(field1 field2 field2 ...)))" (let ((the-index 0)) (while the-fields diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index cdbfa0b591..b081b1c8f9 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -291,9 +291,9 @@ parameters." (defmacro nnselect-get-artlist (group) "Get the list of articles for GROUP. -If the group parameter 'nnselect-get-artlist-override-function is +If the group parameter `nnselect-get-artlist-override-function' is non-nil call this function with argument GROUP to get the -artlist; if the group parameter 'nnselect-always-regenerate is +artlist; if the group parameter `nnselect-always-regenerate' is non-nil, regenerate the artlist; otherwise retrieve the artlist directly from the group parameters." `(when (gnus-nnselect-group-p ,group) @@ -310,9 +310,9 @@ directly from the group parameters." (defmacro nnselect-store-artlist (group artlist) "Store the ARTLIST for GROUP. -If the group parameter 'nnselect-store-artlist-override-function +If the group parameter `nnselect-store-artlist-override-function' is non-nil call this function on GROUP and ARTLIST; if the group -parameter 'nnselect-always-regenerate is non-nil don't store the +parameter `nnselect-always-regenerate' is non-nil don't store the artlist; otherwise store the ARTLIST in the group parameters." `(let ((override (gnus-group-get-parameter ,group diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ff47bcb49..45308e6e9c 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1902,8 +1902,8 @@ variable with value KEYMAP." The heuristic to determine which keymap is most likely to be relevant to a user follows this order: -1. 'keymap' text property at point -2. 'local-map' text property at point +1. `keymap' text property at point +2. `local-map' text property at point 3. the `current-local-map' This is used to set the default value for the interactive prompt diff --git a/lisp/so-long.el b/lisp/so-long.el index f4ae71d905..a2b4282ad6 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -1518,14 +1518,14 @@ The variables are set in accordance with what was remembered in `so-long'." (kill-local-variable variable)))) (defun so-long-mode-maintain-preserved-variables () - "Set any 'preserved' variables. + "Set any \"preserved\" variables. The variables are set in accordance with what was remembered in `so-long'." (dolist (var (so-long-original 'so-long-mode-preserved-variables)) (so-long-restore-variable var))) (defun so-long-mode-maintain-preserved-minor-modes () - "Enable or disable 'preserved' minor modes. + "Enable or disable \"preserved\" minor modes. The modes are set in accordance with what was remembered in `so-long'." (dolist (mode (so-long-original 'so-long-mode-preserved-minor-modes)) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 3cf692bfda..270877041a 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -212,7 +212,7 @@ switches." (autoload 'vc-expand-dirs "vc") (defun vc-svn-dir-status-files (_dir files callback) - "Run 'svn status' for DIR and update BUFFER via CALLBACK. + "Run \"svn status\" for DIR and update BUFFER via CALLBACK. CALLBACK is called as (CALLBACK RESULT BUFFER), where RESULT is a list of conses (FILE . STATE) for directory DIR." ;; FIXME shouldn't this rather default to all the files in dir? commit 54a3132cfa6541e74688e1cf7821aab7d8df926a Author: Michael Albinus Date: Tue May 24 12:15:41 2022 +0200 Add ".epub" to Tramp archive file suffixes. * doc/misc/tramp.texi (Archive file names): * lisp/net/tramp-archive.el (tramp-archive-suffixes): Add ".epub". diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index bb91aec0cc..12d4987726 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -4478,6 +4478,11 @@ HP-UX SD depots @cindex @file{depot} file archive suffix @cindex file archive suffix @file{depot} +@item @samp{.epub} --- +Electronic publications +@cindex @file{epub} file archive suffix +@cindex file archive suffix @file{epub} + @item @samp{.exe} --- Self extracting Microsoft Windows EXE files @cindex @file{exe} file archive suffix diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 4a020c7150..f30aa021b6 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -57,6 +57,7 @@ ;; * ".crate" - Cargo (Rust) packages ;; * ".deb" - Debian packages ;; * ".depot" - HP-UX SD depots +;; * ".epub" - Electronic publications ;; * ".exe" - Self extracting Microsoft Windows EXE files ;; * ".iso" - ISO 9660 images ;; * ".jar" - Java archives @@ -145,6 +146,7 @@ "crate" ;; Cargo (Rust) packages. Not in libarchive testsuite. "deb" ;; Debian packages. Not in libarchive testsuite. "depot" ;; HP-UX SD depot. Not in libarchive testsuite. + "epub" ;; Electronic publications. Not in libarchive testsuite. "exe" ;; Self extracting Microsoft Windows EXE files. "iso" ;; ISO 9660 images. "jar" ;; Java archives. Not in libarchive testsuite. commit 59951f7af5877221a25d66a1344b649c6872bac6 Author: Lars Ingebrigtsen Date: Tue May 24 11:51:18 2022 +0200 Audit quoting symbols in C doc strings * test/manual/etags/c-src/emacs/src/keyboard.c (Frecursive_edit): * src/xfns.c (syms_of_xfns): * src/xdisp.c (Fwindow_text_pixel_size): (syms_of_xdisp): * src/w32notify.c (Fw32notify_add_watch): (Fw32notify_add_watch): * src/frame.c (Fframe_child_frame_border_width): * src/comp.c (Fcomp__subr_signature): * src/alloc.c (Fgarbage_collect): * lib-src/make-docfile.c (scan_c_stream): Audit quoting symbols in C doc strings. diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index d2d4b1d277..908d73f525 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -1068,7 +1068,7 @@ scan_c_stream (FILE *infile) attributes: attribute1 attribute2 ...) (Lisp_Object arg...) - Now only ’const’, ’noinline’ and 'noreturn' attributes + Now only `const', `noinline' and `noreturn' attributes are used. */ /* Advance to the end of docstring. */ diff --git a/src/alloc.c b/src/alloc.c index 3cfc3d61dd..cfa51c0a8d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6302,7 +6302,7 @@ where each entry has the form (NAME SIZE USED FREE), where: to return them to the OS). However, if there was overflow in pure space, and Emacs was dumped -using the 'unexec' method, `garbage-collect' returns nil, because +using the \"unexec\" method, `garbage-collect' returns nil, because real GC can't be done. Note that calling this function does not guarantee that absolutely all diff --git a/src/comp.c b/src/comp.c index 2b9808aba6..97bc6a5f9d 100644 --- a/src/comp.c +++ b/src/comp.c @@ -756,7 +756,7 @@ comp_hash_source_file (Lisp_Object filename) DEFUN ("comp--subr-signature", Fcomp__subr_signature, Scomp__subr_signature, 1, 1, 0, - doc: /* Support function to 'hash_native_abi'. + doc: /* Support function to hash_native_abi. For internal use. */) (Lisp_Object subr) { diff --git a/src/frame.c b/src/frame.c index 1391cef628..795dcb3ca6 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3643,7 +3643,7 @@ DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0, DEFUN ("frame-child-frame-border-width", Fframe_child_frame_border_width, Sframe_child_frame_border_width, 0, 1, 0, doc: /* Return width of FRAME's child-frame border in pixels. - If FRAME's 'child-frame-border-width' parameter is nil, return FRAME's + If FRAME's `child-frame-border-width' parameter is nil, return FRAME's internal border width instead. */) (Lisp_Object frame) { diff --git a/src/w32notify.c b/src/w32notify.c index ccefecb659..72e634f77c 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -519,16 +519,16 @@ watched for some reason, this function signals a `file-error' error. FILTER is a list of conditions for reporting an event. It can include the following symbols: - 'file-name' -- report file creation, deletion, or renaming - 'directory-name' -- report directory creation, deletion, or renaming - 'attributes' -- report changes in attributes - 'size' -- report changes in file-size - 'last-write-time' -- report changes in last-write time - 'last-access-time' -- report changes in last-access time - 'creation-time' -- report changes in creation time - 'security-desc' -- report changes in security descriptor - -If FILE is a directory, and FILTER includes 'subtree', then all the + `file-name' -- report file creation, deletion, or renaming + `directory-name' -- report directory creation, deletion, or renaming + `attributes' -- report changes in attributes + `size' -- report changes in file-size + `last-write-time' -- report changes in last-write time + `last-access-time' -- report changes in last-access time + `creation-time' -- report changes in creation time + `security-desc' -- report changes in security descriptor + +If FILE is a directory, and FILTER includes `subtree', then all the subdirectories will also be watched and changes in them reported. When any event happens that satisfies the conditions specified by @@ -541,11 +541,11 @@ DESCRIPTOR is the same object as the one returned by this function. ACTION is the description of the event. It could be any one of the following: - 'added' -- FILE was added - 'removed' -- FILE was deleted - 'modified' -- FILE's contents or its attributes were modified - 'renamed-from' -- a file was renamed whose old name was FILE - 'renamed-to' -- a file was renamed and its new name is FILE + `added' -- FILE was added + `removed' -- FILE was deleted + `modified' -- FILE's contents or its attributes were modified + `renamed-from' -- a file was renamed whose old name was FILE + `renamed-to' -- a file was renamed and its new name is FILE FILE is the name of the file whose event is being reported. diff --git a/src/xdisp.c b/src/xdisp.c index e3e4ca9bb3..bbe64340d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11234,7 +11234,7 @@ argument if the size of the buffer is large or unknown. Optional argument MODE-LINES nil or omitted means do not include the height of the mode-, tab- or header-line of WINDOW in the return value. -If it is the symbol `mode-line', 'tab-line' or `header-line', include +If it is the symbol `mode-line', `tab-line' or `header-line', include only the height of that line, if present, in the return value. If t, include the height of any of these, if present, in the return value. @@ -36249,7 +36249,7 @@ they return to their normal size when the minibuffer is closed, or the echo area becomes empty. This variable does not affect resizing of the minibuffer window of -minibuffer-only frames. These are handled by 'resize-mini-frames' +minibuffer-only frames. These are handled by `resize-mini-frames' only. */); /* Contrary to the doc string, we initialize this to nil, so that loading loadup.el won't try to resize windows before loading @@ -36473,7 +36473,7 @@ see biditest.el in the test suite. */); doc: /* Non-nil means inhibit the Bidirectional Parentheses Algorithm. Disabling the BPA makes redisplay faster, but might produce incorrect display reordering of bidirectional text with embedded parentheses and -other bracket characters whose 'paired-bracket' Unicode property is +other bracket characters whose `paired-bracket' Unicode property is non-nil, see `get-char-code-property'. */); bidi_inhibit_bpa = false; diff --git a/src/xfns.c b/src/xfns.c index 4ba7edcb98..94077e0af4 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -9700,11 +9700,11 @@ default and usually works with most desktops. Some desktop environments however, may refuse to resize a child frame when Emacs is built with GTK3. For those environments, the two settings below are provided. -If this equals the symbol 'hide', Emacs temporarily hides the child +If this equals the symbol `hide', Emacs temporarily hides the child frame during resizing. This approach seems to work reliably, may however induce some flicker when the frame is made visible again. -If this equals the symbol 'resize-mode', Emacs uses GTK's resize mode to +If this equals the symbol `resize-mode', Emacs uses GTK's resize mode to always trigger an immediate resize of the child frame. This method is deprecated by GTK and may not work in future versions of that toolkit. It also may freeze Emacs when used with other desktop environments. It diff --git a/test/manual/etags/c-src/emacs/src/keyboard.c b/test/manual/etags/c-src/emacs/src/keyboard.c index 7228f8cb5d..506bf0d01c 100644 --- a/test/manual/etags/c-src/emacs/src/keyboard.c +++ b/test/manual/etags/c-src/emacs/src/keyboard.c @@ -759,7 +759,7 @@ force_auto_save_soon (void) DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", doc: /* Invoke the editor command loop recursively. To get out of the recursive edit, a command can throw to `exit' -- for -instance `(throw 'exit nil)'. +instance `(throw \\='exit nil)'. If you throw a value other than t, `recursive-edit' returns normally to the function that called it. Throwing a t value causes `recursive-edit' to quit, so that control returns to the command loop commit 6fe45ed9699c98d9f2cc3d0483a14f0ffa108ef9 Author: Po Lu Date: Tue May 24 15:11:19 2022 +0800 Allow the user to fix `x-mouse-click-focus-ignore-position' on some systems * src/xterm.c (handle_one_xevent): Apply that variable instead. (syms_of_xterm): Update doc string and add new option to adjust the focus click timeout. diff --git a/src/xterm.c b/src/xterm.c index 9edec9dbeb..fe1b317dcf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -16212,7 +16212,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (f && x_mouse_click_focus_ignore_position) { - ignore_next_mouse_click_timeout = event->xmotion.time + 200; + ignore_next_mouse_click_timeout = (event->xmotion.time + + x_mouse_click_focus_ignore_time); mouse_click_timeout_display = dpyinfo; } @@ -17505,7 +17506,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (f && x_mouse_click_focus_ignore_position) { - ignore_next_mouse_click_timeout = enter->time + 200; + ignore_next_mouse_click_timeout = (enter->time + + x_mouse_click_focus_ignore_time); mouse_click_timeout_display = dpyinfo; } @@ -25441,9 +25443,21 @@ This variable is used only when the window manager requires that you click on a frame to select it (give it focus). In that case, a value of nil, means that the selected window and cursor position changes to reflect the mouse click position, while a non-nil value means that the -selected window or cursor position is preserved. */); +selected window or cursor position is preserved. + +This option works by ignoring button press events for a given amount +of time after a frame might've been focused. If it does not work for +you, try increasing the value of +`x-mouse-click-focus-ignore-time'. */); x_mouse_click_focus_ignore_position = false; + DEFVAR_INT ("x-mouse-click-focus-ignore-time", x_mouse_click_focus_ignore_time, + doc: /* Number of miliseconds for which to ignore buttons after focus change. +This variable only takes effect if +`x-mouse-click-focus-ignore-position' is non-nil, and should be +adjusted if the default value does not work for whatever reason. */); + x_mouse_click_focus_ignore_time = 200; + DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars, doc: /* Which toolkit scroll bars Emacs uses, if any. A value of nil means Emacs doesn't use toolkit scroll bars.