commit 062f5aa640db1b8208f9c45dd12fea08e85658d9 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Tue Jun 1 10:29:33 2021 +0200 Allow packages to change the hl-line overlay priority * lisp/hl-line.el (hl-line-overlay-priority): New variable (bug#11509). (hl-line-make-overlay): Use it. diff --git a/etc/NEWS b/etc/NEWS index 351295a268..fe8789c60b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1991,6 +1991,11 @@ Shift while typing 'C-a', i.e. 'C-S-a', will now highlight the text. ** Miscellaneous +--- +*** New variable 'hl-line-overlay-priority'. +This can be used to change the priority of the hl-line overlays. + ++++ *** New command 'mailcap-view-file'. This command will open a viewer based on the file type, as determined by ~/.mailcap and related files and variables. diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 82952e934b..26cfcc3f9c 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -125,6 +125,9 @@ This variable is expected to be made buffer-local by modes.") (defvar hl-line-overlay-buffer nil "Most recently visited buffer in which Hl-Line mode is enabled.") +(defvar hl-line-overlay-priority -50 + "Priority used on the overlay used by hl-line.") + ;;;###autoload (define-minor-mode hl-line-mode "Toggle highlighting of the current line (Hl-Line mode). @@ -152,7 +155,7 @@ line about point in the selected window only." (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) - (overlay-put ol 'priority -50) ;(bug#16192) + (overlay-put ol 'priority hl-line-overlay-priority) ;(bug#16192) (overlay-put ol 'face hl-line-face) ol)) commit d9ccc3fa2ac0ce1bd522ddc26070edfac55c69a7 Author: Lars Ingebrigtsen Date: Tue Jun 1 10:22:57 2021 +0200 Fix problem with `format-alist' marking all the text in the buffer * lisp/format.el (format-decode-run-method): Use it to avoid marking the entire buffer (bug#11691). * lisp/simple.el (shell-command-on-region): Allow replacing text without activating the mark. diff --git a/lisp/format.el b/lisp/format.el index 3e2d92fef1..1e87d25284 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -181,7 +181,7 @@ it should be a Lisp function. BUFFER is currently ignored." ;; We should perhaps go via a temporary buffer and copy it ;; back, in case of errors. (if (and (zerop (save-window-excursion - (shell-command-on-region from to method t t + (shell-command-on-region from to method t 'no-mark error-buff))) ;; gzip gives zero exit status with bad args, for instance. (zerop (with-current-buffer error-buff diff --git a/lisp/simple.el b/lisp/simple.el index 8849919360..cdd77f74c3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4334,7 +4334,7 @@ current buffer after START. Optional fifth arg REPLACE, if non-nil, means to insert the output in place of text from START to END, putting point and mark -around it. +around it. If REPLACE is the symbol `no-mark', don't set the mark. Optional sixth arg ERROR-BUFFER, if non-nil, specifies a buffer or buffer name to which to direct the command's standard error @@ -4409,7 +4409,9 @@ characters." (let ((swap (and replace (< start end)))) ;; Don't muck with mark unless REPLACE says we should. (goto-char start) - (and replace (push-mark (point) 'nomsg)) + (when (and replace + (not (eq replace 'no-mark))) + (push-mark (point) 'nomsg)) (setq exit-status (call-shell-region start end command replace (if error-file @@ -4420,7 +4422,9 @@ characters." ;; (and shell-buffer (not (eq shell-buffer (current-buffer))) ;; (kill-buffer shell-buffer))) ;; Don't muck with mark unless REPLACE says we should. - (and replace swap (exchange-point-and-mark))) + (when (and replace swap + (not (eq replace 'no-mark))) + (exchange-point-and-mark))) ;; No prefix argument: put the output in a temp buffer, ;; replacing its entire contents. (let ((buffer (get-buffer-create commit 43a9c3f725967001cfbcb9e85525f035d628bf36 Author: Lars Ingebrigtsen Date: Tue Jun 1 09:41:40 2021 +0200 Document `with-selected-frame' * doc/lispref/windows.texi (Selecting Windows): Document `with-selected-frame' (bug#12075). diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 82d2ce4757..44656c057a 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1838,6 +1838,14 @@ with @var{window} as the selected window without needlessly running @code{buffer-list-update-hook}. @end defmac +@defmac with-selected-frame frame forms@dots{} +This macro executes @var{forms} with @var{frame} as the selected +frame. The value returned is the value of the last form in +@var{forms}. This macro saves and restores the selected frame, and +changes the order of neither the recently selected windows nor the +buffers in the buffer list. +@end defmac + @defun frame-selected-window &optional frame This function returns the window on @var{frame} that is selected within that frame. @var{frame} should be a live frame; if omitted or commit 0a7ca6fc3f4c22c9efc809fcd08e866734c6c981 Author: Lars Ingebrigtsen Date: Tue Jun 1 09:15:13 2021 +0200 Obsolete `global-whitespace-newline-mode' * lisp/whitespace.el (global-whitespace-newline-mode): Make obsolete since it doesn't work correctly, and seems superfluous (bug#12496). diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 22bfae0697..b45d595cc2 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1039,6 +1039,9 @@ See also `whitespace-newline' and `whitespace-display-mappings'." 1 -1)) ;; sync states (running a batch job) (setq global-whitespace-newline-mode global-whitespace-mode))) +(make-obsolete 'global-whitespace-newline-mode + "Use `global-whitespace-mode' with `whitespace-style' set to `(newline-mark newline)' instead" + "28.1") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; commit 85e17196fa2b6333fbce7fdac1e2e17b045b91ae Author: Lars Ingebrigtsen Date: Tue Jun 1 08:55:06 2021 +0200 Add a new command `mailcap-view-file' * doc/misc/emacs-mime.texi (mailcap): Document it (bug#12972). * lisp/net/mailcap.el (mailcap-view-file): New command. diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 0cf5ba9650..7cd3e5f582 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -1870,6 +1870,11 @@ A customizable list of viewers that take preference over Interface functions: @table @code +@item mailcap-view-file +@findex mailcap-view-file +Prompt for a file name, and start a viewer applicable for the file +type in question. + @item mailcap-parse-mailcaps @findex mailcap-parse-mailcaps @vindex mailcap-prefer-mailcap-viewers diff --git a/etc/NEWS b/etc/NEWS index 6622861aaf..351295a268 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1991,6 +1991,10 @@ Shift while typing 'C-a', i.e. 'C-S-a', will now highlight the text. ** Miscellaneous +*** New command 'mailcap-view-file'. +This command will open a viewer based on the file type, as determined +by ~/.mailcap and related files and variables. + +++ *** New command 'C-x C-k Q' to force redisplay in keyboard macros. diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index 3097c9a671..54f7f416ab 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1156,6 +1156,29 @@ current buffer after passing its contents to the shell command." (mailcap--async-shell method file)) (funcall method)))) +(defun mailcap-view-file (file) + "View FILE according to rules given by the mailcap system. +This normally involves executing some external program to display +the file. + +See \"~/.mailcap\", `mailcap-mime-data' and related files and variables." + (interactive "fOpen file with mailcap: ") + (setq file (expand-file-name file)) + (mailcap-parse-mailcaps) + (let ((command (mailcap-mime-info + (mailcap-extension-to-mime (file-name-extension file))))) + (unless command + (error "No viewer for %s" (file-name-extension file))) + ;; Remove quotes around the file name - we'll use shell-quote-argument. + (while (string-match "['\"]%s['\"]" command) + (setq command (replace-match "%s" t t command))) + (setq command (replace-regexp-in-string + "%s" + (shell-quote-argument (convert-standard-filename file)) + command + nil t)) + (start-process-shell-command command nil command))) + (provide 'mailcap) ;;; mailcap.el ends here commit 78f885f3702704300531f71dc3bc3f6613d0ce72 Author: Lars Ingebrigtsen Date: Tue Jun 1 07:57:09 2021 +0200 Fix documentation of literal `face' syntax in font-lock section * doc/lispref/modes.texi (Search-based Fontification): Fix the literal `(0 (face ...))' syntax documentation (bug#13917). diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 88f2f14c09..02064e7a37 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -3004,7 +3004,8 @@ name. However, @var{facespec} can also evaluate to a list of this form: @example -(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{}) +(@var{subexp} +(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{})) @end example @noindent commit 23b6cd41f55b833e8a562c51642d36b5211a510b Author: Philip Kaludercic Date: Tue Jun 1 07:49:10 2021 +0200 Improve random selection of keyservers * epa-ks.el (epa-keyserver): Interpret a list as a pool. (epa-ks--query-url): Add new auxiliary function. (epa-ks--fetch-key): Use epa-ks--query-url. (epa-search-keys): Use epa-ks--query-url. diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el index a33025b112..ebdb127421 100644 --- a/lisp/epa-ks.el +++ b/lisp/epa-ks.el @@ -43,7 +43,8 @@ This is used by `epa-ks-lookup-key', for looking up public keys." :type '(choice :tag "Keyserver" - (const random) + (repeat :tag "Random pool" + (string :tag "Keyserver address")) (const "keyring.debian.org") (const "keys.gnupg.net") (const "keyserver.ubuntu.com") @@ -141,20 +142,33 @@ Keys are marked using `epa-ks-mark-key-to-fetch'." (epa-ks--fetch-key id)))) (tabulated-list-clear-all-tags)) +(defun epa-ks--query-url (query exact) + "Return URL for QUERY. +If EXACT is non-nil, don't accept approximate matches." + (format "https://%s/pks/lookup?%s" + (cond ((null epa-keyserver) + (user-error "Empty keyserver pool")) + ((listp epa-keyserver) + (nth (random (length epa-keyserver)) + epa-keyserver)) + ((stringp epa-keyserver) + epa-keyserver) + ((error "Invalid type for `epa-keyserver'"))) + (url-build-query-string + (append `(("search" ,query) + ("options" "mr") + ("op" "index")) + (and exact '(("exact" "on"))))))) + (defun epa-ks--fetch-key (id) "Send request to import key with specified ID." (url-retrieve - (format "https://%s/pks/lookup?%s" - epa-keyserver - (url-build-query-string - `(("search" ,(concat "0x" (url-hexify-string id))) - ("options" "mr") - ("op" "get")))) + (epa-ks--query-url (concat "0x" (url-hexify-string id)) t) (lambda (status) (when (plist-get status :error) (error "Request failed: %s" - (caddr (assq (caddr (plist-get status :error)) - url-http-codes)))) + (caddr (assq (caddr (plist-get status :error)) + url-http-codes)))) (forward-paragraph) (save-excursion (goto-char (point-max)) @@ -224,13 +238,7 @@ enough, since keyservers have strict timeout settings." (erase-buffer)) (epa-ks-search-mode)) (url-retrieve - (format "https://%s/pks/lookup?%s" - epa-keyserver - (url-build-query-string - (append `(("search" ,query) - ("options" "mr") - ("op" "index")) - (and exact '(("exact" "on")))))) + (epa-ks--query-url query exact) (lambda (status) (when (plist-get status :error) (when buf commit ef07d0b8c7576ae0726d410ea41853b3da59a4fc Author: Juri Linkov Date: Mon May 31 23:32:50 2021 +0300 * lisp/isearch.el (lazy-highlight-buffer-max-at-a-time): Change from 20 to 200 Suggested by Augusto Stoffel in bug#48581 diff --git a/lisp/isearch.el b/lisp/isearch.el index 232a994dfa..33776d8069 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -404,7 +404,7 @@ A value of nil means highlight all matches shown on the screen." (integer :tag "Some")) :group 'lazy-highlight) -(defcustom lazy-highlight-buffer-max-at-a-time 20 +(defcustom lazy-highlight-buffer-max-at-a-time 200 ; 20 (bug#48581) "Maximum matches to highlight at a time (for `lazy-highlight-buffer'). Larger values may reduce Isearch's responsiveness to user input; smaller values make matches highlight slowly. commit 8992a4520274600c6698406a93ff4e056897879c Author: Andrea Corallo Date: Mon May 31 20:35:43 2021 +0200 * Make *Async-native-compile-log* buffer read-only (bug#48763) * lisp/emacs-lisp/comp.el (comp-run-async-workers): Make "*Async-native-compile-log*" read-only. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index b09739cb92..fa5a4522c3 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3941,7 +3941,11 @@ display a message." (load1 load) (process (make-process :name (concat "Compiling: " source-file) - :buffer (get-buffer-create comp-async-buffer-name) + :buffer (with-current-buffer + (get-buffer-create + comp-async-buffer-name) + (setf buffer-read-only t) + (current-buffer)) :command (list (expand-file-name invocation-name invocation-directory) @@ -3970,8 +3974,9 @@ display a message." (run-hooks 'native-comp-async-all-done-hook) (with-current-buffer (get-buffer-create comp-async-buffer-name) (save-excursion - (goto-char (point-max)) - (insert "Compilation finished.\n"))) + (let ((buffer-read-only nil)) + (goto-char (point-max)) + (insert "Compilation finished.\n")))) ;; `comp-deferred-pending-h' should be empty at this stage. ;; Reset it anyway. (clrhash comp-deferred-pending-h))) commit 2ee5ce208f212ed658cf2125ef6bc24a435dda50 Author: Alan Mackenzie Date: Mon May 31 16:24:11 2021 +0000 Make frames record when their selected window was the mini-window When a frame in this state is selected again by Fselect_frame (but not by Fselect_window), the mini-window rather than the frame's currently selected window, is chosen for selection, should there still be an active minibuffer in it. This fixes bug #48674. * src/frame.h (struct frame): Add new boolean field select_mini_window_flag. * src/frame.c (make_frame): Initialize select_mini_window_flag to false. (do_switch_frame): Set the new flag appropriately for the old frame, and process the new frame's setting of this flag, before setting it to false. * src/window.c (select_window): Set f->select_mini_window_flag to false. (Fset_frame_selected_window, Fdelete_other_windows_internal) (Fdelete_window_internal): Add comments clarifying that there is no clearing of f->select_mini_window_flag in these functions. diff --git a/src/frame.c b/src/frame.c index e3d65dd28f..623e4ba2cd 100644 --- a/src/frame.c +++ b/src/frame.c @@ -982,6 +982,7 @@ make_frame (bool mini_p) f->ns_transparent_titlebar = false; #endif #endif + f->select_mini_window_flag = false; /* This one should never be zero. */ f->change_stamp = 1; root_window = make_window (); @@ -1542,7 +1543,17 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor tty->top_frame = frame; } + sf->select_mini_window_flag = MINI_WINDOW_P (XWINDOW (sf->selected_window)); + selected_frame = frame; + + move_minibuffers_onto_frame (sf, for_deletion); + + if (f->select_mini_window_flag + && !NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) + f->selected_window = f->minibuffer_window; + f->select_mini_window_flag = false; + if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame = XFRAME (selected_frame); @@ -1559,7 +1570,6 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor #endif internal_last_event_frame = Qnil; - move_minibuffers_onto_frame (sf, for_deletion); return frame; } diff --git a/src/frame.h b/src/frame.h index 75a0b184c1..cad3df5ae1 100644 --- a/src/frame.h +++ b/src/frame.h @@ -462,6 +462,11 @@ struct frame in X builds only. */ bool_bf was_invisible : 1; + /* True when the frame isn't selected, and selecting it in the + future should select the mini-window rather than the currently + selected window in the frame, assuming there is still an active + minibuffer in that mini-window. */ + bool_bf select_mini_window_flag : 1; /* Bitfield area ends here. */ /* This frame's change stamp, set the last time window change diff --git a/src/window.c b/src/window.c index 9961c54161..2d98ae5f15 100644 --- a/src/window.c +++ b/src/window.c @@ -468,6 +468,7 @@ Return WINDOW. */) else { fset_selected_window (XFRAME (frame), window); + /* Don't clear FRAME's select_mini_window_flag here. */ return window; } } @@ -517,6 +518,9 @@ select_window (Lisp_Object window, Lisp_Object norecord, /* Do not select a tooltip window (Bug#47207). */ error ("Cannot select a tooltip window"); + /* We deinitely want to select WINDOW, not the mini-window. */ + f->select_mini_window_flag = false; + /* Make the selected window's buffer current. */ Fset_buffer (w->contents); @@ -3242,6 +3246,9 @@ window-start value is reasonable when this function is called. */) if (EQ (selected_frame, w->frame)) Fselect_window (window, Qnil); else + /* Do not clear f->select_mini_window_flag here. If the + last selected window on F was an active minibuffer, we + want to return to it on a later Fselect_frame. */ fset_selected_window (f, window); } } @@ -5153,6 +5160,9 @@ Signal an error when WINDOW is the only window on its frame. */) if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) Fselect_window (new_selected_window, Qt); else + /* Do not clear f->select_mini_window_flag here. If the + last selected window on F was an active minibuffer, we + want to return to it on a later Fselect_frame. */ fset_selected_window (f, new_selected_window); unblock_input (); commit 63e9a4b1e1fe99462ec97b2145b91898fa5b4085 Author: Glenn Morris Date: Mon May 31 08:40:26 2021 -0700 * src/keyboard.c (make_lispy_event): Fix previous. diff --git a/src/keyboard.c b/src/keyboard.c index 4433cfa419..bddbb793a5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5733,7 +5733,7 @@ make_lispy_event (struct input_event *event) /* Was the down event in a window body? */ && FIXNUMP (Fcar (Fcdr (start_pos))) && WINDOW_LIVE_P (Fcar (start_pos)) - && Ffboundp (Qwindow_edges)) + && !NILP (Ffboundp (Qwindow_edges))) /* If the window (etc.) at the mouse position has changed between the down event and the up event, we assume there's been a redisplay between the commit b7c1b81ffbebb4d821a52bd1f502ed94562721e1 Merge: 6e2d3bce08 5dfa5e26dd Author: Glenn Morris Date: Mon May 31 07:50:34 2021 -0700 Merge from origin/emacs-27 5dfa5e26dd (origin/emacs-27) Improve documentation of regexp ranges commit 6e2d3bce087d30a535b1f01715d7820576ffe390 Author: Alan Mackenzie Date: Mon May 31 10:33:10 2021 +0000 Correct mouse handling when window origin changes between down and up events Do this by using frame relative positions rather than window relative ones, which gave rise to spurious drag events when the origin of the window changed between the mouse down and up events. This fixes bug #48409. * keyboard.c (frame_relative_event_pos): New static variable. (make_lispy_event): Record frame relative position of down event. When the up event is in the same position, "move" this event into the window of the down event when this window (typically a mini-window) is no longer under the mouse. Call make_lispy_position a second time to generate this changed event. (syms_of_keyboard): Declare Qwindow_edges. static_pro frame_relative_event_pos. diff --git a/src/keyboard.c b/src/keyboard.c index c855d45afa..4433cfa419 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5018,6 +5018,10 @@ static short const internal_border_parts[] = { static Lisp_Object button_down_location; +/* A cons recording the original frame-relative x and y coordinates of + the down mouse event. */ +static Lisp_Object frame_relative_event_pos; + /* Information about the most recent up-going button event: Which button, what location, and what time. */ @@ -5669,6 +5673,7 @@ make_lispy_event (struct input_event *event) double_click_count = 1; button_down_time = event->timestamp; *start_pos_ptr = Fcopy_alist (position); + frame_relative_event_pos = Fcons (event->x, event->y); ignore_mouse_drag_p = false; } @@ -5691,20 +5696,12 @@ make_lispy_event (struct input_event *event) ignore_mouse_drag_p = false; else { - Lisp_Object new_down, down; intmax_t xdiff = double_click_fuzz, ydiff = double_click_fuzz; - /* The third element of every position - should be the (x,y) pair. */ - down = Fcar (Fcdr (Fcdr (start_pos))); - new_down = Fcar (Fcdr (Fcdr (position))); - - if (CONSP (down) - && FIXNUMP (XCAR (down)) && FIXNUMP (XCDR (down))) - { - xdiff = XFIXNUM (XCAR (new_down)) - XFIXNUM (XCAR (down)); - ydiff = XFIXNUM (XCDR (new_down)) - XFIXNUM (XCDR (down)); - } + xdiff = XFIXNUM (event->x) + - XFIXNUM (XCAR (frame_relative_event_pos)); + ydiff = XFIXNUM (event->y) + - XFIXNUM (XCDR (frame_relative_event_pos)); if (! (0 < double_click_fuzz && - double_click_fuzz < xdiff @@ -5721,12 +5718,51 @@ make_lispy_event (struct input_event *event) a click. But mouse-drag-region completely ignores this case and it hasn't caused any real problem, so it's probably OK to ignore it as well. */ - && EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position))))) + && (EQ (Fcar (Fcdr (start_pos)), + Fcar (Fcdr (position))) /* Same buffer pos */ + || !EQ (Fcar (start_pos), + Fcar (position))))) /* Different window */ { /* Mouse has moved enough. */ button_down_time = 0; click_or_drag_modifier = drag_modifier; } + else if (((!EQ (Fcar (start_pos), Fcar (position))) + || (!EQ (Fcar (Fcdr (start_pos)), + Fcar (Fcdr (position))))) + /* Was the down event in a window body? */ + && FIXNUMP (Fcar (Fcdr (start_pos))) + && WINDOW_LIVE_P (Fcar (start_pos)) + && Ffboundp (Qwindow_edges)) + /* If the window (etc.) at the mouse position has + changed between the down event and the up event, + we assume there's been a redisplay between the + two events, and we pretend the mouse is still in + the old window to prevent a spurious drag event + being generated. */ + { + Lisp_Object edges + = call4 (Qwindow_edges, Fcar (start_pos), Qt, Qnil, Qt); + int new_x = XFIXNUM (Fcar (frame_relative_event_pos)); + int new_y = XFIXNUM (Fcdr (frame_relative_event_pos)); + + /* If the up-event is outside the down-event's + window, use coordinates that are within it. */ + if (new_x < XFIXNUM (Fcar (edges))) + new_x = XFIXNUM (Fcar (edges)); + else if (new_x >= XFIXNUM (Fcar (Fcdr (Fcdr (edges))))) + new_x = XFIXNUM (Fcar (Fcdr (Fcdr (edges)))) - 1; + if (new_y < XFIXNUM (Fcar (Fcdr (edges)))) + new_y = XFIXNUM (Fcar (Fcdr (edges))); + else if (new_y + >= XFIXNUM (Fcar (Fcdr (Fcdr (Fcdr (edges)))))) + new_y = XFIXNUM (Fcar (Fcdr (Fcdr (Fcdr (edges))))) - 1; + + position = make_lispy_position + (XFRAME (event->frame_or_window), + make_fixnum (new_x), make_fixnum (new_y), + event->timestamp); + } } /* Don't check is_double; treat this as multiple if the @@ -11645,6 +11681,7 @@ syms_of_keyboard (void) DEFSYM (Qmake_frame_visible, "make-frame-visible"); DEFSYM (Qselect_window, "select-window"); DEFSYM (Qselection_request, "selection-request"); + DEFSYM (Qwindow_edges, "window-edges"); { int i; @@ -11661,6 +11698,7 @@ syms_of_keyboard (void) button_down_location = make_nil_vector (5); staticpro (&button_down_location); + staticpro (&frame_relative_event_pos); mouse_syms = make_nil_vector (5); staticpro (&mouse_syms); wheel_syms = make_nil_vector (ARRAYELTS (lispy_wheel_names)); commit 0b1dfb5de601c945e88e98c8fc40611d015a8b77 Author: Colin Woodbury Date: Mon May 31 10:55:37 2021 +0200 Remove spurious @example from the elisp manual * doc/lispref/macros.texi (Defining Macros): Remove spurious extra pair of @example/@end example. Copyright-paperwork-exempt: yes diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi index b8df363614..cf23ecb9d4 100644 --- a/doc/lispref/macros.texi +++ b/doc/lispref/macros.texi @@ -240,7 +240,6 @@ they cannot be called interactively. of constants and nonconstant parts. To make this easier, use the @samp{`} syntax (@pxref{Backquote}). For example: -@example @example @group (defmacro t-becomes-nil (variable) @@ -253,7 +252,6 @@ of constants and nonconstant parts. To make this easier, use the @equiv{} (if (eq foo t) (setq foo nil)) @end group @end example -@end example @node Problems with Macros @section Common Problems Using Macros commit 5dfa5e26dd58c6e8aa135c81ecfdbda92725556e (refs/remotes/origin/emacs-27) Author: Eli Zaretskii Date: Sun May 30 13:20:02 2021 +0300 Improve documentation of regexp ranges * doc/lispref/searching.texi (Regexp Special): Document the effect of using octal escapes in regexp ranges. (Bug#17758) diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 8b900da616..1ee4be7dd1 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -363,7 +363,7 @@ preceding expression either once or not at all. For example, @anchor{Non-greedy repetition} @item @samp{*?}, @samp{+?}, @samp{??} @cindex non-greedy repetition characters in regexp -These are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+} +are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+} and @samp{?}. Where those operators match the largest possible substring (consistent with matching the entire containing expression), the non-greedy variants match the smallest possible substring @@ -438,6 +438,13 @@ including newline. However, a reversed range should always be from the letter @samp{z} to the letter @samp{a} to make it clear that it is not a typo; for example, @samp{[+-*/]} should be avoided, because it matches only @samp{/} rather than the likely-intended four characters. + +@item +If the end points of a range are raw 8-bit bytes (@pxref{Text +Representations}), or if the range start is ASCII and the end is a raw +byte (as in @samp{[a-\377]}), the range will match only ASCII +characters and raw 8-bit bytes, but not non-ASCII characters. This +feature is intended for searching text in unibyte buffers and strings. @end enumerate Some kinds of character alternatives are not the best style even