commit 132fa716155ca1d4faa0ae936d14e7831e88dcf5 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sat Apr 23 10:04:33 2022 +0800 Avoid unnecessary calculations when handling button events during DND * src/xterm.c (handle_one_xevent): Only calculate DND grab for button release events. diff --git a/src/xterm.c b/src/xterm.c index 7e8d226fb2..1b1074b2f4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15972,103 +15972,106 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto OTHER; } - for (int i = 1; i < 8; ++i) + if (event->xbutton.type == ButtonRelease) { - if (i != event->xbutton.button - && event->xbutton.state & (Button1Mask << (i - 1))) - dnd_grab = true; - } - - if (!dnd_grab && event->xbutton.type == ButtonRelease) - { - x_dnd_end_window = x_dnd_last_seen_window; - x_dnd_in_progress = false; - - if (x_dnd_last_seen_window != None - && x_dnd_last_protocol_version != -1) + for (int i = 1; i < 8; ++i) { - x_dnd_pending_finish_target = x_dnd_last_seen_window; - x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; - - x_dnd_waiting_for_finish - = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, - x_dnd_selection_timestamp, - x_dnd_last_protocol_version); + if (i != event->xbutton.button + && event->xbutton.state & (Button1Mask << (i - 1))) + dnd_grab = true; } - else if (x_dnd_last_seen_window != None) + + if (!dnd_grab) { - xm_drop_start_message dmsg; - xm_drag_receiver_info drag_receiver_info; - - if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window, - &drag_receiver_info) - && drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE - && (x_dnd_allow_current_frame - || x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))) + x_dnd_end_window = x_dnd_last_seen_window; + x_dnd_in_progress = false; + + if (x_dnd_last_seen_window != None + && x_dnd_last_protocol_version != -1) { - if (!x_dnd_motif_setup_p) - xm_setup_drag_info (dpyinfo, x_dnd_frame); + x_dnd_pending_finish_target = x_dnd_last_seen_window; + x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; - if (x_dnd_motif_setup_p) + x_dnd_waiting_for_finish + = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, + x_dnd_selection_timestamp, + x_dnd_last_protocol_version); + } + else if (x_dnd_last_seen_window != None) + { + xm_drop_start_message dmsg; + xm_drag_receiver_info drag_receiver_info; + + if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window, + &drag_receiver_info) + && drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE + && (x_dnd_allow_current_frame + || x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))) { - memset (&dmsg, 0, sizeof dmsg); - - dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR, - XM_DRAG_REASON_DROP_START); - dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST; - dmsg.side_effects - = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), - (!x_dnd_xm_use_help - ? XM_DROP_ACTION_DROP - : XM_DROP_ACTION_DROP_HELP)); - dmsg.timestamp = event->xbutton.time; - dmsg.x = event->xbutton.x_root; - dmsg.y = event->xbutton.y_root; - dmsg.index_atom = dpyinfo->Xatom_XdndSelection; - dmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); - - if (!XM_DRAG_STYLE_IS_DROP_ONLY (drag_receiver_info.protocol_style)) - x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (x_dnd_frame), - x_dnd_frame, x_dnd_last_seen_window, - event->xbutton.time); - - xm_send_drop_message (dpyinfo, FRAME_X_WINDOW (x_dnd_frame), - x_dnd_last_seen_window, &dmsg); - - x_dnd_waiting_for_finish = true; - x_dnd_waiting_for_motif_finish = 1; + if (!x_dnd_motif_setup_p) + xm_setup_drag_info (dpyinfo, x_dnd_frame); + + if (x_dnd_motif_setup_p) + { + memset (&dmsg, 0, sizeof dmsg); + + dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR, + XM_DRAG_REASON_DROP_START); + dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST; + dmsg.side_effects + = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, + x_dnd_wanted_action), + XM_DROP_SITE_VALID, + xm_side_effect_from_action (dpyinfo, + x_dnd_wanted_action), + (!x_dnd_xm_use_help + ? XM_DROP_ACTION_DROP + : XM_DROP_ACTION_DROP_HELP)); + dmsg.timestamp = event->xbutton.time; + dmsg.x = event->xbutton.x_root; + dmsg.y = event->xbutton.y_root; + dmsg.index_atom = dpyinfo->Xatom_XdndSelection; + dmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); + + if (!XM_DRAG_STYLE_IS_DROP_ONLY (drag_receiver_info.protocol_style)) + x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (x_dnd_frame), + x_dnd_frame, x_dnd_last_seen_window, + event->xbutton.time); + + xm_send_drop_message (dpyinfo, FRAME_X_WINDOW (x_dnd_frame), + x_dnd_last_seen_window, &dmsg); + + x_dnd_waiting_for_finish = true; + x_dnd_waiting_for_motif_finish = 1; + } + } + else + { + x_set_pending_dnd_time (event->xbutton.time); + x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None + ? x_dnd_last_seen_toplevel + : x_dnd_last_seen_window), + event->xbutton.x_root, event->xbutton.y_root, + event->xbutton.time); } } - else + else if (x_dnd_last_seen_toplevel != None) { x_set_pending_dnd_time (event->xbutton.time); - x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None - ? x_dnd_last_seen_toplevel - : x_dnd_last_seen_window), - event->xbutton.x_root, event->xbutton.y_root, + x_dnd_send_unsupported_drop (dpyinfo, x_dnd_last_seen_toplevel, + event->xbutton.x_root, + event->xbutton.y_root, event->xbutton.time); } - } - else if (x_dnd_last_seen_toplevel != None) - { - x_set_pending_dnd_time (event->xbutton.time); - x_dnd_send_unsupported_drop (dpyinfo, x_dnd_last_seen_toplevel, - event->xbutton.x_root, - event->xbutton.y_root, - event->xbutton.time); - } - x_dnd_last_protocol_version = -1; - x_dnd_last_motif_style = XM_DRAG_STYLE_NONE; - x_dnd_last_seen_window = None; - x_dnd_last_seen_toplevel = None; - x_dnd_frame = NULL; - x_set_dnd_targets (NULL, 0); + x_dnd_last_protocol_version = -1; + x_dnd_last_motif_style = XM_DRAG_STYLE_NONE; + x_dnd_last_seen_window = None; + x_dnd_last_seen_toplevel = None; + x_dnd_frame = NULL; + x_set_dnd_targets (NULL, 0); + } } goto OTHER; @@ -17234,111 +17237,114 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto XI_OTHER; } - for (int i = 0; i < xev->buttons.mask_len * 8; ++i) - { - if (i != xev->detail && XIMaskIsSet (xev->buttons.mask, i)) - dnd_grab = true; - } - - if (!dnd_grab && xev->evtype == XI_ButtonRelease) + if (xev->evtype == XI_ButtonRelease) { - x_dnd_end_window = x_dnd_last_seen_window; - x_dnd_in_progress = false; - - if (x_dnd_last_seen_window != None - && x_dnd_last_protocol_version != -1) + for (int i = 0; i < xev->buttons.mask_len * 8; ++i) { - x_dnd_pending_finish_target = x_dnd_last_seen_window; - x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; - - x_dnd_waiting_for_finish - = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, - x_dnd_selection_timestamp, - x_dnd_last_protocol_version); + if (i != xev->detail && XIMaskIsSet (xev->buttons.mask, i)) + dnd_grab = true; } - else if (x_dnd_last_seen_window != None) + + if (!dnd_grab) { - xm_drop_start_message dmsg; - xm_drag_receiver_info drag_receiver_info; - - if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window, - &drag_receiver_info) - && drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE - && (x_dnd_allow_current_frame - || x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))) + x_dnd_end_window = x_dnd_last_seen_window; + x_dnd_in_progress = false; + + if (x_dnd_last_seen_window != None + && x_dnd_last_protocol_version != -1) { - if (!x_dnd_motif_setup_p) - xm_setup_drag_info (dpyinfo, x_dnd_frame); + x_dnd_pending_finish_target = x_dnd_last_seen_window; + x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; - if (x_dnd_motif_setup_p) + x_dnd_waiting_for_finish + = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, + x_dnd_selection_timestamp, + x_dnd_last_protocol_version); + } + else if (x_dnd_last_seen_window != None) + { + xm_drop_start_message dmsg; + xm_drag_receiver_info drag_receiver_info; + + if (!xm_read_drag_receiver_info (dpyinfo, x_dnd_last_seen_window, + &drag_receiver_info) + && drag_receiver_info.protocol_style != XM_DRAG_STYLE_NONE + && (x_dnd_allow_current_frame + || x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))) + { + if (!x_dnd_motif_setup_p) + xm_setup_drag_info (dpyinfo, x_dnd_frame); + + if (x_dnd_motif_setup_p) + { + memset (&dmsg, 0, sizeof dmsg); + + dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR, + XM_DRAG_REASON_DROP_START); + dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST; + dmsg.side_effects + = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, + x_dnd_wanted_action), + XM_DROP_SITE_VALID, + xm_side_effect_from_action (dpyinfo, + x_dnd_wanted_action), + (!x_dnd_xm_use_help + ? XM_DROP_ACTION_DROP + : XM_DROP_ACTION_DROP_HELP)); + dmsg.timestamp = xev->time; + dmsg.x = lrint (xev->root_x); + dmsg.y = lrint (xev->root_y); + /* This atom technically has to be + unique to each drag-and-drop + operation, but that isn't easy to + accomplish, since we cannot + randomly move data around between + selections. Let's hope no two + instances of Emacs try to drag + into the same window at the same + time. */ + dmsg.index_atom = dpyinfo->Xatom_XdndSelection; + dmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); + + if (!XM_DRAG_STYLE_IS_DROP_ONLY (drag_receiver_info.protocol_style)) + x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (x_dnd_frame), + x_dnd_frame, x_dnd_last_seen_window, + xev->time); + + xm_send_drop_message (dpyinfo, FRAME_X_WINDOW (x_dnd_frame), + x_dnd_last_seen_window, &dmsg); + + x_dnd_waiting_for_finish = true; + x_dnd_waiting_for_motif_finish = 1; + } + } + else { - memset (&dmsg, 0, sizeof dmsg); - - dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR, - XM_DRAG_REASON_DROP_START); - dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST; - dmsg.side_effects - = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), - (!x_dnd_xm_use_help - ? XM_DROP_ACTION_DROP - : XM_DROP_ACTION_DROP_HELP)); - dmsg.timestamp = xev->time; - dmsg.x = lrint (xev->root_x); - dmsg.y = lrint (xev->root_y); - /* This atom technically has to be - unique to each drag-and-drop - operation, but that isn't easy to - accomplish, since we cannot - randomly move data around between - selections. Let's hope no two - instances of Emacs try to drag - into the same window at the same - time. */ - dmsg.index_atom = dpyinfo->Xatom_XdndSelection; - dmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); - - if (!XM_DRAG_STYLE_IS_DROP_ONLY (drag_receiver_info.protocol_style)) - x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (x_dnd_frame), - x_dnd_frame, x_dnd_last_seen_window, - xev->time); - - xm_send_drop_message (dpyinfo, FRAME_X_WINDOW (x_dnd_frame), - x_dnd_last_seen_window, &dmsg); - - x_dnd_waiting_for_finish = true; - x_dnd_waiting_for_motif_finish = 1; + x_set_pending_dnd_time (xev->time); + x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None + ? x_dnd_last_seen_toplevel + : x_dnd_last_seen_window), + xev->root_x, xev->root_y, xev->time); } } - else + else if (x_dnd_last_seen_toplevel != None) { x_set_pending_dnd_time (xev->time); - x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None - ? x_dnd_last_seen_toplevel - : x_dnd_last_seen_window), - xev->root_x, xev->root_y, xev->time); + x_dnd_send_unsupported_drop (dpyinfo, + x_dnd_last_seen_toplevel, + xev->root_x, xev->root_y, + xev->time); } - } - else if (x_dnd_last_seen_toplevel != None) - { - x_set_pending_dnd_time (xev->time); - x_dnd_send_unsupported_drop (dpyinfo, - x_dnd_last_seen_toplevel, - xev->root_x, xev->root_y, - xev->time); - } - x_dnd_last_protocol_version = -1; - x_dnd_last_motif_style = XM_DRAG_STYLE_NONE; - x_dnd_last_seen_window = None; - x_dnd_last_seen_toplevel = None; - x_dnd_frame = NULL; - x_set_dnd_targets (NULL, 0); + x_dnd_last_protocol_version = -1; + x_dnd_last_motif_style = XM_DRAG_STYLE_NONE; + x_dnd_last_seen_window = None; + x_dnd_last_seen_toplevel = None; + x_dnd_frame = NULL; + x_set_dnd_targets (NULL, 0); - goto XI_OTHER; + goto XI_OTHER; + } } } commit a0ebc6f20f59f57b03379756b509349c6ba46f99 Author: Po Lu Date: Sat Apr 23 00:36:45 2022 +0000 Avoid clearing splash screen message during DND on Haiku * src/haikuterm.c (haiku_read_socket): Respect any_help_event_p when sending help events for DND. diff --git a/src/haikuterm.c b/src/haikuterm.c index 8c6d620b0f..4f671cddd0 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3164,7 +3164,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) /* It doesn't make sense to show tooltips when another program is dragging stuff over us. */ - do_help = -1; + if (any_help_event_p || do_help) + do_help = -1; if (!be_drag_and_drop_in_progress ()) { commit 0b9b363dabd70032a288e14333896022caa2d252 Author: Alan Mackenzie Date: Fri Apr 22 19:11:31 2022 +0000 Byte compiler: Prevent special forms' symbols being replaced by bare symbols These are symbols with position from source code, which should not be replaced by bare symbols in, e.g., optimization functions. * lisp/Makefile.in: (BYTE_COMPILE_FLAGS, compile-first case): Set max-specpdl-size to 5000 for the benefit of lisp/emacs-lisp/comp.el. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker) (byte-optimize--rename-var, byte-optimize-if, byte-optimize-letX) * lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel) (byte-compile-lambda) * lisp/emacs-lisp/cconv.el (cconv-convert) * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Preserve, e.g., (car form) in the byte compiler, when this form's car is a symbol with position of a special form, rather than replacing the symbol with a bare symbol, e.g. 'cond. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 308407a8bf..fabf6ed55e 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -78,7 +78,9 @@ AUTOGENEL = ${loaddefs} ${srcdir}/cus-load.el ${srcdir}/finder-inf.el \ BYTE_COMPILE_FLAGS = \ --eval '(setq load-prefer-newer t)' $(BYTE_COMPILE_EXTRA_FLAGS) # ... but we must prefer .elc files for those in the early bootstrap. -compile-first: BYTE_COMPILE_FLAGS = $(BYTE_COMPILE_EXTRA_FLAGS) +# A larger `max-specpdl-size' is needed for emacs-lisp/comp.el. +compile-first: BYTE_COMPILE_FLAGS = \ + --eval '(setq max-specpdl-size 5000)' $(BYTE_COMPILE_EXTRA_FLAGS) # Files to compile before others during a bootstrap. This is done to # speed up the bootstrap process. They're ordered by size, so we use diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 39bb622459..d3d8405d06 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -338,7 +338,7 @@ for speeding up processing.") (let ((exps-opt (byte-optimize-body exps t))) (if (macroexp-const-p exp-opt) `(progn ,@exps-opt ,exp-opt) - `(prog1 ,exp-opt ,@exps-opt))) + `(,fn ,exp-opt ,@exps-opt))) exp-opt))) (`(,(or `save-excursion `save-restriction `save-current-buffer) . ,exps) @@ -358,7 +358,7 @@ for speeding up processing.") (then-opt (and test-opt (byte-optimize-form then for-effect))) (else-opt (and (not (and test-opt const)) (byte-optimize-body else for-effect)))) - `(if ,test-opt ,then-opt . ,else-opt))) + `(,fn ,test-opt ,then-opt . ,else-opt))) (`(,(or 'and 'or) . ,exps) ;; FIXME: We have to traverse the expressions in left-to-right @@ -397,7 +397,7 @@ for speeding up processing.") ;; as mutated variables have been marked as non-substitutable. (condition (byte-optimize-form (car condition-body) nil)) (body (byte-optimize-body (cdr condition-body) t))) - `(while ,condition . ,body))) + `(,fn ,condition . ,body))) (`(interactive . ,_) (byte-compile-warn-x form "misplaced interactive spec: `%s'" form) @@ -409,7 +409,7 @@ for speeding up processing.") form) (`(condition-case ,var ,exp . ,clauses) - `(condition-case ,var ;Not evaluated. + `(,fn ,var ;Not evaluated. ,(byte-optimize-form exp for-effect) ,@(mapcar (lambda (clause) (let ((byte-optimize--lexvars @@ -432,14 +432,14 @@ for speeding up processing.") (let ((bodyform (byte-optimize-form exp for-effect))) (pcase exps (`(:fun-body ,f) - `(unwind-protect ,bodyform + `(,fn ,bodyform :fun-body ,(byte-optimize-form f nil))) (_ - `(unwind-protect ,bodyform + `(,fn ,bodyform . ,(byte-optimize-body exps t)))))) (`(catch ,tag . ,exps) - `(catch ,(byte-optimize-form tag nil) + `(,fn ,(byte-optimize-form tag nil) . ,(byte-optimize-body exps for-effect))) ;; Needed as long as we run byte-optimize-form after cconv. @@ -495,7 +495,7 @@ for speeding up processing.") (cons (byte-optimize-form (car rest) nil) (cdr rest))))) (push name byte-optimize--dynamic-vars) - `(defvar ,name . ,optimized-rest))) + `(,fn ,name . ,optimized-rest))) (`(,(pred byte-code-function-p) . ,exps) (cons fn (mapcar #'byte-optimize-form exps))) @@ -561,49 +561,50 @@ for speeding up processing.") (defun byte-optimize--rename-var (var new-var form) "Replace VAR with NEW-VAR in FORM." - (pcase form - ((pred symbolp) (if (eq form var) new-var form)) - (`(setq . ,args) - (let ((new-args nil)) - (while args - (push (byte-optimize--rename-var var new-var (car args)) new-args) - (push (byte-optimize--rename-var var new-var (cadr args)) new-args) - (setq args (cddr args))) - `(setq . ,(nreverse new-args)))) - ;; In binding constructs like `let', `let*' and `condition-case' we - ;; rename everything for simplicity, even new bindings named VAR. - (`(,(and head (or 'let 'let*)) ,bindings . ,body) - `(,head - ,(mapcar (lambda (b) (byte-optimize--rename-var-body var new-var b)) - bindings) - ,@(byte-optimize--rename-var-body var new-var body))) - (`(condition-case ,res-var ,protected-form . ,handlers) - `(condition-case ,(byte-optimize--rename-var var new-var res-var) - ,(byte-optimize--rename-var var new-var protected-form) - ,@(mapcar (lambda (h) - (cons (car h) - (byte-optimize--rename-var-body var new-var (cdr h)))) - handlers))) - (`(internal-make-closure ,vars ,env . ,rest) - `(internal-make-closure - ,vars ,(byte-optimize--rename-var-body var new-var env) . ,rest)) - (`(defvar ,name . ,rest) - ;; NAME is not renamed here; we only care about lexical variables. - `(defvar ,name . ,(byte-optimize--rename-var-body var new-var rest))) - - (`(cond . ,clauses) - `(cond ,@(mapcar (lambda (c) - (byte-optimize--rename-var-body var new-var c)) - clauses))) - - (`(function . ,_) form) - (`(quote . ,_) form) - (`(lambda . ,_) form) - - ;; Function calls and special forms not handled above. - (`(,head . ,args) - `(,head . ,(byte-optimize--rename-var-body var new-var args))) - (_ form))) + (let ((fn (car-safe form))) + (pcase form + ((pred symbolp) (if (eq form var) new-var form)) + (`(setq . ,args) + (let ((new-args nil)) + (while args + (push (byte-optimize--rename-var var new-var (car args)) new-args) + (push (byte-optimize--rename-var var new-var (cadr args)) new-args) + (setq args (cddr args))) + `(,fn . ,(nreverse new-args)))) + ;; In binding constructs like `let', `let*' and `condition-case' we + ;; rename everything for simplicity, even new bindings named VAR. + (`(,(and head (or 'let 'let*)) ,bindings . ,body) + `(,head + ,(mapcar (lambda (b) (byte-optimize--rename-var-body var new-var b)) + bindings) + ,@(byte-optimize--rename-var-body var new-var body))) + (`(condition-case ,res-var ,protected-form . ,handlers) + `(,fn ,(byte-optimize--rename-var var new-var res-var) + ,(byte-optimize--rename-var var new-var protected-form) + ,@(mapcar (lambda (h) + (cons (car h) + (byte-optimize--rename-var-body var new-var (cdr h)))) + handlers))) + (`(internal-make-closure ,vars ,env . ,rest) + `(,fn + ,vars ,(byte-optimize--rename-var-body var new-var env) . ,rest)) + (`(defvar ,name . ,rest) + ;; NAME is not renamed here; we only care about lexical variables. + `(,fn ,name . ,(byte-optimize--rename-var-body var new-var rest))) + + (`(cond . ,clauses) + `(,fn ,@(mapcar (lambda (c) + (byte-optimize--rename-var-body var new-var c)) + clauses))) + + (`(function . ,_) form) + (`(quote . ,_) form) + (`(lambda . ,_) form) + + ;; Function calls and special forms not handled above. + (`(,head . ,args) + `(,head . ,(byte-optimize--rename-var-body var new-var args))) + (_ form)))) (defun byte-optimize-let-form (head form for-effect) ;; Recursively enter the optimizer for the bindings and body @@ -1174,21 +1175,21 @@ See Info node `(elisp) Integer Basics'." (proper-list-p clause)) (if (null (cddr clause)) ;; A trivial `progn'. - (byte-optimize-if `(if ,(cadr clause) ,@(nthcdr 2 form))) + (byte-optimize-if `(,(car form) ,(cadr clause) ,@(nthcdr 2 form))) (nconc (butlast clause) (list (byte-optimize-if - `(if ,(car (last clause)) ,@(nthcdr 2 form))))))) + `(,(car form) ,(car (last clause)) ,@(nthcdr 2 form))))))) ((byte-compile-trueconstp clause) `(progn ,clause ,(nth 2 form))) ((byte-compile-nilconstp clause) `(progn ,clause ,@(nthcdr 3 form))) ((nth 2 form) (if (equal '(nil) (nthcdr 3 form)) - (list 'if clause (nth 2 form)) + (list (car form) clause (nth 2 form)) form)) ((or (nth 3 form) (nthcdr 4 form)) - (list 'if + (list (car form) ;; Don't make a double negative; ;; instead, take away the one that is there. (if (and (consp clause) (memq (car clause) '(not null)) @@ -1267,7 +1268,7 @@ See Info node `(elisp) Integer Basics'." (and (consp binding) (cadr binding))) bindings) ,const) - `(let* ,(butlast bindings) + `(,head ,(butlast bindings) ,@(and (consp (car (last bindings))) (cdar (last bindings))) ,const))) @@ -1282,7 +1283,7 @@ See Info node `(elisp) Integer Basics'." `(progn ,@(mapcar (lambda (binding) (and (consp binding) (cadr binding))) bindings)) - `(let* ,(butlast bindings) + `(,head ,(butlast bindings) ,@(and (consp (car (last bindings))) (cdar (last bindings)))))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f97324f3a8..28237d67d2 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -471,7 +471,7 @@ Return the compile-time value of FORM." (let ((print-symbols-bare t)) ; Possibly redundant binding. (setf form (macroexp-macroexpand form byte-compile-macro-environment))) (if (eq (car-safe form) 'progn) - (cons 'progn + (cons (car form) (mapcar (lambda (subform) (byte-compile-recurse-toplevel subform non-toplevel-case)) @@ -3084,7 +3084,7 @@ lambda-expression." ;; which may include "calls" to ;; internal-make-closure (Bug#29988). lexical-binding) - (setq int `(interactive ,newform))))) + (setq int `(,(car int) ,newform))))) ((cdr int) ; Invalid (interactive . something). (byte-compile-warn-x int "malformed interactive spec: %s" int)))) diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index be4fea7be1..4535f1aa6e 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -500,11 +500,11 @@ places where they originally did not directly appear." args))) (`(cond . ,cond-forms) ; cond special form - `(cond . ,(mapcar (lambda (branch) - (mapcar (lambda (form) - (cconv-convert form env extend)) - branch)) - cond-forms))) + `(,(car form) . ,(mapcar (lambda (branch) + (mapcar (lambda (form) + (cconv-convert form env extend)) + branch)) + cond-forms))) (`(function (lambda ,args . ,body) . ,_) (let ((docstring (if (eq :documentation (car-safe (car body))) @@ -538,7 +538,7 @@ places where they originally did not directly appear." (msg (when (eq class :unused) (cconv--warn-unused-msg var "variable"))) (newprotform (cconv-convert protected-form env extend))) - `(condition-case ,var + `(,(car form) ,var ,(if msg (macroexp--warn-wrap var msg newprotform 'lexical) newprotform) @@ -554,9 +554,9 @@ places where they originally did not directly appear." `((let ((,var (list ,var))) ,@body)))))) handlers)))) - (`(unwind-protect ,form . ,body) - `(unwind-protect ,(cconv-convert form env extend) - :fun-body ,(cconv--convert-function () body env form))) + (`(unwind-protect ,form1 . ,body) + `(,(car form) ,(cconv-convert form1 env extend) + :fun-body ,(cconv--convert-function () body env form1))) (`(setq . ,forms) ; setq special form (if (= (logand (length forms) 1) 1) @@ -568,7 +568,7 @@ places where they originally did not directly appear." (sym-new (or (cdr (assq sym env)) sym)) (value (cconv-convert (pop forms) env extend))) (push (pcase sym-new - ((pred symbolp) `(setq ,sym-new ,value)) + ((pred symbolp) `(,(car form) ,sym-new ,value)) (`(car-safe ,iexp) `(setcar ,iexp ,value)) ;; This "should never happen", but for variables which are ;; mutated+captured+unused, we may end up trying to `setq' @@ -604,7 +604,7 @@ places where they originally did not directly appear." (cons fun args))))))) (`(interactive . ,forms) - `(interactive . ,(mapcar (lambda (form) + `(,(car form) . ,(mapcar (lambda (form) (cconv-convert form nil nil)) forms))) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index e4bc2df280..51c6e8e0ca 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -330,108 +330,109 @@ Assumes the caller has bound `macroexpand-all-environment'." (setq form (macroexp-macroexpand form macroexpand-all-environment)) ;; FIXME: It'd be nice to use `byte-optimize--pcase' here, but when ;; I tried it, it broke the bootstrap :-( - (pcase form - (`(cond . ,clauses) - (macroexp--cons 'cond (macroexp--all-clauses clauses) form)) - (`(condition-case . ,(or `(,err ,body . ,handlers) pcase--dontcare)) - (macroexp--cons - 'condition-case - (macroexp--cons err - (macroexp--cons (macroexp--expand-all body) - (macroexp--all-clauses handlers 1) - (cddr form)) - (cdr form)) - form)) - (`(,(or 'defvar 'defconst) ,(and name (pred symbolp)) . ,_) - (push name macroexp--dynvars) - (macroexp--all-forms form 2)) - (`(function ,(and f `(lambda . ,_))) - (let ((macroexp--dynvars macroexp--dynvars)) - (macroexp--cons 'function - (macroexp--cons (macroexp--all-forms f 2) - nil - (cdr form)) - form))) - (`(,(or 'function 'quote) . ,_) form) - (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) - pcase--dontcare)) - (let ((macroexp--dynvars macroexp--dynvars)) + (let ((fn (car-safe form))) + (pcase form + (`(cond . ,clauses) + (macroexp--cons fn (macroexp--all-clauses clauses) form)) + (`(condition-case . ,(or `(,err ,body . ,handlers) pcase--dontcare)) (macroexp--cons - fun - (macroexp--cons - (macroexp--all-clauses bindings 1) - (if (null body) - (macroexp-unprogn - (macroexp-warn-and-return - (format "Empty %s body" fun) - nil nil 'compile-only fun)) - (macroexp--all-forms body)) - (cdr form)) - form))) - (`(,(and fun `(lambda . ,_)) . ,args) - ;; Embedded lambda in function position. - ;; If the byte-optimizer is loaded, try to unfold this, - ;; i.e. rewrite it to (let () ). We'd do it in the optimizer - ;; anyway, but doing it here (i.e. earlier) can sometimes avoid the - ;; creation of a closure, thus resulting in much better code. - (let ((newform (macroexp--unfold-lambda form))) - (if (eq newform form) - ;; Unfolding failed for some reason, avoid infinite recursion. - (macroexp--cons (macroexp--all-forms fun 2) - (macroexp--all-forms args) - form) - (macroexp--expand-all newform)))) - (`(funcall ,exp . ,args) - (let ((eexp (macroexp--expand-all exp)) - (eargs (macroexp--all-forms args))) - ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' - ;; has a compiler-macro, or to unfold it. - (pcase eexp - ((and `#',f - (guard (not (or (special-form-p f) (macrop f))))) ;; bug#46636 - (macroexp--expand-all `(,f . ,eargs))) - (_ `(funcall ,eexp . ,eargs))))) - (`(funcall . ,_) form) ;bug#53227 - (`(,func . ,_) - (let ((handler (function-get func 'compiler-macro)) - (funargs (function-get func 'funarg-positions))) - ;; Check functions quoted with ' rather than with #' - (dolist (funarg funargs) - (let ((arg (nth funarg form))) - (when (and (eq 'quote (car-safe arg)) - (eq 'lambda (car-safe (cadr arg)))) - (setcar (nthcdr funarg form) - (macroexp-warn-and-return - (format "%S quoted with ' rather than with #'" - (let ((f (cadr arg))) - (if (symbolp f) f `(lambda ,(nth 1 f) ...)))) - arg nil nil (cadr arg)))))) - ;; Macro expand compiler macros. This cannot be delayed to - ;; byte-optimize-form because the output of the compiler-macro can - ;; use macros. - (if (null handler) - ;; No compiler macro. We just expand each argument (for - ;; setq/setq-default this works alright because the variable names - ;; are symbols). - (macroexp--all-forms form 1) - ;; If the handler is not loaded yet, try (auto)loading the - ;; function itself, which may in turn load the handler. - (unless (functionp handler) - (with-demoted-errors "macroexp--expand-all: %S" - (autoload-do-load (indirect-function func) func))) - (let ((newform (macroexp--compiler-macro handler form))) - (if (eq form newform) - ;; The compiler macro did not find anything to do. - (if (equal form (setq newform (macroexp--all-forms form 1))) - form - ;; Maybe after processing the args, some new opportunities - ;; appeared, so let's try the compiler macro again. - (setq form (macroexp--compiler-macro handler newform)) - (if (eq newform form) - newform - (macroexp--expand-all newform))) - (macroexp--expand-all newform)))))) - (_ form))) + fn + (macroexp--cons err + (macroexp--cons (macroexp--expand-all body) + (macroexp--all-clauses handlers 1) + (cddr form)) + (cdr form)) + form)) + (`(,(or 'defvar 'defconst) ,(and name (pred symbolp)) . ,_) + (push name macroexp--dynvars) + (macroexp--all-forms form 2)) + (`(function ,(and f `(lambda . ,_))) + (let ((macroexp--dynvars macroexp--dynvars)) + (macroexp--cons fn + (macroexp--cons (macroexp--all-forms f 2) + nil + (cdr form)) + form))) + (`(,(or 'function 'quote) . ,_) form) + (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) + pcase--dontcare)) + (let ((macroexp--dynvars macroexp--dynvars)) + (macroexp--cons + fun + (macroexp--cons + (macroexp--all-clauses bindings 1) + (if (null body) + (macroexp-unprogn + (macroexp-warn-and-return + (format "Empty %s body" fun) + nil nil 'compile-only fun)) + (macroexp--all-forms body)) + (cdr form)) + form))) + (`(,(and fun `(lambda . ,_)) . ,args) + ;; Embedded lambda in function position. + ;; If the byte-optimizer is loaded, try to unfold this, + ;; i.e. rewrite it to (let () ). We'd do it in the optimizer + ;; anyway, but doing it here (i.e. earlier) can sometimes avoid the + ;; creation of a closure, thus resulting in much better code. + (let ((newform (macroexp--unfold-lambda form))) + (if (eq newform form) + ;; Unfolding failed for some reason, avoid infinite recursion. + (macroexp--cons (macroexp--all-forms fun 2) + (macroexp--all-forms args) + form) + (macroexp--expand-all newform)))) + (`(funcall ,exp . ,args) + (let ((eexp (macroexp--expand-all exp)) + (eargs (macroexp--all-forms args))) + ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' + ;; has a compiler-macro, or to unfold it. + (pcase eexp + ((and `#',f + (guard (not (or (special-form-p f) (macrop f))))) ;; bug#46636 + (macroexp--expand-all `(,f . ,eargs))) + (_ `(funcall ,eexp . ,eargs))))) + (`(funcall . ,_) form) ;bug#53227 + (`(,func . ,_) + (let ((handler (function-get func 'compiler-macro)) + (funargs (function-get func 'funarg-positions))) + ;; Check functions quoted with ' rather than with #' + (dolist (funarg funargs) + (let ((arg (nth funarg form))) + (when (and (eq 'quote (car-safe arg)) + (eq 'lambda (car-safe (cadr arg)))) + (setcar (nthcdr funarg form) + (macroexp-warn-and-return + (format "%S quoted with ' rather than with #'" + (let ((f (cadr arg))) + (if (symbolp f) f `(lambda ,(nth 1 f) ...)))) + arg nil nil (cadr arg)))))) + ;; Macro expand compiler macros. This cannot be delayed to + ;; byte-optimize-form because the output of the compiler-macro can + ;; use macros. + (if (null handler) + ;; No compiler macro. We just expand each argument (for + ;; setq/setq-default this works alright because the variable names + ;; are symbols). + (macroexp--all-forms form 1) + ;; If the handler is not loaded yet, try (auto)loading the + ;; function itself, which may in turn load the handler. + (unless (functionp handler) + (with-demoted-errors "macroexp--expand-all: %S" + (autoload-do-load (indirect-function func) func))) + (let ((newform (macroexp--compiler-macro handler form))) + (if (eq form newform) + ;; The compiler macro did not find anything to do. + (if (equal form (setq newform (macroexp--all-forms form 1))) + form + ;; Maybe after processing the args, some new opportunities + ;; appeared, so let's try the compiler macro again. + (setq form (macroexp--compiler-macro handler newform)) + (if (eq newform form) + newform + (macroexp--expand-all newform))) + (macroexp--expand-all newform)))))) + (_ form)))) (pop byte-compile-form-stack))) ;; Record which arguments expect functions, so we can warn when those commit 5b23c9942ae057c886e68edb8c4bf09bf7e8eda9 Author: Alan Mackenzie Date: Fri Apr 22 17:16:21 2022 +0000 Byte compiler: correct output warning message positions (part 2) A supplementary commit to that on 2022-04-18: * lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos): Handle vectors and records correctly. * lisp/emacs-lisp/byte-run.el (byte-run--ssp-seen): Correct the doc string. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 384e8cba88..0113051c8e 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -32,8 +32,7 @@ (defvar byte-run--ssp-seen nil "Which conses/vectors/records have been processed in strip-symbol-positions? -The value is a hash table, the key being the old element and the value being -the corresponding new element of the same type. +The value is a hash table, the keys being the elements and the values being t. The purpose of this is to detect circular structures.") diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 8128410916..f97324f3a8 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1185,14 +1185,14 @@ Here, \"first\" is by a depth first search." (and (symbolp (setq sym (byte-compile--first-symbol-with-pos (cdr form)))) sym) 0)) - ((and (vectorp form) + ((and (or (vectorp form) (recordp form)) (> (length form) 0)) (let ((i 0) (len (length form)) elt) (catch 'sym (while (< i len) - (when (symbolp + (when (symbol-with-pos-p (setq elt (byte-compile--first-symbol-with-pos (aref form i)))) (throw 'sym elt)) (setq i (1+ i))) commit 2d71fd3b041506c68b5f1cd1e409e09e25778c34 Author: Lars Ingebrigtsen Date: Fri Apr 22 17:16:42 2022 +0200 Further doc string quoting fixes * test/lisp/progmodes/cperl-mode-tests.el (cperl--run-test-cases): * lisp/simple.el (undo-equiv-table): * lisp/shell.el (shell-mode): (shell-mode): * lisp/recentf.el (recentf-mode): * lisp/org/ob-table.el (org-sbe): * lisp/net/eudc.el (eudc-rfc5322-cctext-token): * lisp/mail/ietf-drums-date.el (ietf-drums-date--slot-ranges): * lisp/faces.el (color-luminance-dark-limit): * lisp/erc/erc.el (erc-tls): * lisp/emacs-lisp/pcase.el (pcase-setq): Further quoting fixes in doc strings. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 0330a2a0ab..07443dabfe 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -328,7 +328,7 @@ PATTERNS are normal `pcase' patterns, and VALUES are expression. Evaluation happens sequentially as in `setq' (not in parallel). -An example: (pcase-setq `((,a) [(,b)]) '((1) [(2)])) +An example: (pcase-setq \\=`((,a) [(,b)]) \\='((1) [(2)])) VAL is presumed to match PAT. Failure to match may signal an error or go undetected, binding variables to arbitrary values, such as nil. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 52fe106f2d..06381c5ebe 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2269,7 +2269,7 @@ Example usage: (erc-tls :server \"irc.libera.chat\" :port 6697 :client-certificate - '(\"/home/bandali/my-cert.key\" + \\='(\"/home/bandali/my-cert.key\" \"/home/bandali/my-cert.crt\"))" (interactive (let ((erc-default-port erc-default-port-tls)) (erc-select-read-args))) diff --git a/lisp/faces.el b/lisp/faces.el index b4e1f03eef..962501ee7c 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1858,8 +1858,8 @@ on which one provides better contrast with COLOR." "#ffffff" "black")) (defconst color-luminance-dark-limit 0.325 - "The relative luminance below which a color is considered 'dark'. -A 'dark' color in this sense provides better contrast with white + "The relative luminance below which a color is considered \"dark\". +A \"dark\" color in this sense provides better contrast with white than with black; see `color-dark-p'. This value was determined experimentally.") diff --git a/lisp/mail/ietf-drums-date.el b/lisp/mail/ietf-drums-date.el index 6f64ae7337..ddef7f11b6 100644 --- a/lisp/mail/ietf-drums-date.el +++ b/lisp/mail/ietf-drums-date.el @@ -50,8 +50,8 @@ See the decoded-time defstruct.") '((0 60) (0 59) (0 23) (1 31) (1 12) (1 9999)) "Numeric slot ranges, for bounds checking. Note that RFC5322 explicitly requires that seconds go up to 60, -to allow for leap seconds (see Mills, D., 'Network Time -Protocol', STD 12, RFC 1119, September 1989).") +to allow for leap seconds (see Mills, D., \"Network Time +Protocol\", STD 12, RFC 1119, September 1989).") (defsubst ietf-drums-date--ignore-char-p (char) ;; Ignore whitespace and commas. diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 6ce89ce5be..808d2ca509 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -174,7 +174,7 @@ Value is the new string." "Folding white space.") (defconst eudc-rfc5322-cctext-token "\u005D-\u007E\u002A-\u005B\u0021-\u0027" - "Printable US-ASCII characters not including '(', ')', or '\\'.") + "Printable US-ASCII characters not including \"(\", \")\", or \"\\\".") (defun eudc-rfc5322-quote-phrase (string) "Quote STRING if it needs quoting as a phrase in a header." diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el index 2f092998d8..f6729e0ece 100644 --- a/lisp/org/ob-table.el +++ b/lisp/org/ob-table.el @@ -84,7 +84,7 @@ is the equivalent of the following source code block: #+end_src NOTE: The quotation marks around the function name, -'source-block', are optional. +`source-block', are optional. NOTE: By default, string variable names are interpreted as references to source-code blocks, to force interpretation of a diff --git a/lisp/recentf.el b/lisp/recentf.el index 5e2f221861..2de9831154 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1353,7 +1353,7 @@ to a file, and killing a buffer is counted as \"operating\" on the file. If instead you want to prioritize files that appear in buffers you switch to a lot, you can say something like the following: - (add-hook 'buffer-list-update-hook 'recentf-track-opened-file)" + (add-hook \\='buffer-list-update-hook #\\='recentf-track-opened-file)" :global t :group 'recentf :keymap recentf-mode-map diff --git a/lisp/shell.el b/lisp/shell.el index a9990f5d55..627c48e35f 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -528,7 +528,7 @@ Shell buffers. It implements `shell-completion-execonly' for the shell. This is useful for entering passwords. Or, add the function `comint-watch-for-password-prompt' to `comint-output-filter-functions'. -If you want to make multiple shell buffers, rename the `*shell*' buffer +If you want to make multiple shell buffers, rename the \"*shell*\" buffer using \\[rename-buffer] or \\[rename-uniquely] and start a new shell. If you want to make shell buffers limited in length, add the function @@ -575,7 +575,7 @@ buffer. By default, shell mode does nothing special when it receives a \"bell\" character (C-g or ^G). If you - (add-hook 'comint-output-filter-functions 'shell-filter-ring-bell nil t) + (add-hook \\='comint-output-filter-functions #\\='shell-filter-ring-bell nil t) from `shell-mode-hook', Emacs will call the `ding' function whenever it receives the bell character in output from a command." diff --git a/lisp/simple.el b/lisp/simple.el index 323d51dd2d..75720d895c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3008,12 +3008,12 @@ the minibuffer contents." (defconst undo-equiv-table (make-hash-table :test 'eq :weakness t) "Table mapping redo records to the corresponding undo one. -A redo record for an undo in region maps to 'undo-in-region. +A redo record for an undo in region maps to `undo-in-region'. A redo record for ordinary undo maps to the following (earlier) undo. A redo record that undoes to the beginning of the undo list maps to t. In the rare case where there are (erroneously) consecutive nil's in `buffer-undo-list', `undo' maps the previous valid undo record to -'empty, if the previous record is a redo record, `undo' doesn't change +`empty', if the previous record is a redo record, `undo' doesn't change its mapping. To be clear, a redo record is just an undo record, the only difference diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index b8a3bd97d8..4e0debffb6 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -64,7 +64,7 @@ The expected output from running BODY on the input goes here. # -------- NAME: end -------- You can have many of these blocks in one test file. You can -chose a NAME for each block, which is passed to the 'should' +chose a NAME for each block, which is passed to the `should' clause for easy identification of the first test case that failed (if any). Text outside these the blocks is ignored by the tests, so you can use it to document the test cases if you wish." commit bbf389ea6deab229ba18dc519fe712ec982609d1 Author: Lars Ingebrigtsen Date: Fri Apr 22 16:17:22 2022 +0200 Audit quoting the quote character in doc strings * test/src/regex-emacs-tests.el (regex-tests-compare): (regex-tests-compare): (regex-tests-match): * test/lisp/xml-tests.el (xml-parse-tests--qnames): * test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from): * test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset): * test/lisp/calc/calc-tests.el (calc-tests-equal): * lisp/window.el (get-lru-window): (get-mru-window): (get-largest-window): (quit-restore-window): (display-buffer): * lisp/vc/vc-rcs.el (vc-rcs-consult-headers): * lisp/url/url-auth.el (url-digest-auth-build-response): * lisp/tutorial.el (tutorial--find-changed-keys): * lisp/transient.el (transient-suffix-object): * lisp/textmodes/rst.el (rst-insert-list-new-item): * lisp/textmodes/bibtex.el (bibtex-clean-entry): * lisp/tab-bar.el (tab-bar--key-to-number): (toggle-frame-tab-bar): * lisp/ses.el (ses-recalculate-cell): (ses-define-local-printer): (ses-prin1): * lisp/progmodes/xref.el (xref--find-ignores-arguments): * lisp/progmodes/verilog-mode.el (verilog-single-declaration-end): * lisp/progmodes/tcl.el (tcl-mode-hook): * lisp/progmodes/gdb-mi.el (gdb-get-buffer-create): * lisp/progmodes/elisp-mode.el (elisp--xref-make-xref): * lisp/play/dunnet.el (dun-room-objects): * lisp/outline.el (outline--cycle-state): * lisp/org/ox-publish.el (org-publish-find-property): * lisp/org/ox-html.el (org-html--unlabel-latex-environment): * lisp/org/org-table.el (org-table-collapse-header): * lisp/org/org-plot.el (org--plot/prime-factors): * lisp/org/org-agenda.el (org-agenda--mark-blocked-entry): (org-agenda-set-restriction-lock): * lisp/org/ob-lua.el (org-babel-lua-read-string): * lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process): (org-babel-julia-evaluate-session): * lisp/org/ob-core.el (org-babel-default-header-args): * lisp/obsolete/mouse-sel.el (mouse-select): (mouse-select-secondary): * lisp/net/tramp.el (tramp-methods): * lisp/net/eww.el (eww-accept-content-types): * lisp/net/dictionary-connection.el (dictionary-connection-status): * lisp/minibuffer.el (completion-flex--make-flex-pattern): * lisp/mh-e/mh-mime.el (mh-have-file-command): * lisp/mh-e/mh-limit.el (mh-subject-to-sequence): (mh-subject-to-sequence-threaded): (mh-subject-to-sequence-unthreaded): * lisp/mail/feedmail.el (feedmail-queue-buffer-file-name): (feedmail-vm-mail-mode): * lisp/ls-lisp.el (ls-lisp--sanitize-switches): * lisp/keymap.el (key-valid-p): * lisp/international/ccl.el (ccl-compile-branch-blocks): * lisp/image/image-converter.el (image-convert): * lisp/gnus/spam.el (spam-backend-check): * lisp/gnus/nnselect.el (nnselect-generate-artlist): * lisp/gnus/nnmairix.el (nnmairix-widget-other): * lisp/gnus/message.el (message-mailto): * lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article): * lisp/gnus/gnus-search.el (gnus-search-prepare-query): * lisp/frame.el (frame-size-history): * lisp/eshell/esh-var.el (eshell-parse-variable-ref): * lisp/eshell/em-dirs.el (eshell-expand-multiple-dots): * lisp/erc/erc-backend.el (erc-bounds-of-word-at-point): * lisp/emulation/cua-rect.el (cua--rectangle-operation): * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): * lisp/emacs-lisp/package.el (package-desc-suffix): * lisp/emacs-lisp/faceup.el (faceup-test-explain): * lisp/emacs-lisp/comp.el (comp-curr-allocation-class): (comp-alloc-class-to-container): (comp-add-cstrs): (comp-remove-type-hints-func): (batch-byte+native-compile): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/elec-pair.el (electric-pair--syntax-ppss): * lisp/doc-view.el (doc-view-doc-type): * lisp/cedet/semantic/symref.el (semantic-symref-tool-alist): (semantic-symref-hit-to-tag-via-db): (semantic-symref-hit-to-tag-via-buffer): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay): * lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map): * lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function): * lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions): * lisp/cedet/semantic.el (semantic-working-type): * lisp/cedet/ede/files.el (ede-flush-directory-hash): * lisp/calc/calc.el (calc--header-line): * lisp/auth-source.el (auth-source-pick-first-password): (auth-source--decode-octal-string): * etc/themes/modus-themes.el (modus-themes--paren): (modus-themes--agenda-habit): * admin/cus-test.el (cus-test-vars-with-changed-state): Fix quoting in doc strings. In code examples, the ' character is quoted with \\=, and regularize 'foo to `foo', and quote strings like "foo" instead of 'foo'. diff --git a/admin/cus-test.el b/admin/cus-test.el index 8f0914ff69..5894abed3d 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el @@ -156,7 +156,7 @@ Names should be as they appear in loaddefs.el.") "Set by `cus-test-apropos' to a list of options with :get property.") (defvar cus-test-vars-with-changed-state nil - "Set by `cus-test-apropos' to a list of options with state 'changed.") + "Set by `cus-test-apropos' to a list of options with state \\='changed.") (defvar cus-test-deps-errors nil "List of require/load problems found by `cus-test-deps'.") diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index adec113bd2..1c52223950 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -3368,10 +3368,10 @@ theme's fallback text color." (defun modus-themes--paren (normalbg intensebg) "Conditional use of intense colors for matching parentheses. -NORMALBG should be the special palette color 'bg-paren-match' or +NORMALBG should be the special palette color `bg-paren-match' or something similar. INTENSEBG must be easier to discern next to other backgrounds, such as the special palette color -'bg-paren-match-intense'." +`bg-paren-match-intense'." (let ((properties (modus-themes--list-or-warn 'modus-themes-paren-match))) (list :inherit (if (memq 'bold properties) @@ -3637,8 +3637,8 @@ clearly distinguishes past, present, future tasks." (defun modus-themes--agenda-habit (default traffic simple &optional default-d traffic-d simple-d) "Specify background values for `modus-themes-org-agenda' habits. DEFAULT is the original foregrounc color. TRAFFIC is to be used -when the 'traffic-light' style is applied, while SIMPLE -corresponds to the 'simplified style'. +when the `traffic-light' style is applied, while SIMPLE +corresponds to the \"simplified style\". Optional DEFAULT-D, TRAFFIC-D, SIMPLE-D are alternatives to the main colors, meant for dopia when `modus-themes-deuteranopia' is diff --git a/lisp/auth-source.el b/lisp/auth-source.el index cd135bd2e2..fc62e36dfc 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -867,7 +867,7 @@ while \(:host t) would find all host entries." secret))) (defun auth-source-pick-first-password (&rest spec) - "Pick the first secret found by applying 'auth-source-search' to SPEC." + "Pick the first secret found by applying `auth-source-search' to SPEC." (auth-info-password (car (apply #'auth-source-search (plist-put spec :max 1))))) (defun auth-source-format-prompt (prompt alist) @@ -1958,7 +1958,7 @@ entries for git.gnus.org: (defun auth-source--decode-octal-string (string) - "Convert octal STRING to utf-8 string. E.g: 'a\134b' to 'a\b'." + "Convert octal STRING to utf-8 string. E.g: \"a\134b\" to \"a\b\"." (let ((list (string-to-list string)) (size (length string))) (decode-coding-string diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 2c139a0238..523f51533a 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1375,7 +1375,7 @@ Notations: 3.14e6 3.14 * 10^6 LONG is a desired text for a wide window, SHORT is a desired abbreviated text, and width is the buffer width, which will be -some fraction of the 'parent' window width (At the time of +some fraction of the \"parent\" window width (At the time of writing, 2/3 for calc, 1/3 for trail). The optional FUDGE is a trial-and-error adjustment number for the edge-cases at the border of the two cases." diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el index 3b9002a6e3..b8acb192c1 100644 --- a/lisp/cedet/ede/files.el +++ b/lisp/cedet/ede/files.el @@ -257,7 +257,7 @@ If optional EXACT is non-nil, only return exact matches for DIR." (defun ede-flush-directory-hash () "Flush the project directory hash. Do this only when developing new projects that are incorrectly putting -'nomatch tokens into the hash." +`nomatch' tokens into the hash." (interactive) (setq ede-project-directory-hash (make-hash-table :test 'equal)) ;; Also slush the current project's locator hash. diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index dc6751db6c..78002dd8ab 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -497,8 +497,8 @@ is requested." (defvar semantic-working-type 'percent "The type of working message to use when parsing. -'percent means we are doing a linear parse through the buffer. -'dynamic means we are reparsing specific tags.") +`percent' means we are doing a linear parse through the buffer. +`dynamic' means we are reparsing specific tags.") (defvar semantic-minimum-working-buffer-size (* 1024 5) "The minimum size of a buffer before working messages are displayed. diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 7f25a84891..82785ec6d2 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el @@ -729,7 +729,7 @@ Exit the save between databases if there is user input." (defvar semanticdb-project-predicate-functions nil "List of predicates to try that indicate a directory belongs to a project. This list is used when `semanticdb-persistent-path' contains the value -'project. If the predicate list is nil, then presume all paths are valid. +`project'. If the predicate list is nil, then presume all paths are valid. Project Management software (such as EDE and JDE) should add their own predicates with `add-hook' to this variable, and semanticdb will save tag diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index e894022315..92644ce006 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -591,7 +591,7 @@ in the new list. If optional argument SEARCH-PARTS is non-nil, all sub-parts of tags are searched. The overloadable function `semantic-tag-components' is used for the searching child lists. If SEARCH-PARTS is the symbol -'positiononly, then only children that have positional information are +`positiononly', then only children that have positional information are searched. If SEARCH-INCLUDES has not been implemented. diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el index a7c02032e2..9b70afd0a3 100644 --- a/lisp/cedet/semantic/java.el +++ b/lisp/cedet/semantic/java.el @@ -391,7 +391,7 @@ That is TAG `symbol-name' without the leading `@'." Return the list of FUN results. If optional PROPERTY is non-nil only call FUN for javadoc keywords which have a value for PROPERTY. FUN receives two arguments: the javadoc keyword and its associated -'javadoc property list. It can return any value. All nil values are +`javadoc' property list. It can return any value. All nil values are removed from the result list." (delq nil (mapcar diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index 26a3b39f0d..57e59f4e9f 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el @@ -726,7 +726,7 @@ Returns position with the end of that macro." (point)))))) (defun semantic-lex-spp-get-overlay (&optional point) - "Return first overlay which has a 'semantic-spp property." + "Return first overlay which has a `semantic-spp' property." (let ((overlays (overlays-at (or point (point))))) (while (and overlays (null (overlay-get (car overlays) 'semantic-spp))) diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index ba236059f6..e48cefa4ca 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el @@ -101,7 +101,7 @@ Where PREDICATE is a function that takes a directory name for the root of a project, and returns non-nil if the tool represented by KEY is supported. -If no tools are supported, then 'grep is assumed.") +If no tools are supported, then `grep' is assumed.") (defun semantic-symref-calculate-rootdir () "Calculate the root directory for a symref search. @@ -475,7 +475,7 @@ already." Return the Semantic tag associated with HIT. SEARCHTXT is the text that is being searched for. Used to narrow the in-buffer search. -SEARCHTYPE is the type of search (such as 'symbol or 'tagname). +SEARCHTYPE is the type of search (such as `symbol' or `tagname'). If there is no database, or if the searchtype is wrong, return nil." ;; Allowed search types for this mechanism: ;; tagname, tagregexp, tagcompletions @@ -506,7 +506,7 @@ If there is no database, or if the searchtype is wrong, return nil." Return the Semantic tag associated with HIT. SEARCHTXT is the text that is being searched for. Used to narrow the in-buffer search. -SEARCHTYPE is the type of search (such as 'symbol or 'tagname). +SEARCHTYPE is the type of search (such as `symbol' or `tagname'). Optional OPEN-BUFFERS, when nil will use a faster version of `find-file' when a file needs to be opened. If non-nil, then normal buffer initialization will be used. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 10adc9fcc9..e8698fad7e 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -234,8 +234,8 @@ Higher values result in larger images." (defvar doc-view-doc-type nil "The type of document in the current buffer. -Can be `dvi', `pdf', `ps', `djvu', `odf', 'epub', `cbz', `fb2', -`'xps' or `oxps'.") +Can be `dvi', `pdf', `ps', `djvu', `odf', `epub', `cbz', `fb2', +`xps' or `oxps'.") ;; FIXME: The doc-view-current-* definitions below are macros because they ;; map to accessors which we want to use via `setf' as well! diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index c3fd90e5bf..231dcdeb98 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -256,7 +256,7 @@ cache is flushed from position START, defaulting to point." (defun electric-pair--syntax-ppss (&optional pos where) "Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'. -WHERE is a list defaulting to '(string comment) and indicates +WHERE is a list defaulting to \\='(string comment) and indicates when to fallback to `parse-partial-sexp'." (let* ((pos (or pos (point))) (where (or where '(string comment))) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 364b5120a0..c2f8c4d009 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2560,7 +2560,7 @@ values. For compatibility, (cl-values A B C) is a synonym for (list A B C). (push x defun-declarations-alist))) (defun cl--optimize (f _args &rest qualities) - "Serve 'cl-optimize' in function declarations. + "Serve `cl-optimize' in function declarations. Example: (defun foo (x) (declare (cl-optimize (speed 3) (safety 0))) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 00efedd71f..237de52884 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -238,7 +238,7 @@ native compilation runs.") (defvar comp-curr-allocation-class 'd-default "Current allocation class. -Can be one of: 'd-default', 'd-impure' or 'd-ephemeral'. See `comp-ctxt'.") +Can be one of: `d-default', `d-impure' or `d-ephemeral'. See `comp-ctxt'.") (defconst comp-passes '(comp-spill-lap comp-limplify @@ -1023,7 +1023,7 @@ To be used by all entry points." (defun comp-alloc-class-to-container (alloc-class) "Given ALLOC-CLASS, return the data container for the current context. -Assume allocation class 'd-default as default." +Assume allocation class `d-default' as default." (cl-struct-slot-value 'comp-ctxt (or alloc-class 'd-default) comp-ctxt)) (defsubst comp-add-const-to-relocs (obj) @@ -2633,8 +2633,8 @@ TARGET-BB-SYM is the symbol name of the target block." do (comp-emit-call-cstr target insn-cell cstr))))))) (defun comp-add-cstrs (_) - "Rewrite conditional branches adding appropriate 'assume' insns. -This is introducing and placing 'assume' insns in use by fwprop + "Rewrite conditional branches adding appropriate `assume' insns. +This is introducing and placing `assume' insns in use by fwprop to propagate conditional branch test information on target basic blocks." (maphash (lambda (_ f) @@ -3482,7 +3482,7 @@ Return the list of m-var ids nuked." (defun comp-remove-type-hints-func () "Remove type hints from the current function. -These are substituted with a normal 'set' op." +These are substituted with a normal `set' op." (cl-loop for b being each hash-value of (comp-func-blocks comp-func) do (comp-loop-insn-in-block b @@ -4217,7 +4217,7 @@ Generate .elc files in addition to the .eln files. Force the produced .eln to be outputted in the eln system directory (the last entry in `native-comp-eln-load-path') unless `native-compile-target-directory' is non-nil. If the environment -variable 'NATIVE_DISABLED' is set, only byte compile." +variable \"NATIVE_DISABLED\" is set, only byte compile." (comp-ensure-native-compiler) (if (equal (getenv "NATIVE_DISABLED") "1") (batch-byte-compile) diff --git a/lisp/emacs-lisp/faceup.el b/lisp/emacs-lisp/faceup.el index 77689f434c..b44132dcea 100644 --- a/lisp/emacs-lisp/faceup.el +++ b/lisp/emacs-lisp/faceup.el @@ -1006,7 +1006,7 @@ which could be defined as: (defun my-test-explain (args...) (let ((faceup-test-explain t)) (the-test args...))) - (put 'my-test 'ert-explainer 'my-test-explain) + (put \\='my-test \\='ert-explainer \\='my-test-explain) Alternative, you can use the macro `faceup-defexplainer' as follows: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f6aad64d35..7f2c427c2e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -566,9 +566,9 @@ This is the name of the package with its version appended." "Return file-name extension of package-desc object PKG-DESC. Depending on the `package-desc-kind' of PKG-DESC, this is one of: - 'single - \".el\" - 'tar - \".tar\" - 'dir - \"\" + \\='single - \".el\" + \\='tar - \".tar\" + \\='dir - \"\" Signal an error if the kind is none of the above." (pcase (package-desc-kind pkg-desc) diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index 2494e94807..d11980f4f4 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -47,7 +47,7 @@ match if is not `equal' to VALUE. Furthermore, a nil PREDICATE means that the match region is ended if the value changes. For instance, this means that if you loop with - (while (setq prop (text-property-search-forward 'face)) + (while (setq prop (text-property-search-forward \\='face)) ...) you will get all distinct regions with non-nil `face' values in diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index e399fd0fbf..a7f3d5fe14 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -572,7 +572,7 @@ Only call fct for visible lines if VISIBLE==t. Set undo boundary if UNDO is non-nil. Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges) Perform auto-tabify after operation if TABIFY is non-nil. -Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear." +Mark is kept if keep-clear is `keep' and cleared if keep-clear is `clear'." (declare (indent 4)) (let* ((inhibit-field-text-motion t) (start (cua--rectangle-top)) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 398fe6cc9e..4b21711da4 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -464,7 +464,7 @@ If POS is out of range, the value is nil." (defun erc-bounds-of-word-at-point () "Return the bounds of word at point, or nil if we're not at a word. If no `subword-mode' is active, then this is -\(bounds-of-thing-at-point 'word)." +\(bounds-of-thing-at-point \\='word)." (if (or (erc-word-at-arg-p (point)) (erc-word-at-arg-p (1- (point)))) (save-excursion diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 3998026d7f..5396044d8c 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -313,7 +313,7 @@ With the following piece of advice, you can make this functionality available in most of Emacs, with the exception of filename completion in the minibuffer: - (advice-add 'expand-file-name :around #'my-expand-multiple-dots) + (advice-add \\='expand-file-name :around #\\='my-expand-multiple-dots) (defun my-expand-multiple-dots (orig-fun filename &rest args) (apply orig-fun (eshell-expand-multiple-dots filename) args))" (while (string-match "\\(?:\\`\\|/\\)\\.\\.\\(\\.+\\)\\(?:\\'\\|/\\)" diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index ca4cbd744c..3c6bcc753c 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -422,7 +422,7 @@ Possible options are: NAME an environment or Lisp variable value \"LONG-NAME\" disambiguates the length of the name - 'LONG-NAME' as above + `LONG-NAME' as above {COMMAND} result of command is variable's value (LISP-FORM) result of Lisp form is variable's value write the output of command to a temporary file; diff --git a/lisp/frame.el b/lisp/frame.el index 7b19b8b5d3..83e67dac4e 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1727,7 +1727,7 @@ to the selected frame. Storing information about resize operations is off by default. If you set the variable `frame-size-history' like this -(setq frame-size-history '(100)) +(setq frame-size-history \\='(100)) then Emacs will save information about the next 100 significant operations affecting any frame's size in that variable. This diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 6c70257f42..17724c3a51 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -2125,9 +2125,9 @@ Assume \"size\" key is equal to \"larger\"." (defun gnus-search-prepare-query (query-spec) "Accept a search query in raw format, and prepare it. QUERY-SPEC is an alist produced by functions such as -`gnus-group-make-search-group', and contains at least a 'query +`gnus-group-make-search-group', and contains at least a `query' key, and possibly some meta keys. This function extracts any -additional meta keys from the 'query string, and parses the +additional meta keys from the `query' string, and parses the remaining string, then adds all that to the top-level spec." (let ((query (alist-get 'query query-spec)) val) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 62efacfd6e..d2221eb41c 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9447,7 +9447,7 @@ The 1st element is the button named by `gnus-collect-urls-primary-text'." (defun gnus-collect-urls-from-article () "Select the article and return the list of URLs in it. -See 'gnus-collect-urls'." +See `gnus-collect-urls'." (gnus-summary-select-article) (gnus-with-article-buffer (article-goto-body) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 30734b8f1a..cc994d3ba5 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -9008,7 +9008,7 @@ used to take the screenshot." This is meant to be used for MIME handlers: Setting the handler for \"x-scheme-handler/mailto;\" to \"emacs -f message-mailto %u\" will then start up Emacs ready to compose mail. For emacsclient use - emacsclient -e '(message-mailto \"%u\")'" + emacsclient -e \\='(message-mailto \"%u\")'" (interactive) ;; Send email (message-mail) diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index 4e8e329f98..8c811b0c6c 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -333,7 +333,7 @@ this might lead to problems, especially when used with marks propagation." (defvar nnmairix-widget-other '(threads flags) "Other editable mairix commands when using customization widgets. -Currently there are 'threads and 'flags.") +Currently there are `threads' and `flags'.") (defvar nnmairix-interactive-query-parameters '((?f "from" "f" "From") (?t "to" "t" "To") (?c "to" "tc" "To or Cc") diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 89ddd60897..cdbfa0b591 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -269,8 +269,8 @@ If this variable is nil, or if the provided function returns nil, (defun nnselect-generate-artlist (group &optional specs) "Generate the artlist for GROUP using SPECS. -SPECS should be an alist including an 'nnselect-function and an -'nnselect-args. The former applied to the latter should create +SPECS should be an alist including an `nnselect-function' and an +`nnselect-args'. The former applied to the latter should create the artlist. If SPECS is nil retrieve the specs from the group parameters." (let* ((specs diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index 297576288b..5af29c0a24 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -852,7 +852,7 @@ The value nil means that the check does not yield a decision, and so, that further checks are needed. The value t means that the message is definitely not spam, and that further spam checks should be inhibited. Otherwise, a mailgroup name or the symbol -'spam (depending on `spam-split-symbolic-return') is returned where +`spam' (depending on `spam-split-symbolic-return') is returned where the mail should go, and further checks are also inhibited. The usual mailgroup name is the value of `spam-split-group', meaning that the message is definitely a spam." diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el index a339e95ab4..7914d28c29 100644 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@ -109,7 +109,7 @@ To pass in image data, IMAGE should a string containing the image data, and IMAGE-FORMAT should be a symbol with a MIME format name like \"image/webp\". For instance: - (image-convert data-string 'image/bmp) + (image-convert data-string \\='image/bmp) IMAGE can also be an image object as returned by `create-image'. diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index 9188e3d6ae..c7d883276d 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el @@ -577,7 +577,7 @@ Return register which holds a value of the expression." (ccl-check-register expr cmd))) (defun ccl-compile-branch-blocks (code rrr blocks) - "Compile BLOCKs of BRANCH statement. CODE is 'branch or 'read-branch. + "Compile BLOCKs of BRANCH statement. CODE is `branch' or `read-branch'. REG is a register which holds a value of EXPRESSION part. BLOCKs is a list of CCL-BLOCKs." (let ((branches (length blocks)) diff --git a/lisp/keymap.el b/lisp/keymap.el index c0fdf8721b..db37d80b36 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -306,10 +306,10 @@ number of characters have a special shorthand syntax. Here's some example key sequences. - \"f\" (the key 'f') - \"S o m\" (a three key sequence of the keys 'S', 'o' and 'm') - \"C-c o\" (a two key sequence of the keys 'c' with the control modifier - and then the key 'o') + \"f\" (the key `f') + \"S o m\" (a three key sequence of the keys `S', `o' and `m') + \"C-c o\" (a two key sequence of the keys `c' with the control modifier + and then the key `o') \"H-\" (the key named \"left\" with the hyper modifier) \"M-RET\" (the \"return\" key with a meta modifier) \"C-M-\" (the \"space\" key with both the control and meta modifiers) diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 7a4be3c7e4..33dd98ef8d 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -891,7 +891,7 @@ All ls time options, namely c, t and u, are handled." nil) (defun ls-lisp--sanitize-switches (switches) - "Convert long options of GNU 'ls' to their short form. + "Convert long options of GNU \"ls\" to their short form. Conversion is done only for flags supported by ls-lisp. Long options not supported by ls-lisp are removed. Supported options are: A a B C c F G g h i n R r S s t U u v X. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 32edc29261..35e9f73f8c 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1317,7 +1317,7 @@ feedmail-queue-buffer-file-name is restored to nil. Example advice for mail-send: - (advice-add 'mail-send :around #'my-feedmail-mail-send-advice) + (advice-add \\='mail-send :around #\\='my-feedmail-mail-send-advice) (defun my-feedmail-mail-send-advice (orig-fun &rest args) (let ((feedmail-queue-buffer-file-name buffer-file-name) (buffer-file-name nil)) @@ -1742,7 +1742,7 @@ applied to a file after you've just read it from disk: for example, a feedmail FQM message file from a queue. You could use something like this: - (add-to-list 'auto-mode-alist \\='(\"\\\\.fqm\\\\\\='\" . feedmail-vm-mail-mode))" + (add-to-list \\='auto-mode-alist \\='(\"\\\\.fqm\\\\\\='\" . feedmail-vm-mail-mode))" (feedmail-say-debug ">in-> feedmail-vm-mail-mode") (let ((the-buf (current-buffer))) (vm-mail) diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el index a2ea761013..3e731e22a1 100644 --- a/lisp/mh-e/mh-limit.el +++ b/lisp/mh-e/mh-limit.el @@ -143,7 +143,7 @@ Use \\\\[mh-widen] to undo this command." ;;; Support Routines (defun mh-subject-to-sequence (all) - "Put all following messages with same subject in sequence 'subject. + "Put all following messages with same subject in sequence `subject'. If arg ALL is t, move to beginning of folder buffer to collect all messages. If arg ALL is nil, collect only messages from current one on forward. @@ -161,7 +161,7 @@ Return number of messages put in the sequence: (mh-subject-to-sequence-unthreaded all))) (defun mh-subject-to-sequence-threaded (all) - "Put all messages with the same subject in the 'subject sequence. + "Put all messages with the same subject in the `subject' sequence. This function works when the folder is threaded. In this situation the subject could get truncated and so the normal @@ -192,7 +192,7 @@ are taken into account." It would be desirable to avoid hard-coding this.") (defun mh-subject-to-sequence-unthreaded (all) - "Put all following messages with same subject in sequence 'subject. + "Put all following messages with same subject in sequence `subject'. This function only works with an unthreaded folder. If arg ALL is t, move to beginning of folder buffer to collect all messages. If diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 98a20b7bb4..d2e07977e5 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -1764,7 +1764,7 @@ initialized. Always use the command `mh-have-file-command'.") ;;;###mh-autoload (defun mh-have-file-command () "Return t if `file' command is on the system. -'file -i' is used to get MIME type of composition insertion." +\"file -i\" is used to get MIME type of composition insertion." (when (eq mh-have-file-command 'undefined) (setq mh-have-file-command (and (executable-find "file") ; file command exists diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 198162266e..d52084afc3 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4101,7 +4101,7 @@ This turns into (prefix \"f\" any \"o\" any \"o\" any point) which is at the core of flex logic. The extra -'any' is optimized away later on." +`any' is optimized away later on." (mapcan (lambda (elem) (if (stringp elem) (mapcan (lambda (char) diff --git a/lisp/net/dictionary-connection.el b/lisp/net/dictionary-connection.el index aef3c4efc7..a4afcd6647 100644 --- a/lisp/net/dictionary-connection.el +++ b/lisp/net/dictionary-connection.el @@ -83,10 +83,10 @@ Return a data structure identifying the connection." "Return the status of the CONNECTION. Possible return values are the symbols: nil: argument is not a connection object - 'none: argument is not connected - 'up: connection is open and buffer is existing - 'down: connection is closed - 'alone: connection is not associated with a buffer" + `none': argument is not connected + `up': connection is open and buffer is existing + `down': connection is closed + `alone': connection is not associated with a buffer" (when (dictionary-connection-p connection) (let ((process (dictionary-connection-process connection)) (buffer (dictionary-connection-buffer connection))) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 75dc679a3d..57cb566c95 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -311,7 +311,7 @@ parameter, and should return the (possibly) transformed URL." (defvar eww-accept-content-types "text/html, text/plain, text/sgml, text/css, application/xhtml+xml, */*;q=0.01" - "Value used for the HTTP 'Accept' header.") + "Value used for the HTTP \"Accept\" header.") (defvar-keymap eww-link-keymap :parent shr-map diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d7d375e111..9aac5b27e6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -238,7 +238,7 @@ pair of the form (KEY VALUE). The following KEYs are defined: unchanged after expansion (i.e. no host, no user or no port were specified), that sublist is not used. For e.g. - '((\"-a\" \"-b\") (\"-l\" \"%u\")) + \\='((\"-a\" \"-b\") (\"-l\" \"%u\")) that means that (\"-l\" \"%u\") is used only if the user was specified, and it is thus effectively optional. diff --git a/lisp/obsolete/mouse-sel.el b/lisp/obsolete/mouse-sel.el index a9d6bfee60..3eacac65fb 100644 --- a/lisp/obsolete/mouse-sel.el +++ b/lisp/obsolete/mouse-sel.el @@ -438,7 +438,7 @@ Click sets point & mark to click position. Dragging extends region/selection. Multi-clicking selects word/lines/paragraphs, as determined by -'mouse-sel-determine-selection-thing. +`mouse-sel-determine-selection-thing'. Clicking mouse-2 while selecting copies selected text to the kill-ring. Clicking mouse-1 or mouse-3 kills the selected text. @@ -459,7 +459,7 @@ Click sets the start of the secondary selection to click position. Dragging extends the secondary selection. Multi-clicking selects word/lines/paragraphs, as determined by -'mouse-sel-determine-selection-thing. +`mouse-sel-determine-selection-thing'. Clicking mouse-2 while selecting copies selected text to the kill-ring. Clicking mouse-1 or mouse-3 kills the selected text. diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 23ef162a7f..04af84d2e4 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -480,7 +480,7 @@ value. The value can either be a string or a closure that evaluates to a string. The closure is evaluated when the source block is being evaluated (e.g. during execution or export), with point at the source block. It is not possible to use an -arbitrary function symbol (e.g. 'some-func), since org uses +arbitrary function symbol (e.g. `some-func'), since org uses lexical binding. To achieve the same functionality, call the function within a closure (e.g. (lambda () (some-func))). diff --git a/lisp/org/ob-julia.el b/lisp/org/ob-julia.el index abddca3613..50a44bcf44 100644 --- a/lisp/org/ob-julia.el +++ b/lisp/org/ob-julia.el @@ -250,8 +250,8 @@ end") (defun org-babel-julia-evaluate-external-process (body result-type result-params column-names-p) "Evaluate BODY in external julia process. -If RESULT-TYPE equals 'output then return standard output as a -string. If RESULT-TYPE equals 'value then return the value of the +If RESULT-TYPE equals `output' then return standard output as a +string. If RESULT-TYPE equals `value' then return the value of the last statement in BODY, as elisp." (cl-case result-type (value @@ -274,8 +274,8 @@ last statement in BODY, as elisp." (defun org-babel-julia-evaluate-session (session body result-type result-params column-names-p) "Evaluate BODY in SESSION. -If RESULT-TYPE equals 'output then return standard output as a -string. If RESULT-TYPE equals 'value then return the value of the +If RESULT-TYPE equals `output' then return standard output as a +string. If RESULT-TYPE equals `value' then return the value of the last statement in BODY, as elisp." (cl-case result-type (value diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el index 48de0dbad0..b6e78fb7fd 100644 --- a/lisp/org/ob-lua.el +++ b/lisp/org/ob-lua.el @@ -395,7 +395,7 @@ fd:close()" (org-babel-lua-table-or-string results))))) (defun org-babel-lua-read-string (string) - "Strip 's from around Lua string." + "Strip \\=' characters from around Lua string." (org-unbracket-string "'" "'" string)) (provide 'ob-lua) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 71aac271f7..dfd5d829db 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -4124,7 +4124,7 @@ dimming them." ;FIXME: The arg isn't used, actually! If the header at `org-hd-marker' is blocked according to `org-entry-blocked-p', then if `org-agenda-dim-blocked-tasks' is -'invisible and the header is not blocked by checkboxes, set the +`invisible' and the header is not blocked by checkboxes, set the text property `org-todo-blocked' to `invisible', otherwise set it to t." (when (get-text-property 0 'todo-state entry) @@ -7399,7 +7399,7 @@ Argument ARG is the prefix argument." When in a restricted subtree, remove it. The restriction will span over the entire file if TYPE is `file', -or if type is '(4), or if the cursor is before the first headline +or if type is \\='(4), or if the cursor is before the first headline in the file. Otherwise, only apply the restriction to the current subtree." (interactive "P") diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index bf84c99e04..4507fbe7dd 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el @@ -280,7 +280,7 @@ When NORMALISE is non-nil, the count is divided by the number of values." collect (cons n (/ (length m) normaliser))))) (defun org--plot/prime-factors (value) - "Return the prime decomposition of VALUE, e.g. for 12, '(3 2 2)." + "Return the prime decomposition of VALUE, e.g. for 12, \\='(3 2 2)." (let ((factors '(1)) (i 1)) (while (/= 1 value) (setq i (1+ i)) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 860fd6e560..c301bc6af1 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -5465,7 +5465,7 @@ The table is taken from the parameter TXT, or from the buffer at point." (nreverse table))))) (defun org-table-collapse-header (table &optional separator max-header-lines) - "Collapse the lines before 'hline into a single header. + "Collapse the lines before `hline' into a single header. The given TABLE is a list of lists as returned by `org-table-to-lisp'. The leading lines before the first `hline' symbol are considered diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index 81ef002a05..9cf9125aeb 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el @@ -2909,7 +2909,7 @@ Starred and \"displaymath\" environments are not numbered." (defun org-html--unlabel-latex-environment (latex-frag) "Change environment in LATEX-FRAG string to an unnumbered one. -For instance, change an 'equation' environment to 'equation*'." +For instance, change an `equation' environment to `equation*'." (replace-regexp-in-string "\\`[ \t]*\\\\begin{\\([^*]+?\\)}" "\\1*" diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index 636bd0d2ae..51e2352b4e 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el @@ -839,7 +839,7 @@ in `org-export-options-alist' or in export back-ends. In the latter case, optional argument BACKEND has to be set to the back-end where the option is defined, e.g., - (org-publish-find-property file :subtitle 'latex) + (org-publish-find-property file :subtitle \\='latex) Return value may be a string or a list, depending on the type of PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'." diff --git a/lisp/outline.el b/lisp/outline.el index 9f73ca0d0c..7fd43195cc 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1502,7 +1502,7 @@ LEVEL, decides of subtree visibility according to (defun outline--cycle-state () "Return the cycle state of current heading. -Return either 'hide-all, 'headings-only, or 'show-all." +Return either `hide-all', `headings-only', or `show-all'." (save-excursion (let (start end ov-list heading-end) (outline-back-to-heading) diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 07f27374df..b859176bb4 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -898,7 +898,7 @@ Regular objects have whole numbers lower than 255. Objects that cannot be taken but might move and are described during room description are negative. Stuff that is described and might change are 255, and are -handled specially by 'dun-describe-room.") +handled specially by `dun-describe-room'.") (defconst dun-room-silents (list nil (list obj-tree obj-coconut) ;; dead-end diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0dfff32f20..8cae680634 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -779,7 +779,7 @@ functions are annotated with \"\" via the (defun elisp--xref-make-xref (type symbol file &optional summary) "Return an xref for TYPE SYMBOL in FILE. TYPE must be a type in `find-function-regexp-alist' (use nil for -'defun). If SUMMARY is non-nil, use it for the summary; +`defun'). If SUMMARY is non-nil, use it for the summary; otherwise build the summary from TYPE and SYMBOL." (xref-make (or summary (format elisp--xref-format (or type 'defun) symbol)) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index a35a7deb4b..089c273bc6 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1581,7 +1581,7 @@ Buffer mode and name are selected according to buffer type. If buffer has trigger associated with it in `gdb-buffer-rules', this trigger is subscribed to `gdb-buf-publisher' and called with -'update argument." +`update' argument." (or (gdb-get-buffer buffer-type thread) (let ((rules (assoc buffer-type gdb-buffer-rules)) (new (generate-new-buffer "limbo"))) diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index ed6dce02c0..8c179879ce 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -344,7 +344,7 @@ information): Add functions to the hook with `add-hook': - (add-hook 'tcl-mode-hook #'tcl-guess-application)") + (add-hook \\='tcl-mode-hook #\\='tcl-guess-application)") (defvar tcl-proc-list diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index edce3fef6c..31d50a1882 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -3622,10 +3622,10 @@ is 0. Meaning of *single* declaration: E.g. In a module's port-list - module test(input clk, rst, x, output [1:0] y); - Here 'input clk, rst, x' is 1 *single* declaration statement, -and 'output [1:0] y' is the other single declaration. In the 1st single -declaration, POINT is moved to start of 'clk'. And in the 2nd declaration, -POINT is moved to 'y'." + Here `input clk, rst, x' is 1 *single* declaration statement, +and `output [1:0] y' is the other single declaration. In the 1st single +declaration, POINT is moved to start of `clk'. And in the 2nd declaration, +POINT is moved to `y'." (let (maxpoint old-point) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 958d4e8b9d..fee2d0afcb 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1868,7 +1868,7 @@ to control which program to use when looking for matches." (xref--find-ignores-arguments ignores dir))) (defun xref--find-ignores-arguments (ignores dir) - "Convert IGNORES and DIR to a list of arguments for 'find'. + "Convert IGNORES and DIR to a list of arguments for `find'. IGNORES is a list of glob patterns. DIR is an absolute directory, used as the root of the ignore globs." (cl-assert (not (string-match-p "\\`~" dir))) diff --git a/lisp/ses.el b/lisp/ses.el index 59e10e777f..7a9b35d749 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -2331,7 +2331,7 @@ Narrow to print area if optional argument NONARROW is nil." "Recalculate and reprint the current cell or range. If CURCELL is non nil use it as current cell or range -without any check, otherwise function (ses-check-curcell 'range) +without any check, otherwise function (ses-check-curcell \\='range) is called. For an individual cell, shows the error if the formula or printer @@ -3774,15 +3774,15 @@ DEFINITION shall be either a string formatter, e.g.: \"%.2f\" or (\"%.2f\") for left alignment. or a lambda expression, e.g. for formatting in ISO format dates -created with a '(calcFunc-date YEAR MONTH DAY)' formula: +created with a `(calcFunc-date YEAR MONTH DAY)' formula: (lambda (x) (cond ((null val) \"\") - ((eq (car-safe x) 'date) - (let ((calc-format-date '(X YYYY \"-\" MM \"-\" DD))) + ((eq (car-safe x) \\='date) + (let ((calc-format-date \\='(X YYYY \"-\" MM \"-\" DD))) (math-format-date x))) - (t (ses-center-span val ?# 'ses-prin1)))) + (t (ses-center-span val ?# \\='ses-prin1)))) If NAME is already used to name a local printer function, then the current definition is proposed as default value, and the @@ -4122,7 +4122,7 @@ until the next nonblank column." (ses-center-span value ?~ printer)) (defun ses-prin1 (value) - "Shorthand for '(prin1-to-string VALUE t)'. + "Shorthand for `(prin1-to-string VALUE t)'. Useful to handle the default behavior in custom lambda based printer functions." (prin1-to-string value t)) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index c4d450fe2a..a0dd20a99c 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -229,7 +229,7 @@ a list of frames to update." (defun tab-bar--key-to-number (key) "Return the tab number represented by KEY. -If KEY is a symbol 'tab-N', where N is a tab number, the value is N. +If KEY is a symbol `tab-N', where N is a tab number, the value is N. If KEY is \\='current-tab, the value is nil. For any other value of KEY, the value is t." (cond @@ -426,7 +426,7 @@ on each new frame when the global `tab-bar-mode' is disabled, or if you want to disable the tab bar individually on each new frame when the global `tab-bar-mode' is enabled, by using - (add-hook 'after-make-frame-functions 'toggle-frame-tab-bar)" + (add-hook \\='after-make-frame-functions #\\='toggle-frame-tab-bar)" (interactive) (set-frame-parameter frame 'tab-bar-lines (if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1)) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index b2e0b7f9d0..62a4af1377 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -5039,7 +5039,7 @@ on the value of `bibtex-entry-format'. If the reference key of the entry is empty or a prefix argument is given, calculate a new reference key. (Note: this works only if fields in entry begin on separate lines prior to calling `bibtex-clean-entry' or if -'realign is contained in `bibtex-entry-format'.) +`realign' is contained in `bibtex-entry-format'.) Don't call `bibtex-clean-entry' on @Preamble entries. At end of the cleaning process, the functions in `bibtex-clean-entry-hook' are called with region narrowed to entry." diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 9d3e9effe6..6a91cef1d9 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -2351,7 +2351,7 @@ If user selects bullets or #, it's just added with position arranged by `rst-insert-list-new-tag'. If user selects enumerations, a further prompt is given. User need to -input a starting item, for example 'e' for 'A)' style. The position is +input a starting item, for example `e' for `A)' style. The position is also arranged by `rst-insert-list-new-tag'." (let* ((itemstyle (completing-read (format-prompt "Select preferred item style" "#.") diff --git a/lisp/transient.el b/lisp/transient.el index 0d7f9d0317..13e8de258b 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1384,7 +1384,7 @@ The optional argument COMMAND is intended for internal use. If you are contemplating using it in your own code, then you should probably use this instead: - (get COMMAND 'transient--suffix)" + (get COMMAND \\='transient--suffix)" (when command (cl-check-type command command)) (if (or transient--prefix diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 2d313076e3..0f3a1506d6 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -385,7 +385,7 @@ correspond to what the tutorial says.\n\n") "Find the key bindings used in the tutorial that have changed. Return a list with elements of the form - '(KEY DEF-FUN DEF-FUN-TXT WHERE REMARK QUIET) + (KEY DEF-FUN DEF-FUN-TXT WHERE REMARK QUIET) where diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index dd658b1b68..53cefb46e4 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -307,8 +307,8 @@ object." (defun url-digest-auth-build-response (key url realm attrs) "Compute authorization string for the given challenge using KEY. -The string looks like 'Digest username=\"John\", realm=\"The -Realm\", ...' +The string looks like \"Digest username=\"John\", realm=\"The +Realm\", ...\" Part of the challenge is already solved in a pre-computed KEY which is list of a realm (or a directory), user name, and hash diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index fb57b2bbc6..170f5c8d46 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -1062,9 +1062,9 @@ file." (defun vc-rcs-consult-headers (file) "Search for RCS headers in FILE, and set properties accordingly. -Returns: nil if no headers were found - 'rev if a workfile revision was found - 'rev-and-lock if revision and lock info was found" +Returns: nil if no headers were found + `rev' if a workfile revision was found + `rev-and-lock' if revision and lock info was found" (cond ((not (get-file-buffer file)) nil) ((let (status version) diff --git a/lisp/window.el b/lisp/window.el index f3a09ee462..c15f14cc61 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2496,7 +2496,7 @@ unless DEDICATED is non-nil, so if all windows are dedicated, the value is nil. Avoid returning the selected window if possible. Optional argument NOT-SELECTED non-nil means never return the selected window. Optional argument NO-OTHER non-nil means to -never return a window whose 'no-other-window' parameter is +never return a window whose `no-other-window' parameter is non-nil. The following non-nil values of the optional argument ALL-FRAMES @@ -2538,7 +2538,7 @@ never a candidate unless DEDICATED is non-nil, so if all windows are dedicated, the value is nil. Optional argument NOT-SELECTED non-nil means never return the selected window. Optional argument NO-OTHER non-nil means to never return a window whose -'no-other-window' parameter is non-nil. +`no-other-window' parameter is non-nil. The following non-nil values of the optional argument ALL-FRAMES have special meanings: @@ -2574,7 +2574,7 @@ never a candidate unless DEDICATED is non-nil, so if all windows are dedicated, the value is nil. Optional argument NOT-SELECTED non-nil means never return the selected window. Optional argument NO-OTHER non-nil means to never return a window whose -'no-other-window' parameter is non-nil. +`no-other-window' parameter is non-nil. The following non-nil values of the optional argument ALL-FRAMES have special meanings: @@ -5117,7 +5117,7 @@ parameter to nil. See Info node `(elisp) Quitting Windows' for more details. If WINDOW's dedicated flag is t, try to delete WINDOW. If it -equals the value 'side', restore that value when WINDOW is not +equals the value `side', restore that value when WINDOW is not deleted. Optional second argument BURY-OR-KILL tells how to proceed with @@ -7549,7 +7549,7 @@ to an expression containing one of these \"action\" functions: For instance: - (setq display-buffer-alist '((\".*\" display-buffer-at-bottom))) + (setq display-buffer-alist \\='((\".*\" display-buffer-at-bottom))) Buffer display can be further customized to a very high degree; the rest of this docstring explains some of the many @@ -7604,7 +7604,7 @@ Action alist entries are: the window specified in frame lines), a floating point number (the fraction of its total height with respect to the total height of the frame's root window), a cons cell whose - car is 'body-lines' and whose cdr is an integer that + car is `body-lines' and whose cdr is an integer that specifies the height of the window's body in frame lines, or a function to be called with one argument - the chosen window. That function is supposed to adjust the height of @@ -7615,7 +7615,7 @@ Action alist entries are: the window specified in frame lines), a floating point number (the fraction of its total width with respect to the width of the frame's root window), a cons cell whose car is - 'body-columns' and whose cdr is an integer that specifies the + `body-columns' and whose cdr is an integer that specifies the width of the window's body in frame columns, or a function to be called with one argument - the chosen window. That function is supposed to adjust the width of the window. @@ -7623,7 +7623,7 @@ Action alist entries are: alone on their frame and specifies the desired size of that window either as a cons of integers (the total width and height of the window on that frame), a cons cell whose car is - 'body-chars' and whose cdr is a cons of integers (the desired + `body-chars' and whose cdr is a cons of integers (the desired width and height of the window's body in columns and lines of its frame), or a function to be called with one argument - the chosen window. That function is supposed to adjust the diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 892fd278df..56cb9057ed 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -38,7 +38,7 @@ ;; be used to compare such calc expressions. (defun calc-tests-equal (a b) "Like `equal' but allow for different representations of numbers. -For example: (calc-tests-equal 10 '(float 1 1)) => t. +For example: (calc-tests-equal 10 \\='(float 1 1)) => t. A and B should be calc expressions." (cond ((math-numberp a) (and (math-numberp b) diff --git a/test/lisp/cedet/srecode-utest-template.el b/test/lisp/cedet/srecode-utest-template.el index 1eb91e6053..87c28c6af1 100644 --- a/test/lisp/cedet/srecode-utest-template.el +++ b/test/lisp/cedet/srecode-utest-template.el @@ -33,7 +33,7 @@ ;;; MAP DUMP TESTING (defun srecode-utest-map-reset () "Reset, then dump the map of SRecoder templates. -Probably should be called 'describe-srecode-maps'." +Probably should be called `describe-srecode-maps'." (interactive) (message "SRecode Template Path: %S" srecode-map-load-path) ;; Interactive call allows us to dump. diff --git a/test/lisp/mh-e/mh-thread-tests.el b/test/lisp/mh-e/mh-thread-tests.el index 84f59e5d30..ea8d441e2d 100644 --- a/test/lisp/mh-e/mh-thread-tests.el +++ b/test/lisp/mh-e/mh-thread-tests.el @@ -24,7 +24,7 @@ (eval-when-compile (require 'cl-lib)) (defun mh-thread-tests-before-from () - "Generate the fields of a scan line up to where the 'From' field would start. + "Generate the fields of a scan line up to where the \"From\" field would start. The exact contents are not important, but the number of characters is." (concat (make-string mh-cmd-note ?9) (make-string mh-scan-cmd-note-width ?A) diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el index eecf6406fb..748f1e3944 100644 --- a/test/lisp/xml-tests.el +++ b/test/lisp/xml-tests.el @@ -97,7 +97,7 @@ ((("FOOBAR:" . "something") nil "hi there")) ((FOOBAR:something nil "hi there")))) "List of strings which are parsed using namespace expansion. -Parser is called with and without 'symbol-qnames argument.") +Parser is called with and without `symbol-qnames' argument.") (ert-deftest xml-parse-tests () "Test XML parsing." diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index e6288d1fc9..ff0d6be3f5 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el @@ -157,8 +157,8 @@ are known failures, and are skipped." (defun regex-tests-compare (string what-failed bounds-ref &optional substring-ref) "I just ran a search, looking at STRING. WHAT-FAILED describes -what failed, if anything; valid values are 'search-failed, -'compilation-failed and nil. I compare the beginning/end of each +what failed, if anything; valid values are `search-failed', +`compilation-failed' and nil. I compare the beginning/end of each group with their expected values. This is done with either BOUNDS-REF or SUBSTRING-REF; one of those should be non-nil. BOUNDS-REF is a sequence [start-ref0 end-ref0 start-ref1 @@ -166,9 +166,9 @@ end-ref1 ....] while SUBSTRING-REF is the expected substring obtained by indexing the input string by start/end-ref. If the search was supposed to fail then start-ref0/substring-ref0 -is 'search-failed. If the search wasn't even supposed to compile +is `search-failed'. If the search wasn't even supposed to compile successfully, then start-ref0/substring-ref0 is -'compilation-failed. If I only care about a match succeeding, +`compilation-failed'. If I only care about a match succeeding, this can be set to t. This function returns a string that describes the failure, or nil @@ -259,8 +259,8 @@ BOUNDS-REF is a sequence [start-ref0 end-ref0 start-ref1 end-ref1 ....]. If the search was supposed to fail then start-ref0 is -'search-failed. If the search wasn't even supposed to compile -successfully, then start-ref0 is 'compilation-failed. +`search-failed'. If the search wasn't even supposed to compile +successfully, then start-ref0 is `compilation-failed'. This function returns a string that describes the failure, or nil on success" commit 16dfec3c4ccafb2ec7b9a428fb2730ca8f0202fd Author: Lars Ingebrigtsen Date: Fri Apr 22 15:17:15 2022 +0200 Fix map-into doc string example * lisp/emacs-lisp/map.el (map-into): Fix quote quoting in example. diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index dea5b34991..c53f253f87 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -540,7 +540,7 @@ TYPE is a list whose car is `hash-table' and cdr a list of keyword-args forwarded to `make-hash-table'. Example: - (map-into '((1 . 3)) '(hash-table :test eql))" + (map-into \\='((1 . 3)) \\='(hash-table :test eql))" (map--into-hash map (cdr type))) (defun map--make-pcase-bindings (args) commit 93f87a3190f9efebe0e2db0cd5cfe5aeac6b64c3 Author: Lars Ingebrigtsen Date: Fri Apr 22 14:58:59 2022 +0200 Make `C-u C-x =' be more verbose about invisible characters * lisp/descr-text.el (describe-text-properties-1): Note confusing bits about invisible characters (bug#3400). diff --git a/lisp/descr-text.el b/lisp/descr-text.el index a816088932..0f01ad676a 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -176,6 +176,10 @@ otherwise." (insert "\n")) ;; Text properties (when properties + (when (plist-get properties 'invisible) + (insert "\nNote that character has an invisibility property,\n" + " so the character displayed at point in the buffer may\n" + " differ from the character described here.\n")) (newline) (insert "There are text properties here:\n") (describe-property-list properties))))) commit 38797bfa5ef2759d8ae09035eee136273239a277 Author: Lars Ingebrigtsen Date: Fri Apr 22 14:34:50 2022 +0200 Allow completion-ignore-case to be buffer-local * lisp/minibuffer.el (completing-read-default): Use the value of completion-ignore-case from the current buffer (bug#12615). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e1947ae5dd..198162266e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4245,6 +4245,7 @@ See `completing-read' for the meaning of the arguments." ;; override bindings in base-keymap. base-keymap))) (buffer (current-buffer)) + (c-i-c completion-ignore-case) (result (minibuffer-with-setup-hook (lambda () @@ -4254,7 +4255,9 @@ See `completing-read' for the meaning of the arguments." (setq-local minibuffer-completion-confirm (unless (eq require-match t) require-match)) (setq-local minibuffer--require-match require-match) - (setq-local minibuffer--original-buffer buffer)) + (setq-local minibuffer--original-buffer buffer) + ;; Copy the value from original buffer to the minibuffer. + (setq-local completion-ignore-case c-i-c)) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) commit 3aaed2e1ccfcc230f813d3fe7867a7abc5b22109 Author: Lars Ingebrigtsen Date: Fri Apr 22 14:04:43 2022 +0200 Fix problem with (narrow-to-page 1) with point at point-max * lisp/textmodes/page.el (forward-page): Make this work more consistently if point is on bol (bug#20663). diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index 3fc1832334..5d6f017eb9 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el @@ -35,11 +35,18 @@ A page boundary is any line whose beginning matches the regexp (interactive "p") (or count (setq count 1)) (while (and (> count 0) (not (eobp))) - ;; In case the page-delimiter matches the null string, - ;; don't find a match without moving. - (if (bolp) (forward-char 1)) - (unless (re-search-forward page-delimiter nil t) - (goto-char (point-max))) + (if (and (looking-at page-delimiter) + (> (match-end 0) (point))) + ;; If we're standing at the page delimiter, then just skip to + ;; the end of it. (But only if it's not a zero-length + ;; delimiter, because then we wouldn't have forward progress.) + (goto-char (match-end 0)) + ;; In case the page-delimiter matches the null string, + ;; don't find a match without moving. + (when (bolp) + (forward-char 1)) + (unless (re-search-forward page-delimiter nil t) + (goto-char (point-max)))) (setq count (1- count))) (while (and (< count 0) (not (bobp))) ;; In case the page-delimiter matches the null string, diff --git a/test/lisp/textmodes/page-tests.el b/test/lisp/textmodes/page-tests.el index 596f3a6ceb..b7217e69f0 100644 --- a/test/lisp/textmodes/page-tests.el +++ b/test/lisp/textmodes/page-tests.el @@ -80,6 +80,17 @@ (narrow-to-page 2) (should (equal (buffer-string) "baz")) (narrow-to-page -1) + (should (equal (buffer-string) "bar\n")) + + (widen) + (goto-char (point-min)) + (narrow-to-page) + (should (equal (buffer-string) "foo\n")) + (goto-char (point-max)) + (narrow-to-page 2) + (should (equal (buffer-string) "baz")) + (goto-char (point-max)) + (narrow-to-page -1) (should (equal (buffer-string) "bar\n")))) (ert-deftest page-tests-count-lines-page () @@ -100,4 +111,5 @@ (forward-page) (should (equal (page--what-page) '(3 4))))) + ;;; page-tests.el ends here commit f2f9e8dc76cdc7433624ee7e88ec5380a5b06902 Author: Eli Zaretskii Date: Fri Apr 22 15:18:56 2022 +0300 ; Improve comments for a recently installed bugfix * lisp/startup.el (command-line): Remove references to a wrong bug number and improve comments for delaying the 'user-emacs-directory' warning. (Bug#25163) diff --git a/lisp/startup.el b/lisp/startup.el index 4391fdd996..57a38a295e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1291,9 +1291,11 @@ please check its value") (setcdr command-line-args args))) ;; Re-evaluate predefined variables whose initial value depends on - ;; the runtime context. - (let ((user-emacs-directory-warning nil)) ; Delay showing this - ; warning (Bug#25162). + ;; the runtime context. But delay the warning about + ;; `user-emacs-directory' being inaccessible until after processing + ;; the init file and the command-line arguments, in case the user + ;; customized `user-emacs-directory-warning' to nil via those. + (let ((user-emacs-directory-warning nil)) (when (listp custom-delayed-init-variables) (mapc #'custom-reevaluate-setting ;; Initialize them in the same order they were loaded, in @@ -1559,14 +1561,17 @@ please check its value") (list 'error (substitute-command-keys "Memory exhausted--use \\[save-some-buffers] then exit and restart Emacs"))) - ;; Reevaluate `user-emacs-directory-warning' before process '--eval' - ;; args, so that the user can override that default (Bug#25162). + ;; Reevaluate `user-emacs-directory-warning' before processing + ;; '--eval' arguments, so that the user could override the default + ;; value in the '--eval' forms. (custom-reevaluate-setting 'user-emacs-directory-warning) ;; Process the remaining args. (command-line-1 (cdr command-line-args)) - ;; Check if `user-emacs-directory' is accessible (Bug#25162). + ;; Check if `user-emacs-directory' is accessible and warn if it + ;; isn't, unless `user-emacs-directory-warning' was customized to + ;; disable that warning. (when (and user-emacs-directory-warning (not (file-accessible-directory-p user-emacs-directory))) (locate-user-emacs-file "")) commit 05705454d5c616cb54294ae3bbb2d40ab72fc8ed Author: Po Lu Date: Fri Apr 22 19:43:42 2022 +0800 Don't transfer window attributes trying to find the XM drag window * src/xterm.c (xm_get_drag_window): Select for impossible event mask instead of asking for the window attributes. diff --git a/src/xterm.c b/src/xterm.c index adfe3059d1..7e8d226fb2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1385,7 +1385,6 @@ xm_get_drag_window (struct x_display_info *dpyinfo) unsigned char *tmp_data = NULL; Window drag_window; XSetWindowAttributes attrs; - XWindowAttributes wattrs; Display *temp_display; void *old_handler; @@ -1403,8 +1402,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo) { drag_window = *(Window *) tmp_data; x_catch_errors (dpyinfo->display); - XGetWindowAttributes (dpyinfo->display, - drag_window, &wattrs); + /* We use ButtonPressMask since it's one of the events an + input-only window can never get. */ + XSelectInput (dpyinfo->display, drag_window, + ButtonPressMask); rc = !x_had_errors_p (dpyinfo->display); x_uncatch_errors_after_check (); @@ -1474,8 +1475,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo) current display, and the XOpenDisplay above didn't accidentally connect to some other display. */ x_catch_errors (dpyinfo->display); - XGetWindowAttributes (dpyinfo->display, - drag_window, &wattrs); + /* We use ButtonPressMask since it's one of the events an + input-only window can never get. */ + XSelectInput (dpyinfo->display, drag_window, + ButtonPressMask); rc = !x_had_errors_p (dpyinfo->display); x_uncatch_errors_after_check (); unblock_input ();