commit 42e4d6b8ce238507193a563730d25e1d96e2ad3d (HEAD, refs/remotes/origin/master) Author: Tassilo Horn Date: Thu May 12 23:24:47 2022 +0200 Improve cycle-spacing and bind it to M-SPC by default * lisp/bindings.el (esc-map): Bind M-SPC to cycle-spacing instead of just-one-space. * lisp/simple.el (delete-space--internal): New function. (delete-horizontal-space): Use it. (delete-all-space): New command. (just-one-space): Implement on its own instead of calling cycle-spacing with a special flag. (cycle-spacing--context): Make it a plist instead of a list. Adapt docstring accordingly. (cycle-spacing-actions): New user option. (cycle-spacing): Rewrite so that it performs the actions in cycle-spacing-actions instead of the hard-coded ones. * doc/emacs/killing.texi (characters): Mention and add a variable index entry for cycle-spacing-actions. * etc/NEWS: Document that M-SPC is now cycle-spacing instead of just-one-space. diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 2fd2d21dd3..30025134eb 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -111,24 +111,27 @@ active (@pxref{Using Region}). @kindex M-\ @findex delete-horizontal-space -@kindex M-SPC -@findex just-one-space -@findex cycle-spacing - The other delete commands are those that delete only whitespace +The other delete commands are those that delete only whitespace characters: spaces, tabs and newlines. @kbd{M-\} (@code{delete-horizontal-space}) deletes all the spaces and tab characters before and after point. With a prefix argument, this only -deletes spaces and tab characters before point. @kbd{M-@key{SPC}} -(@code{just-one-space}) does likewise but leaves a single space before +deletes spaces and tab characters before point. + +@findex just-one-space +@code{just-one-space} does likewise but leaves a single space before point, regardless of the number of spaces that existed previously (even if there were none before). With a numeric argument @var{n}, it leaves @var{n} spaces before point if @var{n} is positive; if @var{n} is negative, it deletes newlines in addition to spaces and tabs, -leaving @minus{}@var{n} spaces before point. The command @code{cycle-spacing} -acts like a more flexible version of @code{just-one-space}. It -does different things if you call it repeatedly in succession. -The first call acts like @code{just-one-space}, the next removes -all whitespace, and a third call restores the original whitespace. +leaving @minus{}@var{n} spaces before point. + +@kindex M-SPC +@findex cycle-spacing +@vindex cycle-spacing-actions +The command @code{cycle-spacing} (@kbd{M-@key{SPC}}) acts like a more +flexible version of @code{just-one-space}. It performs different +space cleanup actions if you call it repeatedly in succession as +defined by @code{cycle-spacing-actions}. @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines after the current line. If the current line is blank, it deletes all diff --git a/etc/NEWS b/etc/NEWS index a3ec2100e9..c53b896edd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -677,6 +677,11 @@ recreate it anew next time 'imenu' is invoked. * Editing Changes in Emacs 29.1 ++++ +** M-SPC is now bound to 'cycle-spacing' (formerly it was 'just-one-space'). +The actions performed by 'cycle-spacing' and their order can now be +customized via 'cycle-spacing-actions'. + --- ** 'scroll-other-window' and 'scroll-other-window-down' now respects remapping. These commands (bound to 'C-M-v' and 'C-M-V') used to scroll the other diff --git a/lisp/bindings.el b/lisp/bindings.el index bfe5ba8623..ed1325e326 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -990,7 +990,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key esc-map "\\" 'delete-horizontal-space) (define-key esc-map "m" 'back-to-indentation) (define-key ctl-x-map "\C-o" 'delete-blank-lines) -(define-key esc-map " " 'just-one-space) +(define-key esc-map " " 'cycle-spacing) (define-key esc-map "z" 'zap-to-char) (define-key esc-map "=" 'count-words-region) (define-key ctl-x-map "=" 'what-cursor-position) diff --git a/lisp/simple.el b/lisp/simple.el index 3812f6d8c6..6cbc73e942 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1072,15 +1072,26 @@ Leave one space or none, according to the context." "Delete all spaces and tabs around point. If BACKWARD-ONLY is non-nil, delete them only before point." (interactive "*P") + (delete-space--internal " \t" backward-only)) + +(defun delete-all-space (&optional backward-only) + "Delete all spaces, tabs, and newlines around point. +If BACKWARD-ONLY is non-nil, delete them only before point." + (interactive "*P") + (delete-space--internal " \t\r\n" backward-only)) + +(defun delete-space--internal (chars backward-only) + "Delete CHARS around point. +If BACKWARD-ONLY is non-nil, delete them only before point." (let ((orig-pos (point))) (delete-region (if backward-only - orig-pos + orig-pos (progn - (skip-chars-forward " \t") - (constrain-to-field nil orig-pos t))) + (skip-chars-forward chars) + (constrain-to-field nil orig-pos t))) (progn - (skip-chars-backward " \t") + (skip-chars-backward chars) (constrain-to-field nil orig-pos))))) (defun just-one-space (&optional n) @@ -1088,73 +1099,223 @@ If BACKWARD-ONLY is non-nil, delete them only before point." If N is negative, delete newlines as well, leaving -N spaces. See also `cycle-spacing'." (interactive "*p") - (cycle-spacing n nil 'single-shot)) + (let ((orig-pos (point)) + (skip-characters (if (and n (< n 0)) " \t\n\r" " \t")) + (num (abs (or n 1)))) + (skip-chars-backward skip-characters) + (constrain-to-field nil orig-pos) + (let* ((num (- num (skip-chars-forward " " (+ num (point))))) + (mid (point)) + (end (progn + (skip-chars-forward skip-characters) + (constrain-to-field nil orig-pos t)))) + (delete-region mid end) + (insert (make-string num ?\s))))) (defvar cycle-spacing--context nil - "Store context used in consecutive calls to `cycle-spacing' command. -The first time `cycle-spacing' runs, it saves in this variable: -its N argument, the original point position, and the original spacing -around point.") + "Stored context used in consecutive calls to `cycle-spacing' command. +The value is a property list with the following elements: +- `:orig-pos' The original position of point when starting the + sequence. +- `:whitespace-string' All whitespace characters around point + including newlines. +- `:n' The prefix arg given to the initial invocation + which is reused for all actions in this cycle. +- `:last-action' The last action performed in the cycle.") + +(defcustom cycle-spacing-actions + '( just-one-space + delete-all-space + restore) + "List of actions cycled through by `cycle-spacing'. +Supported values are: +- `just-one-space' Delete all but N (prefix arg) spaces. + See that command's docstring for details. +- `delete-space-after' Delete spaces after point keeping only N. +- `delete-space-before' Delete spaces before point keeping only N. +- `delete-all-space' Delete all spaces around point. +- `restore' Restore the original spacing. + +All actions make use of the prefix arg given to `cycle-spacing' +in the initial invocation, i.e., `just-one-space' keeps this +amount of spaces deleting surplus ones. `just-one-space' and all +other actions have the contract that a positive prefix arg (or +zero) only deletes tabs and spaces whereas a negative prefix arg +also deletes newlines. + +The `delete-space-before' and `delete-space-after' actions handle +the prefix arg \\[negative-argument] without a number provided +specially: all spaces before/after point are deleted (as if N was +0) including newlines (as if N was negative). + +In addition to the predefined actions listed above, any function +which accepts one argument is allowed. It receives the raw +prefix arg of this cycle. + +In addition, an action may take the form (ACTION ARG) where +ACTION is any action except for `restore' and ARG is either +- an integer with the meaning that ACTION should always use this + fixed integer instead of the actual prefix arg or +- the symbol `inverted-arg' with the meaning that ACTION should + be performed with the inverted actual prefix arg. +- the symbol `-' with the meaning that ACTION should include + newlines but it's up to the ACTION to decide how to interpret + it as a number, e.g., `delete-space-before' and + `delete-space-after' treat it like 0 whereas `just-one-space' + treats it like -1 as is usual." + :group 'editing-basics + :type (let ((actions + '((const :tag "Just N (prefix arg) spaces" just-one-space) + (const :tag "Delete spaces after point" delete-space-after) + (const :tag "Delete spaces before point" delete-space-before) + (const :tag "Delete all spaces around point" delete-all-space) + (function :tag "Function receiving a numerig arg")))) + `(repeat + (choice + ,@actions + (list :tag "Action with modified arg" + (choice ,@actions) + (choice (const :tag "Inverted prefix arg" inverted-arg) + (const :tag "Fixed numeric arg" integer))) + (const :tag "Restore the original spacing" restore)))) + :version "29.1") -(defun cycle-spacing (&optional n preserve-nl-back mode) +(defun cycle-spacing (&optional n) "Manipulate whitespace around point in a smart way. -In interactive use, this function behaves differently in successive -consecutive calls. - -The first call in a sequence acts like `just-one-space'. -It deletes all spaces and tabs around point, leaving one space -\(or N spaces). N is the prefix argument. If N is negative, -it deletes newlines as well, leaving -N spaces. -\(If PRESERVE-NL-BACK is non-nil, it does not delete newlines before point.) - -The second call in a sequence deletes all spaces. - -The third call in a sequence restores the original whitespace (and point). - -If MODE is `single-shot', it performs only the first step in the sequence. -If MODE is `fast' and the first step would not result in any change -\(i.e., there are exactly (abs N) spaces around point), -the function goes straight to the second step. - -Repeatedly calling the function with different values of N starts a -new sequence each time." - (interactive "*p") - (let ((orig-pos (point)) - (skip-characters (if (and n (< n 0)) " \t\n\r" " \t")) - (num (abs (or n 1)))) - (skip-chars-backward (if preserve-nl-back " \t" skip-characters)) - (constrain-to-field nil orig-pos) - (cond - ;; Command run for the first time, single-shot mode or different argument - ((or (eq 'single-shot mode) - (not (equal last-command this-command)) - (not cycle-spacing--context) - (not (eq (car cycle-spacing--context) n))) - (let* ((start (point)) - (num (- num (skip-chars-forward " " (+ num (point))))) - (mid (point)) - (end (progn - (skip-chars-forward skip-characters) - (constrain-to-field nil orig-pos t)))) - (setq cycle-spacing--context ;; Save for later. - ;; Special handling for case where there was no space at all. - (unless (= start end) - (cons n (cons orig-pos (buffer-substring start (point)))))) - ;; If this run causes no change in buffer content, delete all spaces, - ;; otherwise delete all excess spaces. - (delete-region (if (and (eq mode 'fast) (zerop num) (= mid end)) - start mid) end) - (insert (make-string num ?\s)))) - - ;; Command run for the second time. - ((not (equal orig-pos (point))) - (delete-region (point) orig-pos)) - - ;; Command run for the third time. - (t - (insert (cddr cycle-spacing--context)) - (goto-char (cadr cycle-spacing--context)) - (setq cycle-spacing--context nil))))) +Repeated calls perform the actions in `cycle-spacing-actions' one +after the other, wrapping around after the last one. + +All actions are amendable using a prefix arg N. In general, a +zero or positive prefix arg allows only for deletion of tabs and +spaces whereas a negative prefix arg also allows for deleting +newlines. + +The prefix arg given at the first invocation starting a cycle is +provided to all following actions, i.e., + \\[negative-argument] \\[cycle-spacing] \\[cycle-spacing] \\[cycle-spacing] +is equivalent to + \\[negative-argument] \\[cycle-spacing] \\[negative-argument] \\[cycle-spacing] \\[negative-argument] \\[cycle-spacing]. + +A new sequence can be started by providing a different prefix arg +than provided at the initial invocation (except for 1), or by +doing any other command before the next \\[cycle-spacing]." + (interactive "*P") + ;; Initialize `cycle-spacing--context' if needed. + (when (or (not (equal last-command this-command)) + (not cycle-spacing--context) + ;; With M-5 M-SPC M-SPC... we pass the prefix arg 5 to + ;; each action and only start a new cycle when a different + ;; prefix arg is given and which is not the default value + ;; 1. + (and n (not (equal (plist-get cycle-spacing--context :n) + n)))) + (let ((orig-pos (point)) + (skip-characters " \t\n\r")) + (save-excursion + (skip-chars-backward skip-characters) + (constrain-to-field nil orig-pos) + (let ((start (point)) + (end (progn + (skip-chars-forward skip-characters) + (constrain-to-field nil orig-pos t)))) + (setq cycle-spacing--context ;; Save for later. + (list :orig-pos orig-pos + :whitespace-string (buffer-substring start end) + :n n + :last-action nil)))))) + + ;; Cycle through the actions in `cycle-spacing-actions'. + (when cycle-spacing--context + (cl-labels ((next-action () + (let* ((l cycle-spacing-actions) + (elt (plist-get cycle-spacing--context + :last-action))) + (if (null elt) + (car cycle-spacing-actions) + (catch 'found + (while l + (cond + ((null (cdr l)) + (throw 'found + (when (eq elt (car l)) + (car cycle-spacing-actions)))) + ((and (eq elt (car l)) + (cdr l)) + (throw 'found (cadr l))) + (t (setq l (cdr l))))))))) + (skip-chars (chars max-dist direction) + (if (eq direction 'forward) + (skip-chars-forward + chars + (and max-dist (+ (point) max-dist))) + (skip-chars-backward + chars + (and max-dist (- (point) max-dist))))) + (delete-space (n include-newlines direction) + (let ((orig-point (point)) + (chars (if include-newlines + " \t\r\n" + " \t"))) + (when (or (zerop n) + (= n (abs (skip-chars chars n direction)))) + (let ((start (point)) + (end (progn + (skip-chars chars nil direction) + (point)))) + (unless (= start end) + (delete-region start end)) + (goto-char (if (eq direction 'forward) + orig-point + (+ n end))))))) + (restore () + (delete-all-space) + (insert (plist-get cycle-spacing--context + :whitespace-string)) + (goto-char (plist-get cycle-spacing--context + :orig-pos)))) + (let ((action (next-action))) + (atomic-change-group + (restore) + (unless (eq action 'restore) + ;; action can be some-action or (some-action ) where + ;; arg is either an integer, the arg to be always used for + ;; this action or - to use the inverted context n for this + ;; action. + (let* ((actual-action (if (listp action) + (car action) + action)) + (arg (when (listp action) + (nth 1 action))) + (context-n (plist-get cycle-spacing--context :n)) + (actual-n (cond + ((integerp arg) arg) + ((eq 'inverted-arg arg) + (* -1 (prefix-numeric-value context-n))) + ((eq '- arg) '-) + (t context-n))) + (numeric-n (prefix-numeric-value actual-n)) + (include-newlines (and actual-n + (or (eq actual-n '-) + (< actual-n 0))))) + (cond + ((eq actual-action 'just-one-space) + (just-one-space numeric-n)) + ((eq actual-action 'delete-space-after) + (delete-space (if (eq actual-n '-) 0 (abs numeric-n)) + include-newlines 'forward)) + ((eq actual-action 'delete-space-before) + (delete-space (if (eq actual-n '-) 0 (abs numeric-n)) + include-newlines 'backward)) + ((eq actual-action 'delete-all-space) + (if include-newlines + (delete-all-space) + (delete-horizontal-space))) + ((functionp actual-action) + (funcall actual-action actual-n)) + (t + (error "Don't know how to handle action %S" action))))) + (setf (plist-get cycle-spacing--context :last-action) + action)))))) (defun beginning-of-buffer (&optional arg) "Move point to the beginning of the buffer. commit 1fc1d8b88994303ac7c1aac673cb3fead5ff4d9e Merge: 0651bc6d17 f928330fa8 Author: Stefan Kangas Date: Mon May 16 06:30:38 2022 +0200 Merge from origin/emacs-28 f928330fa8 Update to Org 9.5.3-6-gef41f3 007bf9a34c Hide temporary FUSE files in Tramp 5dbaddc729 ; Fix some typos commit 0651bc6d175ddb863855fddd056ca623c5900c20 Merge: 5ac5d00479 950dab21e3 Author: Stefan Kangas Date: Mon May 16 06:30:38 2022 +0200 ; Merge from origin/emacs-28 The following commit was skipped: 950dab21e3 * test/lisp/net/tramp-tests.el (tramp-test27-load): Adapt ... commit 5ac5d00479131d25b9a727f416c149826a505afa Merge: 44e5339e82 48201ce8de Author: Stefan Kangas Date: Mon May 16 06:30:38 2022 +0200 Merge from origin/emacs-28 48201ce8de ; * lisp/electric.el (electric-indent-mode): Fix a typo. commit 44e5339e82fa9d92542558cba997cab6d605f59b Author: Po Lu Date: Mon May 16 11:05:32 2022 +0800 Improve safety of handling unsupported drop events on X * src/keyboard.c (kbd_buffer_get_event): * src/xterm.c (handle_one_xevent): Check that the event frame is still live after calling arbitrary Lisp code. diff --git a/src/keyboard.c b/src/keyboard.c index e8f51f8a6f..6c114986b7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4041,6 +4041,11 @@ kbd_buffer_get_event (KBOARD **kbp, break; } + /* `x-dnd-unsupported-drop-function' could have deleted the + event frame. */ + if (!FRAME_LIVE_P (f)) + break; + x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (f), event->ie.frame_or_window, XCAR (event->ie.arg), diff --git a/src/xterm.c b/src/xterm.c index 775b114434..54edefa3c1 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10112,6 +10112,11 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, continue; } + /* `x-dnd-unsupported-drop-function' could have deleted the + event frame. */ + if (!FRAME_LIVE_P (event_frame)) + continue; + x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (event_frame), event->ie.frame_or_window, XCAR (event->ie.arg), commit a57687dc0e27f72642bc1ce14ad53889e55676dc Author: Po Lu Date: Mon May 16 01:37:27 2022 +0000 Clean up Haiku code after file panel changes * src/haiku_support.cc: * src/haiku_support.h: Stop including pthread.h and specpdl_ref. * src/haikumenu.c (run_menu_bar_help_event): Ignore invalid help events instead of aborting. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 2143f14dc9..6cdc4e31be 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -82,8 +82,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include - #ifdef USE_BE_CAIRO #include #endif diff --git a/src/haiku_support.h b/src/haiku_support.h index 8aeaf48787..bccef2628b 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -437,32 +437,14 @@ struct haiku_session_manager_reply dimensions of a BRect, instead of relying on the broken Width and Height functions. */ -#define BE_RECT_HEIGHT(rect) (ceil (((rect).bottom - (rect).top) + 1)) -#define BE_RECT_WIDTH(rect) (ceil (((rect).right - (rect).left) + 1)) +#define BE_RECT_HEIGHT(rect) (ceil (((rect).bottom - (rect).top) + 1)) +#define BE_RECT_WIDTH(rect) (ceil (((rect).right - (rect).left) + 1)) #endif /* __cplusplus */ -/* C++ code cannot include lisp.h, but file dialogs need to be able - to bind to the specpdl and handle quitting correctly. */ - -#ifdef __cplusplus -#if SIZE_MAX > 0xffffffff -#define WRAP_SPECPDL_REF 1 -#endif -#ifdef WRAP_SPECPDL_REF -typedef struct { ptrdiff_t bytes; } specpdl_ref; -#else -typedef ptrdiff_t specpdl_ref; -#endif - -#else -#include "lisp.h" -#endif - #ifdef __cplusplus extern "C" { #endif -#include #include #ifdef __cplusplus diff --git a/src/haikumenu.c b/src/haikumenu.c index 9779c34a99..57fc7fd7c3 100644 --- a/src/haikumenu.c +++ b/src/haikumenu.c @@ -728,7 +728,7 @@ run_menu_bar_help_event (struct frame *f, int mb_idx) vec = f->menu_bar_vector; if ((mb_idx + MENU_ITEMS_ITEM_HELP) >= ASIZE (vec)) - emacs_abort (); + return; help = AREF (vec, mb_idx + MENU_ITEMS_ITEM_HELP); if (STRINGP (help) || NILP (help)) commit af4a0d7ad67152a54ac588aa7c0557f8eefd06df Author: Po Lu Date: Mon May 16 09:22:50 2022 +0800 ; Remove extraneous debugging code * src/xterm.c (handle_one_xevent): Remove extra debugging code. diff --git a/src/xterm.c b/src/xterm.c index 45b756b0af..775b114434 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17762,8 +17762,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!other_valuators_found) goto XI_OTHER; - else - puts ("ovf"); } #ifdef HAVE_XWIDGETS } commit dd05eb40485b49e8b06154b21dbd8097178c5aed Author: Po Lu Date: Mon May 16 09:18:33 2022 +0800 Handle pointer axes changing along with scroll valuators * xterm.c (x_get_scroll_valuator_delta): Set valuator_return to NULL if no valuator was found. (handle_one_xevent): Assume pointer axes might've changed if no scroll valuator was found but valuators were set when handling motion events. diff --git a/src/xterm.c b/src/xterm.c index 21c31271ca..45b756b0af 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4307,6 +4307,7 @@ x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, } } + *valuator_return = NULL; return DBL_MAX; } @@ -17507,6 +17508,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XIValuatorState *states; double *values; bool found_valuator = false; + bool other_valuators_found = false; #endif /* A fake XMotionEvent for x_note_mouse_movement. */ XMotionEvent ev; @@ -17564,6 +17566,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, i, *values, &val); values++; + if (!val) + { + other_valuators_found = true; + continue; + } + if (delta != DBL_MAX) { if (!f) @@ -17752,7 +17760,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (source && !NILP (source->name)) inev.ie.device = source->name; - goto XI_OTHER; + if (!other_valuators_found) + goto XI_OTHER; + else + puts ("ovf"); } #ifdef HAVE_XWIDGETS } commit f928330fa86e1493d2862180b132a99022458c96 (refs/remotes/origin/emacs-28) Author: Kyle Meyer Date: Sun May 15 17:49:17 2022 -0400 Update to Org 9.5.3-6-gef41f3 diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index dc689662b7..6bafb6fc37 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.5.3-3-gd54104")) + (let ((org-git-version "release_9.5.3-6-gef41f3")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 1fc4251a34..6842bfe9b1 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -247,7 +247,7 @@ byte-compiled before it is loaded." (if compile (progn (byte-compile-file tangled-file) - (load tangled-file) + (load-file (byte-compile-dest-file tangled-file)) (message "Compiled and loaded %s" tangled-file)) (load-file tangled-file) (message "Loaded %s" tangled-file)))) @@ -15026,8 +15026,9 @@ When matching, the match groups are the following: (let* ((regexp (if extended (if (eq extended 'agenda) - (rx (or (regexp org-ts-regexp3) - (regexp org-element--timestamp-regexp))) + (rx-to-string + `(or (regexp ,org-ts-regexp3) + (regexp ,org-element--timestamp-regexp))) org-ts-regexp3) org-ts-regexp2)) (pos (point)) commit cd5fcf10c6d4bbe4b72acfbc8b908b37513acac1 Author: Stefan Kangas Date: Sun May 15 16:59:42 2022 +0200 Minor clarification of package-update-all docstring * lisp/emacs-lisp/package.el (package-update-all): Clarify docstring slightly. (Bug#55408) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b2a01248e8..f356a2bf60 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2166,8 +2166,8 @@ to install it but still mark it as selected." (defun package-update-all (&optional query) "Upgrade all packages. -If QUERY, ask the user before updating packages. Interactively, -QUERY is always true." +If QUERY, ask the user before updating packages. When called +interactively, QUERY is always true." (interactive (list t)) (let ((updateable (package--updateable-packages))) (if (not updateable) commit 2b3f3d421aac829f8cdefed1d2fc3f6116066a0d Author: Augusto Stoffel Date: Sat May 14 17:21:27 2022 +0200 Make minibuffer lazy highlight setup buffer-local where appropriate * lisp/isearch.el (minibuffer-lazy-highlight-setup): Modify hooks buffer-locally, so that recursive minibuffers are not affected by the special behavior of lazy-highlight. Also make 'isearch-filter-predicate' buffer-local, so that isearch in the minibuffer is not affected by the region filter (bug#55110). diff --git a/lisp/isearch.el b/lisp/isearch.el index 96168f94bd..3e1dab4d15 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4441,12 +4441,13 @@ LAX-WHITESPACE: The value of `isearch-lax-whitespace' and (format minibuffer-lazy-count-format isearch-lazy-count-total))))) (lambda () - (add-hook 'minibuffer-exit-hook unwind) - (add-hook 'after-change-functions after-change) + (add-hook 'minibuffer-exit-hook unwind nil t) + (add-hook 'after-change-functions after-change nil t) (when minibuffer-lazy-count-format (setq overlay (make-overlay (point-min) (point-min) (current-buffer) t)) (add-hook 'lazy-count-update-hook display-count)) (when filter + (make-local-variable 'isearch-filter-predicate) (add-function :after-while isearch-filter-predicate filter)) (funcall after-change nil nil nil))))) commit 4cba465c58a3bac258b97ae6dffb8441bf71f337 Author: Eli Zaretskii Date: Sun May 15 19:08:08 2022 +0300 ; * lisp/international/fontset.el (otf-script-alist): Fix typos. diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 288eb86e5c..0abbf2309c 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -369,8 +369,8 @@ (latn . latin) (lepc . lepcha) (limb . limbu) - (lina . linear_a) - (linb . linear_b) + (lina . linear-a) + (linb . linear-b) (lisu . lisu) (lyci . lycian) (lydi . lydian) @@ -437,7 +437,7 @@ (sora . sora-sompeng) (soyo . soyombo) (sund . sundanese) - (sylo . syloti_nagri) + (sylo . syloti-nagri) (syrc . syriac) (tglg . tagalog) (tagb . tagbanwa) commit d4ae418691fc454f0fb7a6b377dbb675fccbdb8f Author: Eli Zaretskii Date: Sun May 15 19:02:46 2022 +0300 ; Improve documentation of the OVERRIDES argument to prin1 * src/print.c (Fprin1, syms_of_print): * etc/NEWS: * doc/lispref/streams.texi (Output Functions, Output Overrides): Fix typos and cross-references, and improve wording. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index d805d08744..bba1dc2eee 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -653,7 +653,7 @@ This function outputs the printed representation of @var{object} to If @var{overrides} is non-@code{nil}, it should either be @code{t} (which tells @code{prin1} to use the defaults for all printer related -variables), or a list of settings. @xref{Output Overrides} for details. +variables), or a list of settings. @xref{Output Overrides}, for details. @end defun @defun princ object &optional stream @@ -716,7 +716,7 @@ would have printed for the same argument. If @var{overrides} is non-@code{nil}, it should either be @code{t} (which tells @code{prin1} to use the defaults for all printer related -variables), or a list of settings. @xref{Output Overrides} for details. +variables), or a list of settings. @xref{Output Overrides}, for details. @end example If @var{noescape} is non-@code{nil}, that inhibits use of quoting @@ -983,20 +983,25 @@ having their own escape syntax such as newline. @node Output Overrides @section Overriding Output Variables +@cindex overrides, in output functions +@cindex output variables, overriding -@xref{Output Functions} lists the numerous variables that controls how -the Emacs Lisp printer outputs data. These are generally available -for users to change, but sometimes you want to output data in the -default format. For instance, if you're storing Emacs Lisp data in a -file, you don't want that data to be shortened by a -@code{print-length} setting. +The previous section (@pxref{Output Functions}) lists the numerous +variables that control how the Emacs Lisp printer formats data for +outputs. These are generally available for users to change, but +sometimes you want to output data in the default format, or override +the user settings in some other way. For instance, if you're storing +Emacs Lisp data in a file, you don't want that data to be shortened by +a @code{print-length} setting. The @code{prin1} and @code{prin1-to-string} functions therefore have -an optional @var{overrides} argument. This variable can either be -@code{t} (which means that all printing variables should be the -default values), or a list of settings. Each element in the list can -either be @code{t} (which means ``reset to defaults'') or a pair where -the @code{car} is a symbol, and the @code{cdr} is the value. +an optional @var{overrides} argument. This argument can either be +@code{t} (which means that all printing variables should be reset to +the default values), or a list of settings for some of the variables. +Each element in the list can be either @code{t} (which means ``reset +to defaults'', and will usually be the first element of the list), or +a pair whose @code{car} is a symbol that stands for an output variable +and whose @code{cdr} is the value for that variable. For instance, this prints using nothing but defaults: @@ -1005,14 +1010,14 @@ For instance, this prints using nothing but defaults: @end lisp This prints @var{object} using the current printing settings, but -overrides @code{print-length} to 5: +overrides the value of @code{print-length} to be 5: @lisp (prin1 object nil '((length . 5))) @end lisp And finally, this prints @var{object} using only default settings, but -overrides @code{print-length} to 5: +with @code{print-length} bound to 5: @lisp (prin1 object nil '(t (length . 5))) @@ -1024,46 +1029,32 @@ map to: @table @code @item length This overrides @code{print-length}. - @item level This overrides @code{print-level}. - @item circle This overrides @code{print-circle}. - @item quoted This overrides @code{print-quoted}. - @item escape-newlines This overrides @code{print-escape-newlines}. - @item escape-control-characters This overrides @code{print-escape-control-characters}. - @item escape-nonascii This overrides @code{print-escape-nonascii}. - @item escape-multibyte This overrides @code{print-escape-multibyte}. - @item charset-text-property This overrides @code{print-charset-text-property}. - @item unreadeable-function This overrides @code{print-unreadable-function}. - @item gensym This overrides @code{print-gensym}. - @item continuous-numbering This overrides @code{print-continuous-numbering}. - @item number-table This overrides @code{print-number-table}. - @item float-format This overrides @code{float-output-format}. - @item integers-as-characters This overrides @code{print-integers-as-characters}. @end table diff --git a/etc/NEWS b/etc/NEWS index 715827e76f..a3ec2100e9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1818,8 +1818,8 @@ functions. * Lisp Changes in Emacs 29.1 +++ -** 'prin1' and 'prin1-to-string' now takes an OVERRIDES parameter. -This parameter can be used to override printer settings. +** 'prin1' and 'prin1-to-string' now take an optional OVERRIDES parameter. +This parameter can be used to override values of print-related settings. +++ ** New minor mode 'header-line-indent-mode'. diff --git a/src/print.c b/src/print.c index c9a9b868f9..41c0a18816 100644 --- a/src/print.c +++ b/src/print.c @@ -688,11 +688,11 @@ of these: If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. -OVERRIDES should be a list of settings. An element in this list be -the symbol t, which means "use all the defaults". If not, an element -should be a pair, where the `car' or the pair is the setting, and the -`cdr' of the pair is the value of printer-related settings to use for -this `prin1' call. +Optional argument OVERRIDES should be a list of settings for print-related +variables. An element in this list can be the symbol t, which means "reset +all the values to their defaults". Otherwise, an element should be a pair, +where the `car' or the pair is the setting symbol, and the `cdr' is the +value of of the setting to use for this `prin1' call. For instance: @@ -702,7 +702,7 @@ See the manual entry `(elisp)Output Overrides' for a list of possible values. As a special case, OVERRIDES can also simply be the symbol t, which -means "use all the defaults". */) +means "use default values for all the print-related settings". */) (Lisp_Object object, Lisp_Object printcharfun, Lisp_Object overrides) { specpdl_ref count = SPECPDL_INDEX (); @@ -2645,6 +2645,7 @@ be printed. */); DEFVAR_LISP ("print--variable-mapping", Vprint__variable_mapping, doc: /* Mapping for print variables in `prin1'. +Internal use only. Do not modify this list. */); Vprint__variable_mapping = Qnil; Lisp_Object total[] = { commit 4aa811585597884398b5be13d92f4af0a06de3e1 Author: Simen Heggestøyl Date: Sun May 15 16:22:14 2022 +0200 Recognize some more SCSS selectors * lisp/textmodes/css-mode.el (css--selector-regexp): Recognize some more SCSS selectors. * test/lisp/textmodes/css-mode-resources/scss-selectors.txt: Add tests for them. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 99b4482dc5..a2a7774aba 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -936,8 +936,8 @@ cannot be completed sensibly: `custom-ident', ;; Same as for non-sassy except we do want to allow { and } ;; chars in selectors in the case of #{$foo} ;; variable interpolation! - (concat "\\(?:[-_%*#.>[:alnum:]]*" scss--hash-re - "\\|[-_%*#.>[:alnum:]]+\\)")) + (concat "\\(?:[-_%*#.>&+~[:alnum:]]*" scss--hash-re + "\\|[-_%*#.>&+~[:alnum:]]+\\)")) ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids diff --git a/test/lisp/textmodes/css-mode-resources/scss-selectors.txt b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt index 86e58110b7..3e05191a91 100644 --- a/test/lisp/textmodes/css-mode-resources/scss-selectors.txt +++ b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt @@ -4,3 +4,7 @@ p.#{$name}::after var f.#{$bar}::after p::after p.#{$name} f.#{$bar} k.var #{$bar} #{$bar} p.#{$name} +&:hover +> li ++ li +~ li commit f171a36c0ad7a0b5b69c3d4bad2875c54e2ccdd9 Author: Simen Heggestøyl Date: Sun May 15 16:00:27 2022 +0200 Fix warning suppression in (S)CSS mode tests * test/lisp/textmodes/css-mode-tests.el (css-mode-test-selectors) (scss-mode-test-selectors): Fix warning suppression. diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 555a73c3bb..a746edf894 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -424,7 +424,7 @@ (with-temp-buffer (insert-file-contents (ert-resource-file "css-selectors.txt")) (string-lines (buffer-string))))) - (with-suppressed-warnings ((interactive font-lock-debug-fontif)) + (with-suppressed-warnings ((interactive-only font-lock-debug-fontify)) (dolist (selector selectors) (with-temp-buffer (css-mode) @@ -474,7 +474,7 @@ (with-temp-buffer (insert-file-contents (ert-resource-file "scss-selectors.txt")) (string-lines (buffer-string))))) - (with-suppressed-warnings ((interactive font-lock-debug-fontif)) + (with-suppressed-warnings ((interactive-only font-lock-debug-fontify)) (dolist (selector selectors) (with-temp-buffer (scss-mode) commit cfedc2872e7ee56e4da6e5e557786ab66ddbbf23 Author: Lars Ingebrigtsen Date: Sun May 15 15:41:46 2022 +0200 Fix native-comp type of prin1-to-string * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix type of prin1-to-string. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 237de52884..7c755372bf 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -483,7 +483,7 @@ Useful to hook into pass checkers.") (point-min (function () integer)) (preceding-char (function () fixnum)) (previous-window (function (&optional window t t) window)) - (prin1-to-string (function (t &optional t) string)) + (prin1-to-string (function (t &optional t t) string)) (processp (function (t) boolean)) (proper-list-p (function (t) integer)) (propertize (function (string &rest t) string)) commit a517f3d759cb0747482ee6572065c7cd9518faa5 Author: Lars Ingebrigtsen Date: Sun May 15 15:37:12 2022 +0200 Adjust more prin1-to-string callers * src/w32.c (check_windows_init_file): * src/comp.c (Lisp_Object): (emit_lisp_obj_reloc_lval): (emit_lisp_obj_rval): (emit_mvar_rval): (emit_limple_insn): (emit_static_object): Adjust prin1-to-string callers. diff --git a/src/comp.c b/src/comp.c index 66a7ab789a..b01106c906 100644 --- a/src/comp.c +++ b/src/comp.c @@ -761,7 +761,7 @@ For internal use. */) (Lisp_Object subr) { return concat2 (Fsubr_name (subr), - Fprin1_to_string (Fsubr_arity (subr), Qnil)); + Fprin1_to_string (Fsubr_arity (subr), Qnil, Qnil)); } /* Produce a key hashing Vcomp_subr_list. */ @@ -1707,7 +1707,7 @@ static gcc_jit_lvalue * emit_lisp_obj_reloc_lval (Lisp_Object obj) { emit_comment (format_string ("l-value for lisp obj: %s", - SSDATA (Fprin1_to_string (obj, Qnil)))); + SSDATA (Fprin1_to_string (obj, Qnil, Qnil)))); imm_reloc_t reloc = obj_to_reloc (obj); return gcc_jit_context_new_array_access (comp.ctxt, @@ -1720,7 +1720,7 @@ static gcc_jit_rvalue * emit_lisp_obj_rval (Lisp_Object obj) { emit_comment (format_string ("const lisp obj: %s", - SSDATA (Fprin1_to_string (obj, Qnil)))); + SSDATA (Fprin1_to_string (obj, Qnil, Qnil)))); if (NILP (obj)) { @@ -1968,7 +1968,7 @@ emit_mvar_rval (Lisp_Object mvar) SSDATA ( Fprin1_to_string ( NILP (func) ? value : CALL1I (comp-func-c-name, func), - Qnil))); + Qnil, Qnil))); } if (FIXNUMP (value)) { @@ -2471,7 +2471,7 @@ emit_limple_insn (Lisp_Object insn) else if (EQ (op, Qsetimm)) { /* Ex: (setimm #s(comp-mvar 9 1 t 3 nil) a). */ - emit_comment (SSDATA (Fprin1_to_string (arg[1], Qnil))); + emit_comment (SSDATA (Fprin1_to_string (arg[1], Qnil, Qnil))); imm_reloc_t reloc = obj_to_reloc (arg[1]); emit_frame_assignment ( arg[0], @@ -2647,7 +2647,7 @@ emit_static_object (const char *name, Lisp_Object obj) specbind (intern_c_string ("print-quoted"), Qt); specbind (intern_c_string ("print-gensym"), Qt); specbind (intern_c_string ("print-circle"), Qt); - Lisp_Object str = Fprin1_to_string (obj, Qnil); + Lisp_Object str = Fprin1_to_string (obj, Qnil, Qnil); unbind_to (count, Qnil); ptrdiff_t len = SBYTES (str); diff --git a/src/w32.c b/src/w32.c index 1b10b9965f..590d9e85d9 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10297,7 +10297,8 @@ check_windows_init_file (void) openp (Vload_path, init_file, Fget_load_suffixes (), NULL, Qnil, 0, 0); if (fd < 0) { - Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); + Lisp_Object load_path_print = Fprin1_to_string (Vload_path, + Qnil, Qnil); char *init_file_name = SSDATA (init_file); char *load_path = SSDATA (load_path_print); char *buffer = alloca (1024 commit aa95b2a47dce8cf74f70f43f72e35349782d1c74 Author: Lars Ingebrigtsen Date: Sun May 15 15:29:28 2022 +0200 Add OVERRIDES argument to prin1/prin1-to-string * doc/lispref/streams.texi (Output Functions): Document it. (Output Overrides): New node. * src/process.c (Faccept_process_output): * src/print.c (debug_print, print_error_message): * src/pdumper.c (print_paths_to_root_1, decode_emacs_reloc): * src/lread.c (readevalloop): * src/eval.c (internal_lisp_condition_case): * src/editfns.c (styled_format): Adjust prin1/prin1-to-string callers. * src/print.c (Fprin1): Take an OVERRIDES parameter. (print_bind_overrides, print_bind_all_defaults): New functions. (Fprin1_to_string): Take an OVERRIDES parameter. diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 968a2790e2..a3d1d80408 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -739,6 +739,7 @@ Reading and Printing Lisp Objects * Output Functions:: Functions to print Lisp objects as text. * Output Variables:: Variables that control what the printing functions do. +* Output Overrides:: Overriding output variables. Minibuffers diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 781a50f5c4..d805d08744 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -21,6 +21,7 @@ reading) or where to put it (if printing). * Output Streams:: Various data types that can be used as output streams. * Output Functions:: Functions to print Lisp objects as text. * Output Variables:: Variables that control what the printing functions do. +* Output Overrides:: Overriding output variables. @end menu @node Streams Intro @@ -634,7 +635,7 @@ characters are used. @code{print} returns @var{object}. For example: @end example @end defun -@defun prin1 object &optional stream +@defun prin1 object &optional stream overrides This function outputs the printed representation of @var{object} to @var{stream}. It does not print newlines to separate output as @code{print} does, but it does use quoting characters just like @@ -649,6 +650,10 @@ This function outputs the printed representation of @var{object} to @result{} " came back" @end group @end example + +If @var{overrides} is non-@code{nil}, it should either be @code{t} +(which tells @code{prin1} to use the defaults for all printer related +variables), or a list of settings. @xref{Output Overrides} for details. @end defun @defun princ object &optional stream @@ -694,7 +699,7 @@ newline character first, which enables you to display incomplete lines. @end defun -@defun prin1-to-string object &optional noescape +@defun prin1-to-string object &optional noescape overrides @cindex object to string This function returns a string containing the text that @code{prin1} would have printed for the same argument. @@ -708,6 +713,10 @@ would have printed for the same argument. (prin1-to-string (mark-marker)) @result{} "#" @end group + +If @var{overrides} is non-@code{nil}, it should either be @code{t} +(which tells @code{prin1} to use the defaults for all printer related +variables), or a list of settings. @xref{Output Overrides} for details. @end example If @var{noescape} is non-@code{nil}, that inhibits use of quoting @@ -971,3 +980,93 @@ Letter, Number, Punctuation, Symbol and Private-use (@pxref{Character Properties}), as well as the control characters having their own escape syntax such as newline. @end defvar + +@node Output Overrides +@section Overriding Output Variables + +@xref{Output Functions} lists the numerous variables that controls how +the Emacs Lisp printer outputs data. These are generally available +for users to change, but sometimes you want to output data in the +default format. For instance, if you're storing Emacs Lisp data in a +file, you don't want that data to be shortened by a +@code{print-length} setting. + +The @code{prin1} and @code{prin1-to-string} functions therefore have +an optional @var{overrides} argument. This variable can either be +@code{t} (which means that all printing variables should be the +default values), or a list of settings. Each element in the list can +either be @code{t} (which means ``reset to defaults'') or a pair where +the @code{car} is a symbol, and the @code{cdr} is the value. + +For instance, this prints using nothing but defaults: + +@lisp +(prin1 object nil t) +@end lisp + +This prints @var{object} using the current printing settings, but +overrides @code{print-length} to 5: + +@lisp +(prin1 object nil '((length . 5))) +@end lisp + +And finally, this prints @var{object} using only default settings, but +overrides @code{print-length} to 5: + +@lisp +(prin1 object nil '(t (length . 5))) +@end lisp + +Below is a list of symbols that can be used, and which variables they +map to: + +@table @code +@item length +This overrides @code{print-length}. + +@item level +This overrides @code{print-level}. + +@item circle +This overrides @code{print-circle}. + +@item quoted +This overrides @code{print-quoted}. + +@item escape-newlines +This overrides @code{print-escape-newlines}. + +@item escape-control-characters +This overrides @code{print-escape-control-characters}. + +@item escape-nonascii +This overrides @code{print-escape-nonascii}. + +@item escape-multibyte +This overrides @code{print-escape-multibyte}. + +@item charset-text-property +This overrides @code{print-charset-text-property}. + +@item unreadeable-function +This overrides @code{print-unreadable-function}. + +@item gensym +This overrides @code{print-gensym}. + +@item continuous-numbering +This overrides @code{print-continuous-numbering}. + +@item number-table +This overrides @code{print-number-table}. + +@item float-format +This overrides @code{float-output-format}. + +@item integers-as-characters +This overrides @code{print-integers-as-characters}. +@end table + +In the future, more overrides may be offered that do not map directly +to a variable, but can only be used via this parameter. diff --git a/etc/NEWS b/etc/NEWS index b89771cdbd..715827e76f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1817,6 +1817,10 @@ functions. * Lisp Changes in Emacs 29.1 ++++ +** 'prin1' and 'prin1-to-string' now takes an OVERRIDES parameter. +This parameter can be used to override printer settings. + +++ ** New minor mode 'header-line-indent-mode'. This is meant to be used in modes that have a header line that should diff --git a/src/editfns.c b/src/editfns.c index 6cb684d4d8..17f0252969 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3327,7 +3327,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (EQ (arg, args[n])) { Lisp_Object noescape = conversion == 'S' ? Qnil : Qt; - spec->argument = arg = Fprin1_to_string (arg, noescape); + spec->argument = arg = Fprin1_to_string (arg, noescape, Qnil); if (STRING_MULTIBYTE (arg) && ! multibyte) { multibyte = true; diff --git a/src/eval.c b/src/eval.c index 29c122e2fb..25ac8e4529 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1341,7 +1341,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, && (SYMBOLP (XCAR (tem)) || CONSP (XCAR (tem)))))) error ("Invalid condition handler: %s", - SDATA (Fprin1_to_string (tem, Qt))); + SDATA (Fprin1_to_string (tem, Qt, Qnil))); if (CONSP (tem) && EQ (XCAR (tem), QCsuccess)) success_handler = XCDR (tem); else diff --git a/src/lread.c b/src/lread.c index 409e97cdfa..5f3d83a846 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2349,7 +2349,7 @@ readevalloop (Lisp_Object readcharfun, { Vvalues = Fcons (val, Vvalues); if (EQ (Vstandard_output, Qt)) - Fprin1 (val, Qnil); + Fprin1 (val, Qnil, Qnil); else Fprint (val, Qnil); } diff --git a/src/pdumper.c b/src/pdumper.c index 5923d9b1d8..88e7b311a8 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -1383,7 +1383,7 @@ print_paths_to_root_1 (struct dump_context *ctx, { Lisp_Object referrer = XCAR (referrers); referrers = XCDR (referrers); - Lisp_Object repr = Fprin1_to_string (referrer, Qnil); + Lisp_Object repr = Fprin1_to_string (referrer, Qnil, Qnil); for (int i = 0; i < level; ++i) putc (' ', stderr); fwrite (SDATA (repr), 1, SBYTES (repr), stderr); @@ -3758,7 +3758,7 @@ decode_emacs_reloc (struct dump_context *ctx, Lisp_Object lreloc) reloc.u.dump_offset = dump_recall_object (ctx, target_value); if (reloc.u.dump_offset <= 0) { - Lisp_Object repr = Fprin1_to_string (target_value, Qnil); + Lisp_Object repr = Fprin1_to_string (target_value, Qnil, Qnil); error ("relocation target was not dumped: %s", SDATA (repr)); } dump_check_dump_off (ctx, reloc.u.dump_offset); diff --git a/src/print.c b/src/print.c index d7583282b6..c9a9b868f9 100644 --- a/src/print.c +++ b/src/print.c @@ -620,7 +620,51 @@ If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */) return val; } -DEFUN ("prin1", Fprin1, Sprin1, 1, 2, 0, +static void +print_bind_all_defaults (void) +{ + for (Lisp_Object vars = Vprint__variable_mapping; !NILP (vars); + vars = XCDR (vars)) + { + Lisp_Object elem = XCDR (XCAR (vars)); + specbind (XCAR (elem), XCAR (XCDR (elem))); + } +} + +static void +print_bind_overrides (Lisp_Object overrides) +{ + if (EQ (overrides, Qt)) + print_bind_all_defaults (); + else if (!CONSP (overrides)) + xsignal (Qwrong_type_argument, Qconsp); + else + { + while (!NILP (overrides)) + { + Lisp_Object setting = XCAR (overrides); + if (EQ (setting, Qt)) + print_bind_all_defaults (); + else if (!CONSP (setting)) + xsignal (Qwrong_type_argument, Qconsp); + else + { + Lisp_Object key = XCAR (setting), + value = XCDR (setting); + Lisp_Object map = Fassq (key, Vprint__variable_mapping); + if (NILP (map)) + xsignal2 (Qwrong_type_argument, Qsymbolp, map); + specbind (XCAR (XCDR (map)), value); + } + + if (!NILP (XCDR (overrides)) && !CONSP (XCDR (overrides))) + xsignal (Qwrong_type_argument, Qconsp); + overrides = XCDR (overrides); + } + } +} + +DEFUN ("prin1", Fprin1, Sprin1, 1, 3, 0, doc: /* Output the printed representation of OBJECT, any Lisp object. Quoting characters are printed when needed to make output that `read' can handle, whenever this is possible. For complex objects, the behavior @@ -642,21 +686,43 @@ of these: - t, in which case the output is displayed in the echo area. If PRINTCHARFUN is omitted, the value of `standard-output' (which see) -is used instead. */) - (Lisp_Object object, Lisp_Object printcharfun) +is used instead. + +OVERRIDES should be a list of settings. An element in this list be +the symbol t, which means "use all the defaults". If not, an element +should be a pair, where the `car' or the pair is the setting, and the +`cdr' of the pair is the value of printer-related settings to use for +this `prin1' call. + +For instance: + + (prin1 object nil \\='((length . 100) (circle . t))). + +See the manual entry `(elisp)Output Overrides' for a list of possible +values. + +As a special case, OVERRIDES can also simply be the symbol t, which +means "use all the defaults". */) + (Lisp_Object object, Lisp_Object printcharfun, Lisp_Object overrides) { + specpdl_ref count = SPECPDL_INDEX (); + if (NILP (printcharfun)) printcharfun = Vstandard_output; + if (!NILP (overrides)) + print_bind_overrides (overrides); + PRINTPREPARE; print (object, printcharfun, 1); PRINTFINISH; - return object; + + return unbind_to (count, object); } /* A buffer which is used to hold output being built by prin1-to-string. */ Lisp_Object Vprin1_to_string_buffer; -DEFUN ("prin1-to-string", Fprin1_to_string, Sprin1_to_string, 1, 2, 0, +DEFUN ("prin1-to-string", Fprin1_to_string, Sprin1_to_string, 1, 3, 0, doc: /* Return a string containing the printed representation of OBJECT. OBJECT can be any Lisp object. This function outputs quoting characters when necessary to make output that `read' can handle, whenever possible, @@ -666,13 +732,18 @@ the behavior is controlled by `print-level' and `print-length', which see. OBJECT is any of the Lisp data types: a number, a string, a symbol, a list, a buffer, a window, a frame, etc. +See `prin1' for the meaning of OVERRIDES. + A printed representation of an object is text which describes that object. */) - (Lisp_Object object, Lisp_Object noescape) + (Lisp_Object object, Lisp_Object noescape, Lisp_Object overrides) { specpdl_ref count = SPECPDL_INDEX (); specbind (Qinhibit_modification_hooks, Qt); + if (!NILP (overrides)) + print_bind_overrides (overrides); + /* Save and restore this: we are altering a buffer but we don't want to deactivate the mark just for that. No need for specbind, since errors deactivate the mark. */ @@ -847,7 +918,7 @@ append to existing target file. */) void debug_print (Lisp_Object arg) { - Fprin1 (arg, Qexternal_debugging_output); + Fprin1 (arg, Qexternal_debugging_output, Qnil); fputs ("\r\n", stderr); } @@ -995,7 +1066,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, || EQ (errname, Qend_of_file) || EQ (errname, Quser_error)) Fprinc (obj, stream); else - Fprin1 (obj, stream); + Fprin1 (obj, stream, Qnil); } } } @@ -2571,4 +2642,35 @@ be printed. */); DEFSYM (Qprint_unreadable_function, "print-unreadable-function"); defsubr (&Sflush_standard_output); + + DEFVAR_LISP ("print--variable-mapping", Vprint__variable_mapping, + doc: /* Mapping for print variables in `prin1'. +Do not modify this list. */); + Vprint__variable_mapping = Qnil; + Lisp_Object total[] = { + list3 (intern ("length"), intern ("print-length"), Qnil), + list3 (intern ("level"), intern ("print-level"), Qnil), + list3 (intern ("circle"), intern ("print-circle"), Qnil), + list3 (intern ("quoted"), intern ("print-quoted"), Qt), + list3 (intern ("escape-newlines"), intern ("print-escape-newlines"), Qnil), + list3 (intern ("escape-control-characters"), + intern ("print-escape-control-characters"), Qnil), + list3 (intern ("escape-nonascii"), intern ("print-escape-nonascii"), Qnil), + list3 (intern ("escape-multibyte"), + intern ("print-escape-multibyte"), Qnil), + list3 (intern ("charset-text-property"), + intern ("print-charset-text-property"), Qnil), + list3 (intern ("unreadeable-function"), + intern ("print-unreadable-function"), Qnil), + list3 (intern ("gensym"), intern ("print-gensym"), Qnil), + list3 (intern ("continuous-numbering"), + intern ("print-continuous-numbering"), Qnil), + list3 (intern ("number-table"), intern ("print-number-table"), Qnil), + list3 (intern ("float-format"), intern ("float-output-format"), Qnil), + list3 (intern ("integers-as-characters"), + intern ("print-integers-as-characters"), Qnil), + }; + + Vprint__variable_mapping = CALLMANY (Flist, total); + make_symbol_constant (intern_c_string ("print--variable-mapping")); } diff --git a/src/process.c b/src/process.c index 2f8863aef2..fe3e12343f 100644 --- a/src/process.c +++ b/src/process.c @@ -4779,7 +4779,7 @@ corresponding connection was closed. */) SDATA (proc->name), STRINGP (proc_thread_name) ? SDATA (proc_thread_name) - : SDATA (Fprin1_to_string (proc->thread, Qt))); + : SDATA (Fprin1_to_string (proc->thread, Qt, Qnil))); } } else diff --git a/test/src/print-tests.el b/test/src/print-tests.el index 0bae1959d1..b9b282e580 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el @@ -425,5 +425,48 @@ otherwise, use a different charset." (should (equal (prin1-to-string '\?bar) "\\?bar")) (should (equal (prin1-to-string '\?bar?) "\\?bar?"))) +(ert-deftest test-prin1-overrides () + (with-temp-buffer + (let ((print-length 10)) + (prin1 (make-list 20 t) (current-buffer) t) + (should (= print-length 10))) + (goto-char (point-min)) + (should (= (length (read (current-buffer))) 20))) + + (with-temp-buffer + (let ((print-length 10)) + (prin1 (make-list 20 t) (current-buffer) '((length . 5))) + (should (= print-length 10))) + (goto-char (point-min)) + (should (= (length (read (current-buffer))) 6))) + + (with-temp-buffer + (let ((print-length 10)) + (prin1 (make-list 20 t) (current-buffer) '(t (length . 5))) + (should (= print-length 10))) + (goto-char (point-min)) + (should (= (length (read (current-buffer))) 6)))) + +(ert-deftest test-prin1-to-string-overrides () + (let ((print-length 10)) + (should + (= (length (car (read-from-string + (prin1-to-string (make-list 20 t) nil t)))) + 20))) + + (let ((print-length 10)) + (should + (= (length (car (read-from-string + (prin1-to-string (make-list 20 t) nil + '((length . 5)))))) + 6))) + + (should-error (prin1-to-string 'foo nil 'a)) + (should-error (prin1-to-string 'foo nil '(a))) + (should-error (prin1-to-string 'foo nil '(t . b))) + (should-error (prin1-to-string 'foo nil '(t b))) + (should-error (prin1-to-string 'foo nil '((a . b) b))) + (should-error (prin1-to-string 'foo nil '((length . 10) . b)))) + (provide 'print-tests) ;;; print-tests.el ends here commit 007bf9a34c52334434e5ee29928773f051e0f19e Author: Michael Albinus Date: Sun May 15 15:09:26 2022 +0200 Hide temporary FUSE files in Tramp * lisp/net/tramp-fuse.el (tramp-fuse-remove-hidden-files): New defsubst. (tramp-fuse-handle-directory-files) (tramp-fuse-handle-file-name-all-completions): Use it. diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index 17d419f853..54e7999e7a 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -44,6 +44,12 @@ (delete-file (tramp-fuse-local-file-name filename) trash) (tramp-flush-file-properties v localname))) +(defsubst tramp-fuse-remove-hidden-files (files) + "Remove hidden files from FILES." + (cl-remove-if + (lambda (x) (and (stringp x) (string-match-p "\\.fuse_hidden" x))) + files)) + (defun tramp-fuse-handle-directory-files (directory &optional full match nosort count) "Like `directory-files' for Tramp files." @@ -75,7 +81,8 @@ result))) (setq result (cons item result)))) ;; Return result. - (if nosort result (sort result #'string<)))))) + (tramp-fuse-remove-hidden-files + (if nosort result (sort result #'string<))))))) (defun tramp-fuse-handle-file-attributes (filename &optional id-format) "Like `file-attributes' for Tramp files." @@ -92,20 +99,21 @@ (defun tramp-fuse-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." - (all-completions - filename - (delete-dups - (append - (file-name-all-completions - filename (tramp-fuse-local-file-name directory)) - ;; Some storage systems do not return "." and "..". - (let (result) - (dolist (item '(".." ".") result) - (when (string-prefix-p filename item) - (catch 'match - (dolist (elt completion-regexp-list) - (unless (string-match-p elt item) (throw 'match nil))) - (setq result (cons (concat item "/") result)))))))))) + (tramp-fuse-remove-hidden-files + (all-completions + filename + (delete-dups + (append + (file-name-all-completions + filename (tramp-fuse-local-file-name directory)) + ;; Some storage systems do not return "." and "..". + (let (result) + (dolist (item '(".." ".") result) + (when (string-prefix-p filename item) + (catch 'match + (dolist (elt completion-regexp-list) + (unless (string-match-p elt item) (throw 'match nil))) + (setq result (cons (concat item "/") result))))))))))) (defun tramp-fuse-handle-file-readable-p (filename) "Like `file-readable-p' for Tramp files." commit 22873b5415fbcc81f2d1e0e69cccd5dbeaac51ee Author: Po Lu Date: Sun May 15 12:43:54 2022 +0000 Make Haiku stipple display slightly faster * src/haikuterm.c (haiku_draw_stipple_background): Draw tiled bitmap to end of stipple instead of the end of the frame. diff --git a/src/haikuterm.c b/src/haikuterm.c index df0cd82a39..ed8040edc9 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -1090,8 +1090,7 @@ haiku_draw_stipple_background (struct glyph_string *s, struct face *face, haiku_clip_to_string (s); BView_ClipToRect (view, x, y, width, height); BView_DrawBitmapTiled (view, rec->img, 0, 0, -1, -1, - 0, 0, FRAME_PIXEL_WIDTH (s->f), - FRAME_PIXEL_HEIGHT (s->f)); + 0, 0, x + width, y + height); BView_EndClip (view); } commit 0da7689b167dd92c0ac307122be0a742a10abfb4 Author: Lars Ingebrigtsen Date: Sun May 15 14:13:14 2022 +0200 Don't freeze Emacs on colour codes in sccs-mode * lisp/textmodes/css-mode.el (css--font-lock-keywords): Don't freeze Emacs on #ffffff #ffffff, and be more strict in parsing selectors (bug#53203). diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index ef7debc4bd..99b4482dc5 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -928,6 +928,32 @@ cannot be completed sensibly: `custom-ident', (defface css-proprietary-property '((t :inherit (css-property italic))) "Face to use for vendor-specific properties.") +(defun css--selector-regexp (sassy) + (concat + "\\(?:" + (if (not sassy) + "[-_%*#.>[:alnum:]]+" + ;; Same as for non-sassy except we do want to allow { and } + ;; chars in selectors in the case of #{$foo} + ;; variable interpolation! + (concat "\\(?:[-_%*#.>[:alnum:]]*" scss--hash-re + "\\|[-_%*#.>[:alnum:]]+\\)")) + ;; Even though pseudo-elements should be prefixed by ::, a + ;; single colon is accepted for backward compatibility. + "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids + css-pseudo-element-ids) + t) + "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)\\)?" + ;; Braces after selectors. + "\\(?:\\[[^]\n]+\\]\\)?" + ;; Parentheses after selectors. + "\\(?:([^)]+)\\)?" + ;; Main bit over. But perhaps just [target]? + "\\|\\[[^]\n]+\\]" + ;; :root, ::marker and the like. + "\\|::?[[:alnum:]]+\\(?:([^)]+)\\)?" + "\\)")) + (defun css--font-lock-keywords (&optional sassy) `((,(concat "!\\s-*" (regexp-opt css--bang-ids)) (0 font-lock-builtin-face)) @@ -948,28 +974,16 @@ cannot be completed sensibly: `custom-ident', ;; selector between [...] should simply not be highlighted. (,(concat "^[ \t]*\\(" - (if (not sassy) - ;; We don't allow / as first char, so as not to - ;; take a comment as the beginning of a selector. - "[^@/:{}() \t\n][^:{}()]*" - ;; Same as for non-sassy except we do want to allow { and } - ;; chars in selectors in the case of #{$foo} - ;; variable interpolation! - (concat "\\(?:" scss--hash-re - "\\|[^@/:{}() \t\n#]\\)" - "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) - ;; Even though pseudo-elements should be prefixed by ::, a - ;; single colon is accepted for backward compatibility. - "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids - css-pseudo-element-ids) - t) - "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" - "\\(?:([^)]+)\\)?" - (if (not sassy) - "[^:{}()\n]*" - (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) + ;; We have at least one selector. + (css--selector-regexp sassy) + ;; And then possibly more. + "\\(?:" + ;; Separators between selectors. + "[ \n\t,+~>]+" + (css--selector-regexp sassy) "\\)*" - "\\)\\(?:\n[ \t]*\\)*{") + ;; And then a brace. + "\\)[ \n\t]*{") (1 'css-selector keep)) ;; In the above rule, we allow the open-brace to be on some subsequent ;; line. This will only work if we properly mark the intervening text diff --git a/test/lisp/textmodes/css-mode-resources/css-selectors.txt b/test/lisp/textmodes/css-mode-resources/css-selectors.txt new file mode 100644 index 0000000000..5b3d990f27 --- /dev/null +++ b/test/lisp/textmodes/css-mode-resources/css-selectors.txt @@ -0,0 +1,56 @@ +#firstname +* +p +p.intro +div, p +div p +div > p +div + p +p ~ ul +[target] +[target=_blank] +[title~=flower] +[lang|=en] +a[href^="https"] +a[href$=".pdf"] +a[href*="w3schools"] +a:active +p::after +p::before +input:checked +input:default +input:disabled +p:empty +input:enabled +p:first-child +p::first-letter +p::first-line +p:first-of-type +input:focus +:fullscreen +a:hover +input:in-range +input:indeterminate +input:invalid +p:lang(it) +p:last-child +p:last-of-type +a:link +::marker +:not(p) +p:nth-child(2) +p:nth-last-child(2) +p:nth-last-of-type(2) +p:nth-of-type(2) +p:only-of-type +p:only-child +input:optional +input:out-of-range +input:read-only +input:read-write +input:required +:root +::selection +#news:target +input:valid +a:visited diff --git a/test/lisp/textmodes/css-mode-resources/scss-selectors.txt b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt new file mode 100644 index 0000000000..86e58110b7 --- /dev/null +++ b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt @@ -0,0 +1,6 @@ +p.#{$name} var +p.#{$name}:active var +p.#{$name}::after var +f.#{$bar}::after p::after +p.#{$name} f.#{$bar} k.var #{$bar} #{$bar} +p.#{$name} diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 0ae1593508..555a73c3bb 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -419,5 +419,74 @@ (indent-region (point-min) (point-max)) (should (equal (buffer-string) orig))))) +(ert-deftest css-mode-test-selectors () + (let ((selectors + (with-temp-buffer + (insert-file-contents (ert-resource-file "css-selectors.txt")) + (string-lines (buffer-string))))) + (with-suppressed-warnings ((interactive font-lock-debug-fontif)) + (dolist (selector selectors) + (with-temp-buffer + (css-mode) + (insert selector " {\n}\n") + (font-lock-debug-fontify) + (goto-char (point-min)) + (unless (eq (get-text-property (point) 'face) + 'css-selector) + (should-not (format "Didn't recognize %s as a selector" + (buffer-substring-no-properties + (point) (line-end-position))))))) + ;; Test many selectors. + (dolist (selector selectors) + (with-temp-buffer + (css-mode) + (insert selector " ") + (dotimes (_ (random 5)) + (insert (seq-random-elt '(" , " " > " " + ")) + (seq-random-elt selectors))) + (insert "{\n}\n") + (font-lock-debug-fontify) + (goto-char (point-min)) + (unless (eq (get-text-property (point) 'face) + 'css-selector) + (should-not (format "Didn't recognize %s as a selector" + (buffer-substring-no-properties + (point) (line-end-position))))))) + ;; Test wrong separators. + (dolist (selector selectors) + (with-temp-buffer + (css-mode) + (insert selector " ") + (dotimes (_ (1+ (random 5))) + (insert (seq-random-elt '("=" " @ ")) + (seq-random-elt selectors))) + (insert "{\n}\n") + (font-lock-debug-fontify) + (goto-char (point-min)) + (when (eq (get-text-property (point) 'face) + 'css-selector) + (should-not (format "Recognized %s as a selector" + (buffer-substring-no-properties + (point) (line-end-position)))))))))) + +(ert-deftest scss-mode-test-selectors () + (let ((selectors + (with-temp-buffer + (insert-file-contents (ert-resource-file "scss-selectors.txt")) + (string-lines (buffer-string))))) + (with-suppressed-warnings ((interactive font-lock-debug-fontif)) + (dolist (selector selectors) + (with-temp-buffer + (scss-mode) + (insert selector " {\n}\n") + (font-lock-debug-fontify) + (goto-char (point-min)) + (unless (eq (get-text-property (point) 'face) + 'css-selector) + (should-not (format "Didn't recognize %s as a selector" + (buffer-substring-no-properties + (point) (line-end-position)))))))))) + + (provide 'css-mode-tests) ;;; css-mode-tests.el ends here commit b26574d7d7c458fec7494484ea5bceeed45f2f02 Author: Simen Heggestøyl Date: Sat May 14 13:20:28 2022 +0200 Update CSS Multi-column Layout Module properties * lisp/textmodes/css-mode.el (css-property-alist): Update CSS Multi-column Layout Module properties. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 246a3144a1..ef7debc4bd 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -417,21 +417,20 @@ ("mask-type" "luminance" "alpha") ("clip" "rect()" "auto") - ;; CSS Multi-column Layout Module + ;; CSS Multi-column Layout Module Level 1 ;; (https://www.w3.org/TR/css3-multicol/#property-index) ;; "break-after", "break-before", and "break-inside" are left out ;; below, because they're already included in CSS Fragmentation ;; Module Level 3. - ("column-count" integer "auto") - ("column-fill" "auto" "balance") - ("column-gap" length "normal") + ("column-count" "auto" integer) + ("column-fill" "auto" "balance" "balance-all") ("column-rule" column-rule-width column-rule-style - column-rule-color "transparent") + column-rule-color) ("column-rule-color" color) - ("column-rule-style" border-style) - ("column-rule-width" border-width) + ("column-rule-style" line-style) + ("column-rule-width" line-width) ("column-span" "none" "all") - ("column-width" length "auto") + ("column-width" "auto" length) ("columns" column-width column-count) ;; CSS Overflow Module Level 3 commit dfefe5cb319f0d604d7ced50775fb4b2b86af0fb Author: Simen Heggestøyl Date: Sat May 14 13:13:30 2022 +0200 ; * lisp/textmodes/css-mode.el: Fix link * lisp/textmodes/css-mode.el (css-property-alist): Fix link to CSS Flexible Box Layout Module. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 6ce7172063..246a3144a1 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -327,8 +327,8 @@ ("place-self" justify-self align-self) ("row-gap" "normal" length-percentage) - ;; CSS Flexible Box Layout Module Level 2 - ;; (https://www.w3.org/TR/css-flexbox-2/#property-index) + ;; CSS Flexible Box Layout Module Level 1 + ;; (https://www.w3.org/TR/css-flexbox-1/#property-index) ("flex" "none" flex-grow flex-shrink flex-basis) ("flex-basis" "auto" "content" width) ("flex-direction" "row" "row-reverse" "column" "column-reverse") commit 137720ee6e1bb8489a51092559ce0ed69385d737 Author: Simen Heggestøyl Date: Sat May 14 13:09:53 2022 +0200 Update CSS Box Alignment Module properties * lisp/textmodes/css-mode.el (css-property-alist): Update properties. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 959df5cfe6..6ce7172063 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -308,24 +308,24 @@ ;; CSS Box Alignment Module Level 3 ;; (https://www.w3.org/TR/css-align-3/#property-index) - ("align-content" - baseline-position content-distribution overflow-position content-position) - ("align-items" - "normal" "stretch" baseline-position overflow-position self-position) - ("align-self" - "auto" "normal" "stretch" - baseline-position overflow-position self-position) - ("justify-content" "normal" - content-distribution overflow-position content-position "left" "right") - ("justify-items" - "normal" "stretch" baseline-position overflow-position self-position - "left" "right" "legacy") - ("justify-self" - "auto" "normal" "stretch" baseline-position overflow-position self-position - "left" "right") + ("align-content" baseline-position content-distribution + overflow-position content-position) + ("align-items" "normal" "stretch" baseline-position + overflow-position self-position) + ("align-self" "auto" "normal" "stretch" baseline-position + overflow-position self-position) + ("column-gap" "normal" length-percentage) + ("gap" row-gap column-gap) + ("justify-content" "normal" content-distribution overflow-position + content-position "left" "right") + ("justify-items" "normal" "stretch" baseline-position + overflow-position self-position "left" "right" "legacy" "center") + ("justify-self" "auto" "normal" "stretch" baseline-position + overflow-position self-position "left" "right") ("place-content" align-content justify-content) ("place-items" align-items justify-items) ("place-self" justify-self align-self) + ("row-gap" "normal" length-percentage) ;; CSS Flexible Box Layout Module Level 2 ;; (https://www.w3.org/TR/css-flexbox-2/#property-index) commit 2214f42202e2b8b2601c789e6eee2d28cf433253 Author: Simen Heggestøyl Date: Sat May 14 12:49:07 2022 +0200 Add `all` to CSS property list * lisp/textmodes/css-mode.el (css-property-alist): Add new property `all` from the CSS Cascading and Inheritance Level 3 module. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 1139fd1976..959df5cfe6 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -269,6 +269,10 @@ ("resize" "none" "both" "horizontal" "vertical") ("text-overflow" "clip" "ellipsis" string) + ;; CSS Cascading and Inheritance Level 3 + ;; (https://www.w3.org/TR/css-cascade-3/#property-index) + ("all") + ;; CSS Color Module Level 3 ;; (https://www.w3.org/TR/css3-color/#property) ("color" color) commit ade35760a5a073eac87ce7fdea1373b769b0eff3 Author: Po Lu Date: Sun May 15 17:38:21 2022 +0800 Fix use of more invalid keys in PGTK GSettings code * src/xsettings.c (apply_gsettings_font_hinting): (apply_gsettings_font_rgba_order): Test for key existence before using it. diff --git a/src/xsettings.c b/src/xsettings.c index 16625bd229..2e33ef958a 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -230,6 +230,29 @@ static GSettings *gsettings_client; /* The cairo font_options as obtained using gsettings. */ static cairo_font_options_t *font_options; +static bool +xg_settings_key_valid_p (GSettings *settings, const char *key) +{ +#ifdef GLIB_VERSION_2_32 + GSettingsSchema *schema; + bool rc; + + g_object_get (G_OBJECT (settings), + "settings-schema", &schema, + NULL); + + if (!schema) + return false; + + rc = g_settings_schema_has_key (schema, key); + g_settings_schema_unref (schema); + + return rc; +#else + return false; +#endif +} + /* Store an event for re-rendering of the fonts. */ static void store_font_options_changed (void) @@ -243,13 +266,21 @@ store_font_options_changed (void) static void apply_gsettings_font_hinting (GSettings *settings) { - GVariant *val = g_settings_get_value (settings, GSETTINGS_FONT_HINTING); + GVariant *val; + const char *hinting; + + if (!xg_settings_key_valid_p (settings, GSETTINGS_FONT_HINTING)) + return; + + val = g_settings_get_value (settings, GSETTINGS_FONT_HINTING); + if (val) { g_variant_ref_sink (val); + if (g_variant_is_of_type (val, G_VARIANT_TYPE_STRING)) { - const char *hinting = g_variant_get_string (val, NULL); + hinting = g_variant_get_string (val, NULL); if (!strcmp (hinting, "full")) cairo_font_options_set_hint_style (font_options, @@ -268,29 +299,6 @@ apply_gsettings_font_hinting (GSettings *settings) } } -static bool -xg_settings_key_valid_p (GSettings *settings, const char *key) -{ -#ifdef GLIB_VERSION_2_32 - GSettingsSchema *schema; - bool rc; - - g_object_get (G_OBJECT (settings), - "settings-schema", &schema, - NULL); - - if (!schema) - return false; - - rc = g_settings_schema_has_key (schema, key); - g_settings_schema_unref (schema); - - return rc; -#else - return false; -#endif -} - /* Apply changes in the antialiasing system setting. */ static void apply_gsettings_font_antialias (GSettings *settings) @@ -328,14 +336,22 @@ apply_gsettings_font_antialias (GSettings *settings) static void apply_gsettings_font_rgba_order (GSettings *settings) { - GVariant *val = g_settings_get_value (settings, - GSETTINGS_FONT_RGBA_ORDER); + GVariant *val; + const char *rgba_order; + + if (!xg_settings_key_valid_p (settings, GSETTINGS_FONT_RGBA_ORDER)) + return; + + val = g_settings_get_value (settings, + GSETTINGS_FONT_RGBA_ORDER); + if (val) { g_variant_ref_sink (val); + if (g_variant_is_of_type (val, G_VARIANT_TYPE_STRING)) { - const char *rgba_order = g_variant_get_string (val, NULL); + rgba_order = g_variant_get_string (val, NULL); if (!strcmp (rgba_order, "rgb")) cairo_font_options_set_subpixel_order (font_options, commit 09674074b57bee74ff1039f8ef08c2dea321c0da Author: Stefan Kangas Date: Sun May 15 11:15:06 2022 +0200 ; Fix typos diff --git a/config.bat b/config.bat index 758e462138..e9a180c8ee 100644 --- a/config.bat +++ b/config.bat @@ -310,7 +310,7 @@ rm -f makefile.tmp sed -f ../msdos/sedlibcf.inp < gnulib.mk-in > gnulib.tmp sed -f ../msdos/sedlibmk.inp < gnulib.tmp > gnulib.mk rm -f gnulib.tmp -Rem Create directorys in lib/ that MKDIR_P is supposed to create +Rem Create directories in lib/ that MKDIR_P is supposed to create Rem but I have no idea how to do that on MS-DOS. mkdir sys Rem Create .d files for new files in lib/ and lib/malloc/ diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 340fe766c1..4c8ca967f1 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -83,7 +83,7 @@ together: If EVAL is a string, it will be inserted as is, and then that string will be `read' and evaluated. -2. Document a form or string, but manually document its evalation +2. Document a form or string, but manually document its evaluation result. The provided form will not be evaluated. (FUNC diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el index 0961e214f4..f52b70fe7a 100644 --- a/lisp/eshell/esh-opt.el +++ b/lisp/eshell/esh-opt.el @@ -205,7 +205,7 @@ a long option." VALUE is the potential value of the OPT, coming from args like \"-fVALUE\" or \"--foo=VALUE\", or nil if no value was supplied. If OPT doesn't consume a value, return VALUE unchanged so that it can be -processed later; otherwsie, return nil. +processed later; otherwise, return nil. If the OPT consumes an argument for its value and VALUE is nil, the argument list will be modified." diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el index 7914d28c29..9440c623f9 100644 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@ -49,7 +49,7 @@ formats that are to be supported: Only the suffixes that map to (defcustom image-convert-to-format "png" "The image format to convert to. This should be a string like \"png\" or \"ppm\" or some -other (preferrably lossless) format that Emacs understands +other (preferably lossless) format that Emacs understands natively. The converter chosen has to support the format, and if not, conversion will fail." :group 'image diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 1596cdb481..ab74c2cffd 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -310,7 +310,7 @@ Print messages at start and end of loading unless optional fourth arg NOMESSAGE is non-nil. If EVAL-FUNCTION, call that instead of calling `eval-buffer' -directly. It is called with two paramameters: The buffer object +directly. It is called with two parameters: The buffer object and the file name. Return t if file exists." diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 57cb566c95..21f6e33b0d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1855,7 +1855,7 @@ The browser to used is specified by the (replace-regexp-in-string ".utm_.*" "" url)) (defun eww--transform-url (url) - "Appy `eww-url-transformers'." + "Apply `eww-url-transformers'." (when url (dolist (func eww-url-transformers) (setq url (funcall func url))) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index ae68bf989a..2a9a7a8bf5 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -6848,7 +6848,7 @@ comment at the start of cc-engine.el for more info." ;; checking `c-new-id-start' and `c-new-id-end'. That's done to avoid ;; adding all prefixes of a type as it's being entered and font locked. ;; This is a bit rough and ready, but now covers adding characters into the - ;; middle of an identifer. + ;; middle of an identifier. ;; ;; This function might do hidden buffer changes. (if (and c-new-id-start c-new-id-end diff --git a/lisp/progmodes/erts-mode.el b/lisp/progmodes/erts-mode.el index 31a8bded8a..1b88540ff3 100644 --- a/lisp/progmodes/erts-mode.el +++ b/lisp/progmodes/erts-mode.el @@ -51,17 +51,17 @@ :foreground "blue") (t :bold t)) - "Face used for displaying specificaton values." + "Face used for displaying specification values." :group 'erts-mode) (defface erts-mode-start-test '((t :inherit font-lock-keyword-face)) - "Face used for displaying specificaton test start markers." + "Face used for displaying specification test start markers." :group 'erts-mode) (defface erts-mode-end-test '((t :inherit font-lock-comment-face)) - "Face used for displaying specificaton test start markers." + "Face used for displaying specification test start markers." :group 'erts-mode) (defvar erts-mode-map diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 979b743a65..7bb4fef0c0 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4179,7 +4179,7 @@ must tell Emacs. Here's how to do that in your init file: ;; start a comment. (string-to-syntax ".") ;; Inside a comment, ignore it to avoid -*/ not - ;; being intepreted as a comment end. + ;; being interpreted as a comment end. (forward-char -1) nil))))) ;; Set syntax and font-face highlighting diff --git a/lisp/replace.el b/lisp/replace.el index 81282deb14..3d0877a9a6 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2684,7 +2684,7 @@ It is called with three arguments, as if it were "Function to convert the FROM string of query-replace commands to a regexp. This is used by `query-replace', `query-replace-regexp', etc. as the value of `isearch-regexp-function' when they search for the -occurences of the string/regexp to be replaced. This is intended +occurrences of the string/regexp to be replaced. This is intended to be used when the string to be replaced, as typed by the user, is not to be interpreted literally, but instead should be converted to a regexp that is actually used for the search.") diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 13a73aa7fb..f3abb9d5e6 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -784,7 +784,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." ;;; Handling drops. (defun x-dnd-handle-unsupported-drop (targets _x _y action _window-id _frame _time) - "Return non-nil if the drop described by TARGETS and ACTION should not proceeed." + "Return non-nil if the drop described by TARGETS and ACTION should not proceed." (not (and (or (eq action 'XdndActionCopy) (eq action 'XdndActionMove)) (or (member "STRING" targets) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 62da16d486..88bc8ff6c5 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -451,7 +451,7 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." xwidget-webkit--progress-update-timer (run-at-time 0.5 0.5 #'xwidget-webkit--update-progress-timer-function xwidget))))) - ;; This funciton will be called multi times, so only + ;; This function will be called multi times, so only ;; change buffer name when the load actually completes ;; this can limit buffer-name flicker in mode-line. (when (or (string-equal (nth 3 last-input-event) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index ac2f4f39ea..2143f14dc9 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -143,7 +143,7 @@ struct font_selection_dialog_message /* Whether or not font selection was cancelled. */ bool_bf cancel : 1; - /* Whether or not a size was explictly specified. */ + /* Whether or not a size was explicitly specified. */ bool_bf size_specified : 1; /* The index of the selected font family. */ diff --git a/src/haikuterm.c b/src/haikuterm.c index 57f5b052f6..df0cd82a39 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3036,7 +3036,7 @@ haiku_flush_dirty_back_buffer_on (struct frame *f) haiku_flip_buffers (f); } -/* N.B. that support for TYPE must be explictly added to +/* N.B. that support for TYPE must be explicitly added to haiku_read_socket. */ void haiku_wait_for_event (struct frame *f, int type) diff --git a/src/image.c b/src/image.c index dfa5327992..18e9e72d83 100644 --- a/src/image.c +++ b/src/image.c @@ -9108,7 +9108,7 @@ gif_load (struct frame *f, struct image *img) goto gif_error; } - /* It's an animated image, so initalize the cache. */ + /* It's an animated image, so initialize the cache. */ if (cache && !cache->handle) { cache->handle = gif; diff --git a/src/lread.c b/src/lread.c index 2538851bac..409e97cdfa 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3497,7 +3497,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list, bool locate_syms) /* Optimisation: since the placeholder is already a cons, repurpose it as the actual value. - This allows us to skip the substition below, + This allows us to skip the substitution below, since the placeholder is already referenced inside TEM at the appropriate places. */ Fsetcar (placeholder, XCAR (tem)); diff --git a/src/pgtkfns.c b/src/pgtkfns.c index a0fcf70f31..1feb3fe250 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -848,7 +848,7 @@ pgtk_set_scroll_bar_background (struct frame *f, Lisp_Object new_value, error ("Unknown color."); /* On pgtk, this frame parameter should be ignored, and honor - gtk theme. (It honors the GTK theme if not explictly set, so + gtk theme. (It honors the GTK theme if not explicitly set, so I see no harm in letting users tinker a bit more.) */ char css[64]; sprintf (css, "scrollbar trough { background-color: #%06x; }", @@ -2853,7 +2853,7 @@ x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct Frame parameters may be changed if .Xdefaults contains specifications for the default font. For example, if there is an `Emacs.default.attributeBackground: pink', the `background-color' - attribute of the frame get's set, which let's the internal border + attribute of the frame gets set, which lets the internal border of the tooltip frame appear in pink. Prevent this. */ { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 11ab40a0d3..b9d0b7b512 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -2551,7 +2551,7 @@ pgtk_draw_glyph_string (struct glyph_string *s) } /* Ignore minimum_offset if the amount of pixels was - explictly specified. */ + explicitly specified. */ if (!s->face->underline_pixels_above_descent_line) position = max (position, underline_minimum_offset); } diff --git a/src/pgtkterm.h b/src/pgtkterm.h index 20c161e63b..e31e62ae19 100644 --- a/src/pgtkterm.h +++ b/src/pgtkterm.h @@ -96,7 +96,7 @@ struct scroll_bar editing large files, we establish a minimum height by always drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below where they would be normally; the bottom and top are in a - different co-ordinate system. */ + different coordinate system. */ int start, end; /* If the scroll bar handle is currently being dragged by the user, diff --git a/src/sort.c b/src/sort.c index c7ccfc2305..d10ae692d3 100644 --- a/src/sort.c +++ b/src/sort.c @@ -783,7 +783,7 @@ merge_at (merge_state *ms, const ptrdiff_t i) } -/* Compute the "power" of the first of two adjacent runs begining at +/* Compute the "power" of the first of two adjacent runs beginning at index S1, with the first having length N1 and the second (starting at index S1+N1) having length N2. The run has total length N. */ diff --git a/src/w32term.c b/src/w32term.c index 19786da3a6..da7ac37972 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2720,7 +2720,7 @@ w32_draw_glyph_string (struct glyph_string *s) if (!(s->face->underline_at_descent_line_p /* Ignore minimum_offset if the amount of pixels - was explictly specified. */ + was explicitly specified. */ && s->face->underline_pixels_above_descent_line)) position = max (position, minimum_offset); } diff --git a/src/xterm.c b/src/xterm.c index bb92e1bbe6..21c31271ca 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -78,7 +78,7 @@ along with GNU Emacs. If not, see . */ INPUT FOCUS Under X, the window where keyboard input is sent is not always - explictly defined. When there is a focus window, it receives what + explicitly defined. When there is a focus window, it receives what is referred to as "explicit focus", but when there is none, it receives "implicit focus" whenever the pointer enters it, and loses that focus when the pointer leaves. When the toplevel window of a @@ -2515,7 +2515,7 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo) } /* And the common case where there is no input rect and the - bouding rect equals the window dimensions. */ + bounding rect equals the window dimensions. */ if (tem->n_input_rects == -1 && tem->n_bounding_rects == 1 @@ -8781,7 +8781,7 @@ x_draw_glyph_string (struct glyph_string *s) } /* Ignore minimum_offset if the amount of pixels was - explictly specified. */ + explicitly specified. */ if (!s->face->underline_pixels_above_descent_line) position = max (position, minimum_offset); } @@ -19973,7 +19973,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, } /* And the common case where there is no input rect and the - bouding rect equals the window dimensions. */ + bounding rect equals the window dimensions. */ if (tem->n_input_rects == -1 && tem->n_bounding_rects == 1 diff --git a/test/lisp/ansi-color-tests.el b/test/lisp/ansi-color-tests.el index 2ff7fc6aaf..1b04e8e9de 100644 --- a/test/lisp/ansi-color-tests.el +++ b/test/lisp/ansi-color-tests.el @@ -173,7 +173,7 @@ strings with `eq', this function compares them with `equal'." (should (ansi-color-tests-equal-props propertized-str (buffer-string)))) - ;; \e not followed by '[' and invalid ANSI escape seqences + ;; \e not followed by '[' and invalid ANSI escape sequences (dolist (fun (list ansi-filt ansi-app)) (with-temp-buffer (should (equal (funcall fun "\e") "")) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 7d17fbde67..978f96912f 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1691,7 +1691,7 @@ FN-TEST is the function to test: either `save-some-buffers' or specified inside ARGS-RESULTS. During the call to FN-TEST,`read-event' is overridden with a function that -just returns `n' and `kill-emacs' is overriden to do nothing. +just returns `n' and `kill-emacs' is overridden to do nothing. ARGS-RESULTS is a list of elements (FN-ARGS CALLERS-DIR EXPECTED), where FN-ARGS are the arguments for FN-TEST; diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index fa5a614fbf..d9c5df1790 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6461,7 +6461,7 @@ This requires restrictions of file name syntax." (defun tramp--test-asynchronous-processes-p () "Whether asynchronous processes tests are run. -This is used in tests which we dont't want to tag +This is used in tests which we don't want to tag `:tramp-asynchronous-processes' completely." (and (ert-select-tests @@ -6484,7 +6484,7 @@ This does not support some special file names." (defun tramp--test-expensive-test-p () "Whether expensive tests are run. -This is used in tests which we dont't want to tag `:expensive' +This is used in tests which we don't want to tag `:expensive' completely." (ert-select-tests (ert--stats-selector ert--current-run-stats) commit 5dbaddc729519b399e31eae13a8f71d8caaade34 Author: Stefan Kangas Date: Sun May 15 11:05:36 2022 +0200 ; Fix some typos diff --git a/ChangeLog.3 b/ChangeLog.3 index 52c6300f1f..ecd966fb69 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1293,7 +1293,7 @@ Don't bug out on certain empty elements with ids - * lisp/net/shr.el (shr-descend): Fix empty-element #id targetting + * lisp/net/shr.el (shr-descend): Fix empty-element #id targeting (bug#52391). 2021-12-09 Paul Eggert diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index 191fe8cd85..d634ad5197 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -2025,7 +2025,7 @@ They are defined here anyway to allow sharing certain methods. @code{value} The value. Should not be accessed directly. @item -@code{init-value} Function that is responsable for setting the object's +@code{init-value} Function that is responsible for setting the object's value. If bound, then this is called with the object as the only argument. Usually this is not bound, in which case the object's primary @code{transient-init-value} method is called instead. diff --git a/src/emacs.c b/src/emacs.c index 0f96716fb3..ccc0dd269f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1365,7 +1365,7 @@ main (int argc, char **argv) related to the GUI system, like -font, -geometry, and -title, and then processes the rest of arguments whose priority is below those that are related to the GUI system. The arguments - porcessed by 'command-line' are removed from 'command-line-args'; + processed by 'command-line' are removed from 'command-line-args'; the arguments processed by 'command-line-1' aren't, they are only removed from 'command-line-args-left'. commit aaa2d0db18509b7d2f1e35cbc9dc2b4443f1cce4 Author: Po Lu Date: Sun May 15 08:33:34 2022 +0000 Improve return value of `haiku-roster-launch' * src/haikuselect.c (Fhaiku_roster_launch): Return `already-running' if no PID is available since the target application is already running. (syms_of_haikuselect): New defsym. diff --git a/src/haikuselect.c b/src/haikuselect.c index 0c808bdb93..f7618aa4db 100644 --- a/src/haikuselect.c +++ b/src/haikuselect.c @@ -778,8 +778,9 @@ ignored if it is dropped on top of FRAME. */) DEFUN ("haiku-roster-launch", Fhaiku_roster_launch, Shaiku_roster_launch, 2, 2, 0, doc: /* Launch an application associated with FILE-OR-TYPE. -Return the process ID of the application, or nil if no application was -launched. +Return the process ID of any process created, the symbol +`already-running' if ARGS was sent to a program that's already +running, or nil if launching the application failed. FILE-OR-TYPE can either be a string denoting a MIME type, or a list with one argument FILE, denoting a file whose associated application @@ -850,9 +851,16 @@ after it starts. */) &team_id); unblock_input (); + /* `be_roster_launch' can potentially take a while in IO, but + signals from async input will interrupt that operation. If the + user wanted to quit, act like it. */ + maybe_quit (); + if (rc == B_OK) return SAFE_FREE_UNBIND_TO (depth, make_uint (team_id)); + else if (rc == B_ALREADY_RUNNING) + return Qalready_running; return SAFE_FREE_UNBIND_TO (depth, Qnil); } @@ -913,6 +921,7 @@ used to retrieve the current position of the mouse. */); DEFSYM (Qsize_t, "size_t"); DEFSYM (Qssize_t, "ssize_t"); DEFSYM (Qpoint, "point"); + DEFSYM (Qalready_running, "already-running"); defsubr (&Shaiku_selection_data); defsubr (&Shaiku_selection_put); commit 950dab21e3408788cb2443e2f2c6518a32adfd15 Author: Michael Albinus Date: Sun May 15 09:02:42 2022 +0200 * test/lisp/net/tramp-tests.el (tramp-test27-load): Adapt test. Don't merge diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 8b999a6e34..7a377e7fbf 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4425,7 +4425,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (let ((tmp-name (tramp--test-make-temp-name nil quoted))) (unwind-protect (progn - (load tmp-name 'noerror 'nomessage) + ;; Ange-FTP does not tolerate a missing file, even with `noerror'. + (unless (tramp--test-ange-ftp-p) + (load tmp-name 'noerror 'nomessage)) (should-not (featurep 'tramp-test-load)) (write-region "(provide 'tramp-test-load)" nil tmp-name) ;; `load' in lread.c does not pass `must-suffix'. Why? commit 48201ce8defa617af0ddf65f3b2ae79e6cf01df6 Author: Eli Zaretskii Date: Sun May 15 09:21:36 2022 +0300 ; * lisp/electric.el (electric-indent-mode): Fix a typo. diff --git a/lisp/electric.el b/lisp/electric.el index 4a35c1a2a1..57cdff38ed 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -319,7 +319,7 @@ also include other characters as needed by the major mode; see `electric-indent-chars' for the actual list. By \"reindent\" we mean remove any existing indentation, and then -indent the line accordiung to context and rules of the major mode. +indent the line according to context and rules of the major mode. This is a global minor mode. To toggle the mode in a single buffer, use `electric-indent-local-mode'."