commit cc297af17872233eb00d1bf06b4446be529dc1dc (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri Apr 29 13:48:02 2022 +0800 Handle IO errors when creating Motif drag window * src/xterm.c (xm_drag_window_io_error_handler): New function. (xm_get_drag_window): Use that as the IO error handler when the temporary display is open. diff --git a/src/xterm.c b/src/xterm.c index cce586952a..51828795c5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1390,6 +1390,14 @@ xm_drag_window_error_handler (Display *display, XErrorEvent *event) return 0; } +static _Noreturn int +xm_drag_window_io_error_handler (Display *dpy) +{ + /* DPY isn't created through GDK, so it doesn't matter if we don't + crash here. */ + longjmp (x_dnd_disconnect_handler, 1); +} + static Window xm_get_drag_window (struct x_display_info *dpyinfo) { @@ -1400,7 +1408,7 @@ xm_get_drag_window (struct x_display_info *dpyinfo) Window drag_window; XSetWindowAttributes attrs; Display *temp_display; - void *old_handler; + void *old_handler, *old_io_handler; drag_window = None; rc = XGetWindowProperty (dpyinfo->display, dpyinfo->root_window, @@ -1434,13 +1442,25 @@ xm_get_drag_window (struct x_display_info *dpyinfo) if (drag_window == None) { block_input (); + old_io_handler = XSetIOErrorHandler (xm_drag_window_io_error_handler); + + if (sigsetjmp (x_dnd_disconnect_handler, 1)) + { + XSetIOErrorHandler (old_io_handler); + unblock_input (); + + return None; + } + unrequest_sigio (); temp_display = XOpenDisplay (XDisplayString (dpyinfo->display)); request_sigio (); if (!temp_display) { + XSetIOErrorHandler (old_io_handler); unblock_input (); + return None; } @@ -1484,6 +1504,7 @@ xm_get_drag_window (struct x_display_info *dpyinfo) XCloseDisplay (temp_display); XSetErrorHandler (old_handler); + XSetIOErrorHandler (old_io_handler); /* Make sure the drag window created is actually valid for the current display, and the XOpenDisplay above didn't commit 6044efe76e8baec4395449675f4ad662183f2f85 Author: Po Lu Date: Fri Apr 29 04:22:17 2022 +0000 Fix file name selection conversion on Haiku * lisp/term/haiku-win.el (haiku-normal-selection-encoders): Register new encoder. (haiku-select-encode-file-name): New function. diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el index 403c737c11..0921079246 100644 --- a/lisp/term/haiku-win.el +++ b/lisp/term/haiku-win.el @@ -65,7 +65,8 @@ the type of DATA inside the system message (see the doc string of `haiku-drag-message' for more details).") (defvar haiku-normal-selection-encoders '(haiku-select-encode-xstring - haiku-select-encode-utf-8-string) + haiku-select-encode-utf-8-string + haiku-select-encode-file-name) "List of functions which act as selection encoders. These functions accept two arguments SELECTION and VALUE, and return an association appropriate for a serialized system @@ -226,6 +227,13 @@ VALUE will be encoded as UTF-8 and stored under the type (list "text/plain" 1296649541 (encode-coding-string value 'utf-8-unix)))) +(defun haiku-select-encode-file-name (_selection value) + "Convert VALUE to a system message association. +This takes the file name of VALUE's buffer (if it is an overlay +or a pair of markers) and turns it into a file system reference." + (when (setq value (xselect--selection-bounds value)) + (list "refs" 'ref (buffer-file-name (nth 2 value))))) + (cl-defmethod gui-backend-get-selection (type data-type &context (window-system haiku)) (if (eq data-type 'TARGETS) @@ -297,8 +305,7 @@ VALUE will be encoded as UTF-8 and stored under the type (message "Don't know how to drop any of: %s" (mapcar #'car string))))))) -(define-key special-event-map [drag-n-drop] - 'haiku-drag-and-drop) +(define-key special-event-map [drag-n-drop] 'haiku-drag-and-drop) (defvaralias 'haiku-use-system-tooltips 'use-system-tooltips) commit f91c9dd2b4e8156217b20f8658a2862e1009a27f Author: Po Lu Date: Fri Apr 29 11:52:22 2022 +0800 Remove some unneeded tests from the X double buffering code * src/xterm.c (x_flip_and_flush): Fix coding style. (flush_dirty_back_buffer_on): Avoid testing for impossible situations. diff --git a/src/xterm.c b/src/xterm.c index 98641d0241..cce586952a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5468,7 +5468,7 @@ x_flip_and_flush (struct frame *f) { block_input (); if (FRAME_X_NEED_BUFFER_FLIP (f)) - show_back_buffer (f); + show_back_buffer (f); x_flush (f); unblock_input (); } @@ -13673,12 +13673,9 @@ static void flush_dirty_back_buffer_on (struct frame *f) { block_input (); - if (FRAME_LIVE_P (f) && - FRAME_X_P (f) && - FRAME_X_WINDOW (f) && - !FRAME_GARBAGED_P (f) && - !buffer_flipping_blocked_p () && - FRAME_X_NEED_BUFFER_FLIP (f)) + if (!FRAME_GARBAGED_P (f) + && !buffer_flipping_blocked_p () + && FRAME_X_NEED_BUFFER_FLIP (f)) show_back_buffer (f); unblock_input (); } commit a431b449802918c88685af46d2f720204841ad19 Author: Po Lu Date: Fri Apr 29 09:35:58 2022 +0800 ; * src/xterm.c (x_connection_closed): Clean up compiler warning. diff --git a/src/xterm.c b/src/xterm.c index 35f6bc7fe8..98641d0241 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -20037,13 +20037,14 @@ static char *error_msg; static AVOID x_connection_closed (Display *dpy, const char *error_message, bool ioerror) { - struct x_display_info *dpyinfo = x_display_info_for_display (dpy); + struct x_display_info *dpyinfo; Lisp_Object frame, tail; specpdl_ref idx = SPECPDL_INDEX (); void *io_error_handler; xm_drop_start_message dmsg; struct frame *f; + dpyinfo = x_display_info_for_display (dpy); error_msg = alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); @@ -20104,6 +20105,7 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) } XSetIOErrorHandler (io_error_handler); + dpyinfo = x_display_info_for_display (dpy); x_dnd_last_seen_window = None; x_dnd_last_seen_toplevel = None; commit 24d01af3dde22ccd03b614d981129c6eacb0d56e Author: Po Lu Date: Fri Apr 29 09:27:51 2022 +0800 Cancel DND correctly during display disconnect on a different display * src/xterm.c (x_dnd_io_error_handler): New function. (x_connection_closed): Send the messages to cancel DND if a different display was disconnected. diff --git a/src/xterm.c b/src/xterm.c index c4e0305a6e..35f6bc7fe8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1005,6 +1005,10 @@ static int x_dnd_movement_x, x_dnd_movement_y; static unsigned int x_dnd_keyboard_state; #endif +/* jmp_buf that gets us out of the IO error handler if an error occurs + terminating DND as part of the display disconnect handler. */ +static jmp_buf x_dnd_disconnect_handler; + struct x_client_list_window { Window window; @@ -2571,8 +2575,17 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo) return 0; } -#define X_DND_SUPPORTED_VERSION 5 +static _Noreturn int +x_dnd_io_error_handler (Display *display) +{ +#ifdef USE_GTK + emacs_abort (); +#else + longjmp (x_dnd_disconnect_handler, 1); +#endif +} +#define X_DND_SUPPORTED_VERSION 5 static int x_dnd_get_window_proto (struct x_display_info *, Window); static Window x_dnd_get_window_proxy (struct x_display_info *, Window); @@ -20027,6 +20040,9 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) struct x_display_info *dpyinfo = x_display_info_for_display (dpy); Lisp_Object frame, tail; specpdl_ref idx = SPECPDL_INDEX (); + void *io_error_handler; + xm_drop_start_message dmsg; + struct frame *f; error_msg = alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); @@ -20034,16 +20050,61 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) /* Inhibit redisplay while frames are being deleted. */ specbind (Qinhibit_redisplay, Qt); - /* If drag-and-drop is in progress and the DND frame's display is - DPY, cancel drag-and-drop. Don't reset event masks or try to - send responses to other programs because the display is going + /* If drag-and-drop is in progress, cancel drag-and-drop. If DND + frame's display is DPY, don't reset event masks or try to send + responses to other programs because the display is going away. */ - if ((x_dnd_in_progress || x_dnd_waiting_for_finish) - && dpy == (x_dnd_waiting_for_finish - ? x_dnd_finish_display - : FRAME_X_DISPLAY (x_dnd_frame))) + if (x_dnd_in_progress || x_dnd_waiting_for_finish) { + /* Handle display disconnect errors here because this function + is not reentrant at this particular spot. */ + io_error_handler = XSetIOErrorHandler (x_dnd_io_error_handler); + + if (!sigsetjmp (x_dnd_disconnect_handler, 1) + && x_dnd_in_progress + && dpy != (x_dnd_waiting_for_finish + ? x_dnd_finish_display + : FRAME_X_DISPLAY (x_dnd_frame))) + { + /* Clean up drag and drop if the drag frame's display isn't + the one being disconnected. */ + f = x_dnd_frame; + + if (x_dnd_last_seen_window != None + && x_dnd_last_protocol_version != -1) + x_dnd_send_leave (x_dnd_frame, + x_dnd_last_seen_window); + else if (x_dnd_last_seen_window != None + && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) + && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE + && x_dnd_motif_setup_p) + { + dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR, + XM_DRAG_REASON_DROP_START); + dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST; + dmsg.timestamp = FRAME_DISPLAY_INFO (f)->last_user_time; + dmsg.side_effects + = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), + x_dnd_wanted_action), + XM_DROP_SITE_VALID, + xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), + x_dnd_wanted_action), + XM_DROP_ACTION_DROP_CANCEL); + dmsg.x = 0; + dmsg.y = 0; + dmsg.index_atom = FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection; + dmsg.source_window = FRAME_X_WINDOW (f); + + x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (f), f, + x_dnd_last_seen_window, 0); + xm_send_drop_message (FRAME_DISPLAY_INFO (f), FRAME_X_WINDOW (f), + x_dnd_last_seen_window, &dmsg); + } + } + + XSetIOErrorHandler (io_error_handler); + x_dnd_last_seen_window = None; x_dnd_last_seen_toplevel = None; x_dnd_in_progress = false; @@ -20234,6 +20295,7 @@ x_io_error_quitter (Display *display) DisplayString (display)); x_connection_closed (display, buf, true); } + /* Changing the font of the frame. */ commit bfcef4dd2b15154deaae1be465d3d879c4d15d3a Author: Po Lu Date: Fri Apr 29 08:43:27 2022 +0800 * src/xterm.c (XTflash): Check return value of pselect. diff --git a/src/xterm.c b/src/xterm.c index d774605832..c4e0305a6e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8848,7 +8848,7 @@ XTflash (struct frame *f) GC gc; XGCValues values; fd_set fds; - int fd; + int fd, rc; block_input (); @@ -8921,10 +8921,10 @@ XTflash (struct frame *f) FD_SET (fd, &fds); /* Try to wait that long--but we might wake up sooner. */ - pselect (fd + 1, &fds, NULL, NULL, &timeout, NULL); + rc = pselect (fd + 1, &fds, NULL, NULL, &timeout, NULL); /* Some input is available, exit the visible bell. */ - if (FD_ISSET (fd, &fds)) + if (rc >= 0 && FD_ISSET (fd, &fds)) break; } commit faa29fa2c9e9d5a5d7544a1a39b2a89cf57a8439 Author: Eugene Ha Date: Thu Apr 28 23:48:38 2022 +0200 Find libgccjit.dylib on Homebrew Macos * configure.ac: Also find libggcjit on Homebrew (bug#55173). Copyright-paperwork-exempt: yes diff --git a/configure.ac b/configure.ac index 7c8638a471..53e5779e2f 100644 --- a/configure.ac +++ b/configure.ac @@ -4126,7 +4126,7 @@ if test "${with_native_compilation}" != "no"; then MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \ grep libgccjit.h))" MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \ - grep libgccjit.so\$))" + grep -E 'libgccjit\.(so|dylib)$'))" fi fi commit fa1a7ac617619ef015e02e72950eef219ec62336 Author: Paul Eggert Date: Thu Apr 28 13:40:13 2022 -0700 Pacify byte compiler etc. on org-compat, org-macs Byte-compiler problem reported by Lars Ingebrigtsen in: https://lists.gnu.org/r/emacs-devel/2022-04/msg01256.html * lisp/org/org-compat.el (org-at-table.el-p): Now declared in org-table, not org. (org-string-collate-lessp): Define the ersatz org-string-collate-lessp with the same API as the primary form, to pacify check-declare-file when run on org-macs. * lisp/org/org-macs.el (org-time-convert-to-integer): Declare. diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 7ac07ce4f6..3e394fbab1 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -39,7 +39,7 @@ (declare-function org-calendar-goto-agenda "org-agenda" ()) (declare-function org-align-tags "org" (&optional all)) (declare-function org-at-heading-p "org" (&optional ignored)) -(declare-function org-at-table.el-p "org" ()) +(declare-function org-at-table.el-p "org-table" ()) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-context "org-element" (&optional element)) (declare-function org-element-lineage "org-element" (blob &optional types with-self)) @@ -238,7 +238,7 @@ This is a floating point number if the size is too large for an integer." (if (fboundp 'string-collate-lessp) (defalias 'org-string-collate-lessp 'string-collate-lessp) - (defun org-string-collate-lessp (s1 s2 &rest _) + (defun org-string-collate-lessp (s1 s2 &optional _ _) "Return non-nil if STRING1 is less than STRING2 in lexicographic order. Case is significant." (string< s1 s2))) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 92591b5bb7..bb0562dde0 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -37,6 +37,7 @@ (declare-function org-mode "org" ()) (declare-function org-show-context "org" (&optional key)) (declare-function org-string-collate-lessp "org-compat" (s1 s2 &optional locale ignore-case)) +(declare-function org-time-convert-to-integer "org-compat" (time)) (defvar org-ts-regexp0) (defvar ffap-url-regexp) commit 083d2708f9ec7f09712488a99fc9eedd3d594ff6 Author: Paul Eggert Date: Thu Apr 28 12:50:39 2022 -0700 Change current-time back to list form Change current-time and related functions back to using the traditional list form. Also, add a new boolean variable current-time-list that lets people try out (TICKS . HZ) form, with the goal of smoothing the transition. * src/timefns.c (CURRENT_TIME_LIST): Change default back to true. (current-time-list): New boolean Lisp variable, which defaults to CURRENT_TIME_LIST. All uses of CURRENT_TIME_LIST changed to use current_time_list, and all documentation changed. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index afaed10cdf..049c8a65a8 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -15343,9 +15343,12 @@ nil 100 @end group @group -(1351051674579989697 . 1000000000) -(1173477761000000000 . 1000000000) -(1351050967734791805 . 1000000000) +(20615 27034 579989 697000) +(17905 55681 0 0) +(20615 26327 734791 805000)@footnote{If @code{current-time-list} is +@code{nil} the three timestamps are @code{(1351051674579989697 +. 1000000000)}, @code{(1173477761000000000 . 1000000000)}, and +@code{(1351050967734791805 . 1000000000)}, respectively.} 13188 "-rw-r--r--" @end group diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 4394f64a32..75905658e6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1423,9 +1423,9 @@ For example, here are the file attributes for @file{files.texi}: @group (file-attributes "files.texi" 'string) @result{} (nil 1 "lh" "users" - (1351023123050040152 . 1000000000) - (1310720023000000000 . 1000000000) - (1351023659902289872 . 1000000000) + (20614 64019 50040 152000) + (20000 23 0 0) + (20614 64555 902289 872000) 122295 "-rw-rw-rw-" t 6473924464520138 1014478468) @@ -1449,14 +1449,20 @@ is owned by the user with name @samp{lh}. @item "users" is in the group with name @samp{users}. -@item (1351023123050040152 . 1000000000) -was last accessed on October 23, 2012, at 20:12:03.050040152 UTC. +@item (20614 64019 50040 152000) +was last accessed on October 23, 2012, at 20:12:03.050040152 UTC@. +(This timestamp is @code{(1351023123050040152 . 1000000000)} +if @code{current-time-list} is @code{nil}.) -@item (1310720023000000000 . 1000000000) -was last modified on July 15, 2001, at 08:53:43.000000000 UTC. +@item (20000 23 0 0) +was last modified on July 15, 2001, at 08:53:43.000000000 UTC@. +(This timestamp is @code{(1310720023000000000 . 1000000000)} +if @code{current-time-list} is @code{nil}.) -@item (1351023659902289872 . 1000000000) -last had its status changed on October 23, 2012, at 20:20:59.902289872 UTC. +@item (20614 64555 902289 872000) +last had its status changed on October 23, 2012, at 20:20:59.902289872 UTC@. +(This timestamp is @code{(1351023659902289872 . 1000000000)} +if @code{current-time-list} is @code{nil}.) @item 122295 is 122295 bytes long. (It may not contain 122295 characters, though, diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index d1a3fef7a4..975215d697 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi @@ -503,9 +503,11 @@ if the information is not available. @example @group emacs-build-time - @result{} (1650228902637038831 . 1000000000) + @result{} (25194 55894 8547 617000) @end group @end example +(This timestamp is @code{(1651169878008547617 . 1000000000)} +if @code{current-time-list} was @code{nil} when Emacs was built.) @end defvar @defvar emacs-version diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 89ddf164a1..20b6c1cec6 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1359,6 +1359,10 @@ This represents the number of seconds using the formula: @tex $high \times 2^{16} + low + micro \times 10^{-6} + pico \times 10^{-12}$. @end tex +If @code{current-time-list} is @code{t}, +some functions may default to returning two- or +three-element lists, with omitted @var{micro} and @var{pico} +components defaulting to zero. On all current machines @var{pico} is a multiple of 1000, but this may change as higher-resolution clocks become available. @end itemize @@ -1410,15 +1414,28 @@ The operating system limits the range of time and zone values. @end example @end defun +@defvar current-time-list +This boolean variable is a transition aid. If @code{t}, +@code{current-time} and related functions return timestamps in list +form, typically @code{(@var{high} @var{low} @var{micro} @var{pico})}; +otherwise, they use @code{(@var{ticks} . @var{hz})} form. Currently +this variable defaults to @code{t}, for behavior compatible with +previous Emacs versions. Developers are encourage to test +timestamp-related code with this variable set to @code{nil}, as it +will default to @code{nil} in a future Emacs version, and will be +removed in some version after that. +@end defvar + @defun current-time This function returns the current time as a Lisp timestamp. -The timestamp has the form @code{(@var{ticks} . @var{hz})} where +If @code{current-time-list} is @code{nil}, +the timestamp has the form @code{(@var{ticks} . @var{hz})} where @var{ticks} counts clock ticks and @var{hz} is the clock ticks per second. - -In Emacs 28 and earlier, the returned timestamp had the list form -@code{(@var{high} @var{low} @var{usec} @var{psec})}. You can use -@code{(time-convert nil 'list)} to return the current time in this -older form. @xref{Time Conversion}. +Otherwise, the timestamp has the list form +@code{(@var{high} @var{low} @var{usec} @var{psec})}. +You can use @code{(time-convert nil t)} or @code{(time-convert nil 'list)} +to obtain a particular form regardless of the value of +@code{current-time-list}. @xref{Time Conversion}. @end defun @defun float-time &optional time diff --git a/etc/NEWS b/etc/NEWS index 70087f2629..9f93c4067f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -203,12 +203,15 @@ use the new 'tamil-itrans-digits' and 'tamil-inscript-digits' input methods instead. +++ -** current-time and related functions now yield (TICKS . HZ) timestamps. -Previously they yielded timestamps of the forms (HI LO US PS), (HI LO -US) or (HI LO), which were less regular and less efficient and which -lacked information about clock resolution. This long-planned change -was documented in Emacs 27. To convert a timestamp X to the old -4-element list form, you can use (time-convert X 'list). +** New variable current-time-list governing default timestamp form. +Functions like current-time now yield (TICKS . HZ) timestamps if this +new variable is nil. The variable defaults to t, which means these +functions default to timestamps of the forms (HI LO US PS), (HI LO US) +or (HI LO), which are less regular and less efficient. This is part +of a long-planned change first documented in Emacs 27. Developers are +encourage to test timestamp-related code with this variable set to +nil, as it will default to nil in a future Emacs version and will be +removed some time after that. * Changes in Emacs 29.1 diff --git a/src/timefns.c b/src/timefns.c index 651e0760e8..bca9a566e0 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -69,11 +69,11 @@ enum { TM_YEAR_BASE = 1900 }; # define FASTER_TIMEFNS 1 #endif -/* current-time etc. generate (TICKS . HZ) timestamps. - To change that to the old 4-element list format (HI LO US PS), - compile with -DCURRENT_TIME_LIST=1. */ +/* current-time-list defaults to t, typically generating (HI LO US PS) + timestamps. To change the default to nil, generating (TICKS . HZ) + timestamps, compile with -DCURRENT_TIME_LIST=0. */ #ifndef CURRENT_TIME_LIST -enum { CURRENT_TIME_LIST = false }; +enum { CURRENT_TIME_LIST = true }; #endif #if FIXNUM_OVERFLOW_P (1000000000) @@ -568,7 +568,7 @@ lisp_time_seconds (struct lisp_time t) Lisp_Object make_lisp_time (struct timespec t) { - if (CURRENT_TIME_LIST) + if (current_time_list) { time_t s = t.tv_sec; int ns = t.tv_nsec; @@ -1171,13 +1171,13 @@ time_arith (Lisp_Object a, Lisp_Object b, bool subtract) } /* Return an integer if the timestamp resolution is 1, - otherwise the (TICKS . HZ) form if !CURRENT_TIME_LIST or if + otherwise the (TICKS . HZ) form if !current_time_list or if either input used (TICKS . HZ) form or the result can't be expressed exactly in (HI LO US PS) form, otherwise the (HI LO US PS) form for backward compatibility. */ return (EQ (hz, make_fixnum (1)) ? ticks - : (!CURRENT_TIME_LIST + : (!current_time_list || aform == TIMEFORM_TICKS_HZ || bform == TIMEFORM_TICKS_HZ || !trillion_factor (hz)) @@ -1716,7 +1716,7 @@ usage: (encode-time TIME &rest OBSOLESCENT-ARGUMENTS) */) time_error (mktime_errno); if (EQ (hz, make_fixnum (1))) - return (CURRENT_TIME_LIST + return (current_time_list ? list2 (hi_time (value), lo_time (value)) : INT_TO_INTEGER (value)); else @@ -1747,7 +1747,7 @@ bits, and USEC and PSEC are the microsecond and picosecond counts. */) struct lisp_time t; enum timeform input_form = decode_lisp_time (time, false, &t, 0); if (NILP (form)) - form = CURRENT_TIME_LIST ? Qlist : Qt; + form = current_time_list ? Qlist : Qt; if (EQ (form, Qlist)) return ticks_hz_list4 (t.ticks, t.hz); if (EQ (form, Qinteger)) @@ -1762,14 +1762,15 @@ bits, and USEC and PSEC are the microsecond and picosecond counts. */) DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00. -The time is returned as a pair of integers (TICKS . HZ), where TICKS -counts clock ticks and HZ is the clock ticks per second. - -In Emacs 28 and earlier, the returned timestamp had the form (HIGH LOW -USEC PSEC), where HIGH is the most significant bits of the seconds, -LOW the least significant 16 bits, and USEC and PSEC are the -microsecond and picosecond counts. Use \(time-convert nil \\='list) -if you need this older timestamp form. */) +If the variable `current-time-list' is nil, the time is returned as a +pair of integers (TICKS . HZ), where TICKS counts clock ticks and HZ +is the clock ticks per second. Otherwise, the time is returned as a +list of integers (HIGH LOW USEC PSEC) where HIGH has the most +significant bits of the seconds, LOW has the least significant 16 +bits, and USEC and PSEC are the microsecond and picosecond counts. + +You can use `time-convert' to get a particular timestamp form +regardless of the value of `current-time-list'. */) (void) { return make_lisp_time (current_timespec ()); @@ -2025,6 +2026,19 @@ syms_of_timefns (void) DEFSYM (Qencode_time, "encode-time"); + DEFVAR_BOOL ("current-time-list", current_time_list, + doc: /* Whether `current-time' should return list or (TICKS . HZ) form. + +This boolean variable is a transition aid. If t, `current-time' and +related functions return timestamps in list form, typically +\(HIGH LOW USEC PSEC); otherwise, they use (TICKS . HZ) form. +Currently this variable defaults to t, for behavior compatible with +previous Emacs versions. Developers are encourage to test +timestamp-related code with this variable set to nil, as it will +default to nil in a future Emacs version, and will be removed in some +version after that. */); + current_time_list = CURRENT_TIME_LIST; + defsubr (&Scurrent_time); #ifdef CLOCKS_PER_SEC defsubr (&Scurrent_cpu_time); commit a41a181db5f3aca043ed42b228dc56a6403c21a5 Author: Paul Eggert Date: Thu Apr 28 10:51:01 2022 -0700 Document \807 etc. in raw byte display * doc/emacs/display.texi (Display Custom): Mention potential confusion in raw byte display. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 2ac0dca622..7a6c7f391b 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -2097,3 +2097,14 @@ argument to suppress the effect of bold-face in this case. byte with a decimal value of 128 is displayed as @code{\200}. To change display to the hexadecimal format of @code{\x80}, set the variable @code{display-raw-bytes-as-hex} to @code{t}. +Care may be needed when interpreting a raw byte when copying +text from a terminal containing an Emacs session, or when a terminal's +@code{escape-glyph} face looks like the default face. For example, by +default Emacs displays the four characters @samp{\}, @samp{2}, +@samp{0}, @samp{0} with the same characters it displays a byte with +decimal value 128. The problem can be worse with hex displays, where +the raw byte 128 followed by the character @samp{7} is displayed as +@code{\x807}, which Emacs Lisp reads as the single character U+0807 +SAMARITAN LETTER IT; this confusion does not occur with the +corresponding octal display @code{\2007} because octal escapes contain +at most three digits. commit 75366be2c0aa877eb6acf1b8a1c5312d6504caa9 Author: Lars Ingebrigtsen Date: Thu Apr 28 18:36:59 2022 +0200 Kill off more Gnus buffers on Gnus exit * lisp/gnus/gnus.el (gnus-kill-buffer): Make into function; there's no reason this should be a macro. * lisp/gnus/nntp.el (nntp-make-process-buffer): Ensure that we kill these buffers on Gnus exit (bug#55167). diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 4754a14147..1f673771fa 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -662,12 +662,11 @@ be used directly.") (gnus-prune-buffers) (cl-pushnew (current-buffer) gnus-buffers)) -(defmacro gnus-kill-buffer (buffer) +(defun gnus-kill-buffer (buffer) "Kill BUFFER and remove from the list of Gnus buffers." - `(let ((buf ,buffer)) - (when (gnus-buffer-live-p buf) - (kill-buffer buf) - (gnus-prune-buffers)))) + (when (gnus-buffer-live-p buffer) + (kill-buffer buffer) + (gnus-prune-buffers))) (defun gnus-buffers () "Return a list of live Gnus buffers." diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 0dcff9743a..f047c83293 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1225,6 +1225,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the (generate-new-buffer (format " *server %s %s %s*" nntp-address nntp-port-number buffer)) + (gnus-add-buffer) (mm-disable-multibyte) (setq-local after-change-functions nil nntp-process-wait-for nil commit 9b762c35a1b87d0941ea1d7b09f37e4e397763f8 Author: Sam Steingold Date: Thu Apr 28 11:35:51 2022 -0400 Add Sefirot to Omer counting * lisp/calendar/cal-hebrew.el (diary-hebrew-omer-sefirot): New variable. (diary-hebrew-omer): Use it to show the sefirot. diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index 61ce029e07..1c08de53fb 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -798,6 +798,10 @@ In this case, the following civil date corresponds to the Hebrew birthday." (diary-ordinal-suffix age) (if (= b-date d) "" " (evening)"))))) +(defvar diary-hebrew-omer-sefirot + ["Hesed" "Gevurah" "Tiferet" "Netzach" "Hod" "Yesod" "Malchut"] + "The order of Sefirot for counting the Omer. +See https://opensiddur.org/prayers/solilunar/solar-cycles/sefirat-haomer/the-order-of-counting-the-omer-in-the-spring/") ;;;###diary-autoload (defun diary-hebrew-omer (&optional mark) "Omer count diary entry. @@ -813,7 +817,7 @@ use when highlighting the day in the calendar." (day (% omer 7))) (if (and (> omer 0) (< omer 50)) (cons mark - (format "Day %d%s of the omer (until sunset)" + (format "Day %d%s of the omer (until sunset) %s she'be'%s" omer (if (zerop week) "" @@ -823,7 +827,10 @@ use when highlighting the day in the calendar." (if (zerop day) "" (format " and %d day%s" - day (if (= day 1) "" "s")))))))))) + day (if (= day 1) "" "s"))))) + (aref diary-hebrew-omer-sefirot (% (+ 6 day) 7)) + (aref diary-hebrew-omer-sefirot + (+ (if (zerop day) -1 0) week))))))) (autoload 'diary-make-date "diary-lib") commit b8f4a1e0edc3cdeb1fa2c44cb97e4b8e12233378 Author: Eli Zaretskii Date: Thu Apr 28 18:41:53 2022 +0300 ; * lisp/progmodes/xref.el (xref-query-replace-in-results): Fix last change. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 8d0ad836ef..43ab703da2 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -750,13 +750,12 @@ references displayed in the current *xref* buffer. When called interactively, it uses '.*' as FROM, which means replace the whole name. Unless called with prefix argument, in -which case the user is prompted for both FROM and TO." +which case the user is prompted for both FROM and TO. As each match is found, the user must type a character saying what to do with it. Type SPC or `y' to replace the match, DEL or `n' to skip and go to the next match. For more directions, -type \\[help-command] at that time. -" +type \\[help-command] at that time." (interactive (let* ((fr (if current-prefix-arg commit b3023de5431fc308e2a6db61ed4fdd18db785324 Merge: 904aaabb05 3b6338c8c3 Author: Eli Zaretskii Date: Thu Apr 28 18:37:34 2022 +0300 Merge from origin/emacs-28 # Conflicts: # lisp/progmodes/xref.el commit 904aaabb0516b98b6195b3e8a37ea85d50a8d185 Merge: 99559be8ca 4d4f5640ef Author: Eli Zaretskii Date: Thu Apr 28 18:36:15 2022 +0300 ; Merge from origin/emacs-28 The following commit was skipped: 4d4f564 Fix customization-group of 'python-forward-sexp-function' commit 99559be8ca809dcc3ba85a4a25ff1b9734c885c6 Author: Stefan Kangas Date: Thu Apr 28 17:01:20 2022 +0200 Add tests for image-supported-file-p * test/lisp/image-tests.el (image-type-from-file-name): Suppress obsoletion warnings for test. (image-supported-file-p/built-in) (image-supported-file-p/optional) (image-supported-file-p/unsupported-returns-nil): New tests. diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index 2b3e818d72..908df09f15 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -74,6 +74,18 @@ (should (listp (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center))))) (should-not (find-image '((:type png :file "does-not-exist-foo-bar.png"))))) +(ert-deftest image-supported-file-p/built-in () + ;; (skip-unless (image-type-available-p 'pbm)) ; always built-in + (should (eq (image-supported-file-p "foo.pbm") 'pbm))) + +(ert-deftest image-supported-file-p/optional () + (if (image-type-available-p 'jpeg) + (should (eq (image-supported-file-p "foo.jpg") 'jpeg)) + (should-not (image-supported-file-p "foo.jpg")))) + +(ert-deftest image-supported-file-p/unsupported-returns-nil () + (should-not (image-supported-file-p "foo.some-unsupported-format"))) + (ert-deftest image-type-from-file-name () (with-suppressed-warnings ((obsolete image-type-from-file-name)) (should (eq (image-type-from-file-name "foo.jpg") 'jpeg)) commit 8898e4d4dd055d344b2728fe56cf601ba033cfb7 Author: Stefan Kangas Date: Thu Mar 24 09:55:10 2022 +0100 * lisp/finder.el (finder-mode-map): Use defvar-keymap. diff --git a/lisp/finder.el b/lisp/finder.el index 899e829296..a2a27ea061 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -1,7 +1,6 @@ ;;; finder.el --- topic & keyword-based code finder -*- lexical-binding: t -*- -;; Copyright (C) 1992, 1997-1999, 2001-2022 Free Software Foundation, -;; Inc. +;; Copyright (C) 1992-2022 Free Software Foundation, Inc. ;; Author: Eric S. Raymond ;; Created: 16 Jun 1992 @@ -76,20 +75,18 @@ "Association list of the standard \"Keywords:\" headers. Each element has the form (KEYWORD . DESCRIPTION).") -(defvar finder-mode-map - (let ((map (make-sparse-keymap))) - (define-key map " " 'finder-select) - (define-key map "f" 'finder-select) - (define-key map [follow-link] 'mouse-face) - (define-key map [mouse-2] 'finder-mouse-select) - (define-key map "\C-m" 'finder-select) - (define-key map "?" 'finder-summary) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "q" 'finder-exit) - (define-key map "d" 'finder-list-keywords) - map) - "Keymap used in `finder-mode'.") +(defvar-keymap finder-mode-map + :doc "Keymap used in `finder-mode'." + "SPC" #'finder-select + "f" #'finder-select + "" 'mouse-face + "" #'finder-mouse-select + "C-m" #'finder-select + "?" #'finder-summary + "n" #'next-line + "p" #'previous-line + "q" #'finder-exit + "d" #'finder-list-keywords) (easy-menu-define finder-mode-menu finder-mode-map "Menu for `finder-mode'." commit 3b6338c8c351cce721f2f1aa115cadc401179d5c (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Thu Apr 28 17:53:36 2022 +0300 Improve documentation of font- and face-related attribute functions * lisp/faces.el (face-attribute): * src/xfaces.c (Fx_family_fonts): * src/font.c (Ffont_get, Ffont_put): Improve and clarify the doc strings. * doc/lispref/display.texi (Low-Level Font): Document the :type attribute of a font. Improve documentation of 'font-get' and 'font-put'. (Attribute Functions): Add cross-reference to the description of face attributes. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index b68d3d1c0c..d9e93160ea 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2818,7 +2818,8 @@ modifying the attributes of a named face. @defun face-attribute face attribute &optional frame inherit This function returns the value of the @var{attribute} attribute for -@var{face} on @var{frame}. +@var{face} on @var{frame}. @xref{Face Attributes}, for the supported +attributes. If @var{frame} is omitted or @code{nil}, that means the selected frame (@pxref{Input Focus}). If @var{frame} is @code{t}, this function @@ -2901,7 +2902,8 @@ for all frames. This function is mostly intended for internal usage. @defun set-face-attribute face frame &rest arguments This function sets one or more attributes of @var{face} for @var{frame}. The attributes specified in this way override the face -spec(s) belonging to @var{face}. +spec(s) belonging to @var{face}. @xref{Face Attributes}, for the +supported attributes. The extra arguments @var{arguments} specify the attributes to set, and the values for them. They should consist of alternating attribute @@ -3865,12 +3867,22 @@ symbols, or @code{nil} if none is required. If @code{gsub} or @code{gpos} is a list, a @code{nil} element in that list means that the font must not match any of the remaining tag symbols. The @code{gpos} element may be omitted. + +@item :type +@cindex font backend +The symbol that specifies the @dfn{font backend} used to draw the +characters. The possible values depend on the platform and on how +Emacs was configured at build time. Typical values include +@code{ftcrhb} and @code{xfthb} on X, @code{harfbuzz} on MS-Windows, +@code{ns} on GNUstep, etc. It can also be @code{nil} if left +unspecified, typically in a font-spec. @end table @end defun @defun font-put font-spec property value Set the font property @var{property} in the font-spec @var{font-spec} -to @var{value}. +to @var{value}. The @var{property} can any of the ones described +above. @end defun @cindex font entity @@ -3914,12 +3926,28 @@ object, a font entity, or a font spec. @defun font-get font property This function returns the value of the font property @var{property} -for @var{font}. +for @var{font}. The @var{property} can any of the ones that +@code{font-spec} supports. If @var{font} is a font spec and the font spec does not specify @var{property}, the return value is @code{nil}. If @var{font} is a font object or font entity, the value for the @var{:script} property -may be a list of scripts supported by the font. +may be a list of scripts supported by the font, and the value of the +@code{:otf} property is a cons of the form @w{@code{(@var{gsub} +. @var{gpos})}}, where @var{gsub} and @var{gpos} are lists +representing OpenType features supported by the font, of the form + +@smallexample +((@var{script-tag} (@var{langsys-tag} @var{feature}@dots{}) @dots{}) @dots{}) +@end smallexample + +@noindent where @var{script-tag}, @var{langsys-tag}, and @var{feature} +are symbols representing OpenType layout tags. + +If @var{font} is a font object, the special property +@code{:combining-capability} is non-@code{nil} if the font backend of +@var{font} supports rendering of combining characters for non-OpenType +fonts. @end defun @defun font-face-attributes font &optional frame diff --git a/lisp/faces.el b/lisp/faces.el index 1d21a21622..3bd1e5db6f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -448,6 +448,10 @@ of FACE on FRAME." (defun face-attribute (face attribute &optional frame inherit) "Return the value of FACE's ATTRIBUTE on FRAME. + +See `set-face-attribute' for the list of supported attributes +and their meanings and allowed values. + If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame. diff --git a/src/font.c b/src/font.c index 56a921da94..dcbcbc46be 100644 --- a/src/font.c +++ b/src/font.c @@ -4199,26 +4199,33 @@ merge_font_spec (Lisp_Object from, Lisp_Object to) DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0, doc: /* Return the value of FONT's property KEY. FONT is a font-spec, a font-entity, or a font-object. -KEY is any symbol, but these are reserved for specific meanings: - :family, :weight, :slant, :width, :foundry, :adstyle, :registry, - :size, :name, :script, :otf +KEY can be any symbol, but these are reserved for specific meanings: + :foundry, :family, :adstyle, :registry, :weight, :slant, :width, + :size, :dpi, :spacing, :avgwidth, :script, :lang, :otf See the documentation of `font-spec' for their meanings. -In addition, if FONT is a font-entity or a font-object, values of -:script and :otf are different from those of a font-spec as below: -The value of :script may be a list of scripts that are supported by the font. +If FONT is a font-entity or a font-object, then values of +:script and :otf properties are different from those of a font-spec +as below: -The value of :otf is a cons (GSUB . GPOS) where GSUB and GPOS are lists -representing the OpenType features supported by the font by this form: - ((SCRIPT (LANGSYS FEATURE ...) ...) ...) -SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType -Layout tags. + The value of :script may be a list of scripts that are supported by + the font. + + The value of :otf is a cons (GSUB . GPOS) where GSUB and GPOS are + lists representing the OpenType features supported by the font, of + this form: ((SCRIPT (LANGSYS FEATURE ...) ...) ...), where + SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType + Layout tags. See `otf-script-alist' for the OpenType script tags. In addition to the keys listed above, the following keys are reserved for the specific meanings as below: -The value of :combining-capability is non-nil if the font-backend of -FONT supports rendering of combining characters for non-OTF fonts. */) + The value of :type is a symbol that identifies the font backend to be + used, such as `ftcrhb' or `xfthb' on X , `harfbuzz' or `uniscribe' on + MS-Windows, `ns' on Cocoa/GNUstep, etc. + + The value of :combining-capability is non-nil if the font-backend of + FONT supports rendering of combining characters for non-OTF fonts. */) (Lisp_Object font, Lisp_Object key) { int idx; @@ -4346,7 +4353,9 @@ accepted by the function `font-spec' (which see), VAL must be what allowed in `font-spec'. If FONT is a font-entity or a font-object, KEY must not be the one -accepted by `font-spec'. */) +accepted by `font-spec'. + +See also `font-get' for KEYs that have special meanings. */) (Lisp_Object font, Lisp_Object prop, Lisp_Object val) { int idx; diff --git a/src/xfaces.c b/src/xfaces.c index f7ee19195f..22bd5a81b5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1463,9 +1463,9 @@ enum xlfd_swidth }; /* Order by which font selection chooses fonts. The default values - mean `first, find a best match for the font width, then for the - font height, then for weight, then for slant.' This variable can be - set via set-face-font-sort-order. */ + mean "first, find a best match for the font width, then for the + font height, then for weight, then for slant." This variable can be + set via 'internal-set-font-selection-order'. */ static int font_sort_order[4]; @@ -1516,16 +1516,22 @@ If FAMILY is omitted or nil, list all families. Otherwise, FAMILY must be a string, possibly containing wildcards `?' and `*'. If FRAME is omitted or nil, use the selected frame. + Each element of the result is a vector [FAMILY WIDTH POINT-SIZE WEIGHT SLANT FIXED-P FULL REGISTRY-AND-ENCODING]. -FAMILY is the font family name. POINT-SIZE is the size of the -font in 1/10 pt. WIDTH, WEIGHT, and SLANT are symbols describing the -width, weight and slant of the font. These symbols are the same as for -face attributes. FIXED-P is non-nil if the font is fixed-pitch. -FULL is the full name of the font, and REGISTRY-AND-ENCODING is a string -giving the registry and encoding of the font. -The result list is sorted according to the current setting of -the face font sort order. */) + +FAMILY is the font family name. +POINT-SIZE is the size of the font in 1/10 pt. +WIDTH, WEIGHT, and SLANT are symbols describing the width, weight + and slant of the font. These symbols are the same as for face + attributes, see `set-face-attribute'. +FIXED-P is non-nil if the font is fixed-pitch. +FULL is the full name of the font. +REGISTRY-AND-ENCODING is a string giving the registry and encoding of + the font. + +The resulting list is sorted according to the current setting of +the face font sort order, see `face-font-selection-order'. */) (Lisp_Object family, Lisp_Object frame) { Lisp_Object font_spec, list, *drivers, vec; commit 799c7e277fc6a37bd8b86fea7494ff6df63f3eb1 Author: Stefan Monnier Date: Thu Apr 28 09:38:58 2022 -0400 * lisp/emacs-lisp/nadvice.el: Fix bug#55149 diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index b3778c07bc..b20415a2d3 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -71,7 +71,7 @@ (advice--make-how-alist (:around (apply car cdr r)) (:before (apply car r) (apply cdr r)) - (:after (apply cdr r) (apply car r)) + (:after (prog1 (apply cdr r) (apply car r))) (:override (apply car r)) (:after-until (or (apply cdr r) (apply car r))) (:after-while (and (apply cdr r) (apply car r))) commit 5d032f2904d4604110e24eb3ae0daf8f7701d72f Author: Lars Ingebrigtsen Date: Thu Apr 28 14:58:20 2022 +0200 Allow inserting and selecting binary blobs from sqlite * doc/lispref/text.texi (Database): Document how to insert binary data. * src/sqlite.c (bind_values): Bind BLOB columns correctly (bug#54591). diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index ca6a483c54..a1db715db6 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5309,6 +5309,24 @@ interpolation). @code{sqlite-execute} returns the number of affected rows. For instance, an @samp{insert} statement will return @samp{1}, whereas an @samp{update} statement may return zero or a higher number. + +Strings in SQLite are, by default, stored as @code{utf-8}, and +selecting a text column will decode the string using that charset. +Selecting a blob column will return the raw data without any decoding +(i.e., it will return a unibyte string containing the bytes as stored +in the database). Inserting binary data into blob columns, however, +requires some care, as @code{sqlite-execute} will, by default, +interpret all strings as @code{utf-8}. + +So if you have, for instance, @acronym{GIF} data in a unibyte string +called @var{gif}, you have to mark it specially to let +@code{sqlite-execute} know this: + +@lisp +(put-text-property 0 1 'coding-system 'binary gif) +(sqlite-execute db "insert into foo values (?, ?)" (list gif 2)) +@end lisp + @end defun @defun sqlite-select db query &optional values result-type diff --git a/src/sqlite.c b/src/sqlite.c index 7388b576e9..75a3b2ea32 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -43,6 +43,8 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_open_v2, DEF_DLL_FN (SQLITE_API int, sqlite3_reset, (sqlite3_stmt*)); DEF_DLL_FN (SQLITE_API int, sqlite3_bind_text, (sqlite3_stmt*, int, const char*, int, void(*)(void*))); +DEF_DLL_FN (SQLITE_API int, sqlite3_bind_blob, + (sqlite3_stmt*, int, const char*, int, void(*)(void*))); DEF_DLL_FN (SQLITE_API int, sqlite3_bind_int64, (sqlite3_stmt*, int, sqlite3_int64)); DEF_DLL_FN (SQLITE_API int, sqlite3_bind_double, (sqlite3_stmt*, int, double)); @@ -80,6 +82,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension, # undef sqlite3_open_v2 # undef sqlite3_reset # undef sqlite3_bind_text +# undef sqlite3_bind_blob # undef sqlite3_bind_int64 # undef sqlite3_bind_double # undef sqlite3_bind_null @@ -103,6 +106,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension, # define sqlite3_open_v2 fn_sqlite3_open_v2 # define sqlite3_reset fn_sqlite3_reset # define sqlite3_bind_text fn_sqlite3_bind_text +# define sqlite3_bind_blob fn_sqlite3_bind_blob # define sqlite3_bind_int64 fn_sqlite3_bind_int64 # define sqlite3_bind_double fn_sqlite3_bind_double # define sqlite3_bind_null fn_sqlite3_bind_null @@ -129,6 +133,7 @@ load_dll_functions (HMODULE library) LOAD_DLL_FN (library, sqlite3_open_v2); LOAD_DLL_FN (library, sqlite3_reset); LOAD_DLL_FN (library, sqlite3_bind_text); + LOAD_DLL_FN (library, sqlite3_bind_blob); LOAD_DLL_FN (library, sqlite3_bind_int64); LOAD_DLL_FN (library, sqlite3_bind_double); LOAD_DLL_FN (library, sqlite3_bind_null); @@ -309,10 +314,37 @@ bind_values (sqlite3 *db, sqlite3_stmt *stmt, Lisp_Object values) if (EQ (type, Qstring)) { - Lisp_Object encoded = encode_string (value); - ret = sqlite3_bind_text (stmt, i + 1, - SSDATA (encoded), SBYTES (encoded), - NULL); + Lisp_Object encoded; + bool blob = false; + + if (SBYTES (value) == 0) + encoded = value; + else + { + Lisp_Object coding_system = + Fget_text_property (make_fixnum (0), Qcoding_system, value); + if (NILP (coding_system)) + /* Default to utf-8. */ + encoded = encode_string (value); + else if (EQ (coding_system, Qbinary)) + blob = true; + else + encoded = Fencode_coding_string (value, coding_system, + Qnil, Qnil); + } + + if (blob) + { + if (SBYTES (value) != SCHARS (value)) + xsignal1 (Qerror, build_string ("BLOB values must be unibyte")); + ret = sqlite3_bind_blob (stmt, i + 1, + SSDATA (value), SBYTES (value), + NULL); + } + else + ret = sqlite3_bind_text (stmt, i + 1, + SSDATA (encoded), SBYTES (encoded), + NULL); } else if (EQ (type, Qinteger)) { @@ -426,11 +458,8 @@ row_to_value (sqlite3_stmt *stmt) break; case SQLITE_BLOB: - v = - code_convert_string_norecord - (make_unibyte_string (sqlite3_column_blob (stmt, i), - sqlite3_column_bytes (stmt, i)), - Qutf_8, false); + v = make_unibyte_string (sqlite3_column_blob (stmt, i), + sqlite3_column_bytes (stmt, i)); break; case SQLITE_NULL: @@ -748,4 +777,6 @@ syms_of_sqlite (void) DEFSYM (Qfalse, "false"); DEFSYM (Qsqlite, "sqlite"); DEFSYM (Qsqlite3, "sqlite3"); + DEFSYM (Qbinary, "binary"); + DEFSYM (Qcoding_system, "coding-system"); } diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el index 6e44300f3a..5af4392301 100644 --- a/test/src/sqlite-tests.el +++ b/test/src/sqlite-tests.el @@ -216,4 +216,29 @@ db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") '(nil t))))) +(ert-deftest sqlite-blob () + (skip-unless (sqlite-available-p)) + (let (db) + (progn + (setq db (sqlite-open)) + (sqlite-execute + db "create table if not exists test10 (col1 text, col2 blob, col3 numbre)") + (let ((string (with-temp-buffer + (set-buffer-multibyte nil) + (insert 0 1 2) + (buffer-string)))) + (should-not (multibyte-string-p string)) + (sqlite-execute + db "insert into test10 values (?, ?, 1)" + (list string + (propertize string + 'coding-system 'binary))) + (cl-destructuring-bind + (c1 c2 _) + (car (sqlite-select db "select * from test10 where col3 = 1")) + (should (equal c1 string)) + (should (equal c2 string)) + (should (multibyte-string-p c1)) + (should-not (multibyte-string-p c2))))))) + ;;; sqlite-tests.el ends here commit 613aa1894500f4c707078e71b497662e91f3f6f3 Author: Po Lu Date: Thu Apr 28 12:50:47 2022 +0000 Simplify buffer flipping code on Haiku * src/haikuterm.c (flush_dirty_back_buffers): Delete function. (haiku_flush_dirty_back_buffer_on): New function. (haiku_read_socket): Use that instead of looping over each frame at the end. diff --git a/src/haikuterm.c b/src/haikuterm.c index 5d5e48c391..393d359b66 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2781,22 +2781,12 @@ haiku_make_fullscreen_consistent (struct frame *f) } static void -flush_dirty_back_buffers (void) +haiku_flush_dirty_back_buffer_on (struct frame *f) { - block_input (); - Lisp_Object tail, frame; - FOR_EACH_FRAME (tail, frame) - { - struct frame *f = XFRAME (frame); - if (FRAME_LIVE_P (f) && - FRAME_HAIKU_P (f) && - FRAME_HAIKU_WINDOW (f) && - !FRAME_GARBAGED_P (f) && - !buffer_flipping_blocked_p () && - FRAME_DIRTY_P (f)) - haiku_flip_buffers (f); - } - unblock_input (); + if (!FRAME_GARBAGED_P (f) + && !buffer_flipping_blocked_p () + && FRAME_DIRTY_P (f)) + haiku_flip_buffers (f); } /* N.B. that support for TYPE must be explictly added to @@ -2840,12 +2830,11 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) static void *buf; ssize_t b_size; struct unhandled_event *unhandled_events = NULL; - int button_or_motion_p, need_flush, do_help; + int button_or_motion_p, do_help; enum haiku_event_type type; struct input_event inev, inev2; message_count = 0; - need_flush = 0; button_or_motion_p = 0; do_help = 0; buf = NULL; @@ -2954,7 +2943,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = true; - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); } inev.code = b->keysym ? b->keysym : b->multibyte_char; @@ -3046,7 +3035,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) { hlinfo->mouse_face_hidden = false; clear_mouse_face (hlinfo); - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); } if (b->just_exited_p) @@ -3059,7 +3048,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) clear_mouse_face (hlinfo); hlinfo->mouse_face_mouse_frame = 0; - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); } if (f->auto_lower && !popup_activated_p @@ -3193,7 +3182,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) } if (FRAME_DIRTY_P (f)) - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); break; } case BUTTON_UP: @@ -3231,7 +3220,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) { tab_bar_arg = handle_tab_bar_click (f, x, y, type == BUTTON_DOWN, inev.modifiers); - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); } } @@ -3251,7 +3240,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) { handle_tool_bar_click (f, x, y, type == BUTTON_DOWN, inev.modifiers); - need_flush = 1; + haiku_flush_dirty_back_buffer_on (f); } } @@ -3724,9 +3713,6 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) } } - if (need_flush) - flush_dirty_back_buffers (); - unblock_input (); return message_count; commit 6ef295cd51855c8b2a14b6a8512e6e972c97c4c0 Author: Lars Ingebrigtsen Date: Thu Apr 28 13:50:25 2022 +0200 Document dired-keep-marker-copy more * doc/emacs/dired.texi (Operating on Files): Mention dired-keep-marker-copy. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 27df269ce7..92106ae1ed 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -776,6 +776,11 @@ symbolic links as links or after dereferencing (like @samp{cp -L}). The default is @code{nil}, which means that the symbolic links are copied by creating new ones. +@vindex dired-keep-marker-copy +The @code{dired-keep-marker-copy} user option controls how this +command handles file marking. The default is to mark all new copies +of files with a @samp{C} mark. + @item D @findex dired-do-delete @kindex D @r{(Dired)} commit 1bd7be00dcfcf5e7f0a03356b4f3cadfec128e48 Author: Lars Ingebrigtsen Date: Thu Apr 28 13:48:17 2022 +0200 Improve dired-do-copy doc string * lisp/dired-aux.el (dired-do-copy): Mention the `dired-keep-marker-copy' variable in the doc string (bug#21746). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c2a7086146..11aa0b2a5b 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2469,6 +2469,10 @@ If `dired-copy-preserve-time' is non-nil, this command preserves the modification time of each old file in the copy, similar to the \"-p\" option for the \"cp\" shell command. +The `dired-keep-marker-copy' user option controls how this +command handles file marking. The default is to mark all new +copies of files with a \"C\" mark. + This command copies symbolic links by creating new ones, similar to the \"-d\" option for the \"cp\" shell command. But if `dired-copy-dereference' is non-nil, the symbolic commit 6db90a412ac3aac6ff44d0d92ac26b2ecb228071 Author: Lars Ingebrigtsen Date: Thu Apr 28 13:04:28 2022 +0200 Document the non-effect of narrowing on get-text-property * doc/lispref/text.texi (Examining Properties): Document surprising non-effect of narrowing (bug#16413). * src/textprop.c (Ftext_properties_at, Fget_text_property): Mention narrowing. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index ab9abd0495..ca6a483c54 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2969,6 +2969,12 @@ character after position @var{pos} in @var{object} (a buffer or string). The argument @var{object} is optional and defaults to the current buffer. +If @var{position} is at the end of @var{object}, the value is +@code{nil}, but note that buffer narrowing does not affect the value. +That is, if @var{object} is a buffer or @code{nil}, and the buffer is +narrowed and @var{position} is at the end of the narrowed buffer, the +result may be non-@code{nil}. + If there is no @var{prop} property strictly speaking, but the character has a property category that is a symbol, then @code{get-text-property} returns the @var{prop} property of that symbol. @@ -3021,6 +3027,12 @@ properties take precedence over this variable. This function returns the entire property list of the character at @var{position} in the string or buffer @var{object}. If @var{object} is @code{nil}, it defaults to the current buffer. + +If @var{position} is at the end of @var{object}, the value is +@code{nil}, but note that buffer narrowing does not affect the value. +That is, if @var{object} is a buffer or @code{nil}, and the buffer is +narrowed and @var{position} is at the end of the narrowed buffer, the +result may be non-@code{nil}. @end defun @defvar default-text-properties diff --git a/src/textprop.c b/src/textprop.c index c6c9e102e3..072aac2866 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -561,8 +561,13 @@ DEFUN ("text-properties-at", Ftext_properties_at, doc: /* Return the list of properties of the character at POSITION in OBJECT. If the optional second argument OBJECT is a buffer (or nil, which means the current buffer), POSITION is a buffer position (integer or marker). + If OBJECT is a string, POSITION is a 0-based index into it. -If POSITION is at the end of OBJECT, the value is nil. + +If POSITION is at the end of OBJECT, the value is nil, but note that +buffer narrowing does not affect the value. That is, if OBJECT is a +buffer or nil, and the buffer is narrowed and POSITION is at the end +of the narrowed buffer, the result may be non-nil. If you want to display the text properties at point in a human-readable form, use the `describe-text-properties' command. */) @@ -590,7 +595,11 @@ DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, doc: /* Return the value of POSITION's property PROP, in OBJECT. OBJECT should be a buffer or a string; if omitted or nil, it defaults to the current buffer. -If POSITION is at the end of OBJECT, the value is nil. */) + +If POSITION is at the end of OBJECT, the value is nil, but note that +buffer narrowing does not affect the value. That is, if the buffer is +narrowed and POSITION is at the end of the narrowed buffer, the result +may be non-nil. */) (Lisp_Object position, Lisp_Object prop, Lisp_Object object) { return textget (Ftext_properties_at (position, object), prop); commit 8a007ebc2e62ce77dd34b22a017c1ce6f5d2672c Author: Lars Ingebrigtsen Date: Thu Apr 28 12:38:01 2022 +0200 Add comment to linum-mode about being old * lisp/linum.el (linum-mode): Link to display-line-numbers-mode (bug#34639). diff --git a/lisp/linum.el b/lisp/linum.el index e121618b69..d491da5206 100644 --- a/lisp/linum.el +++ b/lisp/linum.el @@ -74,6 +74,9 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers." ;;;###autoload (define-minor-mode linum-mode "Toggle display of line numbers in the left margin (Linum mode). +This mode has been largely replaced by `display-line-numbers-mode' +(which is much faster and has fewer interaction problems with other +modes). Linum mode is a buffer-local minor mode." :lighter "" ; for desktop.el commit c2c1976d0e8934de92b43c2f9202bdec397a6d0e Author: Lars Ingebrigtsen Date: Thu Apr 28 12:27:39 2022 +0200 Fix `g' in *grep* after `A' in Dired * lisp/dired-aux.el (dired-do-find-regexp): Allow `g' to work in the resulting grep buffer by not being destructive (bug#55157). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 8170c7a084..c2a7086146 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3335,7 +3335,7 @@ REGEXP should use constructs supported by your local `grep' command." (project--files-in-directory mark ignores "*") files)) (push mark files))) - (nreverse marks)) + (reverse marks)) (message "Searching...") (setq xrefs (xref-matches-in-files regexp files)) commit c7d49f91dac8afeb85cb8ee2b209f7ca4b363a4d Author: Lars Ingebrigtsen Date: Thu Apr 28 12:16:35 2022 +0200 Fix another help-fns--insert-menu-bindings parsing problem * lisp/help-fns.el (help-fns--insert-menu-bindings): Fix keymap traversal when elements are symbols. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 9a6225d858..0cb2c6d5d7 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -592,6 +592,8 @@ the C sources, too." (start (point))) (seq-do-indexed (lambda (entry level) + (when (symbolp map) + (setq map (symbol-function map))) (when-let ((elem (assq entry (cdr map)))) (when heading (insert heading) commit 3ba039dc96548fd7289bfbf411b050b88c98f0aa Author: Po Lu Date: Thu Apr 28 17:00:53 2022 +0800 * src/xterm.c (x_term_init): Fix the non-GTK3 XI2 build. diff --git a/src/xterm.c b/src/xterm.c index 49e1ce1b84..d774605832 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23394,6 +23394,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) #ifndef HAVE_GTK3 skip_xi_setup: #endif + ; #endif #ifdef HAVE_XRANDR commit 5f5e114a0327a2ba3eed1cfac399eec74ebbf786 Author: Michael Albinus Date: Thu Apr 28 10:16:50 2022 +0200 Revert previous change in test/Makefile.in * test/Makefile.in (test_template): Revert previous change, it isn't needed. diff --git a/test/Makefile.in b/test/Makefile.in index e7df121d0e..3b6e116e65 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -221,13 +221,11 @@ define test_template ## The similar name is FOO.c if FOO begins with '{lib-,}src/', FOO.el ## otherwise. Although this heuristic does not identify all the ## dependencies, it is better than nothing. - srcfile = $(patsubst %-tests,$(srcdir)/../%,$(1))$(if $(patsubst src/%,,$(patsubst lib-src/%,,$(1))),.el,.c) ifeq (,$(patsubst %-tests,,$(1))$(findstring -tests/,$(1))) - ifeq ($(shell test -e $(srcfile) && echo -n yes),yes) - $(1).log: $(srcfile) + $(1).log: $(patsubst %-tests,$(srcdir)/../%,$(1))$(if \ + $(patsubst src/%,,$(patsubst lib-src/%,,$(1))),.el,.c) $(notdir $(1).log): $(1).log endif - endif ## Short aliases that always re-run the tests, with no logging. ## Define both with and without the directory name for ease of use. commit 76d4e19f8984128d9253673fa91ce5423e9293f1 Author: Eli Zaretskii Date: Thu Apr 28 10:50:50 2022 +0300 Fix handling of proportional fonts on MS-Windows * src/xfaces.c (Fx_family_fonts): Consider fonts whose :spacing value is numeric, but still indicates that they are proportional, to be proportional. * lisp/textmodes/artist.el (artist-mode): Fix test for monospaced fonts. diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index e37b0d988a..686d5f494c 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1371,8 +1371,11 @@ Keymap summary (t ;; Turn mode on (artist-mode-init) - (let ((font (face-attribute 'default :font))) - (when (and (fontp font) (not (font-get font :spacing))) + (let* ((font (face-attribute 'default :font)) + (spacing-prop (if (fontp font) + (font-get font :spacing) + t))) + (when (or (null spacing-prop) (eq spacing-prop 0)) (message "The default font isn't monospaced, so the drawings in this buffer may look odd")))))) ;; Init and exit diff --git a/src/xfaces.c b/src/xfaces.c index d7f1f4d96e..c41782f4f3 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1573,7 +1573,14 @@ the face font sort order. */) make_fixnum (point), FONT_WEIGHT_SYMBOLIC (font), FONT_SLANT_SYMBOLIC (font), - NILP (spacing) || EQ (spacing, Qp) ? Qnil : Qt, + (NILP (spacing) + || EQ (spacing, Qp) + /* If the font was specified in a way + different from XLFD (e.g., on MS-Windows), + we will have a number there, not 'p'. */ + || EQ (spacing, + make_fixnum (FONT_SPACING_PROPORTIONAL))) + ? Qnil : Qt, Ffont_xlfd_name (font, Qnil), AREF (font, FONT_REGISTRY_INDEX)); result = Fcons (v, result); commit 37234157437228174a626fa10353f377179dc46e Author: Arash Esbati Date: Wed Apr 27 12:32:38 2022 +0200 ; * doc/lispref/syntax.texi (Position Parse): Fix a typo. (Bug#55143) diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 9120e63727..e84b901eaa 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -770,7 +770,7 @@ This function returns the parser state that the parser would reach at position @var{pos} starting from the beginning of the visible portion of the buffer. @iftex -See the next section for +See the next section @end iftex @ifnottex @xref{Parser State}, commit 7c1fc2348918a1ad8c61c7519a51042d48d7aa8d Author: Kyle Meyer Date: Sun Apr 24 21:07:40 2022 -0400 Update to Org 9.5.3-3-gd54104 diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e4bb706e08..37a39131d9 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -451,10 +451,6 @@ you can now configure them. (the default) or use the attachment directory of the current node, if it is correctly configured as a Git repository. -*** Some faces now use fixed-pitch - -See [[msg:875z8njaol.fsf@protesilaos.com][this thread]]. - *** New option ~org-attach-sync-delete-empty-dir~ ~org-attach-sync-delete-empty-dir~ controls the deletion of an empty @@ -509,7 +505,7 @@ heading, except return nil. In the past, faces of todo keywords, emphasised text, tags, and priority cookies inherited =default= face. The resulting headline -fontification was not always consistent, as discussed in [[https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00331.html][this bug +fontification was not always consistent, as discussed in [[msg::87h7sawubl.fsf@protesilaos.com][this bug report]]. Now, the relevant faces adapt to face used to fontify the current headline level. diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index dec4d174c4..2b4718805a 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.5.2} +\def\orgversionnumber{9.5.3} \def\versionyear{2021} % latest update \input emacsver.tex diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 1db36bc72b..d96898372f 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el @@ -38,8 +38,7 @@ :group 'org-faces) (defface org-hide - '((default :inherit fixed-pitch) - (((background light)) (:foreground "white")) + '((((background light)) (:foreground "white")) (((background dark)) (:foreground "black"))) "Face used to hide leading stars in headlines. The foreground color of this face should be equal to the background @@ -202,8 +201,7 @@ set the properties in the `org-column' face. For example, set :group 'org-faces) (defface org-date - '((default :inherit fixed-pitch) - (((class color) (background light)) (:foreground "Purple" :underline t)) + '((((class color) (background light)) (:foreground "Purple" :underline t)) (((class color) (background dark)) (:foreground "Cyan" :underline t)) (t (:underline t))) "Face for date/time stamps." @@ -379,8 +377,7 @@ changes." (sexp :tag "Face"))))) (defface org-table ;Copied from `font-lock-function-name-face' - '((default :inherit fixed-pitch) - (((class color) (min-colors 88) (background light)) (:foreground "Blue1")) + '((((class color) (min-colors 88) (background light)) (:foreground "Blue1")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Blue")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue")) @@ -396,8 +393,7 @@ changes." :group 'org-faces) (defface org-formula - '((default :inherit fixed-pitch) - (((class color) (min-colors 88) (background light)) (:foreground "Firebrick")) + '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick")) (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1")) (((class color) (min-colors 8) (background light)) (:foreground "red")) (((class color) (min-colors 8) (background dark)) (:foreground "red")) @@ -405,12 +401,12 @@ changes." "Face for formulas." :group 'org-faces) -(defface org-code '((t :inherit (fixed-pitch shadow))) +(defface org-code '((t :inherit shadow)) "Face for fixed-width text like code snippets." :group 'org-faces :version "22.1") -(defface org-meta-line '((t :inherit (fixed-pitch font-lock-comment-face))) +(defface org-meta-line '((t :inherit font-lock-comment-face)) "Face for meta lines starting with \"#+\"." :group 'org-faces :version "22.1") @@ -437,7 +433,7 @@ This face applies to the #+TITLE:, #+SUBTITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords." :group 'org-faces) -(defface org-block `((t :inherit (fixed-pitch shadow) +(defface org-block `((t :inherit shadow ,@(and (>= emacs-major-version 27) '(:extend t)))) "Face used for text inside various blocks. @@ -459,7 +455,7 @@ verse and quote blocks are fontified using the `org-verse' and "Face used for the line delimiting the end of source blocks." :group 'org-faces) -(defface org-verbatim '((t (:inherit (fixed-pitch shadow)))) +(defface org-verbatim '((t (:inherit shadow))) "Face for fixed-with text like code snippets." :group 'org-faces :version "22.1") diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 5cc98e3806..dc689662b7 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.5.2")) + (let ((org-release "9.5.3")) org-release)) ;;;###autoload (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.2-38-g682ccd")) + (let ((org-git-version "release_9.5.3-3-gd54104")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 4524812c55..1fc4251a34 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; Homepage: https://orgmode.org ;; Package-Requires: ((emacs "25.1")) -;; Version: 9.5.2 +;; Version: 9.5.3 ;; This file is part of GNU Emacs. ;; @@ -15012,20 +15012,24 @@ value is equivalent to `inactive'. When at a timestamp, return the position of the point as a symbol among `bracket', `after', `year', `month', `hour', `minute', `day' or a number of character from the last know part of the -time stamp. +time stamp. If diary sexp timestamps, any point inside the timestamp +is considered `day' (i.e. only `bracket', `day', and `after' return +values are possible). When matching, the match groups are the following: - group 1: year - group 2: month - group 3: day number - group 4: day name + group 1: year, if any + group 2: month, if any + group 3: day number, if any + group 4: day name, if any group 5: hours, if any group 6: minutes, if any" - (let* ((regexp (if extended - (if (eq extended 'agenda) - org-element--timestamp-regexp - org-ts-regexp3) - org-ts-regexp2)) + (let* ((regexp + (if extended + (if (eq extended 'agenda) + (rx (or (regexp org-ts-regexp3) + (regexp org-element--timestamp-regexp))) + org-ts-regexp3) + org-ts-regexp2)) (pos (point)) (match? (let ((boundaries (org-in-regexp regexp))) commit 9a78b235e99322f93c66f067fc2178370b31a2ad Author: Eli Zaretskii Date: Sun Apr 24 22:37:09 2022 +0300 Improve indexing in "Programmed Completion" * doc/lispref/minibuf.texi (Programmed Completion): Improve indexing. (Bug#55095) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index f05f087ba7..bc2f14883c 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1936,6 +1936,7 @@ completion function is trying to complete. If the symbol matches one of the keys in @code{completion-category-overrides}, the usual completion behavior is overridden. @xref{Completion Variables}. +@cindex @code{annotation-function}, in completion @item annotation-function The value should be a function for @dfn{annotating} completions. The function should take one argument, @var{string}, which is a possible @@ -1945,6 +1946,7 @@ Unless this function puts own face on the annotation suffix string, the @code{completions-annotations} face is added by default to that string. +@cindex @code{affixation-function}, in completion @item affixation-function The value should be a function for adding prefixes and suffixes to completions. The function should take one argument, @@ -1955,6 +1957,7 @@ the completion string in the @file{*Completions*} buffer, and a suffix displayed after the completion string. This function takes priority over @code{annotation-function}. +@cindex @code{group-function}, in completion @item group-function The value should be a function for grouping the completion candidates. The function must take two arguments, @var{completion}, which is a @@ -1965,12 +1968,14 @@ can also be @code{nil}. Otherwise the function must return the transformed candidate. The transformation can for example remove a redundant prefix, which is displayed in the group title. +@cindex @code{display-sort-function}, in completion @item display-sort-function The value should be a function for sorting completions. The function should take one argument, a list of completion strings, and return a sorted list of completion strings. It is allowed to alter the input list destructively. +@cindex @code{cycle-sort-function}, in completion @item cycle-sort-function The value should be a function for sorting completions, when @code{completion-cycle-threshold} is non-@code{nil} and the user is commit 1e9b9f403af73a281ee488da42a20c34dd8c05b9 Author: Eli Zaretskii Date: Sun Apr 24 09:56:22 2022 +0300 Improve documentation of 'set-fontset-font' * doc/lispref/display.texi (Fontsets): * src/fontset.c (Fset_fontset_font): Improve and clarify the documentation of 'set-fontset-font'. Rename the arguments to be more self-explanatory. (Bug#55086) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index c82523132e..b68d3d1c0c 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3669,57 +3669,62 @@ Then, the font specifications for all but Chinese GB2312 characters have Chinese GB2312 characters has a wild card @samp{*} in the @var{family} field. -@defun set-fontset-font name character font-spec &optional frame add -This function modifies the existing fontset @var{name} to use the font -matching with @var{font-spec} for the specified @var{character}. +@defun set-fontset-font fontset characters font-spec &optional frame add +This function modifies the existing @var{fontset} to use the font +specified by @var{font-spec} for displaying the specified +@var{characters}. -If @var{name} is @code{nil}, this function modifies the fontset of the -selected frame or that of @var{frame} if @var{frame} is not +If @var{fontset} is @code{nil}, this function modifies the fontset of +the selected frame or that of @var{frame} if @var{frame} is not @code{nil}. -If @var{name} is @code{t}, this function modifies the default -fontset, whose short name is @samp{fontset-default}. +If @var{fontset} is @code{t}, this function modifies the default +fontset, whose short name as a string is @samp{fontset-default}. -In addition to specifying a single codepoint, @var{character} may be a -cons @code{(@var{from} . @var{to})}, where @var{from} and @var{to} are -character codepoints. In that case, use @var{font-spec} for all the -characters in the range @var{from} and @var{to} (inclusive). +The @var{characters} argument can be a single character which should +be displayed using @var{font-spec}. It can also be a cons cell +@w{@code{(@var{from} . @var{to})}}, where @var{from} and @var{to} are +characters. In that case, use @var{font-spec} for all the characters +in the range @var{from} and @var{to} (inclusive). -@var{character} may be a charset (@pxref{Character Sets}). In that -case, use @var{font-spec} for all the characters in the charset. +@var{characters} may be a charset symbol (@pxref{Character Sets}). In +that case, use @var{font-spec} for all the characters in the charset. -@var{character} may be a script name (@pxref{Character Properties, +@var{characters} may be a script symbol (@pxref{Character Properties, char-script-table}). In that case, use @var{font-spec} for all the characters belonging to the script. -@var{character} may be @code{nil}, which means to use @var{font-spec} -for any character which no font-spec is specified. +@var{characters} may be @code{nil}, which means to use @var{font-spec} +for any character in @var{fontset} for which no font-spec is +specified. @var{font-spec} may be a font-spec object created by the function @code{font-spec} (@pxref{Low-Level Font}). -@var{font-spec} may be a cons; @code{(@var{family} . @var{registry})}, -where @var{family} is a family name of a font (possibly including a -foundry name at the head), @var{registry} is a registry name of a font -(possibly including an encoding name at the tail). +@var{font-spec} may be a cons cell @w{@code{(@var{family} +. @var{registry})}}, where @var{family} is a family name of a font +(possibly including a foundry name at the head), and @var{registry} is +a registry name of a font (possibly including an encoding name at the +tail). @var{font-spec} may be a font name, a string. @var{font-spec} may be @code{nil}, which explicitly specifies that -there's no font for the specified @var{character}. This is useful, +there's no font for the specified @var{characters}. This is useful, for example, to avoid expensive system-wide search for fonts for characters that have no glyphs, like those from the Unicode Private Use Area (PUA). The optional argument @var{add}, if non-@code{nil}, specifies how to -add @var{font-spec} to the font specifications previously set. If it -is @code{prepend}, @var{font-spec} is prepended. If it is -@code{append}, @var{font-spec} is appended. By default, -@var{font-spec} overrides the previous settings. +add @var{font-spec} to the font specifications previously set for +@var{characters}. If it is @code{prepend}, @var{font-spec} is +prepended to the existing specs. If it is @code{append}, +@var{font-spec} is appended. By default, @var{font-spec} overwrites +the previously set font specs. -For instance, this changes the default fontset to use a font of which +For instance, this changes the default fontset to use a font whose family name is @samp{Kochi Gothic} for all characters belonging to -the charset @code{japanese-jisx0208}. +the charset @code{japanese-jisx0208}: @smallexample (set-fontset-font t 'japanese-jisx0208 diff --git a/src/fontset.c b/src/fontset.c index eb563a69e2..1793715450 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1450,28 +1450,30 @@ static void update_auto_fontset_alist (Lisp_Object, Lisp_Object); DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 5, 0, doc: /* -Modify fontset NAME to use FONT-SPEC for TARGET characters. +Modify FONTSET to use font specification in FONT-SPEC for displaying CHARACTERS. -NAME is a fontset name (a string), nil for the fontset of FRAME, -or t for the default fontset. +FONTSET should be a fontset name (a string); or nil, meaning the +fontset of FRAME; or t, meaning the default fontset. -TARGET may be a single character to use FONT-SPEC for. +CHARACTERS may be a single character to use FONT-SPEC for. -TARGET may be a cons (FROM . TO), where FROM and TO are characters. +CHARACTERS may be a cons (FROM . TO), where FROM and TO are characters. In that case, use FONT-SPEC for all the characters in the range between FROM and TO (inclusive). -TARGET may be a script symbol. In that case, use FONT-SPEC for +CHARACTERS may be a script symbol. In that case, use FONT-SPEC for all the characters that belong to the script. See the variable -`script-representative-chars' for the list of known scripts. +`script-representative-chars' for the list of known scripts, and +see the variable `char-script-table' for the script of any specific +character. -TARGET may be a charset. In that case, use FONT-SPEC for all -the characters in the charset. See `list-character-sets' and +CHARACTERS may be a charset symbol. In that case, use FONT-SPEC for +all the characters in the charset. See `list-character-sets' and `list-charset-chars' for the list of character sets and their characters. -TARGET may be nil. In that case, use FONT-SPEC for any character for -which no font-spec is specified. +CHARACTERS may be nil. In that case, use FONT-SPEC for any +character for which no font-spec is specified in FONTSET. FONT-SPEC may one of these: * A font-spec object made by the function `font-spec' (which see). @@ -1479,25 +1481,28 @@ FONT-SPEC may one of these: REGISTRY is a font registry name. FAMILY may contain foundry name, and REGISTRY may contain encoding name. * A font name string. - * nil, which explicitly specifies that there's no font for TARGET. + * nil, which explicitly specifies that there's no font for CHARACTERS. -Optional 4th argument FRAME is a frame, or nil for the selected frame, -to be considered in the case that NAME is nil. +Optional 4th argument FRAME is a frame whose fontset should be modified; +it is used if FONTSET is nil. If FONTSET is nil and FRAME is omitted +or nil, that stands for the fontset of the selected frame. Optional 5th argument ADD, if non-nil, specifies how to add FONT-SPEC -to the previously set font specifications for TARGET. If it is -`prepend', FONT-SPEC is prepended. If it is `append', FONT-SPEC is -appended. By default, FONT-SPEC overrides the previous settings. */) - (Lisp_Object name, Lisp_Object target, Lisp_Object font_spec, Lisp_Object frame, Lisp_Object add) +to the previously set font specifications for CHARACTERS. If it is +`prepend', FONT-SPEC is prepended to the existing font specifications. +If it is `append', FONT-SPEC is appended. By default, FONT-SPEC +overwrites the previous settings. */) + (Lisp_Object fontset, Lisp_Object characters, Lisp_Object font_spec, + Lisp_Object frame, Lisp_Object add) { - Lisp_Object fontset; + Lisp_Object fontset_obj; Lisp_Object font_def, registry, family; Lisp_Object range_list; struct charset *charset = NULL; Lisp_Object fontname; bool ascii_changed = 0; - fontset = check_fontset_name (name, &frame); + fontset_obj = check_fontset_name (fontset, &frame); fontname = Qnil; if (CONSP (font_spec)) @@ -1555,18 +1560,18 @@ appended. By default, FONT-SPEC overrides the previous settings. */) else font_def = Qnil; - if (CHARACTERP (target)) + if (CHARACTERP (characters)) { - if (XFIXNAT (target) < 0x80) + if (XFIXNAT (characters) < 0x80) error ("Can't set a font for partial ASCII range"); - range_list = list1 (Fcons (target, target)); + range_list = list1 (Fcons (characters, characters)); } - else if (CONSP (target)) + else if (CONSP (characters)) { Lisp_Object from, to; - from = Fcar (target); - to = Fcdr (target); + from = Fcar (characters); + to = Fcdr (characters); CHECK_CHARACTER (from); CHECK_CHARACTER (to); if (XFIXNAT (from) < 0x80) @@ -1575,38 +1580,38 @@ appended. By default, FONT-SPEC overrides the previous settings. */) error ("Can't set a font for partial ASCII range"); ascii_changed = 1; } - range_list = list1 (target); + range_list = list1 (characters); } - else if (SYMBOLP (target) && !NILP (target)) + else if (SYMBOLP (characters) && !NILP (characters)) { Lisp_Object script_list; Lisp_Object val; range_list = Qnil; script_list = XCHAR_TABLE (Vchar_script_table)->extras[0]; - if (! NILP (Fmemq (target, script_list))) + if (! NILP (Fmemq (characters, script_list))) { - if (EQ (target, Qlatin)) + if (EQ (characters, Qlatin)) ascii_changed = 1; - val = list1 (target); + val = list1 (characters); map_char_table (accumulate_script_ranges, Qnil, Vchar_script_table, val); range_list = Fnreverse (XCDR (val)); } - if (CHARSETP (target)) + if (CHARSETP (characters)) { - CHECK_CHARSET_GET_CHARSET (target, charset); + CHECK_CHARSET_GET_CHARSET (characters, charset); if (charset->ascii_compatible_p) ascii_changed = 1; } else if (NILP (range_list)) error ("Invalid script or charset name: %s", - SDATA (SYMBOL_NAME (target))); + SDATA (SYMBOL_NAME (characters))); } - else if (NILP (target)) + else if (NILP (characters)) range_list = list1 (Qnil); else - error ("Invalid target for setting a font"); + error ("Invalid second argument for setting a font in a fontset"); if (ascii_changed) { @@ -1614,7 +1619,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */) if (NILP (font_spec)) error ("Can't set ASCII font to nil"); - val = CHAR_TABLE_REF (fontset, 0); + val = CHAR_TABLE_REF (fontset_obj, 0); if (! NILP (val) && EQ (add, Qappend)) /* We are going to change just an additional font for ASCII. */ ascii_changed = 0; @@ -1622,7 +1627,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */) if (charset) { - Lisp_Object arg = CALLN (Fvector, fontset, font_def, add, + Lisp_Object arg = CALLN (Fvector, fontset_obj, font_def, add, ascii_changed ? Qt : Qnil, range_list); map_charset_chars (set_fontset_font, Qnil, arg, charset, @@ -1631,15 +1636,15 @@ appended. By default, FONT-SPEC overrides the previous settings. */) range_list = AREF (arg, 4); } for (; CONSP (range_list); range_list = XCDR (range_list)) - FONTSET_ADD (fontset, XCAR (range_list), font_def, add); + FONTSET_ADD (fontset_obj, XCAR (range_list), font_def, add); if (ascii_changed) { Lisp_Object tail, fr; - int fontset_id = XFIXNUM (FONTSET_ID (fontset)); + int fontset_id = XFIXNUM (FONTSET_ID (fontset_obj)); - set_fontset_ascii (fontset, fontname); - name = FONTSET_NAME (fontset); + set_fontset_ascii (fontset_obj, fontname); + fontset = FONTSET_NAME (fontset_obj); FOR_EACH_FRAME (tail, fr) { struct frame *f = XFRAME (fr); @@ -1657,17 +1662,17 @@ appended. By default, FONT-SPEC overrides the previous settings. */) font_object = font_open_by_spec (f, font_spec); if (! NILP (font_object)) { - update_auto_fontset_alist (font_object, fontset); - AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object)); + update_auto_fontset_alist (font_object, fontset_obj); + AUTO_FRAME_ARG (arg, Qfont, Fcons (fontset, font_object)); Fmodify_frame_parameters (fr, arg); } } } - /* Free all realized fontsets whose base is FONTSET. This way, the + /* Free all realized fontsets whose base is FONTSET_OBJ. This way, the specified character(s) are surely redisplayed by a correct font. */ - free_realized_fontsets (fontset); + free_realized_fontsets (fontset_obj); return Qnil; } commit b5e05f09f557af854f8ca4e45ca4a4e66f4d3aa1 Author: Eli Zaretskii Date: Sat Apr 23 21:51:57 2022 +0300 ; Update WEB PAGES part of make-tarball.txt * admin/make-tarball.txt (WEB PAGES): Add instructions for download.html. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 436a0957c0..c8ee3349cd 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -334,6 +334,10 @@ looks like this: +The file download.html may need to be updated, for example if the +MS-Windows binaries will be signed by a different person/key than +those mentioned there. + Next, regenerate the various manuals in HTML, PDF, and PS formats: Invoke ./admin/make-manuals from the top-level directory of the commit a7dde05cb3a06cc1ec807a2dcbe55f6f11f29b99 Author: Michael Albinus Date: Sat Apr 23 08:50:33 2022 +0200 Fix problem with Solaris ls in Tramp * lisp/net/tramp-sh.el (tramp-sunos-unames): Move up. (tramp-sh--quoting-style-options): Handle erroneous Solaris ls. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 54fb539a56..67f5519bbf 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1189,12 +1189,18 @@ component is used as the target of the symlink." ;; The scripts could fail, for example with huge file size. (tramp-do-file-attributes-with-ls v localname id-format)))))))) +(defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11")) + "Regexp to determine remote SunOS.") + (defun tramp-sh--quoting-style-options (vec) "Quoting style options to be used for VEC." (or (tramp-get-ls-command-with vec "--quoting-style=literal --show-control-chars") - (tramp-get-ls-command-with vec "-w") + ;; ls on Solaris does not return an error in that case. We've got + ;; reports for "SunOS 5.11" so far. + (unless (tramp-check-remote-uname vec tramp-sunos-unames) + (tramp-get-ls-command-with vec "-w")) "")) (defun tramp-do-file-attributes-with-ls (vec localname &optional id-format) @@ -3990,9 +3996,6 @@ Returns the exit code of the `test' program." switch (tramp-shell-quote-argument localname))))) -(defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11")) - "Regexp to determine remote SunOS.") - (defun tramp-find-executable (vec progname dirlist &optional ignore-tilde ignore-path) "Search for PROGNAME in $PATH and all directories mentioned in DIRLIST. commit 43ed7b1e0f182a5f4d82f6542ebf4308d0f78fc5 Author: Eli Zaretskii Date: Fri Apr 22 09:26:10 2022 +0300 ; Update instructions about ChangeLog.N file generation * admin/make-tarball.txt: Add instructions about rotating and regenerating the versioned ChangeLog.N file. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 17a4d9f807..436a0957c0 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -54,12 +54,31 @@ General steps (for each step, check for possible errors): section at the beginning of that file, and commit etc/NEWS if it was modified. -2. Regenerate the etc/AUTHORS file: +2. Regenerate the versioned ChangeLog.N and etc/AUTHORS files. + + The "M-x authors" command below will first update the current + versioned ChangeLog.N file. For this to work correctly, make sure + the top-level Makefile says + + PREFERRED_BRANCH = emacs-NN + + where NN is the version on the release branch from which you are + producing the tarball. If NN is incorrect, update Makefile.in and + re-run 'configure' to update Makefile. + + If the versioned ChangeLog.N file is too large, start a new one + by bumping N, and also update the line in top-level Makefile.in + which says + + CHANGELOG_HISTORY_INDEX_MAX = N + + by incrementing the value of N by 1; then regenerate Makefile. + + Now: + M-: (require 'authors) RET M-x authors RET - (This first updates the current versioned ChangeLog.N) - If this says "Problem updating ChangeLog", find the reason for the failure of the command it runs, viz.: commit d5728f129fb2c20e9c0ff44651a538a40f3088af Author: Eli Zaretskii Date: Fri Apr 22 09:05:57 2022 +0300 Another fix for non-ASCII 'overlay-arrow-string' * src/xdisp.c (get_overlay_arrow_glyph_row): Fix yet another place that assumed each character is a single byte. diff --git a/src/xdisp.c b/src/xdisp.c index 42c3e81e5c..6963935666 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -774,7 +774,7 @@ static bool message_buf_print; static bool message_cleared_p; /* A scratch glyph row with contents used for generating truncation - glyphs. Also used in direct_output_for_insert. */ + glyphs and overlay-arrow glyphs. */ #define MAX_SCRATCH_GLYPHS 100 static struct glyph_row scratch_glyph_row; @@ -21653,7 +21653,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) struct buffer *buffer = XBUFFER (w->contents); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); - ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), char_num = 0; + ptrdiff_t arrow_len = SBYTES (overlay_arrow_string), char_num = 0; const unsigned char *arrow_end = arrow_string + arrow_len; const unsigned char *p; struct it it; commit bf771e31bc93d5d48e0661b875cc785c792d214f Author: Eli Zaretskii Date: Thu Apr 21 23:25:49 2022 +0300 ; * src/xdisp.c (get_overlay_arrow_glyph_row): Better var name. diff --git a/src/xdisp.c b/src/xdisp.c index 71de359222..42c3e81e5c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21653,7 +21653,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) struct buffer *buffer = XBUFFER (w->contents); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); - ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), nchars = 0; + ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), char_num = 0; const unsigned char *arrow_end = arrow_string + arrow_len; const unsigned char *p; struct it it; @@ -21684,7 +21684,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) p += it.len; /* Get its face. */ - ilisp = make_fixnum (nchars++); + ilisp = make_fixnum (char_num++); face = Fget_text_property (ilisp, Qface, overlay_arrow_string); it.face_id = compute_char_face (f, it.char_to_display, face); commit 5fe7e4d1ae24047858d8633e22036d288e5f0c06 Author: Eli Zaretskii Date: Thu Apr 21 23:18:42 2022 +0300 Avoid a redisplay loop when 'overlay-arrow-string' is non-ASCII * src/xdisp.c (get_overlay_arrow_glyph_row): Don't assume every character in 'overlay-arrow-string' is one byte long. Reported by Yuri D'Elia . diff --git a/src/xdisp.c b/src/xdisp.c index 15bb5eefb5..71de359222 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21653,7 +21653,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) struct buffer *buffer = XBUFFER (w->contents); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); - ptrdiff_t arrow_len = SCHARS (overlay_arrow_string); + ptrdiff_t arrow_len = SCHARS (overlay_arrow_string), nchars = 0; const unsigned char *arrow_end = arrow_string + arrow_len; const unsigned char *p; struct it it; @@ -21684,7 +21684,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) p += it.len; /* Get its face. */ - ilisp = make_fixnum (p - arrow_string); + ilisp = make_fixnum (nchars++); face = Fget_text_property (ilisp, Qface, overlay_arrow_string); it.face_id = compute_char_face (f, it.char_to_display, face); commit e93e31c8952bf8a7acf898e4ff4d6541c897e12c Author: Eli Zaretskii Date: Thu Apr 21 21:56:09 2022 +0300 ; Fix last change in isearch.el * lisp/isearch.el (isearch-occur): Move the recent addition to doc string from here... (isearch-query-replace-regexp): ...to here. diff --git a/lisp/isearch.el b/lisp/isearch.el index d829744c3a..a68c3a4748 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2383,7 +2383,12 @@ type \\[help-command] at that time." (defun isearch-query-replace-regexp (&optional arg) "Start `query-replace-regexp' with string to replace from last search string. -See `isearch-query-replace' for more information." +See `isearch-query-replace' for more information. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time." (interactive (list current-prefix-arg)) (isearch-query-replace arg t)) @@ -2398,12 +2403,7 @@ the search words, ignoring punctuation. If the last search command was a regular expression search, REGEXP is the regular expression used in that search. If the last search command searched for a literal string, REGEXP is constructed by quoting all the special -characters in that string. - -As each match is found, the user must type a character saying -what to do with it. Type SPC or `y' to replace the match, -DEL or `n' to skip and go to the next match. For more directions, -type \\[help-command] at that time." +characters in that string." (interactive (let* ((perform-collect (consp current-prefix-arg)) (regexp (cond commit 16d1ab02af3335db38e596cfe8ff9c3d1db157ed Author: Eli Zaretskii Date: Thu Apr 21 14:54:45 2022 +0300 Add minimum instructions to 'query-replace' commands * lisp/vc/vc-dir.el (vc-dir-query-replace-regexp): * lisp/textmodes/reftex-global.el (reftex-query-replace-document): * lisp/progmodes/project.el (project-query-replace-regexp): * lisp/progmodes/etags.el (tags-query-replace): * lisp/progmodes/ebrowse.el (ebrowse-tags-query-replace): * lisp/isearch.el (isearch-query-replace, isearch-occur): * lisp/emulation/viper-cmd.el (viper-query-replace): * lisp/dired-aux.el (dired-do-query-replace-regexp) (dired-do-find-regexp-and-replace): * lisp/progmodes/xref.el (xref-query-replace-in-results): * lisp/replace.el (query-replace, query-replace-regexp) (query-replace-regexp-eval, map-query-replace-regexp): Add minimal instructions for dealing with matches, with a link to the command that shows the full instructions. (Bug#55050) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 57155ec26d..f16568f919 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3171,9 +3171,14 @@ To continue searching for next match, use command \\[fileloop-continue]." ;;;###autoload (defun dired-do-query-replace-regexp (from to &optional delimited) "Do `query-replace-regexp' of FROM with TO, on all marked files. +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + Third arg DELIMITED (prefix arg) means replace only word-delimited matches. -If you exit (\\[keyboard-quit], RET or q), you can resume the query replace -with the command \\[tags-loop-continue]." +If you exit the query-replace loop (\\[keyboard-quit], RET or q), you can +resume the query replace with the command \\[tags-loop-continue]." (interactive (let ((common (query-replace-read-args @@ -3240,6 +3245,11 @@ REGEXP should use constructs supported by your local `grep' command." (defun dired-do-find-regexp-and-replace (from to) "Replace matches of FROM with TO, in all marked files. +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + If no files are marked, use the file under point. For any marked directory, matches in all of its files are replaced, diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 1f2f3ecfc3..e08d19c611 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -4168,7 +4168,12 @@ cursor move past the beginning of line." "Query replace. If a null string is supplied as the string to be replaced, the query replace mode will toggle between string replace -and regexp replace." +and regexp replace. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time." (interactive) (let (str) (setq str (viper-read-string-with-history diff --git a/lisp/isearch.el b/lisp/isearch.el index 34e3b69475..d829744c3a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2324,7 +2324,12 @@ arg means replace backward. Note that using the prefix arg is possible only when `isearch-allow-scroll' is non-nil or `isearch-allow-prefix' is non-nil, and it doesn't always provide the correct matches for `query-replace', so the preferred way to run word -replacements from Isearch is `M-s w ... M-%'." +replacements from Isearch is `M-s w ... M-%'. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time." (interactive (list current-prefix-arg)) (barf-if-buffer-read-only) @@ -2393,7 +2398,12 @@ the search words, ignoring punctuation. If the last search command was a regular expression search, REGEXP is the regular expression used in that search. If the last search command searched for a literal string, REGEXP is constructed by quoting all the special -characters in that string." +characters in that string. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time." (interactive (let* ((perform-collect (consp current-prefix-arg)) (regexp (cond diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 047d43a922..dacb2a5f01 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -3633,7 +3633,12 @@ If regular expression is nil, repeat last search." ;;;###autoload (defun ebrowse-tags-query-replace (from to) "Query replace FROM with TO in all files of a class tree. -With prefix arg, process files of marked classes only." +With prefix arg, process files of marked classes only. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time." (interactive "sTree query replace (regexp): \nsTree query replace %s by: ") (setq ebrowse-tags-loop-call diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 3826c1888d..124817ffda 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1836,7 +1836,13 @@ Also see the documentation of the `tags-file-name' variable." Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit (\\[keyboard-quit], RET or q), you can resume the query replace with the command \\[fileloop-continue]. -For non-interactive use, superseded by `fileloop-initialize-replace'." + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + +For non-interactive use, this is superseded by `fileloop-initialize-replace'." (declare (advertised-calling-convention (from to &optional delimited) "27.1")) (interactive (query-replace-read-args "Tags query replace (regexp)" t t)) (fileloop-initialize-replace diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1000e8c87f..07093d6147 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1040,6 +1040,10 @@ command \\[fileloop-continue]." (defun project-query-replace-regexp (from to) "Query-replace REGEXP in all the files of the project. Stops when a match is found and prompts for whether to replace it. +At that prompt, the user must type a character saying what to do +with the match. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. If you exit the `query-replace', you can later continue the `query-replace' loop using the command \\[fileloop-continue]." (interactive diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 2fd5e19237..c4b439f587 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -701,7 +701,13 @@ quit the *xref* buffer." "Perform interactive replacement of FROM with TO in all displayed xrefs. This command interactively replaces FROM with TO in the names of the -references displayed in the current *xref* buffer." +references displayed in the current *xref* buffer. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. +" (interactive (let ((fr (read-regexp "Xref query-replace (regexp)" ".*"))) (list fr diff --git a/lisp/replace.el b/lisp/replace.el index b1cfd7e3f4..dd1bdae4c5 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -357,7 +357,9 @@ should a regexp." (defun query-replace (from-string to-string &optional delimited start end backward region-noncontiguous-p) "Replace some occurrences of FROM-STRING with TO-STRING. As each match is found, the user must type a character saying -what to do with it. For directions, type \\[help-command] at that time. +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's @@ -427,7 +429,9 @@ To customize possible responses, change the bindings in `query-replace-map'." (defun query-replace-regexp (regexp to-string &optional delimited start end backward region-noncontiguous-p) "Replace some things after point matching REGEXP with TO-STRING. As each match is found, the user must type a character saying -what to do with it. For directions, type \\[help-command] at that time. +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's @@ -524,7 +528,9 @@ Interactive use of this function is deprecated in favor of the using `search-forward-regexp' and `replace-match' is preferred. As each match is found, the user must type a character saying -what to do with it. For directions, type \\[help-command] at that time. +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. TO-EXPR is a Lisp expression evaluated to compute each replacement. It may reference `replace-count' to get the number of replacements already made. @@ -610,6 +616,11 @@ Use \\\\[next-history-element] \ to pull the last incremental search regexp to the minibuffer that reads REGEXP. +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + A prefix argument N says to use each replacement string N times before rotating to the next. Fourth and fifth arg START and END specify the region to operate on. diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index a1aa368f60..c7e34b4b90 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el @@ -88,6 +88,12 @@ No active TAGS table is required." (defun reftex-query-replace-document (&optional from to delimited) "Do `query-replace-regexp' of FROM with TO over the entire document. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + If you exit (\\[keyboard-quit], RET or q), you can resume the query replace with the command \\[tags-loop-continue]. No active TAGS table is required." diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index b7315cfed5..18f5b07a7f 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -933,6 +933,12 @@ To continue searching for next match, use command \\[tags-loop-continue]." "Do `query-replace-regexp' of FROM with TO, on all marked files. If a directory is marked, then use the files displayed for that directory. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. + +As each match is found, the user must type a character saying +what to do with it. Type SPC or `y' to replace the match, +DEL or `n' to skip and go to the next match. For more directions, +type \\[help-command] at that time. + If you exit (\\[keyboard-quit], RET or q), you can resume the query replace with the command \\[tags-loop-continue]." ;; FIXME: this is almost a copy of `dired-do-query-replace-regexp'. This commit 4d4f5640ef0f1501bab174ae8d1b3759ba2b6ccc Author: Eli Zaretskii Date: Thu Apr 21 09:06:09 2022 +0300 Fix customization-group of 'python-forward-sexp-function' * lisp/progmodes/python.el (python-forward-sexp-function): Make it be part of both 'python' and 'python-flymake' groups. (Bug#55027) Do not merge to master. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 70828cb223..f7f1784b17 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5569,6 +5569,8 @@ By default messages are considered errors." (defcustom python-forward-sexp-function #'python-nav-forward-sexp "Function to use when navigating between expressions." :version "28.1" + :group 'python + :group 'python-flymake :type '(choice (const :tag "Python blocks" python-nav-forward-sexp) (const :tag "CC-mode like" nil) function))