commit 07222447b6c9e75b713fe3b3954952fbb0e40c71 (HEAD, refs/remotes/origin/master) Merge: c4c4a60f71 067361f3a2 Author: Stefan Kangas Date: Sun Oct 16 08:27:16 2022 +0200 Merge from origin/emacs-28 067361f3a2 ; Improve documentation of 'C-M-i' fdb6f7cf26 ; Fix documentation of 'comp-enable-subr-trampolines' be30369e01 ; Avoid incorrect indentation in an @example. 4bd3dd505e Document how to control where the *.eln files are written b7d7c2d9e9 Add cross-reference to alternative syntaxes for Unicode # Conflicts: # doc/emacs/custom.texi commit c4c4a60f71254b7f59010c5539545fc2fc49b855 Author: Stefan Kangas Date: Sun Oct 16 08:23:35 2022 +0200 Expand 'random' testsuite * test/src/fns-tests.el (ert): Require. (fns-tests-random): Expand test. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 5d5d497c99..fde5af38fc 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -22,6 +22,7 @@ ;;; Code: (require 'cl-lib) +(require 'ert) (ert-deftest fns-tests-identity () (let ((num 12345)) (should (eq (identity num) num))) @@ -29,9 +30,22 @@ (let ((lst '(11))) (should (eq (identity lst) lst)))) (ert-deftest fns-tests-random () - (should (integerp (random))) - (should (>= (random 10) 0)) - (should (< (random 10) 10))) + (unwind-protect + (progn + (should-error (random -1) :type 'args-out-of-range) + (should-error (random 0) :type 'args-out-of-range) + (should (integerp (random))) + (should (= (random 1) 0)) + (should (>= (random 10) 0)) + (should (< (random 10) 10)) + (should (equal (random "seed") (random "seed"))) + ;; The probability of four calls being the same is low. + ;; This makes sure that the value isn't constant. + (should (not (= (random t) (random t) (random t) (random t)))) + ;; Handle bignums. + (should (integerp (random (1+ most-positive-fixnum))))) + ;; Reset the PRNG seed after testing. + (random t))) (ert-deftest fns-tests-length () (should (= (length nil) 0)) commit cf19743aca5cb68c65bf5c8c3730a2eae3cb21e8 Author: Po Lu Date: Sun Oct 16 06:19:12 2022 +0000 Adapt last change to Haiku port * src/haikuterm.c (haiku_frame_up_to_date): (haiku_clear_frame): (haiku_update_begin): (haiku_flush): (haiku_flush_dirty_back_buffer_on): (haiku_read_socket): * src/haikuterm.h (struct haiku_output): (FRAME_COMPLETE_P): Synchronize logic with X. diff --git a/src/haikuterm.c b/src/haikuterm.c index 838eb128fa..4e32b74716 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -232,6 +232,9 @@ haiku_frame_up_to_date (struct frame *f) be_evict_font_cache (); up_to_date_count = 0; } + + /* Mark the frame as complete. */ + FRAME_COMPLETE_P (f) = true; unblock_input (); } @@ -265,6 +268,8 @@ haiku_clear_frame (struct frame *f) mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); + FRAME_COMPLETE_P (f) = false; + block_input (); BView_draw_lock (view, true, 0, 0, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)); @@ -1436,6 +1441,9 @@ haiku_clip_to_row (struct window *w, struct glyph_row *row, static void haiku_update_begin (struct frame *f) { + /* Mark the frame as incomplete so it is not flushed upon handling + input. */ + FRAME_COMPLETE_P (f) = false; } static void @@ -2959,6 +2967,10 @@ haiku_flush (struct frame *f) if (FRAME_DIRTY_P (f) && !buffer_flipping_blocked_p ()) haiku_flip_buffers (f); + /* The frame is complete again as its contents were just + flushed. */ + FRAME_COMPLETE_P (f) = true; + if (FRAME_VISIBLE_P (f) && !FRAME_TOOLTIP_P (f)) BWindow_Flush (FRAME_HAIKU_WINDOW (f)); } @@ -3086,10 +3098,15 @@ haiku_make_fullscreen_consistent (struct frame *f) static void haiku_flush_dirty_back_buffer_on (struct frame *f) { - if (!FRAME_GARBAGED_P (f) - && !buffer_flipping_blocked_p () - && FRAME_DIRTY_P (f)) - haiku_flip_buffers (f); + if (FRAME_GARBAGED_P (f) + || buffer_flipping_blocked_p () + /* If the frame is not already up to date, do not flush buffers + on input, as that will result in flicker. */ + || !FRAME_COMPLETE_P (f) + || !FRAME_DIRTY_P (f)) + return; + + haiku_flip_buffers (f); } /* N.B. that support for TYPE must be explicitly added to @@ -3135,6 +3152,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) int button_or_motion_p, do_help; enum haiku_event_type type; struct input_event inev, inev2; + struct frame *mouse_frame; message_count = 0; button_or_motion_p = 0; @@ -3252,9 +3270,13 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) || !EQ (f->tool_bar_window, hlinfo->mouse_face_window) || !EQ (f->tab_bar_window, hlinfo->mouse_face_window))) { + mouse_frame = hlinfo->mouse_face_mouse_frame; + clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = true; - haiku_flush_dirty_back_buffer_on (f); + + if (mouse_frame) + haiku_flush_dirty_back_buffer_on (mouse_frame); } inev.code = b->keysym ? b->keysym : b->multibyte_char; diff --git a/src/haikuterm.h b/src/haikuterm.h index 86274fd42a..70e8cf948b 100644 --- a/src/haikuterm.h +++ b/src/haikuterm.h @@ -174,6 +174,10 @@ struct haiku_output displayed yet. */ bool_bf dirty_p : 1; + /* Whether or not the frame is complete, i.e. safe to flush on + input. */ + bool_bf complete_p : 1; + struct font *font; /* The pending position we're waiting for. */ @@ -275,6 +279,7 @@ struct scroll_bar #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) #define FRAME_DIRTY_P(f) (FRAME_OUTPUT_DATA (f)->dirty_p) +#define FRAME_COMPLETE_P(f) (FRAME_OUTPUT_DATA (f)->complete_p) #define MAKE_FRAME_DIRTY(f) (FRAME_DIRTY_P (f) = 1) #define FRAME_OUTPUT_DATA(f) ((f)->output_data.haiku) #define FRAME_HAIKU_WINDOW(f) (FRAME_OUTPUT_DATA (f)->window) commit 067361f3a29ae23ff609a4308dd025fe783b9723 (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Sun Oct 16 09:10:14 2022 +0300 ; Improve documentation of 'C-M-i' * doc/emacs/programs.texi (Symbol Completion): Remove redundant text, rephrase, and improve indexing and markup. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index ef9b3885e7..a0c044b920 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1406,27 +1406,38 @@ nor comments). The default value is @code{code}. Completion is normally done in the minibuffer (@pxref{Completion}), but you can also complete symbol names in ordinary Emacs buffers. +@cindex tags-based completion @kindex M-TAB @kindex C-M-i - In programming language modes, type @kbd{C-M-i} or @kbd{M-@key{TAB}} -to complete the partial symbol before point. On graphical displays, -the @kbd{M-@key{TAB}} key is usually reserved by the window manager -for switching graphical windows, so you should type @kbd{C-M-i} or -@kbd{@key{ESC} @key{TAB}} instead. - -@cindex tags-based completion @findex completion-at-point@r{, in programming language modes} @cindex Lisp symbol completion @cindex completion (Lisp symbols) In most programming language modes, @kbd{C-M-i} (or -@kbd{M-@key{TAB}}) invokes the command @code{completion-at-point}, -which generates its completion list in a flexible way. If Semantic -mode is enabled, it tries to use the Semantic parser data for -completion (@pxref{Semantic}). If Semantic mode is not enabled or -fails at performing completion, it tries to complete using the -selected tags table (@pxref{Tags Tables}). If in Emacs Lisp mode, it -performs completion using the function, variable, or property names -defined in the current Emacs session. +@kbd{M-@key{TAB}}@footnote{ +On graphical displays, the @kbd{M-@key{TAB}} key is usually reserved +by the window manager for switching graphical windows, so you should +type @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} instead. +}) invokes the command @code{completion-at-point}, which generates the +list of possible completions for the symbol at point. This command +uses the available support facilities to come up with the completion +candidates: + +@itemize @bullet +@item +If Semantic mode is enabled (@pxref{Semantic}), the command tries to +use the Semantic parser data for completion. + +@item +If Semantic mode is not enabled or fails at performing completion, the +command tries to complete using the selected tags table (@pxref{Tags +Tables}); you need to visit the tags table with @w{@kbd{M-x +visit-tags-table}} for that to work. + +@item +In Emacs Lisp mode, the command performs completion using the +function, variable, or property names defined in the current Emacs +session. +@end itemize In all other respects, in-buffer symbol completion behaves like minibuffer completion. For instance, if Emacs cannot complete to a commit da6778d1ce55843cd52da7db66bcb518c441e46e Author: Po Lu Date: Sun Oct 16 14:02:31 2022 +0800 Fix multiple sources of flicker under X Fix three kinds of flicker. The first is if you do: (while t (sit-for 1) (redraw-display)) and press a key, the frame will turn blank until you C-g. The second is where handling async input happens in the middle of drawing and causes a buffer flip to happen. The third is where unmapping the hourglass window causes exposures. * src/dispnew.c (redraw_frame): Garbage the frame if it is a window system frame. * src/xterm.c (x_update_begin): Clear complete flag. (x_flip_and_flush, XTframe_up_to_date): Set complete flag. (x_show_hourglass): Fix hourglass window class. (flush_dirty_back_buffer_on): Rename to x_flush_dirty_back_buffer_on. (x_flush_dirty_back_buffer_on): Check if the frame is complete before trying to flip. (handle_one_xevent): Flush frames in a more detailed fashion. * src/xterm.h (struct x_output): New flag `complete'. (FRAME_X_COMPLETE_P): New macro. diff --git a/src/dispnew.c b/src/dispnew.c index 2568ba1086..5a9ba8909e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3152,10 +3152,19 @@ redraw_frame (struct frame *f) update_begin (f); if (FRAME_MSDOS_P (f)) FRAME_TERMINAL (f)->set_terminal_modes_hook (FRAME_TERMINAL (f)); + + if (FRAME_WINDOW_P (f)) + /* Garbage the frame now. Otherwise, platforms that support + double buffering will display the blank contents of the frame + even though the frame should be redrawn at some point in the + future. */ + SET_FRAME_GARBAGED (f); + clear_frame (f); clear_current_matrices (f); update_end (f); fset_redisplay (f); + /* Mark all windows as inaccurate, so that every window will have its redisplay done. */ mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); diff --git a/src/xterm.c b/src/xterm.c index d35af7a8de..ee6db62bb9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7044,6 +7044,13 @@ x_update_begin (struct frame *f) #else /* Nothing to do. */ #endif + +#ifdef HAVE_XDBE + if (FRAME_X_DOUBLE_BUFFERED_P (f)) + /* The frame is no longer complete, as it is in the midst of an + update. */ + FRAME_X_COMPLETE_P (f) = false; +#endif } /* Draw a vertical window border from (x,y0) to (x,y1) */ @@ -7190,6 +7197,10 @@ x_flip_and_flush (struct frame *f) #ifdef HAVE_XDBE if (FRAME_X_NEED_BUFFER_FLIP (f)) show_back_buffer (f); + + /* The frame is complete again as its contents were just + flushed. */ + FRAME_X_COMPLETE_P (f) = true; #endif x_flush (f); unblock_input (); @@ -7240,6 +7251,9 @@ XTframe_up_to_date (struct frame *f) if (!buffer_flipping_blocked_p () && FRAME_X_NEED_BUFFER_FLIP (f)) show_back_buffer (f); + + /* The frame is now complete, as its contents have been drawn. */ + FRAME_X_COMPLETE_P (f) = true; #endif #ifdef HAVE_XSYNC @@ -10806,6 +10820,7 @@ x_clear_frame (struct frame *f) /* We have to clear the scroll bars. If we have changed colors or something like that, then they should be notified. */ x_scroll_bar_clear (f); + unblock_input (); } @@ -10857,7 +10872,7 @@ x_show_hourglass (struct frame *f) (xcb_window_t) x->hourglass_window, parent, 0, 0, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), 0, - XCB_WINDOW_CLASS_INPUT_OUTPUT, + XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT, XCB_CW_CURSOR, &cursor); #endif @@ -17033,18 +17048,21 @@ x_net_wm_state (struct frame *f, Window window) /* Flip back buffers on F if it has undrawn content. */ -#ifdef HAVE_XDBE static void -flush_dirty_back_buffer_on (struct frame *f) +x_flush_dirty_back_buffer_on (struct frame *f) { - block_input (); - if (!FRAME_GARBAGED_P (f) - && !buffer_flipping_blocked_p () - && FRAME_X_NEED_BUFFER_FLIP (f)) - show_back_buffer (f); - unblock_input (); -} +#ifdef HAVE_XDBE + if (FRAME_GARBAGED_P (f) + || buffer_flipping_blocked_p () + /* If the frame is not already up to date, do not flush buffers + on input, as that will result in flicker. */ + || !FRAME_X_COMPLETE_P (f) + || !FRAME_X_NEED_BUFFER_FLIP (f)) + return; + + show_back_buffer (f); #endif +} #ifdef HAVE_GTK3 void @@ -17824,7 +17842,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, Time gen_help_time UNINIT; #endif ptrdiff_t nbytes = 0; - struct frame *any, *f = NULL; + struct frame *any, *f = NULL, *mouse_frame; Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; /* This holds the state XLookupString needs to implement dead keys and other tricks known as "compose processing". _X Window System_ @@ -19148,9 +19166,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, || !EQ (f->tab_bar_window, hlinfo->mouse_face_window)) ) { - clear_mouse_face (hlinfo); - hlinfo->mouse_face_hidden = true; - } + mouse_frame = hlinfo->mouse_face_mouse_frame; + + clear_mouse_face (hlinfo); + hlinfo->mouse_face_hidden = true; + + if (mouse_frame) + x_flush_dirty_back_buffer_on (mouse_frame); + } #if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS if (f == 0) @@ -19630,6 +19653,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { clear_mouse_face (hlinfo); hlinfo->mouse_face_mouse_frame = 0; + x_flush_dirty_back_buffer_on (xvw->frame); } if (any_help_event_p) @@ -19783,6 +19807,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, certainly no longer on any text in the frame. */ clear_mouse_face (hlinfo); hlinfo->mouse_face_mouse_frame = 0; + x_flush_dirty_back_buffer_on (f); } /* Generate a nil HELP_EVENT to cancel a help-echo. @@ -19840,7 +19865,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, help_echo_string = Qnil; if (hlinfo->mouse_face_hidden) - { + { hlinfo->mouse_face_hidden = false; clear_mouse_face (hlinfo); } @@ -20171,6 +20196,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) do_help = 1; + + if (f) + x_flush_dirty_back_buffer_on (f); goto OTHER; } @@ -20837,9 +20865,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, tab_bar_p = EQ (window, f->tab_bar_window); if (tab_bar_p) - tab_bar_arg = handle_tab_bar_click - (f, x, y, event->xbutton.type == ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); + { + tab_bar_arg = handle_tab_bar_click + (f, x, y, event->xbutton.type == ButtonPress, + x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); + x_flush_dirty_back_buffer_on (f); + } } #if ! defined (USE_GTK) @@ -20857,9 +20888,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, || f->last_tool_bar_item != -1)); if (tool_bar_p && event->xbutton.button < 4) - handle_tool_bar_click - (f, x, y, event->xbutton.type == ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); + { + handle_tool_bar_click + (f, x, y, event->xbutton.type == ButtonPress, + x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); + x_flush_dirty_back_buffer_on (f); + } } #endif /* !USE_GTK */ @@ -21398,6 +21432,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, certainly no longer on any text in the frame. */ clear_mouse_face (hlinfo); hlinfo->mouse_face_mouse_frame = 0; + x_flush_dirty_back_buffer_on (f); } /* Generate a nil HELP_EVENT to cancel a help-echo. @@ -22073,6 +22108,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, do_help = 1; } + + if (f) + x_flush_dirty_back_buffer_on (f); goto XI_OTHER; } @@ -22592,9 +22630,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, tab_bar_p = EQ (window, f->tab_bar_window); if (tab_bar_p) - tab_bar_arg = handle_tab_bar_click - (f, x, y, xev->evtype == XI_ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, bv.state)); + { + tab_bar_arg = handle_tab_bar_click + (f, x, y, xev->evtype == XI_ButtonPress, + x_x_to_emacs_modifiers (dpyinfo, bv.state)); + x_flush_dirty_back_buffer_on (f); + } } #if ! defined (USE_GTK) @@ -22619,10 +22660,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, || f->last_tool_bar_item != -1)); if (tool_bar_p && xev->detail < 4) - handle_tool_bar_click_with_device - (f, x, y, xev->evtype == XI_ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, bv.state), - source ? source->name : Qt); + { + handle_tool_bar_click_with_device + (f, x, y, xev->evtype == XI_ButtonPress, + x_x_to_emacs_modifiers (dpyinfo, bv.state), + source ? source->name : Qt); + x_flush_dirty_back_buffer_on (f); + } } #endif /* !USE_GTK */ @@ -22919,8 +22963,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, || !EQ (f->tab_bar_window, hlinfo->mouse_face_window)) ) { + mouse_frame = hlinfo->mouse_face_mouse_frame; + clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = true; + + if (mouse_frame) + x_flush_dirty_back_buffer_on (mouse_frame); } if (f != 0) @@ -24084,18 +24133,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, count++; } - /* Sometimes event processing draws to either F or ANY outside - redisplay. To ensure that these changes become visible, draw - them here. */ - -#ifdef HAVE_XDBE - if (f) - flush_dirty_back_buffer_on (f); - - if (any && any != f) - flush_dirty_back_buffer_on (any); -#endif - SAFE_FREE (); return count; } diff --git a/src/xterm.h b/src/xterm.h index b68a234faa..55fd193a29 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -916,11 +916,6 @@ struct x_output Picture picture; #endif - /* Flag that indicates whether we've modified the back buffer and - need to publish our modifications to the front buffer at a - convenient time. */ - bool need_buffer_flip; - /* The X window used for the bitmap icon; or 0 if we don't have a bitmap icon. */ Window icon_desc; @@ -1091,6 +1086,18 @@ struct x_output and inactive states. */ bool_bf alpha_identical_p : 1; +#ifdef HAVE_XDBE + /* Flag that indicates whether we've modified the back buffer and + need to publish our modifications to the front buffer at a + convenient time. */ + bool_bf need_buffer_flip : 1; + + /* Flag that indicates whether or not the frame contents are + complete and can be safely flushed while handling async + input. */ + bool_bf complete : 1; +#endif + #ifdef HAVE_X_I18N /* Input context (currently, this means Compose key handler setup). */ XIC xic; @@ -1248,6 +1255,10 @@ extern void x_mark_frame_dirty (struct frame *f); /* Return the need-buffer-flip flag for frame F. */ #define FRAME_X_NEED_BUFFER_FLIP(f) ((f)->output_data.x->need_buffer_flip) + +/* Return whether or not the frame F has been completely drawn. Used + while handling async input. */ +#define FRAME_X_COMPLETE_P(f) ((f)->output_data.x->complete) #endif /* Return the outermost X window associated with the frame F. */ commit 0ff389c0c17b0b2938e79640e86b594344f20e55 Author: Paul Eggert Date: Sat Oct 15 11:59:11 2022 -0700 Fix ‘make bootstrap’ when the *.m4 files change This should help avoid problems like Bug#58535. * Makefile.in (bootstrap-clean): Also remove autom4te.cache. diff --git a/Makefile.in b/Makefile.in index 2d617e2294..45b4a59e3d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,14 +52,14 @@ # make bootstrap # Removes all the compiled files to force a new bootstrap from a # clean slate, and then build in the normal way. If the FAST Make -# variable is set, then the config.cache file isn't removed. This -# allows you to say +# variable is set, then the autom4te.cache directory and the +# config.cache file are not removed. This lets you say # # ./configure -C # make FAST=true bootstrap # # and use the cached results from the configure run, which is much -# faster. +# faster though it does not work in general. # # make docs # Make Emacs documentation files from their sources; requires makeinfo. @@ -1040,7 +1040,7 @@ bootstrap-clean: $(distclean_dirs:=_bootstrap-clean) rm -f ${srcdir}/etc/refcards/emacsver.tex rm -rf native-lisp/ lisp/leim/ja-dic/ ifndef FAST - rm -f config.cache + rm -fr autom4te.cache config.cache endif ${top_bootclean} commit 215f65d1dcb70f29fa4919f5581d28ad27ba4db2 Author: Michael Albinus Date: Sat Oct 15 18:21:13 2022 +0200 Minor Tramp fixes * lisp/net/tramp-sh.el (tramp-perl-id): Fix Perl script. (tramp-sh-handle-expand-file-name): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name): Check, that there's really a Tramp file name. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 3240f5352a..d74afc8412 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -789,8 +789,8 @@ use strict; use warnings; use POSIX qw(getgroups); -my ($user, $passwd, $uid, $gid) = getpwuid $< ; -my $group = getgrgid $gid ; +my ( $uid, $user ) = ( $>, scalar getpwuid $> ); +my ( $gid, $group ) = ( $), scalar getgrgid $) ); my @groups = map { $_ . \"(\" . getgrgid ($_) . \")\" } getgroups (); printf \"uid=%%d(%%s) gid=%%d(%%s) groups=%%s\\n\", @@ -2827,11 +2827,14 @@ the result will be a local, non-Tramp, file name." ;; Handle empty NAME. (when (zerop (length name)) (setq name ".")) ;; On MS Windows, some special file names are not returned properly - ;; by `file-name-absolute-p'. - (if (and (eq system-type 'windows-nt) - (string-match-p - (tramp-compat-rx bol (| (: alpha ":") (: (literal null-device) eol))) - name)) + ;; by `file-name-absolute-p'. If `tramp-syntax' is `simplified', + ;; there could be the falso positive "/:". + (if (or (and (eq system-type 'windows-nt) + (string-match-p + (tramp-compat-rx bol (| (: alpha ":") (: (literal null-device) eol))) + name)) + (and (not (tramp-tramp-file-p name)) + (not (tramp-tramp-file-p dir)))) (tramp-run-real-handler #'expand-file-name (list name dir)) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index dc87c590b3..bc8739c4d6 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -369,33 +369,36 @@ the result will be a local, non-Tramp, file name." ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (tramp-compat-file-name-concat dir name))) - (with-parsed-tramp-file-name name nil - ;; Tilde expansion if necessary. We cannot accept "~/", because - ;; under sudo "~/" is expanded to the local user home directory - ;; but to the root home directory. - (when (zerop (length localname)) - (setq localname "~")) - (unless (file-name-absolute-p localname) - (setq localname (format "~%s/%s" user localname))) - (when (string-match - (tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) - localname) - (let ((uname (match-string 1 localname)) - (fname (match-string 2 localname)) - hname) - (when (zerop (length uname)) - (setq uname user)) - (when (setq hname (tramp-get-home-directory v uname)) - (setq localname (concat hname fname))))) - ;; Do not keep "/..". - (when (string-match-p (rx bos "/" (** 1 2 ".") eos) localname) - (setq localname "/")) - ;; Do normal `expand-file-name' (this does "~user/", "/./" and "/../"). - (tramp-make-tramp-file-name - v (if (string-prefix-p "~" localname) - localname - (tramp-run-real-handler - #'expand-file-name (list localname)))))) + ;; If NAME is not a Tramp file, run the real handler. + (if (not (tramp-tramp-file-p name)) + (tramp-run-real-handler #'expand-file-name (list name)) + (with-parsed-tramp-file-name name nil + ;; Tilde expansion if necessary. We cannot accept "~/", because + ;; under sudo "~/" is expanded to the local user home directory + ;; but to the root home directory. + (when (zerop (length localname)) + (setq localname "~")) + (unless (file-name-absolute-p localname) + (setq localname (format "~%s/%s" user localname))) + (when (string-match + (tramp-compat-rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) + localname) + (let ((uname (match-string 1 localname)) + (fname (match-string 2 localname)) + hname) + (when (zerop (length uname)) + (setq uname user)) + (when (setq hname (tramp-get-home-directory v uname)) + (setq localname (concat hname fname))))) + ;; Do not keep "/..". + (when (string-match-p (rx bos "/" (** 1 2 ".") eos) localname) + (setq localname "/")) + ;; Do normal `expand-file-name' (this does "~user/", "/./" and "/../"). + (tramp-make-tramp-file-name + v (if (string-prefix-p "~" localname) + localname + (tramp-run-real-handler + #'expand-file-name (list localname))))))) (defun tramp-sudoedit-remote-acl-p (vec) "Check, whether ACL is enabled on the remote host." commit 5933055a3e7387b0095f0df7876a208ab15f4f45 Author: Philip Kaludercic Date: Sat Oct 15 00:06:25 2022 +0200 * lisp/vc/vc-git.el (vc-git-symbolic-commit): Use --no-undefined diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 0eae7dd6b8..3c6afec037 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -2038,16 +2038,15 @@ allowed to include revision specifications like \"master~8\" branch), otherwise such revision specifications are rejected, and the function returns nil." (and commit - (let ((name (with-temp-buffer - (and - (vc-git--out-ok "name-rev" "--name-only" commit) - (goto-char (point-min)) - (or force (not (looking-at "^.*[~^].*$" t))) - (= (forward-line 2) 1) - (bolp) - (buffer-substring-no-properties (point-min) - (1- (point-max))))))) - (and name (not (string= name "undefined")) name)))) + (with-temp-buffer + (and + (vc-git--out-ok "name-rev" "--no-undefined" "--name-only" commit) + (goto-char (point-min)) + (or force (not (looking-at "^.*[~^].*$" t))) + (= (forward-line 2) 1) + (bolp) + (buffer-substring-no-properties (point-min) + (1- (point-max))))))) (defvar-keymap vc-dir-git-mode-map "z c" #'vc-git-stash commit 1f4b234a5c166552e14f387515642de632a2b1a3 Author: Philip Kaludercic Date: Thu Oct 13 22:29:23 2022 +0200 * lisp/vc/vc-git.el (vc-git-symbolic-commit): Add argument FORCE (Bug#57400) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 5d564f3c94..0eae7dd6b8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -2030,14 +2030,19 @@ FILE can be nil." (setq ok nil)))))) (and ok str))) -(defun vc-git-symbolic-commit (commit) - "Translate COMMIT string into symbolic form. -Returns nil if not possible." +(defun vc-git-symbolic-commit (commit &optional force) + "Translate revision string of COMMIT to a symbolic form. +If the optional argument FORCE is non-nil, the returned value is +allowed to include revision specifications like \"master~8\" +\(the 8th parent of the commit currently pointed to by the master +branch), otherwise such revision specifications are rejected, and +the function returns nil." (and commit (let ((name (with-temp-buffer (and (vc-git--out-ok "name-rev" "--name-only" commit) (goto-char (point-min)) + (or force (not (looking-at "^.*[~^].*$" t))) (= (forward-line 2) 1) (bolp) (buffer-substring-no-properties (point-min) commit 307ad210040251ea0de2e7f453350c4497bda874 Author: Philip Kaludercic Date: Tue Oct 11 21:11:20 2022 +0200 * lisp/vc/vc-git.el (vc-git--rev-parse): Allow abbreviating commits * lisp/vc/vc-git.el (vc-git-working-revision): Use abbreviated comment references. (Bug#57400) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ea06ccaf87..5d564f3c94 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -373,8 +373,9 @@ in the order given by `git status'." (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." - (let (process-file-side-effects) - (vc-git--rev-parse "HEAD"))) + (let* ((process-file-side-effects nil) + (commit (vc-git--rev-parse "HEAD" t))) + (or (vc-git-symbolic-commit commit) commit))) (defun vc-git--symbolic-ref (file) (or @@ -1674,11 +1675,15 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." ;; does not (and cannot) quote. (vc-git--rev-parse (concat rev "~1")))) -(defun vc-git--rev-parse (rev) +(defun vc-git--rev-parse (rev &optional short) (with-temp-buffer (and - (vc-git--out-ok "rev-parse" rev) - (buffer-substring-no-properties (point-min) (+ (point-min) 40))))) + (if short + (vc-git--out-ok "rev-parse" "--short" rev) + (vc-git--out-ok "rev-parse" rev)) + (string-trim-right + (buffer-substring-no-properties (point-min) (min (+ (point-min) 40) + (point-max))))))) (defun vc-git-next-revision (file rev) "Git-specific version of `vc-next-revision'." commit 5fc064f14c0e76bf15b7528ef6ef3771ad169aba Author: Philip Kaludercic Date: Thu Oct 13 10:43:36 2022 +0200 Handle ;;;###theme-autoload comments in etc/themes * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch): Extract the autoloads and have them loaded along with loaddefs.el. * etc/NEWS: Mention the new feature. (Bug#57639) diff --git a/etc/NEWS b/etc/NEWS index 62004c10a6..041fe0bdbd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2846,6 +2846,11 @@ Previously, ';;;###' specs inside a top-level form (i.e., something like '(when ... ;;;### ...)' would be ignored. They are now parsed as normal. +--- +** Themes have special autoload cookies. +All build-in themes are scraped for ;;;###theme-autoload cookies that +are loaded along with the regular auto-loaded code. + +++ ** 'buffer-modified-p' has been extended. This function was previously documented to return only nil or t. This diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index d2654fb206..a1c4f91579 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -736,7 +736,14 @@ rules for built-in packages and excluded files." ;; updated. (file-newer-than-file-p (expand-file-name "emacs-lisp/loaddefs-gen.el" lisp-directory) - output-file)))) + output-file))) + (let ((lisp-mode-autoload-regexp + "^;;;###\\(\\(noexist\\)-\\)?\\(theme-autoload\\)")) + (loaddefs-generate + (expand-file-name "../etc/themes/" lisp-directory) + (expand-file-name "theme-loaddefs.el" lisp-directory)))) + +;;;###autoload (load "theme-loaddefs.el") (provide 'loaddefs-gen) commit da2e6da72296ed6211b8047ccdc42fccab6f1b31 Author: Philip Kaludercic Date: Sat Sep 17 20:11:42 2022 +0200 Tag themes with properties * doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'. * doc/lispref/customize.texi (Custom Themes): Document the new optional argument to 'deftheme'. (Autoload): Mention that 'deftheme' is not copied verbatim. * etc/themes/adwaita-theme.el (adwaita): Add properties. * etc/themes/deeper-blue-theme.el (deeper-blue): Add properties. * etc/themes/dichromacy-theme.el (dichromacy): Add properties. * etc/themes/light-blue-theme.el (light-blue): Add properties. * etc/themes/manoj-dark-theme.el (manoj-dark): Add properties. * etc/themes/misterioso-theme.el (misterioso): Add properties. * etc/themes/tango-dark-theme.el (tango-dark): Add properties. * etc/themes/tango-theme.el (tango): Add properties. * etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties. * etc/themes/tsdh-light-theme.el (tsdh-light): Add properties. * etc/themes/wheatgrass-theme.el (wheatgrass): Add properties. * etc/themes/whiteboard-theme.el (whiteboard): Add properties. * etc/themes/wombat-theme.el (wombat): Add properties. * etc/themes/modus-operandi-theme.el: Add properties. * etc/themes/modus-vivendi-theme.el: Add properties. * etc/themes/leuven-dark-theme.el (leuven-dark): Add properties. * etc/themes/leuven-theme.el (leuven): Add properties. * lisp/custom.el (deftheme): Allow for optional arguments to set the property list. (custom-declare-theme): Accept the same optional arguments as 'deftheme'. (theme-list-variants): Add new function. (theme-choose-variant): Add new command for switching between members of a theme family. (toggle-theme): Add an alias for 'theme-choose-variant'. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Handle 'defcustom's by extracting the properties. (Bug#57639) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index ff7ab83190..f98527bf9a 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -667,6 +667,16 @@ type @kbd{M-x disable-theme}. the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme} anywhere in Emacs and enter the theme name. +@findex theme-choose-variant +Some themes have variants (most often just two: light and dark). You +can switch to another variant using @kbd{M-x theme-choose-variant}. +If the currently active theme has only one other variant, it will be +selected; if there are more variants, the command will prompt you +which one to switch to. + +Note that @code{theme-choose-variant} only works if a single theme +is active. + @node Creating Custom Themes @subsection Creating Custom Themes @cindex custom themes, creating diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 6ba35cffff..204719e942 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1428,12 +1428,32 @@ emacs, The GNU Emacs Manual}.) be a call to @code{deftheme}, and the last form should be a call to @code{provide-theme}. -@defmac deftheme theme &optional doc +@defmac deftheme theme &optional doc &rest properties This macro declares @var{theme} (a symbol) as the name of a Custom theme. The optional argument @var{doc} should be a string describing the theme; this is the description shown when the user invokes the @code{describe-theme} command or types @kbd{?} in the @samp{*Custom -Themes*} buffer. +Themes*} buffer. The remaining arguments @var{properties} are used +pass a property list with theme attributes. + +The following attributes are supported: + +@table @code +@item :family +A symbol designating what ``family'' a theme belongs to. A +@dfn{family} of themes is a set of similar themes that differ by minor +aspects, such as face colors that are meant for the light vs dark +background of the frame. +@item :kind +A symbol. If a theme is enabled and this property has the value +@code{color-scheme}, then the @code{theme-choose-variant} command will +look for other available themes that belong to the same family in +order to switch the themes. Other values are currently unspecified +and should not be used. +@item :background-mode +A symbol, either @code{light} or @code{dark}. This attribute is +currently unused, but should still be specified. +@end table Two special theme names are disallowed (using them causes an error): @code{user} is a dummy theme that stores the user's direct diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 4e4f12dc32..c7fbdac1d7 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -662,7 +662,7 @@ and @code{define-overloadable-function} (see the commentary in and @code{define-global-minor-mode}. @item Other definition types: -@code{defcustom}, @code{defgroup}, @code{defclass} +@code{defcustom}, @code{defgroup}, @code{deftheme}, @code{defclass} (@pxref{Top,EIEIO,,eieio,EIEIO}), and @code{define-skeleton} (@pxref{Top,Autotyping,,autotype,Autotyping}). @end table diff --git a/etc/themes/adwaita-theme.el b/etc/themes/adwaita-theme.el index ba83a0578c..6ad8405559 100644 --- a/etc/themes/adwaita-theme.el +++ b/etc/themes/adwaita-theme.el @@ -21,10 +21,13 @@ ;;; Code: +;;;###theme-autoload (deftheme adwaita "Face colors similar to the default theme of Gnome 3 (Adwaita). The colors are chosen to match Adwaita window decorations and the -default look of the Gnome 3 desktop.") +default look of the Gnome 3 desktop." + :background-mode 'light + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) (custom-theme-set-faces diff --git a/etc/themes/deeper-blue-theme.el b/etc/themes/deeper-blue-theme.el index 8f19147f91..48ed9ba061 100644 --- a/etc/themes/deeper-blue-theme.el +++ b/etc/themes/deeper-blue-theme.el @@ -21,8 +21,11 @@ ;;; Code: +;;;###theme-autoload (deftheme deeper-blue - "Face colors using a deep blue background.") + "Face colors using a deep blue background." + :background-mode 'dark + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) (custom-theme-set-faces diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el index d53c075d92..fe44d520cc 100644 --- a/etc/themes/dichromacy-theme.el +++ b/etc/themes/dichromacy-theme.el @@ -21,6 +21,7 @@ ;;; Code: +;;;###theme-autoload (deftheme dichromacy "Face colors suitable for red/green color-blind users. The color palette is from B. Wong, Nature Methods 8, 441 (2011). @@ -28,7 +29,9 @@ It is intended to provide good variability while being easily differentiated by individuals with protanopia or deuteranopia. Basic, Font Lock, Isearch, Gnus, Message, Flyspell, and -Ansi-Color faces are included.") +Ansi-Color faces are included." + :background-mode 'light + :kind 'color-scheme) (let ((class '((class color) (min-colors 89))) (orange "#e69f00") diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el index 0e162c8bab..08978a2668 100644 --- a/etc/themes/leuven-dark-theme.el +++ b/etc/themes/leuven-dark-theme.el @@ -5,7 +5,7 @@ ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")> ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")> ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme -;; Version: 20220202.1126 +;; Version: 20221010.1208 ;; Keywords: color theme ;; This file is part of GNU Emacs. @@ -93,11 +93,15 @@ CONTROL can be a number, nil, or t. When t, use DEFAULT-HEIGHT." ;;; Theme Faces. +;;;###theme-autoload (deftheme leuven-dark "Face colors with a light background. Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff, Flyspell, Semantic, and Ansi-Color faces are included -- and much -more...") +more..." + :background-mode 'dark + :family 'leuven + :kind 'color-scheme) (let ((class '((class color) (min-colors 89))) diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el index d9a8d5391a..e712a79adf 100644 --- a/etc/themes/leuven-theme.el +++ b/etc/themes/leuven-theme.el @@ -4,7 +4,7 @@ ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")> ;; URL: https://github.com/fniessen/emacs-leuven-theme -;; Version: 20200513.1928 +;; Version: 20221010.1209 ;; Keywords: color theme ;; This file is part of GNU Emacs. @@ -74,11 +74,15 @@ CONTROL can be a number, nil, or t. When t, use DEFAULT-HEIGHT." ;;; Theme Faces. +;;;###theme-autoload (deftheme leuven "Face colors with a light background. Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff, Flyspell, Semantic, and Ansi-Color faces are included -- and much -more...") +more..." + :background-mode 'light + :kind 'color-scheme + :family 'leuven) (let ((class '((class color) (min-colors 89))) diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el index eeca46210c..808fcbfeb2 100644 --- a/etc/themes/light-blue-theme.el +++ b/etc/themes/light-blue-theme.el @@ -26,8 +26,11 @@ ;;; Code: +;;;###theme-autoload (deftheme light-blue - "Face colors utilizing a light blue background.") + "Face colors utilizing a light blue background." + :background-mode 'light + :kind 'color-scheme) (make-obsolete 'light-blue nil "29.1") diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el index af5576386c..f9aaa97c25 100644 --- a/etc/themes/manoj-dark-theme.el +++ b/etc/themes/manoj-dark-theme.el @@ -64,10 +64,13 @@ ;;; Code: +;;;###theme-autoload (deftheme manoj-dark "Very high contrast faces with a black background. This theme avoids subtle color variations, while avoiding the -jarring angry fruit salad look to reduce eye fatigue.") +jarring angry fruit salad look to reduce eye fatigue." + :background-mode 'dark + :kind 'color-scheme) (custom-theme-set-faces 'manoj-dark diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el index 55186384ad..3fd6cdb5af 100644 --- a/etc/themes/misterioso-theme.el +++ b/etc/themes/misterioso-theme.el @@ -21,8 +21,11 @@ ;;; Code: +;;;###theme-autoload (deftheme misterioso - "Predominantly blue/cyan faces on a dark cyan background.") + "Predominantly blue/cyan faces on a dark cyan background." + :background-mode 'dark + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) diff --git a/etc/themes/modus-operandi-theme.el b/etc/themes/modus-operandi-theme.el index 6e609c0803..0f0630a6d1 100644 --- a/etc/themes/modus-operandi-theme.el +++ b/etc/themes/modus-operandi-theme.el @@ -71,4 +71,6 @@ which corresponds to a minimum contrast in relative luminance of (provide-theme 'modus-operandi)) +;;;###theme-autoload (put 'modus-operandi 'theme-properties '(:background-mode light :kind color-scheme :family modus)) + ;;; modus-operandi-theme.el ends here diff --git a/etc/themes/modus-vivendi-theme.el b/etc/themes/modus-vivendi-theme.el index 0983e26c78..02c2d9e129 100644 --- a/etc/themes/modus-vivendi-theme.el +++ b/etc/themes/modus-vivendi-theme.el @@ -71,4 +71,6 @@ which corresponds to a minimum contrast in relative luminance of (provide-theme 'modus-vivendi)) +;;;###theme-autoload (put 'modus-vivendi 'theme-properties '(:background-mode dark :kind color-scheme :family modus)) + ;;; modus-vivendi-theme.el ends here diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el index ef00d2ac49..85995e4e99 100644 --- a/etc/themes/tango-dark-theme.el +++ b/etc/themes/tango-dark-theme.el @@ -27,10 +27,15 @@ ;;; Code: +;;;###theme-autoload (deftheme tango-dark "Face colors using the Tango palette (dark background). Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell, -Semantic, and Ansi-Color faces are included.") +Semantic, and Ansi-Color faces are included." + :background-mode 'dark + :kind 'color-scheme + :family 'tango) + (let ((class '((class color) (min-colors 89))) ;; Tango palette colors. diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el index ecbbf03753..2ac1b42294 100644 --- a/etc/themes/tango-theme.el +++ b/etc/themes/tango-theme.el @@ -27,10 +27,14 @@ ;;; Code: +;;;###theme-autoload (deftheme tango "Face colors using the Tango palette (light background). Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell, -Semantic, and Ansi-Color faces are included.") +Semantic, and Ansi-Color faces are included." + :background-mode 'light + :kind 'color-scheme + :family 'tango) (let ((class '((class color) (min-colors 89))) ;; Tango palette colors. diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el index a88ad75520..6b1e865e42 100644 --- a/etc/themes/tsdh-dark-theme.el +++ b/etc/themes/tsdh-dark-theme.el @@ -19,8 +19,12 @@ ;;; Code: +;;;###theme-autoload (deftheme tsdh-dark - "A dark theme used and created by Tassilo Horn.") + "A dark theme used and created by Tassilo Horn." + :background-mode 'dark + :kind 'color-scheme + :family 'tsdh) (custom-theme-set-faces 'tsdh-dark diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el index d9d09b702b..ac964d66d6 100644 --- a/etc/themes/tsdh-light-theme.el +++ b/etc/themes/tsdh-light-theme.el @@ -19,9 +19,13 @@ ;;; Code: +;;;###theme-autoload (deftheme tsdh-light "A light Emacs theme. -Used and created by Tassilo Horn.") +Used and created by Tassilo Horn." + :background-mode 'light + :kind 'color-scheme + :family 'tsdh) (custom-theme-set-faces 'tsdh-light diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el index c56c8a2d8a..20e7bbbac2 100644 --- a/etc/themes/wheatgrass-theme.el +++ b/etc/themes/wheatgrass-theme.el @@ -19,11 +19,14 @@ ;;; Code: +;;;###theme-autoload (deftheme wheatgrass "High-contrast green/blue/brown faces on a black background. Basic, Font Lock, Isearch, Gnus, and Message faces are included. The default face foreground is wheat, with other faces in shades -of green, brown, and blue.") +of green, brown, and blue." + :background-mode 'dark + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) (custom-theme-set-faces diff --git a/etc/themes/whiteboard-theme.el b/etc/themes/whiteboard-theme.el index f21b18b421..2f86234b32 100644 --- a/etc/themes/whiteboard-theme.el +++ b/etc/themes/whiteboard-theme.el @@ -21,8 +21,11 @@ ;;; Code: +;;;###theme-autoload (deftheme whiteboard - "Face colors similar to markers on a whiteboard.") + "Face colors similar to markers on a whiteboard." + :background-mode 'light + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) (custom-theme-set-faces diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el index d9fab8ac78..9bb026ead1 100644 --- a/etc/themes/wombat-theme.el +++ b/etc/themes/wombat-theme.el @@ -21,11 +21,14 @@ ;;; Code: +;;;###theme-autoload (deftheme wombat "Medium-contrast faces with a dark gray background. Adapted, with permission, from a Vim color scheme by Lars H. Nielsen. Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces -are included.") +are included." + :background-mode 'dark + :kind 'color-scheme) (let ((class '((class color) (min-colors 89)))) (custom-theme-set-faces diff --git a/lisp/custom.el b/lisp/custom.el index 604b1a3ff4..0d3e2e5d0c 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1152,9 +1152,11 @@ list, in which A occurs before B if B was defined with a ;; (provide-theme 'THEME) -(defmacro deftheme (theme &optional doc) +(defmacro deftheme (theme &optional doc &rest properties) "Declare THEME to be a Custom theme. The optional argument DOC is a doc string describing the theme. +PROPERTIES are interpreted as a property list that will be stored +in the `theme-properties' property for THEME. Any theme `foo' should be defined in a file called `foo-theme.el'; see `custom-make-theme-feature' for more information." @@ -1164,18 +1166,25 @@ see `custom-make-theme-feature' for more information." ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem ;; if you need to recompile all the Lisp files using interpreted code. - (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc))) + (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc + (cons 'list properties)))) -(defun custom-declare-theme (theme feature &optional doc) +(defun custom-declare-theme (theme feature &optional doc properties) "Like `deftheme', but THEME is evaluated as a normal argument. -FEATURE is the feature this theme provides. Normally, this is a symbol -created from THEME by `custom-make-theme-feature'." +FEATURE is the feature this theme provides. Normally, this is a +symbol created from THEME by `custom-make-theme-feature'. The +optional argument DOC may contain the documentation for THEME. +The optional argument PROPERTIES may contain a property list of +attributes associated with THEME." (unless (custom-theme-name-valid-p theme) (error "Custom theme cannot be named %S" theme)) (unless (memq theme custom-known-themes) (push theme custom-known-themes)) (put theme 'theme-feature feature) - (when doc (put theme 'theme-documentation doc))) + (when doc + (put theme 'theme-documentation doc)) + (when properties + (put theme 'theme-properties properties))) (defun custom-make-theme-feature (theme) "Given a symbol THEME, create a new symbol by appending \"-theme\". @@ -1372,6 +1381,58 @@ Return t if THEME was successfully loaded, nil otherwise." (enable-theme theme)) t) +(defun theme-list-variants (theme &rest list) + "Return a list of theme variants for THEME. +By default this will use all known custom themes (see +`custom-available-themes') to check for variants. This can be +restricted if the optional argument LIST containing a list of +theme symbols to consider." + (let* ((properties (get theme 'theme-properties)) + (family (plist-get properties :family))) + (seq-filter + (lambda (variant) + (and (eq (plist-get (get variant 'theme-properties) :family) + family) + (not (eq variant theme)))) + (or list (custom-available-themes))))) + +(defun theme-choose-variant (&optional no-confirm no-enable) + "Switch from the current theme to one of its variants. +The current theme will be disabled before variant is enabled. If +the current theme has only one variant, switch to that variant +without prompting, otherwise prompt for the variant to select. +See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE." + (interactive) + (let ((active-color-schemes + (seq-filter + (lambda (theme) + ;; FIXME: As most themes currently do not have a `:kind' + ;; tag, it is assumed that a theme is a color scheme by + ;; default. This should be reconsidered in the future. + (memq (plist-get (get theme 'theme-properties) :kind) + '(color-scheme nil))) + custom-enabled-themes))) + (cond + ((length= active-color-schemes 0) + (user-error "No theme is active, cannot toggle")) + ((length> active-color-schemes 1) + (user-error "More than one theme active, cannot unambiguously toggle"))) + (let* ((theme (car active-color-schemes)) + (family (plist-get (get theme 'theme-properties) :family))) + (unless family + (error "Theme `%s' does not have any known variants" theme)) + (let* ((variants (theme-list-variants theme)) + (choice (cond + ((null variants) + (error "`%s' has no variants" theme)) + ((length= variants 1) + (car variants)) + ((intern (completing-read "Load custom theme: " variants)))))) + (disable-theme theme) + (load-theme choice no-confirm no-enable))))) + +(defalias 'toggle-theme #'theme-choose-variant) + (defun custom-theme-load-confirm (hash) "Query the user about loading a Custom theme that may not be safe. The theme should be in the current buffer. If the user agrees, diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 964d23c770..d2654fb206 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -283,6 +283,12 @@ expression, in which case we want to handle forms differently." ,@(when-let ((safe (plist-get props :safe))) `((put ',varname 'safe-local-variable ,safe)))))) + ;; Extract theme properties. + ((eq car 'deftheme) + (let* ((name (car-safe (cdr-safe form))) + (props (nthcdr 3 form))) + `(put ',name 'theme-properties (list ,@props)))) + ((eq car 'defgroup) ;; In Emacs this is normally handled separately by cus-dep.el, but for ;; third party packages, it can be convenient to explicitly autoload commit 9fcd59a97820e5154e678be8b98fe0cac4e4546e Author: Mauro Aranda Date: Sat Oct 15 10:56:43 2022 -0300 ; Fix message-server-alist :type (Bug#58546) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 67ec0531fa..5e4e9854a6 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4361,10 +4361,10 @@ arguments. If METHOD is nil in this case, the return value of the function will be inserted instead. If the buffer already has a\"X-Message-SMTP-Method\" header, it is left unchanged." - :type '(alist :key-type '(choice - (string :tag "From Address") - (function :tag "Predicate")) - :value-type 'string) + :type '(alist :key-type (choice + (string :tag "From Address") + (function :tag "Predicate")) + :value-type string) :version "29.1" :group 'message-sending) commit 4aeb80ccecd0dc3f3b3f567779632a0f23476a09 Author: Eli Zaretskii Date: Sat Oct 15 14:43:21 2022 +0300 ; Improve message text in xref.el * lisp/progmodes/xref.el (xref--query-replace-1): Improve text of user-error. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index afb4509913..bb36688ef8 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -898,7 +898,7 @@ ITEMS is an xref item which " ; FIXME: Expand documentation. (perform-replace from to t t nil nil multi-query-replace-map))) (unless did-it-once (user-error - "Cannot use subset of matches of identifier for global renaming")) + "Cannot perform global renaming of symbols using find-definition results")) (when (and continue (not buf-pairs)) (message "All results processed")))) commit 08eb639df8d24ef77df896a23972269b676311b7 Author: Stefan Kangas Date: Sat Oct 15 13:07:29 2022 +0200 Add no-byte-compile to the ".dir-locals.el" auto-insert template * lisp/autoinsert.el (auto-insert-alist): Add the no-byte-compile cookie to the ".dir-locals.el" template. diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 580f6b3ced..51d939151c 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -168,7 +168,7 @@ If this contains a %s, that will be replaced by the matching rule." (".dir-locals.el" nil - ";;; Directory Local Variables\n" + ";;; Directory Local Variables -*- no-byte-compile: t; -*-\n" ";;; For more information see (info \"(emacs) Directory Variables\")\n\n" "((" '(setq v1 (let (modes) diff --git a/lisp/files-x.el b/lisp/files-x.el index f6d5d6cc27..0131d495f2 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -489,6 +489,8 @@ from the MODE alist ignoring the input argument VALUE." dir-locals-directory-cache)) ;; Insert modified alist of directory-local variables. + ;; When changing this, also update the ".dir-locals.el" file for + ;; Emacs itself, as well as the template in autoinsert.el. (insert ";;; Directory Local Variables -*- no-byte-compile: t -*-\n") (insert ";;; For more information see (info \"(emacs) Directory Variables\")\n\n") (princ (dir-locals-to-string commit 3187225416c66061b67e89092addc15cad2202b9 Author: Stefan Kangas Date: Sat Oct 15 11:17:51 2022 +0200 ; Prefer HTTPS to HTTP in many URLs diff --git a/ChangeLog.1 b/ChangeLog.1 index cd31aacafb..35533d60ff 100644 --- a/ChangeLog.1 +++ b/ChangeLog.1 @@ -5685,7 +5685,7 @@ (__mktime_internal): Use it systematically for all isdst comparisons. This completes the fix for libc BZ #6723, and removes the need for normalizing tm_isdst. - See + See (not_equal_tm) [DEBUG]: Use isdst_differ here, too. mktime: fix some integer overflow issues and sidestep the rest diff --git a/ChangeLog.3 b/ChangeLog.3 index a09dc29cbe..f2245a4ed5 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -185373,7 +185373,7 @@ * lisp/image.el (image-type-header-regexps): Allow two or more CRs or LFs in initial whitespace sequences. See: - http://netpbm.sourceforge.net/doc/pbm.html + https://netpbm.sourceforge.net/doc/pbm.html 2017-10-16 Paul Eggert @@ -197097,7 +197097,7 @@ Clang on macOS warns about these with -Wtautological-compare. POSIX guarantees that rlim_t is unsigned (cf. - http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html), + https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html), so these resource limits can never be negative. * src/emacs.c (main): Remove tautological comparisons. @@ -199197,7 +199197,7 @@ ' is commonly used as an apostrophe in the prose sections of spec files, which was erroneously highlighted as strings. See for example - http://kmymoney2.sourceforge.net/phb/rpm-example.html + https://kmymoney2.sourceforge.net/phb/rpm-example.html * lisp/progmodes/sh-script.el (sh-mode-syntax-table): Treat ' as punctuation in RPM spec files. diff --git a/INSTALL b/INSTALL index 95d2dbda80..c0323f770b 100644 --- a/INSTALL +++ b/INSTALL @@ -187,7 +187,7 @@ X11 is being used. libz (for PNG): https://www.zlib.net/ X libjpeg for JPEG: https://www.ijg.org/ X libtiff for TIFF: http://www.simplesystems.org/libtiff/ - X libgif for GIF: http://giflib.sourceforge.net/ + X libgif for GIF: https://giflib.sourceforge.net/ librsvg2 for SVG: https://wiki.gnome.org/Projects/LibRsvg libwebp for WebP: https://developers.google.com/speed/webp/ diff --git a/admin/charsets/mapfiles/stdenc.txt b/admin/charsets/mapfiles/stdenc.txt index e39486a319..1c898bac0b 100644 --- a/admin/charsets/mapfiles/stdenc.txt +++ b/admin/charsets/mapfiles/stdenc.txt @@ -54,7 +54,7 @@ # # [v0.1, 5 May 1995] First release. # -# Use the Unicode reporting form +# Use the Unicode reporting form # for any questions or comments or to report errors in the data. # 0020 20 # SPACE # space diff --git a/admin/charsets/mapfiles/symbol.txt b/admin/charsets/mapfiles/symbol.txt index b98baf6cf0..0a5aac8b61 100644 --- a/admin/charsets/mapfiles/symbol.txt +++ b/admin/charsets/mapfiles/symbol.txt @@ -57,7 +57,7 @@ # # [v0.1, 5 May 1995] First release. # -# Use the Unicode reporting form +# Use the Unicode reporting form # for any questions or comments or to report errors in the data. # 0020 20 # SPACE # space diff --git a/admin/unidata/README b/admin/unidata/README index 2da01402b7..2d421dfb6b 100644 --- a/admin/unidata/README +++ b/admin/unidata/README @@ -6,31 +6,31 @@ copyright.html. The names, URLs, and dates for these files are as follows. BidiBrackets.txt -http://www.unicode.org/Public/UNIDATA/BidiBrackets.txt +https://www.unicode.org/Public/UNIDATA/BidiBrackets.txt 2021-06-30 BidiMirroring.txt -http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt +https://www.unicode.org/Public/UNIDATA/BidiMirroring.txt 2021-08-08 Blocks.txt -http://www.unicode.org/Public/8.0.0/ucd/Blocks.txt +https://www.unicode.org/Public/8.0.0/ucd/Blocks.txt 2021-01-22 IVD_Sequences.txt -http://www.unicode.org/ivd/ +https://www.unicode.org/ivd/ 2020-11-06 NormalizationTest.txt -http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt +https://www.unicode.org/Public/UNIDATA/NormalizationTest.txt 2021-05-28 SpecialCasing.txt -http://unicode.org/Public/UNIDATA/SpecialCasing.txt +https://unicode.org/Public/UNIDATA/SpecialCasing.txt 2021-03-08 UnicodeData.txt -http://www.unicode.org/Public/UNIDATA/UnicodeData.txt +https://www.unicode.org/Public/UNIDATA/UnicodeData.txt 2021-07-06 emoji-data.txt diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk index 1c571feff3..48a14ec3ca 100755 --- a/admin/unidata/blocks.awk +++ b/admin/unidata/blocks.awk @@ -23,7 +23,7 @@ ### Commentary: ## This script takes as input Unicode's Blocks.txt -## (http://www.unicode.org/Public/UNIDATA/Blocks.txt) +## (https://www.unicode.org/Public/UNIDATA/Blocks.txt) ## and produces output for Emacs's lisp/international/charscript.el. ## It lumps together all the blocks belonging to the same language. diff --git a/admin/unidata/copyright.html b/admin/unidata/copyright.html index 0ae01c11ad..567c54e72a 100644 --- a/admin/unidata/copyright.html +++ b/admin/unidata/copyright.html @@ -13,7 +13,7 @@ Unicode Terms of Use +href="https://www.unicode.org/webscripts/standard_styles.css">