commit 06e9943412fccda47c3ce18344e8b0f4eb42f8fe Author: Juri Linkov Date: Tue Dec 9 09:44:24 2025 +0200 * lisp/progmodes/hideshow.el (hs-minor-mode): Show/hide margins. Increment 'left-margin-width' when 'hs-indicator-type' is 'margin', and decrement it on disabling 'hs-minor-mode'. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 1317b1a4f43..f0bea28ceac 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -1497,13 +1497,26 @@ Key bindings: (when (and (not (display-graphic-p)) (eq hs-indicator-type 'fringe)) (setq-local hs-indicator-type 'margin)) + (when (eq hs-indicator-type 'margin) + (setq-local left-margin-width (1+ left-margin-width)) + (setq-local fringes-outside-margins t) + ;; Force display of margins + (when (eq (current-buffer) (window-buffer)) + (set-window-buffer nil (window-buffer)))) (jit-lock-register #'hs--add-indicators))) (remove-from-invisibility-spec '(hs . t)) (remove-overlays nil nil 'hs-indicator t) (remove-overlays nil nil 'invisible 'hs) (when hs-show-indicators - (jit-lock-unregister #'hs--add-indicators)))) + (jit-lock-unregister #'hs--add-indicators) + (when (and (eq hs-indicator-type 'margin) + (< 0 left-margin-width)) + (setq-local left-margin-width (1- left-margin-width)) + (kill-local-variable 'fringes-outside-margins) + ;; Force removal of margins + (when (eq (current-buffer) (window-buffer)) + (set-window-buffer nil (window-buffer))))))) ;;;; that's it commit 56870c5f655a5ec2c7d8ab7257f44519370ff0e6 Author: Elías Gabriel Pérez Date: Mon Dec 8 15:45:03 2025 -0600 ; * lisp/progmodes/hideshow.el: Fix comments. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 123eb1bd6c6..1317b1a4f43 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -57,11 +57,7 @@ ;; ;; Add the following to your init file: ;; -;; (require 'hideshow) -;; (add-hook 'X-mode-hook #'hs-minor-mode) ; other modes similarly -;; -;; ;; For use-package users: -;; (use-package hideshow :hook (X-mode . hs-minor-mode)) +;; (add-hook 'X-mode-hook #'hs-minor-mode) ; other modes similarly ;; ;; where X = {emacs-lisp,c,c++,perl,...}. You can also manually toggle ;; hideshow minor mode by typing `M-x hs-minor-mode'. After hideshow is @@ -118,9 +114,10 @@ ;; (defun ttn-hs-hide-level-2 () ;; (when (funcall hs-looking-at-block-start-predicate) ;; (hs-hide-level 2))) -;; (setq-mode-local java-mode ; This requires the mode-local package -;; hs-hide-all-non-comment-function -;; 'ttn-hs-hide-level-2) +;; (add-hook 'java-mode-hook +;; (lambda () +;; (setq-local hs-hide-all-non-comment-function +;; #'ttn-hs-hide-level-2))) ;; ;; Hideshow works with incremental search (isearch) by setting the variable ;; `hs-headline', which is the line of text at the beginning of a hidden commit d10a649e1b3737524f64e14e6a033eec5d0ab17d Author: Paul Eggert Date: Mon Dec 8 18:30:46 2025 -0800 Pacify -Wunused-function re get_conversion_field * src/textconv.c (get_conversion_field): Define only if HAVE_ANDROID, since it is unused on non-Android. diff --git a/src/textconv.c b/src/textconv.c index e5ade79895c..987a5a4ee10 100644 --- a/src/textconv.c +++ b/src/textconv.c @@ -1739,13 +1739,12 @@ handle_pending_conversion_events (void) unbind_to (count, Qnil); } +#ifdef HAVE_ANDROID + /* Return the confines of the field to which editing operations on frame F should be constrained in *BEG and *END. Should no field be active, set *END to PTRDIFF_MAX. */ -#ifndef HAVE_ANDROID -static -#endif void get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) { @@ -1775,8 +1774,6 @@ get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) *end = PTRDIFF_MAX; } -#ifdef HAVE_ANDROID - /* Start a ``batch edit'' in frame F. During a batch edit, point_changed will not be called until the batch edit ends. diff --git a/src/textconv.h b/src/textconv.h index 1e5ed9e4806..54b5e0c574c 100644 --- a/src/textconv.h +++ b/src/textconv.h @@ -153,13 +153,11 @@ extern char *get_surrounding_text (struct frame *, ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *); +extern void get_conversion_field (struct frame *, ptrdiff_t *, ptrdiff_t *); #endif extern bool conversion_disabled_p (void); extern void check_postponed_buffers (void); -#ifdef HAVE_ANDROID -extern void get_conversion_field (struct frame *, ptrdiff_t *, ptrdiff_t *); -#endif extern void register_textconv_interface (struct textconv_interface *); #endif /* _TEXTCONV_H_ */ commit 4990849514899d1f4c7c8e4d92f83b0e1f62d95e Author: Paul Eggert Date: Mon Dec 8 18:05:13 2025 -0800 Move Gnulib configuration back to where it was * configure.ac: Move the gl_INIT call back to where it was, as Mattias Engdegård reported the following problem: checking whether pthread_sigmask is a macro... no ./configure: line 32767: test: =: unary operator expected because moving gl_INIT up made the check for pthread_sigmask’s availability appear later than Gnulib’s check whether it’s a macro. Instead of moving gl_INIT up, call gl_ALIGNASOF earlier, as that’s the only part of gl_INIT that is needed earlier. diff --git a/configure.ac b/configure.ac index 2c29633a6a9..eeb3f4bbd7d 100644 --- a/configure.ac +++ b/configure.ac @@ -3226,31 +3226,6 @@ to configure.]) fi fi -# Configure gnulib. -# -# Do this after any CC or CFLAGS changes that affect Gnulib, -# and before any tests that depend on gnulib tests, -# e.g., the system_malloc=no test below. -# -# Do not affect CFLAGS or LIBS permanently. -# Instead, temporarily revert them to their pre-pkg-config values, -# because gnulib needs to work with both src (which uses the -# pkg-config stuff) and lib-src (which does not). For example, gnulib -# may need to determine whether CLOCK_TIME_LIB should contain -lrt, -# and it therefore needs to run in an environment where LIBS does not -# already contain -lrt merely because 'pkg-config --libs' printed '-lrt' -# for some package unrelated to lib-src. -SAVE_CFLAGS=$CFLAGS -SAVE_LIBS=$LIBS -CFLAGS=$pre_PKG_CONFIG_CFLAGS -LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS" -gl_ASSERT_NO_GNULIB_POSIXCHECK -gl_ASSERT_NO_GNULIB_TESTS -gl_EEMALLOC -gl_INIT -CFLAGS=$SAVE_CFLAGS -LIBS=$SAVE_LIBS - # Does the opsystem file prohibit the use of the GNU malloc? # Assume not, until told otherwise. GNU_MALLOC=yes @@ -3302,6 +3277,15 @@ if test "$emacs_cv_struct_alignment" = yes; then structure to an N-byte boundary.]) fi +# Check for alignas now rather than waiting for gl_INIT to do it, +# as the system_malloc=no test below needs $gl_cv_header_working_stdalign_h. +# Do not simply call gl_INIT here, as the ac_cv_func_pthread_sigmask=yes +# assignment below affects how gl_INIT works. +# Instead, call gl_ALIGNASOF, the only part of gl_INIT needed here. +# Then make gl_ALIGNASOF a no-op so gl_INIT does not duplicate its code. +gl_ALIGNASOF +AC_DEFUN([gl_ALIGNASOF]) + system_malloc=yes # If it appears as if the system malloc can't be trusted to return @@ -7384,6 +7368,25 @@ if test "$with_features" = no && test "$enable_acl" != yes; then enable_acl=no fi +# Configure gnulib. Although this does not affect CFLAGS or LIBS permanently, +# it temporarily reverts them to their pre-pkg-config values, +# because gnulib needs to work with both src (which uses the +# pkg-config stuff) and lib-src (which does not). For example, gnulib +# may need to determine whether CLOCK_TIME_LIB should contain -lrt, +# and it therefore needs to run in an environment where LIBS does not +# already contain -lrt merely because 'pkg-config --libs' printed '-lrt' +# for some package unrelated to lib-src. +SAVE_CFLAGS=$CFLAGS +SAVE_LIBS=$LIBS +CFLAGS=$pre_PKG_CONFIG_CFLAGS +LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS" +gl_ASSERT_NO_GNULIB_POSIXCHECK +gl_ASSERT_NO_GNULIB_TESTS +gl_EEMALLOC +gl_INIT +CFLAGS=$SAVE_CFLAGS +LIBS=$SAVE_LIBS + # Set up libgmp on Android. Make sure to override what gnulib has # found. LIBGMP_CFLAGS= commit 238c2dc3b65dac13bfdf6759a8141d8b645bb1ed Author: Po Lu Date: Tue Dec 9 09:49:23 2025 +0800 ; * src/keyboard.c (make_lispy_event): Remove unused variable. diff --git a/src/keyboard.c b/src/keyboard.c index 8ba9acd6ccc..776b87bde73 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6925,7 +6925,7 @@ make_lispy_event (struct input_event *event) Lisp_Object x, y, id, position; struct frame *f = XFRAME (event->frame_or_window); #if defined HAVE_WINDOW_SYSTEM && !defined HAVE_EXT_MENU_BAR - int column, row, dummy; + int column, row; #endif /* defined HAVE_WINDOW_SYSTEM && !defined HAVE_EXT_MENU_BAR */ #ifdef HAVE_WINDOW_SYSTEM int tab_bar_item; commit a9018ee4986e4b01ac837a6430969f7481188960 Author: Po Lu Date: Tue Dec 9 09:48:53 2025 +0800 Fix builds without toolkit menu bars * src/keyboard.c (make_lispy_event): Call x_y_to_column_row when building internal menu bar events. * src/xdisp.c (x_y_to_column_row): Provide DX and DY parameters to x_y_to_column_row. diff --git a/src/keyboard.c b/src/keyboard.c index b1d523f580c..8ba9acd6ccc 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6948,9 +6948,8 @@ make_lispy_event (struct input_event *event) if (!NILP (f->menu_bar_window)) { - x_y_to_hpos_vpos (XWINDOW (f->menu_bar_window), XFIXNUM (x), - XFIXNUM (y), &column, &row, NULL, NULL, - &dummy); + x_y_to_column_row (XWINDOW (f->menu_bar_window), XFIXNUM (x), + XFIXNUM (y), &column, &row); if (row >= 0 && row < FRAME_MENU_BAR_LINES (f)) { diff --git a/src/xdisp.c b/src/xdisp.c index 233233415d1..06d5481acd3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2447,7 +2447,7 @@ void x_y_to_column_row (struct window *w, int x, int y, int *column, int *row) { int dummy; - x_y_to_hpos_vpos (w, x, y, column, row, &dummy); + x_y_to_hpos_vpos (w, x, y, column, row, NULL, NULL, &dummy); } #endif commit 6caf598ac49b3ed592f22e31307fe71e71490f2b Author: João Távora Date: Mon Dec 8 21:39:34 2025 +0000 Jsonrpc: defend against very large stderr lines In https://github.com/joaotavora/rassumfrassum/issues/1 we found a language server that emits very large single-line messages (5MB): that eventually end up in Eglot's stderr. With the output arriving in chunks into the stderr buffer, this creates a significant slowdown of '[stderr] nil' lines, which eventually clogs up the stdout JSONRPC communication. This fix exits the `jsonrpc--forwarding-buffer` function early if the forward-line call didn't actually move to a new line. * lisp/jsonrpc.el (jsonrpc--forwarding-buffer): Fix. (Version): Bump to 1.0.27. diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 808c1fdd147..ca2647971fd 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ ;; Author: João Távora ;; Keywords: processes, languages, extensions -;; Version: 1.0.26 +;; Version: 1.0.27 ;; Package-Requires: ((emacs "25.2")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -1109,7 +1109,7 @@ PREFIX to CONN's events buffer." (unless (eql max 0) (cl-loop initially (goto-char beg) do (forward-line) - when (bolp) + while (bolp) for line = (buffer-substring (line-beginning-position 0) (line-end-position 0)) commit 74348a722a47b9592f30e276be2c1381f36eb824 Author: Elías Gabriel Pérez Date: Mon Dec 8 21:16:03 2025 +0200 ; * lisp/progmodes/hideshow.el (hs-block-positions): Fix throw tag. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 886bd7505aa..123eb1bd6c6 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -817,7 +817,7 @@ and `hs-block-end-regexp'." (goto-char (match-beginning hs-block-start-mdata-select)) (condition-case _ (funcall hs-forward-sexp-function 1) - (scan-error (throw 'hs-sexp-error nil))) + (scan-error (throw 'hs--block-exit nil))) ;; `end' is the point at the end of the block (setq end (cond ((not adjust-end) (point)) ((and (stringp hs-block-end-regexp) commit 1c43511dbc856509f50642f6a8bfb88f5ff5d96d Author: Paul Eggert Date: Mon Dec 8 10:37:22 2025 -0800 Fix xmenu.c USE_X_TOOLKIT duplication * src/xmenu.c (Fx_menu_bar_open_internal): Don’t say ‘#ifdef USE_X_TOOLKIT’ inside an #if where it is already known that USE_X_TOOLKIT is defined. diff --git a/src/xmenu.c b/src/xmenu.c index f95c50b1833..1a58b1e1427 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -474,7 +474,7 @@ DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_i { XEvent ev; struct frame *f = decode_window_system_frame (frame); -#if defined USE_X_TOOLKIT && defined HAVE_XINPUT2 +#ifdef HAVE_XINPUT2 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); #endif Widget menubar; @@ -489,7 +489,7 @@ DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_i Window child; bool error_p = false; -#if defined USE_X_TOOLKIT && defined HAVE_XINPUT2 +#ifdef HAVE_XINPUT2 /* Clear the XI2 grab so Motif or lwlib can set a core grab. Otherwise some versions of Motif will emit a warning and hang, and lwlib will fail to destroy the menu window. */ commit 855ad6d870852144221a15d04f4b31969689bffb Author: Paul Eggert Date: Mon Dec 8 10:35:03 2025 -0800 Fix some C symbol extern visibility Make some C symbols static if they don’t need to be extern. Also, remove a couple of functions that were discovered to be unused as a result of this process, and mark two extern functions intended to be usable from GDB. * src/buffer.c (previous_overlay_change): * src/composite.c (composition_lisp_table): * src/fileio.c (file_name_directory): * src/frame.c (check_tty): * src/insdel.c (adjust_markers_for_insert): * src/keyboard.c (unread_switch_frame, read_char) (requeued_events_pending_p): * src/sysdep.c (renameat_noreplace) [!HAVE_ANDROID]: * src/textconv.c (get_conversion_field) [!HAVE_ANDROID]: * src/treesit.c (TREESIT_BOB_LINECOL, TREESIT_TS_POINT_1_0) (treesit_buf_tracks_linecol_p, make_treesit_parser) (make_treesit_node): * src/xdisp.c (x_y_to_hpos_vpos): * src/xfaces.c (load_color) [!MSDOS]: * src/xfns.c (x_real_pos_and_offsets): * src/xterm.c (x_dnd_do_unsupported_drop): Now static. Move up if necessary. * src/coding.c (utf8_string_p): * src/keyboard.c (detect_input_pending_ignore_squeezables): Remove; unused. * src/frame.c (gui_set_alpha): * src/textconv.c (start_batch_edit, end_batch_edit, commit_text) (finish_composing_text, set_composing_text) (set_composing_region, textconv_set_point_and_mark) (delete_surrounding_text, request_point_update) (textconv_barrier, replace_text, get_extracted_text) (get_surrounding_text): * src/xdisp.c (gui_union_rectangles): * src/xterm.c (xi_frame_selected_for): Define only if needed. * src/treesit.c (treesit_debug_print_parser_list) (treesit_debug_print_linecol): Declare EXTERNALLY_VISIBLE. * src/xdisp.c (x_y_to_column_row): New function, defined only if needed. All external callers to x_y_to_hpos_vpos changed. diff --git a/src/buffer.c b/src/buffer.c index 3ef95626600..ee3e197a8b0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3171,7 +3171,7 @@ next_overlay_change (ptrdiff_t pos) return next; } -ptrdiff_t +static ptrdiff_t previous_overlay_change (ptrdiff_t pos) { struct itree_node *node; diff --git a/src/buffer.h b/src/buffer.h index 302daac3e04..6049a78af3a 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1250,7 +1250,6 @@ extern void delete_all_overlays (struct buffer *); extern void reset_buffer (struct buffer *); extern void compact_buffer (struct buffer *); extern ptrdiff_t overlays_at (ptrdiff_t, bool, Lisp_Object **, ptrdiff_t *, ptrdiff_t *); -extern ptrdiff_t previous_overlay_change (ptrdiff_t); extern ptrdiff_t next_overlay_change (ptrdiff_t); extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); diff --git a/src/coding.c b/src/coding.c index a923b6bd82d..a5c10d98ec0 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6330,27 +6330,6 @@ check_utf_8 (struct coding_system *coding) return nchars; } - -/* Return whether STRING is a valid UTF-8 string. STRING must be a - unibyte string. */ - -bool -utf8_string_p (Lisp_Object string) -{ - eassert (!STRING_MULTIBYTE (string)); - struct coding_system coding; - setup_coding_system (Qutf_8_unix, &coding); - /* We initialize only the fields that check_utf_8 accesses. */ - coding.head_ascii = -1; - coding.src_pos = 0; - coding.src_pos_byte = 0; - coding.src_chars = SCHARS (string); - coding.src_bytes = SBYTES (string); - coding.src_object = string; - coding.eol_seen = EOL_SEEN_NONE; - return check_utf_8 (&coding) != -1; -} - /* Like make_string, but always returns a multibyte Lisp string, and avoids decoding if TEXT is encoded in UTF-8. */ Lisp_Object diff --git a/src/coding.h b/src/coding.h index 2d538ba69d3..2bf62ca055b 100644 --- a/src/coding.h +++ b/src/coding.h @@ -683,7 +683,6 @@ struct coding_system /* Extern declarations. */ extern Lisp_Object code_conversion_save (bool, bool); extern bool encode_coding_utf_8 (struct coding_system *); -extern bool utf8_string_p (Lisp_Object); extern void setup_coding_system (Lisp_Object, struct coding_system *); extern Lisp_Object coding_charset_list (struct coding_system *); extern Lisp_Object coding_system_charset_list (Lisp_Object); diff --git a/src/commands.h b/src/commands.h index ca672d15d74..58f8253171c 100644 --- a/src/commands.h +++ b/src/commands.h @@ -23,15 +23,6 @@ along with GNU Emacs. If not, see . */ #define Ctl(c) ((c)&037) -/* If not Qnil, this is a switch-frame event which we decided to put - off until the end of a key sequence. This should be read as the - next command input, after any Vunread_command_events. - - read_key_sequence uses this to delay switch-frame events until the - end of the key sequence; Fread_char uses it to put off switch-frame - events until a non-ASCII event is acceptable as input. */ -extern Lisp_Object unread_switch_frame; - /* Nonzero if input is coming from the keyboard. */ #define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive) diff --git a/src/composite.c b/src/composite.c index b6c5b61a6a9..844b8b421a4 100644 --- a/src/composite.c +++ b/src/composite.c @@ -149,7 +149,7 @@ ptrdiff_t n_compositions; /* Hash table for compositions. The key is COMPONENTS-VEC of `composition' property. The value is the corresponding COMPOSITION-ID. */ -Lisp_Object composition_hash_table; +static Lisp_Object composition_hash_table; /* Maximum number of characters to look back for auto-compositions. */ diff --git a/src/composite.h b/src/composite.h index 3af28c68845..02eb34d1603 100644 --- a/src/composite.h +++ b/src/composite.h @@ -191,7 +191,6 @@ extern ptrdiff_t n_compositions; #define CHECK_BORDER (CHECK_HEAD | CHECK_TAIL) #define CHECK_ALL (CHECK_BORDER | CHECK_INSIDE) -extern Lisp_Object composition_hash_table; extern ptrdiff_t get_composition_id (ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object, Lisp_Object); extern bool find_composition (ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, diff --git a/src/dispextern.h b/src/dispextern.h index 19ab104d2e6..e6fdb9becab 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3630,6 +3630,9 @@ extern void gui_union_rectangles (const Emacs_Rectangle *, const Emacs_Rectangle *, Emacs_Rectangle *); extern void gui_consider_frame_title (Lisp_Object); +# ifndef HAVE_EXT_MENU_BAR +extern void x_y_to_column_row (struct window *, int, int, int *, int *); +# endif #endif /* HAVE_WINDOW_SYSTEM */ extern void note_mouse_highlight (struct frame *, int, int); @@ -3642,8 +3645,6 @@ extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *, int, int, enum draw_glyphs_face); extern void display_tty_menu_item (const char *, int, int, int, int, bool); #endif -extern struct glyph *x_y_to_hpos_vpos (struct window *, int, int, int *, int *, - int *, int *, int *); /* Flags passed to try_window. */ #define TRY_WINDOW_CHECK_MARGINS (1 << 0) #define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1) @@ -3747,8 +3748,10 @@ bool parse_color_spec (const char *, Lisp_Object tty_color_name (struct frame *, int); void clear_face_cache (bool); +#ifdef MSDOS unsigned long load_color (struct frame *, struct face *, Lisp_Object, enum lface_attribute_index); +#endif char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, int *); #ifdef HAVE_WINDOW_SYSTEM diff --git a/src/fileio.c b/src/fileio.c index 5cb3a267807..33ed4f8a83f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -429,35 +429,10 @@ use the standard functions without calling themselves recursively. */) return result; } -DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, - 1, 1, 0, - doc: /* Return the directory component in file name FILENAME. -Return nil if FILENAME does not include a directory. -Otherwise return a directory name. -Given a Unix syntax file name, returns a string ending in slash. */) - (Lisp_Object filename) -{ - Lisp_Object handler; - - CHECK_STRING (filename); - - /* If the file name has special constructs in it, - call the corresponding file name handler. */ - handler = Ffind_file_name_handler (filename, Qfile_name_directory); - if (!NILP (handler)) - { - Lisp_Object handled_name = calln (handler, Qfile_name_directory, - filename); - return STRINGP (handled_name) ? handled_name : Qnil; - } - - return file_name_directory (filename); -} - /* Return the directory component of FILENAME, or nil if FILENAME does not contain a directory component. */ -Lisp_Object +static Lisp_Object file_name_directory (Lisp_Object filename) { char *beg = SSDATA (filename); @@ -532,6 +507,31 @@ file_name_directory (Lisp_Object filename) #endif /* DOS_NT */ } +DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, + 1, 1, 0, + doc: /* Return the directory component in file name FILENAME. +Return nil if FILENAME does not include a directory. +Otherwise return a directory name. +Given a Unix syntax file name, returns a string ending in slash. */) + (Lisp_Object filename) +{ + Lisp_Object handler; + + CHECK_STRING (filename); + + /* If the file name has special constructs in it, + call the corresponding file name handler. */ + handler = Ffind_file_name_handler (filename, Qfile_name_directory); + if (!NILP (handler)) + { + Lisp_Object handled_name = calln (handler, Qfile_name_directory, + filename); + return STRINGP (handled_name) ? handled_name : Qnil; + } + + return file_name_directory (filename); +} + DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, Sfile_name_nondirectory, 1, 1, 0, doc: /* Return file name FILENAME sans its directory. diff --git a/src/frame.c b/src/frame.c index 2b3049d657a..1185eacb16c 100644 --- a/src/frame.c +++ b/src/frame.c @@ -130,14 +130,6 @@ decode_window_system_frame (Lisp_Object frame) #endif } -struct frame * -decode_tty_frame (Lisp_Object frame) -{ - struct frame *f = decode_live_frame (frame); - check_tty (f); - return f; -} - void check_window_system (struct frame *f) { @@ -149,7 +141,7 @@ check_window_system (struct frame *f) : "Window system is not in use or not initialized"); } -void +static void check_tty (struct frame *f) { /* FIXME: the noninteractive case is here because some tests running @@ -163,6 +155,14 @@ check_tty (struct frame *f) error ("tty frame should be used"); } +struct frame * +decode_tty_frame (Lisp_Object frame) +{ + struct frame *f = decode_live_frame (frame); + check_tty (f); + return f; +} + /* Return a frame with the given NAME (a string) or nil. Note that if there are several frames with this NAME, the first found is returned. This function was inspired by Fget_buffer. */ @@ -5799,6 +5799,8 @@ gui_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval) #endif } +#if (defined HAVE_PGTK || defined HAVE_NTGUI \ + || defined HAVE_HAIKU || defined HAVE_NS) void gui_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { @@ -5848,6 +5850,7 @@ gui_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval) unblock_input (); } } +#endif void gui_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval) diff --git a/src/frame.h b/src/frame.h index 9238b4ccd6e..9db68775bf6 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1488,7 +1488,6 @@ window_system_available (struct frame *f) } extern WINDOW_SYSTEM_RETURN void check_window_system (struct frame *); -void check_tty (struct frame *f); struct frame *decode_tty_frame (Lisp_Object frame); extern void frame_make_pointer_invisible (struct frame *); extern void frame_make_pointer_visible (struct frame *); diff --git a/src/insdel.c b/src/insdel.c index 24bacdbcaf2..cb788d71eaa 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -284,7 +284,7 @@ adjust_markers_for_delete (ptrdiff_t from, ptrdiff_t from_byte, we advance it if either its insertion-type is t or BEFORE_MARKERS is true. */ -void +static void adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t to, ptrdiff_t to_byte, bool before_markers) { diff --git a/src/keyboard.c b/src/keyboard.c index 2439e61a63e..b1d523f580c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -223,7 +223,7 @@ EMACS_INT command_loop_level; read_key_sequence uses this to delay switch-frame events until the end of the key sequence; Fread_char uses it to put off switch-frame events until a non-ASCII event is acceptable as input. */ -Lisp_Object unread_switch_frame; +static Lisp_Object unread_switch_frame; /* Last size recorded for a current buffer which is not a minibuffer. */ static ptrdiff_t last_non_minibuf_size; @@ -2530,7 +2530,7 @@ read_decoded_event_from_main_queue (struct timespec *end_time, Value is t if we showed a menu and the user rejected it. */ -Lisp_Object +static Lisp_Object read_char (int commandflag, Lisp_Object map, Lisp_Object prev_event, bool *used_mouse_menu, struct timespec *end_time) @@ -6446,13 +6446,11 @@ make_lispy_event (struct input_event *event) if (FRAME_WINDOW_P (f)) { struct window *menu_w = XWINDOW (f->menu_bar_window); - int x, y, dummy; - - x = FRAME_TO_WINDOW_PIXEL_X (menu_w, XFIXNUM (event->x)); - y = FRAME_TO_WINDOW_PIXEL_Y (menu_w, XFIXNUM (event->y)); - - x_y_to_hpos_vpos (XWINDOW (f->menu_bar_window), x, y, &column, &row, - NULL, NULL, &dummy); + x_y_to_column_row + (XWINDOW (f->menu_bar_window), + FRAME_TO_WINDOW_PIXEL_X (menu_w, XFIXNUM (event->x)), + FRAME_TO_WINDOW_PIXEL_Y (menu_w, XFIXNUM (event->y)), + &column, &row); } else #endif @@ -10804,6 +10802,18 @@ restore_reading_key_sequence (int old_reading_key_sequence) #endif /* HAVE_TEXT_CONVERSION */ +/* Return true if there are any pending requeued events (command events + or events to be processed by other levels of the input processing + stages). */ + +static bool +requeued_events_pending_p (void) +{ + return (requeued_command_events_pending_p () + || !NILP (Vunread_post_input_method_events) + || !NILP (Vunread_input_method_events)); +} + /* Read a sequence of keys that ends with a non prefix character, storing it in KEYBUF, a buffer of size READ_KEY_ELTS. Prompt with PROMPT. @@ -11989,15 +11999,6 @@ detect_input_pending (void) return input_pending || get_input_pending (0); } -/* Return true if input events other than mouse movements are - pending. */ - -bool -detect_input_pending_ignore_squeezables (void) -{ - return input_pending || get_input_pending (READABLE_EVENTS_IGNORE_SQUEEZABLES); -} - /* Return true if input events are pending, and run any pending timers. */ bool @@ -12032,18 +12033,6 @@ requeued_command_events_pending_p (void) return (CONSP (Vunread_command_events)); } -/* Return true if there are any pending requeued events (command events - or events to be processed by other levels of the input processing - stages). */ - -bool -requeued_events_pending_p (void) -{ - return (requeued_command_events_pending_p () - || !NILP (Vunread_post_input_method_events) - || !NILP (Vunread_input_method_events)); -} - DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0, doc: /* Return t if command input is currently available with no wait. Actually, the value is nil only if we can be sure that no input is available; diff --git a/src/keyboard.h b/src/keyboard.h index 5e04b54eb74..6d90c87c5f7 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -460,8 +460,6 @@ extern bool ignore_mouse_drag_p; extern Lisp_Object parse_modifiers (Lisp_Object); extern Lisp_Object reorder_modifiers (Lisp_Object); -extern Lisp_Object read_char (int, Lisp_Object, Lisp_Object, - bool *, struct timespec *); extern int parse_solitary_modifier (Lisp_Object symbol); @@ -491,7 +489,6 @@ extern int gobble_input (void); extern bool input_polling_used (void); extern void clear_input_pending (void); extern bool requeued_command_events_pending_p (void); -extern bool requeued_events_pending_p (void); extern void bind_polling_period (int); extern int make_ctrl_char (int) ATTRIBUTE_CONST; extern void stuff_buffered_input (Lisp_Object); diff --git a/src/lisp.h b/src/lisp.h index e63019cc088..968ea4c4086 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4375,8 +4375,6 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void adjust_markers_for_insert (ptrdiff_t, ptrdiff_t, - ptrdiff_t, ptrdiff_t, bool); extern void adjust_markers_bytepos (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, int); extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool, bool); @@ -4785,7 +4783,6 @@ intern_c_string (const char *str) extern Lisp_Object Vautoload_queue; extern Lisp_Object Vrun_hooks; extern Lisp_Object Vsignaling_function; -extern Lisp_Object inhibit_lisp_code; extern bool signal_quit_p (Lisp_Object); /* To run a normal hook, use the appropriate function from the list below. @@ -4982,7 +4979,6 @@ extern void syms_of_marker (void); /* Defined in fileio.c. */ -extern Lisp_Object file_name_directory (Lisp_Object); extern char *splice_dir_file (char *, char const *, char const *) ATTRIBUTE_RETURNS_NONNULL; extern bool file_name_absolute_p (const char *); @@ -5111,7 +5107,6 @@ void handle_input_available_signal (int); #endif extern Lisp_Object pending_funcalls; extern bool detect_input_pending (void); -extern bool detect_input_pending_ignore_squeezables (void); extern bool detect_input_pending_run_timers (bool); extern void safe_run_hooks (Lisp_Object); extern void safe_run_hooks_2 (Lisp_Object, Lisp_Object, Lisp_Object); @@ -5354,7 +5349,9 @@ extern ptrdiff_t emacs_write (int, void const *, ptrdiff_t); extern ptrdiff_t emacs_write_sig (int, void const *, ptrdiff_t); extern ptrdiff_t emacs_write_quit (int, void const *, ptrdiff_t); extern void emacs_perror (char const *); +#ifdef HAVE_ANDROID extern int renameat_noreplace (int, char const *, int, char const *); +#endif extern int str_collate (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern void syms_of_sysdep (void); diff --git a/src/sysdep.c b/src/sysdep.c index af16db36f99..a8320e1db26 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2370,6 +2370,33 @@ emacs_backtrace (int backtrace_limit) } } +/* Rename directory SRCFD's entry SRC to directory DSTFD's entry DST. + This is like renameat except that it fails if DST already exists, + or if this operation is not supported atomically. Return 0 if + successful, -1 (setting errno) otherwise. */ +#ifndef HAVE_ANDROID +static +#endif +int +renameat_noreplace (int srcfd, char const *src, int dstfd, char const *dst) +{ +#if HAVE_RENAMEAT2 && defined RENAME_NOREPLACE + return renameat2 (srcfd, src, dstfd, dst, RENAME_NOREPLACE); +#elif defined SYS_renameat2 && defined RENAME_NOREPLACE + /* Linux kernel 3.15 (2014) or later, with glibc 2.27 (2018) or earlier. */ + return syscall (SYS_renameat2, srcfd, src, dstfd, dst, RENAME_NOREPLACE); +#elif defined RENAME_EXCL + return renameatx_np (srcfd, src, dstfd, dst, RENAME_EXCL); +#else +# ifdef WINDOWSNT + if (srcfd == AT_FDCWD && dstfd == AT_FDCWD) + return sys_rename_replace (src, dst, 0); +# endif + errno = ENOSYS; + return -1; +#endif +} + #if !defined HAVE_NTGUI && !(defined HAVE_ANDROID \ && !defined ANDROID_STUBIFY) void @@ -2863,30 +2890,6 @@ emacs_perror (char const *message) errno = err; } -/* Rename directory SRCFD's entry SRC to directory DSTFD's entry DST. - This is like renameat except that it fails if DST already exists, - or if this operation is not supported atomically. Return 0 if - successful, -1 (setting errno) otherwise. */ -int -renameat_noreplace (int srcfd, char const *src, int dstfd, char const *dst) -{ -#if HAVE_RENAMEAT2 && defined RENAME_NOREPLACE - return renameat2 (srcfd, src, dstfd, dst, RENAME_NOREPLACE); -#elif defined SYS_renameat2 && defined RENAME_NOREPLACE - /* Linux kernel 3.15 (2014) or later, with glibc 2.27 (2018) or earlier. */ - return syscall (SYS_renameat2, srcfd, src, dstfd, dst, RENAME_NOREPLACE); -#elif defined RENAME_EXCL - return renameatx_np (srcfd, src, dstfd, dst, RENAME_EXCL); -#else -# ifdef WINDOWSNT - if (srcfd == AT_FDCWD && dstfd == AT_FDCWD) - return sys_rename_replace (src, dst, 0); -# endif - errno = ENOSYS; - return -1; -#endif -} - /* Like strsignal, except async-signal-safe, and this function returns a string in the C locale rather than the current locale. */ char const * diff --git a/src/textconv.c b/src/textconv.c index 105a8077072..e5ade79895c 100644 --- a/src/textconv.c +++ b/src/textconv.c @@ -1743,6 +1743,9 @@ handle_pending_conversion_events (void) F should be constrained in *BEG and *END. Should no field be active, set *END to PTRDIFF_MAX. */ +#ifndef HAVE_ANDROID +static +#endif void get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) { @@ -1772,6 +1775,8 @@ get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) *end = PTRDIFF_MAX; } +#ifdef HAVE_ANDROID + /* Start a ``batch edit'' in frame F. During a batch edit, point_changed will not be called until the batch edit ends. @@ -2307,6 +2312,7 @@ get_surrounding_text (struct frame *f, ptrdiff_t left, unbind_to (count, Qnil); return buffer; } +#endif /* HAVE_ANDROID */ /* Return whether or not text conversion is temporarily disabled. `reset' should always call this to determine whether or not to diff --git a/src/textconv.h b/src/textconv.h index d4562344a7e..1e5ed9e4806 100644 --- a/src/textconv.h +++ b/src/textconv.h @@ -126,6 +126,7 @@ extern int textconv_query (struct frame *, struct textconv_callback_struct *, int); extern bool detect_conversion_events (void); extern void handle_pending_conversion_events (void); +#ifdef HAVE_ANDROID extern void start_batch_edit (struct frame *, unsigned long); extern void end_batch_edit (struct frame *, unsigned long); extern void commit_text (struct frame *, Lisp_Object, ptrdiff_t, @@ -152,10 +153,13 @@ extern char *get_surrounding_text (struct frame *, ptrdiff_t, ptrdiff_t, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, ptrdiff_t *); +#endif extern bool conversion_disabled_p (void); extern void check_postponed_buffers (void); +#ifdef HAVE_ANDROID extern void get_conversion_field (struct frame *, ptrdiff_t *, ptrdiff_t *); +#endif extern void register_textconv_interface (struct textconv_interface *); #endif /* _TEXTCONV_H_ */ diff --git a/src/treesit.c b/src/treesit.c index 71ded0dcb71..3d63ad67157 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -472,10 +472,10 @@ init_treesit_functions (void) /*** Constants */ /* A linecol_cache that points to BOB, this is always valid. */ -const struct ts_linecol TREESIT_BOB_LINECOL = { 1, 1, 0 }; +static struct ts_linecol const TREESIT_BOB_LINECOL = { 1, 1, 0 }; /* An uninitialized linecol. */ const struct ts_linecol TREESIT_EMPTY_LINECOL = { 0, 0, 0 }; -const TSPoint TREESIT_TS_POINT_1_0 = { 1, 0 }; +static TSPoint const TREESIT_TS_POINT_1_0 = { 1, 0 }; @@ -563,7 +563,7 @@ treesit_initialize (void) /*** Debugging */ -void treesit_debug_print_parser_list (char *, Lisp_Object); +void treesit_debug_print_parser_list (char *, Lisp_Object) EXTERNALLY_VISIBLE; void treesit_debug_print_parser_list (char *msg, Lisp_Object parser) @@ -980,7 +980,7 @@ loaded or the file name couldn't be determined, return nil. */) #define TREESIT_DEBUG_LINECOL false -void treesit_debug_print_linecol (struct ts_linecol); +void treesit_debug_print_linecol (struct ts_linecol) EXTERNALLY_VISIBLE; void treesit_debug_print_linecol (struct ts_linecol linecol) @@ -988,8 +988,9 @@ treesit_debug_print_linecol (struct ts_linecol linecol) printf ("{ line=%td col=%td bytepos=%td }\n", linecol.line, linecol.col, linecol.bytepos); } -/* Returns true if BUF tracks linecol. */ -bool treesit_buf_tracks_linecol_p (struct buffer *buf) +/* Return true if BUF tracks linecol. */ +static bool +treesit_buf_tracks_linecol_p (struct buffer *buf) { return BUF_TS_LINECOL_BEGV (buf).bytepos != 0; } @@ -1990,7 +1991,7 @@ treesit_read_buffer (void *parser, uint32_t byte_index, /* Wrap the parser in a Lisp_Object to be used in the Lisp machine. */ -Lisp_Object +static Lisp_Object make_treesit_parser (Lisp_Object buffer, TSParser *parser, TSTree *tree, Lisp_Object language_symbol, Lisp_Object tag, bool tracks_linecol) @@ -2043,7 +2044,7 @@ make_treesit_parser (Lisp_Object buffer, TSParser *parser, } /* Wrap the node in a Lisp_Object to be used in the Lisp machine. */ -Lisp_Object +static Lisp_Object make_treesit_node (Lisp_Object parser, TSNode node) { struct Lisp_TS_Node *lisp_node; diff --git a/src/treesit.h b/src/treesit.h index 5937dba8653..e317e15a9f8 100644 --- a/src/treesit.h +++ b/src/treesit.h @@ -231,12 +231,9 @@ CHECK_TS_COMPILED_QUERY (Lisp_Object query) INLINE_HEADER_END -extern const struct ts_linecol TREESIT_BOB_LINECOL; /* An uninitialized linecol. */ extern const struct ts_linecol TREESIT_EMPTY_LINECOL; -extern const TSPoint TREESIT_TS_POINT_1_0; -extern bool treesit_buf_tracks_linecol_p (struct buffer *); extern struct ts_linecol linecol_offset (struct ts_linecol, struct ts_linecol); extern struct ts_linecol treesit_linecol_maybe (ptrdiff_t, ptrdiff_t, @@ -244,9 +241,6 @@ extern struct ts_linecol treesit_linecol_maybe (ptrdiff_t, ptrdiff_t, extern void treesit_record_change (ptrdiff_t, ptrdiff_t, ptrdiff_t, struct ts_linecol, struct ts_linecol, ptrdiff_t); -extern Lisp_Object make_treesit_parser (Lisp_Object, TSParser *, TSTree *, - Lisp_Object, Lisp_Object, bool); -extern Lisp_Object make_treesit_node (Lisp_Object, TSNode); extern bool treesit_node_uptodate_p (Lisp_Object); extern bool treesit_node_buffer_live_p (Lisp_Object); diff --git a/src/xdisp.c b/src/xdisp.c index 68ba07e6d61..233233415d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2363,7 +2363,7 @@ pixel_to_glyph_coords (struct frame *f, int pix_x, int pix_y, int *x, int *y, text, or we can't tell because W's current matrix is not up to date. */ -struct glyph * +static struct glyph * x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos, int *dx, int *dy, int *area) { @@ -2436,6 +2436,21 @@ x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos, return glyph; } +#if defined HAVE_WINDOW_SYSTEM && !defined HAVE_EXT_MENU_BAR + +/* Find the glyph under window-relative coordinates X/Y in window W. + Consider only glyphs from buffer text, i.e. no glyphs from overlay + strings. Return in *HPOS and *VPOS the row and column number of + the glyph found. */ + +void +x_y_to_column_row (struct window *w, int x, int y, int *column, int *row) +{ + int dummy; + x_y_to_hpos_vpos (w, x, y, column, row, &dummy); +} +#endif + /* Convert frame-relative x/y to coordinates relative to window W. Takes pseudo-windows into account. */ @@ -37690,6 +37705,8 @@ gui_intersect_rectangles (const Emacs_Rectangle *r1, const Emacs_Rectangle *r2, return intersection_p; } +# if HAVE_ANDROID + /* EXPORT: Determine the union of the rectangles A and B. Return the smallest rectangle encompassing both the bounds of A and B in *RESULT. It @@ -37738,6 +37755,7 @@ gui_union_rectangles (const Emacs_Rectangle *a, const Emacs_Rectangle *b, result->width = result_box.x2 - result_box.x1; result->height = result_box.y2 - result_box.y1; } +# endif #endif /* HAVE_WINDOW_SYSTEM */ diff --git a/src/xfaces.c b/src/xfaces.c index 9a3c95436a3..2e063fc9fd1 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1362,6 +1362,9 @@ load_color2 (struct frame *f, struct face *face, Lisp_Object name, record that fact in flags of the face so that we don't try to free these colors. */ +#ifndef MSDOS +static +#endif unsigned long load_color (struct frame *f, struct face *face, Lisp_Object name, enum lface_attribute_index target_index) diff --git a/src/xfns.c b/src/xfns.c index e9ca756cc32..0fc3f7aeeab 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -213,7 +213,7 @@ check_x_display_info (Lisp_Object object) Store the screen positions of frame F into XPTR and YPTR. These are the positions of the containing window manager window, not Emacs's own window. */ -void +static void x_real_pos_and_offsets (struct frame *f, int *left_offset_x, int *right_offset_x, diff --git a/src/xterm.c b/src/xterm.c index e47a836713a..ed8cbadde41 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3988,7 +3988,7 @@ x_dnd_get_wm_state_and_proto (struct x_display_info *dpyinfo, it as a request for XdndSelection. Note that you must use the X data types instead of the MIME types in this case. (e.g. XA_STRING instead of text/plain). */ -void +static void x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo, Lisp_Object frame, Lisp_Object value, Lisp_Object targets, Window target_window, @@ -5308,6 +5308,7 @@ x_extension_initialize (struct x_display_info *dpyinfo) #ifdef HAVE_XINPUT2 +# ifdef HAVE_X_TOOLKIT bool xi_frame_selected_for (struct frame *f, unsigned long event) { @@ -5328,6 +5329,7 @@ xi_frame_selected_for (struct frame *f, unsigned long event) return false; } +# endif /* Convert XI2 button state IN to a standard X button modifier mask, and place it in OUT. */ diff --git a/src/xterm.h b/src/xterm.h index 57e37a1a8f5..a1f86fd53d1 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1733,9 +1733,6 @@ SELECTION_EVENT_DISPLAY (struct selection_input_event *ev) extern frame_parm_handler x_frame_parm_handlers[]; extern void x_free_gcs (struct frame *); extern void x_relative_mouse_position (struct frame *, int *, int *); -extern void x_real_pos_and_offsets (struct frame *, int *, int *, int *, - int *, int *, int *, int *, int *, - int *); extern void x_default_font_parameter (struct frame *, Lisp_Object); /* From xrdb.c. */ @@ -1860,10 +1857,6 @@ extern Lisp_Object x_dnd_begin_drag_and_drop (struct frame *, Time, Atom, Lisp_Object, Atom *, const char **, size_t, bool, Atom *, int, Lisp_Object, bool); -extern void x_dnd_do_unsupported_drop (struct x_display_info *, Lisp_Object, - Lisp_Object, Lisp_Object, Window, int, - int, Time); - extern int x_display_pixel_height (struct x_display_info *); extern int x_display_pixel_width (struct x_display_info *); @@ -2024,10 +2017,12 @@ extern int x_error_message_count; #ifdef HAVE_XINPUT2 extern struct xi_device_t *xi_device_from_id (struct x_display_info *, int); +# ifdef HAVE_X_TOOLKIT extern bool xi_frame_selected_for (struct frame *, unsigned long); -#ifndef USE_GTK +# endif +# ifndef USE_GTK extern unsigned int xi_convert_event_state (XIDeviceEvent *); -#endif +# endif #endif extern void mark_xterm (void); commit 777622682f5db092560d6bdde040f65aa4671ba3 Author: Przemysław Kryger Date: Mon Dec 8 15:47:03 2025 +0000 Fix package-vc-tests * lisp/emacs-lisp/package-vc.el (package-vc--make): Use same format for buffer as `package-vc--build-documentation'. * test/lisp/emacs-lisp/package-vc-tests.el (message-auto-save-directory): Silence byte compiler. (package-vc-with-tests-environment): Initialize package archives after setting a temporary `package-user-dir'. Set up `package-gnupghome-dir'. Remove `default-directory' binding. (package-vc-tests-environment-tear-down): Fix argument order in `package-vc-tests-log-buffer-name' call. (package-vc-tests-with-installed): Rename from `package-vc-with-installed-tests'. (package-vc-test-deftest): Use `package-vc-tests-with-installed'. (prepare-patch): Bind `message-auto-save-directory' to `package-vc-tests-dir'. * test/lisp/package-vc-tests.el: Rename to test/lisp/emacs-lisp/package-vc-tests.el * test/lisp/package-vc-resources/Makefile.in: Rename to test/lisp/emacs-lisp/package-vc-resources/Makefile.in * test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in * test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in * test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in * test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in * test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in * test/lisp/package-vc-resources/test-package-SUFFIX.texi.in: Rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX.texi.in diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index c6e69c64a80..c536bdd642b 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -407,7 +407,7 @@ prepared." (let ((default-directory (package-vc--checkout-dir pkg-desc)) (target (plist-get pkg-spec :make)) (cmd (plist-get pkg-spec :shell-command)) - (buf (format " *package-vc make %s*" (package-desc-name pkg-desc))) + (buf (format " *package-vc make: %s*" (package-desc-name pkg-desc))) (makexe (or package-vc-make-program (seq-find #'executable-find '("gmake" "make"))))) (when (or cmd target) diff --git a/test/lisp/package-vc-resources/Makefile.in b/test/lisp/emacs-lisp/package-vc-resources/Makefile.in similarity index 100% rename from test/lisp/package-vc-resources/Makefile.in rename to test/lisp/emacs-lisp/package-vc-resources/Makefile.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in diff --git a/test/lisp/package-vc-resources/test-package-SUFFIX.texi.in b/test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX.texi.in similarity index 100% rename from test/lisp/package-vc-resources/test-package-SUFFIX.texi.in rename to test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX.texi.in diff --git a/test/lisp/package-vc-tests.el b/test/lisp/emacs-lisp/package-vc-tests.el similarity index 97% rename from test/lisp/package-vc-tests.el rename to test/lisp/emacs-lisp/package-vc-tests.el index 74235da7ec5..6430848b094 100644 --- a/test/lisp/package-vc-tests.el +++ b/test/lisp/emacs-lisp/package-vc-tests.el @@ -43,6 +43,9 @@ (require 'ert-x) (require 'ert) +;; Silence byte-compiler +(defvar message-auto-save-directory) + (defvar package-vc-tests-preserve-artefacts nil "When non-nil preserve temporary files and buffers produced by tests. Each test produces a new temporary directory for each package under @@ -391,22 +394,24 @@ names." ;; in directory package-vc-resources. Before executing body make sure ;; that: ;; - ;; - `package' has been initialised, and there are no - ;; `package-archives' defined - (let* ((package-archives (unless package--initialized - (let (package-archives) - (package-initialize) - (package-vc--archives-initialize)) - nil)) - ;; - create a temporary location for packages and test files - (package-vc-tests-dir + (let* ((package-vc-tests-dir (expand-file-name (make-temp-file "package-vc-tests-" t (format-time-string "-%Y%m%d.%H%M%S.%3N")))) - ;; - packages are installed into a test directory + ;; - packages are installed into test directory (package-user-dir (expand-file-name "elpa" package-vc-tests-dir)) + ;; - keyring is saved in test directory + (package-gnupghome-dir (expand-file-name "gnupg" + package-user-dir)) + ;; - `package' has been initialised, and there are no + ;; `package-archives' defined + (package-archives (unless package--initialized + (let (package-archives) + (package-initialize) + (package-vc--archives-initialize)) + nil)) ;; - define test packages, their checkout locations, lisp ;; directories, and install functions (package-vc-tests-packages (package-vc-tests-packages)) @@ -476,12 +481,7 @@ names." ;; - don't register projects (package-vc-register-as-project nil) ;; - allow build commands - (package-vc-allow-build-commands t) - ;; - FIXME: something sets `default-directory' to last - ;; checkout directory after `package-vc-checkout', which - ;; causes problems when this function deletes the temporary - ;; directory after body execution. - (default-directory package-vc-tests-dir)) + (package-vc-allow-build-commands t)) (funcall function))) (defun package-vc-tests-environment-tear-down (pkg) @@ -524,8 +524,8 @@ when PKG matches `package-vc-tests-preserve-artefacts'." (delq nil (mapcar (lambda (type) (get-buffer - (package-vc-tests-log-buffer-name type - pkg))) + (package-vc-tests-log-buffer-name pkg + type))) '(doc make))))) (if (or (memq package-vc-tests-preserve-artefacts `(t ,pkg)) (and (listp package-vc-tests-preserve-artefacts) @@ -538,7 +538,7 @@ when PKG matches `package-vc-tests-preserve-artefacts'." (dolist (buffer buffers) (kill-buffer buffer))))) -(defun package-vc-with-installed-tests (pkg function) +(defun package-vc-tests-with-installed (pkg function) "Call FUNCTION with PKG installed in a test environment. FUNCTION should have no arguments." (package-vc-with-tests-environment @@ -670,7 +670,7 @@ car of ARGS (a symbol) to name of the package." :file-name ,file :body (lambda () - (package-vc-with-installed-tests + (package-vc-tests-with-installed ',pkg (funcall ,fn ',pkg)) nil))) tests))) @@ -932,7 +932,8 @@ car of ARGS (a symbol) to name of the package." (package-vc-test-deftest prepare-patch (pkg) ;; Ensure `vc-prepare-patch' respects subject from function argument - (let ((vc-prepare-patches-separately nil)) + (let ((message-auto-save-directory package-vc-tests-dir) + (vc-prepare-patches-separately nil)) (package-vc-prepare-patch (package-vc-tests-package-desc pkg t) "test-subject" (cdr package-vc-tests-repository)) commit 70d24d0dd5742a6e0ffb77c9134a5970627ae849 Author: Sean Whitton Date: Mon Dec 8 16:53:16 2025 +0000 ; Improve documentation of the User Lisp directory. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 33c1c1b707d..f7ad5bf108a 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -3106,42 +3106,50 @@ Gather and activate autoload cookies. This means that you can use autoloaded commands and other entry points for the files in your @code{user-lisp-directory} without explicitly loading any of the files in your initialization file. (@pxref{Autoload,,, elisp, The -Emacs Lisp Reference Manual}) +Emacs Lisp Reference Manual}.) @item Byte-compile all files, and if supported on your system, natively compile them too. This speeds up the execution of the code in the files when they are loaded. (@pxref{Byte Compilation,,, elisp, The -Emacs Lisp Reference Manual}) +Emacs Lisp Reference Manual}.) @item Adjust @code{load-path} such that all the files can be loaded and autoloaded in the usual ways. (@pxref{Library Search,,, elisp, The -Emacs Lisp Reference Manual}) +Emacs Lisp Reference Manual}.) @end itemize - Keep in mind that as the User Lisp directory is processed at startup, -before loading the @ref{Init File} file, adjustment have to be made in -your early-init file (@pxref{Early Init File}). + The User Lisp directory is processed before loading the @ref{Init +File} file. Therefore any customizations to the user options discussed +below must be made in your early init file (@pxref{Early Init File}) in +order to have any effect. @vindex user-lisp-ignored-directories @vindex user-lisp-auto-scrape @findex prepare-user-lisp By default, Emacs considers all Lisp files within -@code{user-lisp-directory}, even in subdirectories. You prevent Emacs -from descending into specific subdirectories by customizing -@code{user-lisp-ignored-directories}. You can disable scraping at -startup by setting @code{user-lisp-auto-scrape} to @code{nil}. All -preparations automatically occur at startup if necessary, but can be -manually invoked during a session using the @code{prepare-user-lisp} -command. It is recommended to run the command with a prefix argument -after upgrading Emacs, to force all generated files to be updated. +@code{user-lisp-directory}, including within subdirectories. You can +prevent Emacs from descending into specific subdirectories by +customizing @code{user-lisp-ignored-directories}. You can completely +disable scraping at startup by customizing @code{user-lisp-auto-scrape} +to @code{nil}. In addition to how Emacs prepares the Lisp files +automatically at startup, you can manually invoke preparation using the +command @code{prepare-user-lisp}. + + Although Emacs automatically handles recompilation when the contents +of any Lisp files within the User Lisp directory have changed, there are +other reasons why recompilation can become necessary that Emacs can't +autodetect. A good rule of thumb that will catch most (but not all) +such issues is to force recompilation each time you upgrade to a new +release of Emacs. Start the new version of Emacs, type @w{@kbd{C-u M-x +prepare-user-lisp}}, then quit and restart Emacs again. The User Lisp directory is a simpler mechanism than package -installations (@pxref{Packages}). In particular, there is no automatic +installation (@pxref{Packages}). In particular, there is no automatic dependency resolution or upgrading for files in the User Lisp directory, or any facility for building and registering package documentation. This means that usually the User Lisp directory is best for code you have written only for yourself. However, it is possible to use the User -Lisp directory for third party packages or packages you maintain. +Lisp directory for third party packages or public packages you maintain. @node Authentication @section Keeping Persistent Authentication Information commit 154d6f0a155f917cad6fc44d971fb1f77a9820cf Author: Sean Whitton Date: Mon Dec 8 16:49:13 2025 +0000 ; package-vc-install-from-checkout: Fix 'obsolete' declaration. diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index b6b456331b8..c6e69c64a80 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -1022,7 +1022,7 @@ one created by `package-vc-checkout'. If invoked interactively with a prefix argument, prompt the user for the NAME of the package to set up. If the optional argument INTERACTIVE is non-nil (as happens interactively), DIR must be an absolute file name." - (declare (obsolete "Use the User Lisp directory instead." "30.1")) + (declare (obsolete "use the User Lisp directory instead." "31.1")) (interactive (let ((dir (expand-file-name (read-directory-name "Directory: ")))) (list dir (and current-prefix-arg (let ((base (file-name-base