commit cb95d771a230716562b359c6a49e8ae1b822af14 (HEAD, refs/remotes/origin/master) Author: Alan Mackenzie Date: Fri Mar 1 09:25:43 2019 +0000 * src/pdumper.c: Clarify the message about updating hash values diff --git a/src/pdumper.c b/src/pdumper.c index 2f5c719803..724ea7be6d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -71,8 +71,9 @@ along with GNU Emacs. If not, see . */ /* CHECK_STRUCTS being true makes the build break if we notice changes to the source defining certain Lisp structures we dump. If you change one of these structures, check that the pdumper code is - still valid and update the hash from the dmpstruct.h generated by - your new code. */ + still valid, and update the pertinent hash lower down in this file + (pdumper.c) by manually copying the value from the dmpstruct.h + generated from your new code. */ #ifndef CHECK_STRUCTS # define CHECK_STRUCTS 1 #endif commit f62f7db2c8f253416631a4d8a657a70e23c49173 Author: Eli Zaretskii Date: Fri Mar 1 10:42:59 2019 +0200 ; * src/xfaces.c (syms_of_xfaces): Fix last change. diff --git a/src/xfaces.c b/src/xfaces.c index 69e73e8c0d..e397f0b8a0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6805,7 +6805,10 @@ between two colors that will still qualify them to be used as foreground and background. If the value of `color-distance', invoked with a nil METRIC argument, for the foreground and background colors of a face is less than this threshold, the distant-foreground color, if defined, -will be used for the face instead of the foreground color. */); +will be used for the face instead of the foreground color. + +Lisp programs that change the value of this variable should also +clear the face cache, see `clear-face-cache'. */); face_near_same_color_threshold = 30000; #ifdef HAVE_WINDOW_SYSTEM commit 63d0dc7937bddd803145f2df23a600597c4fd8e7 Author: Federico Tedin Date: Tue Jan 15 22:08:15 2019 -0300 Allow control on the threshold for using 'distant-foreground' * src/xfaces.c (NEAR_SAME_COLOR_THRESHOLD): Macro deleted. (load_face_colors): Compare against face_near_same_color_threshold instead of NEAR_SAME_COLOR_THRESHOLD. (syms_of_xfaces) : New variable. (Bug#34001) * etc/NEWS: Announce the change. diff --git a/etc/NEWS b/etc/NEWS index 683a4279a3..29ed7ab481 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -145,6 +145,13 @@ EMACS_SOCKET_NAME environment variable to an appropriate value. *** When run by root, emacsclient no longer connects to non-root sockets. (Instead you can use Tramp methods to run root commands in a non-root Emacs.) +--- +** Control of the threshold for using the 'distant-foreground' color. +The threshold for color distance below which the 'distant-foreground' +color of the face will be used instead of the foreground color can now +be controlled via the new variable 'face-near-same-color-threshold'. +The default value is 30000, as the previously hard-coded threshold. + +++ ** The function 'read-passwd' uses '*' as default character to hide passwords. diff --git a/src/xfaces.c b/src/xfaces.c index 3ba824b651..69e73e8c0d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1157,8 +1157,6 @@ load_color (struct frame *f, struct face *face, Lisp_Object name, #ifdef HAVE_WINDOW_SYSTEM -#define NEAR_SAME_COLOR_THRESHOLD 30000 - /* Load colors for face FACE which is used on frame F. Colors are specified by slots LFACE_BACKGROUND_INDEX and LFACE_FOREGROUND_INDEX of ATTRS. If the background color specified is not supported on F, @@ -1199,7 +1197,7 @@ load_face_colors (struct frame *f, struct face *face, dfg = attrs[LFACE_DISTANT_FOREGROUND_INDEX]; if (!NILP (dfg) && !UNSPECIFIEDP (dfg) - && color_distance (&xbg, &xfg) < NEAR_SAME_COLOR_THRESHOLD) + && color_distance (&xbg, &xfg) < face_near_same_color_threshold) { if (EQ (attrs[LFACE_INVERSE_INDEX], Qt)) face->background = load_color (f, face, dfg, LFACE_BACKGROUND_INDEX); @@ -6799,6 +6797,17 @@ RESCALE-RATIO is a floating point number to specify how much larger a font of 10 point, we actually use a font of 10 * RESCALE-RATIO point. */); Vface_font_rescale_alist = Qnil; + DEFVAR_INT ("face-near-same-color-threshold", face_near_same_color_threshold, + doc: /* Threshold for using distant-foreground color instead of foreground. + +The value should be an integer number providing the minimum distance +between two colors that will still qualify them to be used as foreground +and background. If the value of `color-distance', invoked with a nil +METRIC argument, for the foreground and background colors of a face is +less than this threshold, the distant-foreground color, if defined, +will be used for the face instead of the foreground color. */); + face_near_same_color_threshold = 30000; + #ifdef HAVE_WINDOW_SYSTEM defsubr (&Sbitmap_spec_p); defsubr (&Sx_list_fonts); commit 44b7436d4408ddfb72c1758d60395872791ae00d Author: Juri Linkov Date: Thu Feb 28 23:32:39 2019 +0200 * lisp/replace.el (flush-lines): Return the number of deleted lines. When called interactively, also print the number. (Bug#34520) * doc/emacs/search.texi (Other Repeating Search): Update flush-lines that prints the number of deleted lines. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 25f0cc4183..761fe929ae 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1872,11 +1872,13 @@ region instead. @findex flush-lines @item M-x flush-lines Prompt for a regexp, and delete each line that contains a match for -it, operating on the text after point. This command deletes the -current line if it contains a match starting after point. If the -region is active, it operates on the region instead; if a line -partially contained in the region contains a match entirely contained -in the region, it is deleted. +it, operating on the text after point. When the command finishes, +it prints the number of deleted matching lines. + +This command deletes the current line if it contains a match starting +after point. If the region is active, it operates on the region +instead; if a line partially contained in the region contains a match +entirely contained in the region, it is deleted. If a match is split across lines, @code{flush-lines} deletes all those lines. It deletes the lines before starting to look for the next diff --git a/etc/NEWS b/etc/NEWS index 8a34049cf0..683a4279a3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -850,6 +850,9 @@ and case-sensitivity together with search strings in the search ring. --- *** Isearch now has its own tool-bar and menu-bar menu. ++++ +*** flush-lines prints and returns the number of deleted matching lines. + ** Debugger +++ @@ -1146,6 +1149,7 @@ the 128...255 range, as expected. ** Frames ++++ *** New command 'make-frame-on-monitor' makes a frame on the specified monitor. diff --git a/lisp/replace.el b/lisp/replace.el index b482d76afc..59ad1a375b 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -850,7 +850,6 @@ If nil, uses `regexp-history'." (defalias 'delete-matching-lines 'flush-lines) (defalias 'count-matches 'how-many) - (defun keep-lines-read-args (prompt) "Read arguments for `keep-lines' and friends. Prompt for a regexp with PROMPT. @@ -930,9 +929,8 @@ a previously found match." (set-marker rend nil) nil) - (defun flush-lines (regexp &optional rstart rend interactive) - "Delete lines containing matches for REGEXP. + "Delete lines containing matches for REGEXP. When called from Lisp (and usually when called interactively as well, see below), applies to the part of the buffer after point. The line point is in is deleted if and only if it contains a @@ -953,7 +951,10 @@ a non-nil INTERACTIVE argument. If a match is split across lines, all the lines it lies in are deleted. They are deleted _before_ looking for the next match. Hence, a match -starting on the same line at which another match ended is ignored." +starting on the same line at which another match ended is ignored. + +Return the number of deleted matching lines. When called interactively, +also print the number." (interactive (progn (barf-if-buffer-read-only) @@ -968,7 +969,8 @@ starting on the same line at which another match ended is ignored." (setq rstart (point) rend (point-max-marker))) (goto-char rstart)) - (let ((case-fold-search + (let ((count 0) + (case-fold-search (if (and case-fold-search search-upper-case) (isearch-no-upper-case-p regexp t) case-fold-search))) @@ -978,10 +980,11 @@ starting on the same line at which another match ended is ignored." (delete-region (save-excursion (goto-char (match-beginning 0)) (forward-line 0) (point)) - (progn (forward-line 1) (point)))))) - (set-marker rend nil) - nil) - + (progn (forward-line 1) (point))) + (setq count (1+ count)))) + (set-marker rend nil) + (when interactive (message "Deleted %d matching lines" count)) + count)) (defun how-many (regexp &optional rstart rend interactive) "Print and return number of matches for REGEXP following point. commit 5d60229bf1a9a496102fc2a3ef9e57dcce7bef10 Author: Eli Zaretskii Date: Thu Feb 28 21:16:10 2019 +0200 Avoid rare crashes in xbacktrace * src/eval.c (backtrace_thread_p, backtrace_top): Don't segfault in "xbacktrace" if called before the specpdl machinery is initialized in pdumped Emacs. diff --git a/src/eval.c b/src/eval.c index bf16a709b1..e162725f03 100644 --- a/src/eval.c +++ b/src/eval.c @@ -179,7 +179,7 @@ set_backtrace_debug_on_exit (union specbinding *pdl, bool doe) bool backtrace_p (union specbinding *pdl) -{ return pdl >= specpdl; } +{ return specpdl ? pdl >= specpdl : false; } static bool backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) @@ -188,6 +188,12 @@ backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) union specbinding * backtrace_top (void) { + /* This is so "xbacktrace" doesn't crash in pdumped Emacs if they + invoke the command before init_eval_once_for_pdumper initializes + specpdl machinery. See also backtrace_p above. */ + if (!specpdl) + return NULL; + union specbinding *pdl = specpdl_ptr - 1; while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE) pdl--;