commit 15426191a1353ac208d8ebe4a5920228e0df41a4 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Mon Dec 15 19:30:50 2014 -0800 * test/automated/data/flymake/Makefile: Comment. diff --git a/test/automated/data/flymake/Makefile b/test/automated/data/flymake/Makefile index a92db78..0f3f397 100644 --- a/test/automated/data/flymake/Makefile +++ b/test/automated/data/flymake/Makefile @@ -2,9 +2,11 @@ CC_OPTS = -Wall -## Recent gcc's (e.g. 4.8.2 on RHEL7) can automatically colorize their output, +## Recent gcc (e.g. 4.8.2 on RHEL7) can automatically colorize their output, ## which can confuse flymake. Set GCC_COLORS to disable that. -## TODO is this something that should be fixed in flymake? +## This only seems to be an issue in batch mode, where you would not +## normally use flymake, so it seems like just avoiding the issue +## in this test is fine. Set flymake-log-level to 3 to investigate. check-syntax: GCC_COLORS= $(CC) $(CC_OPTS) ${CHK_SOURCES} commit 1fc1f89341daa10f9318f60d03493b5bbfd7e12e Author: Glenn Morris Date: Mon Dec 15 21:08:40 2014 -0500 Disable gcc color in test/automated/data/flymake/Makefile * test/automated/data/flymake/Makefile (check-syntax): Prevent colorized gcc output from confusing flymake. diff --git a/test/ChangeLog b/test/ChangeLog index 6fa1186..78a03d1 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,11 @@ 2014-12-16 Glenn Morris + * automated/data/flymake/Makefile (check-syntax): + Prevent colorized gcc output from confusing flymake. + * automated/flymake-tests.el (flymake-tests-data-directory): Change from flymake/warnpred to more standard data/flymake. + * automated/flymake/warnpred/: Rename to automated/data/flymake/. 2014-12-11 Michael Albinus diff --git a/test/automated/data/flymake/Makefile b/test/automated/data/flymake/Makefile index 33af51c..a92db78 100644 --- a/test/automated/data/flymake/Makefile +++ b/test/automated/data/flymake/Makefile @@ -2,7 +2,10 @@ CC_OPTS = -Wall +## Recent gcc's (e.g. 4.8.2 on RHEL7) can automatically colorize their output, +## which can confuse flymake. Set GCC_COLORS to disable that. +## TODO is this something that should be fixed in flymake? check-syntax: - $(CC) $(CC_OPTS) ${CHK_SOURCES} + GCC_COLORS= $(CC) $(CC_OPTS) ${CHK_SOURCES} # eof commit e2aec9bee32236f931df57ae621eb2666408da48 Author: Glenn Morris Date: Mon Dec 15 20:41:03 2014 -0500 Move flymake test data to more standard location * test/automated/flymake-tests.el (flymake-tests-data-directory): Change from flymake/warnpred to more standard data/flymake. * .gitignore: Update for relocated flymake test data. diff --git a/.gitignore b/.gitignore index 188dd9f..d05352e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,7 @@ InfoPlist.strings Makefile !admin/charsets/Makefile !etc/refcards/Makefile -!test/automated/flymake/warnpred/Makefile +!test/automated/data/flymake/Makefile !test/indent/Makefile makefile /*.cache diff --git a/test/ChangeLog b/test/ChangeLog index c4ff2c7..6fa1186 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-12-16 Glenn Morris + + * automated/flymake-tests.el (flymake-tests-data-directory): + Change from flymake/warnpred to more standard data/flymake. + 2014-12-11 Michael Albinus * automated/vc-tests.el (vc-test--revision-granularity-function): diff --git a/test/automated/data/flymake/Makefile b/test/automated/data/flymake/Makefile new file mode 100644 index 0000000..33af51c --- /dev/null +++ b/test/automated/data/flymake/Makefile @@ -0,0 +1,8 @@ +# Makefile for flymake tests + +CC_OPTS = -Wall + +check-syntax: + $(CC) $(CC_OPTS) ${CHK_SOURCES} + +# eof diff --git a/test/automated/data/flymake/test.c b/test/automated/data/flymake/test.c new file mode 100644 index 0000000..3a39261 --- /dev/null +++ b/test/automated/data/flymake/test.c @@ -0,0 +1,5 @@ +int main() +{ + char c = 1000; + return c; +} diff --git a/test/automated/data/flymake/test.pl b/test/automated/data/flymake/test.pl new file mode 100644 index 0000000..2013b2e --- /dev/null +++ b/test/automated/data/flymake/test.pl @@ -0,0 +1,2 @@ +@arr = [1,2,3,4]; +@arr[1] = -1; diff --git a/test/automated/flymake-tests.el b/test/automated/flymake-tests.el index e5f444e..2a18a5e 100644 --- a/test/automated/flymake-tests.el +++ b/test/automated/flymake-tests.el @@ -26,7 +26,7 @@ (require 'flymake) (defvar flymake-tests-data-directory - (expand-file-name "flymake/warnpred" (getenv "EMACS_TEST_DIRECTORY")) + (expand-file-name "data/flymake" (getenv "EMACS_TEST_DIRECTORY")) "Directory containing flymake test data.") diff --git a/test/automated/flymake/warnpred/Makefile b/test/automated/flymake/warnpred/Makefile deleted file mode 100644 index 33af51c..0000000 --- a/test/automated/flymake/warnpred/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# Makefile for flymake tests - -CC_OPTS = -Wall - -check-syntax: - $(CC) $(CC_OPTS) ${CHK_SOURCES} - -# eof diff --git a/test/automated/flymake/warnpred/test.c b/test/automated/flymake/warnpred/test.c deleted file mode 100644 index 3a39261..0000000 --- a/test/automated/flymake/warnpred/test.c +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - char c = 1000; - return c; -} diff --git a/test/automated/flymake/warnpred/test.pl b/test/automated/flymake/warnpred/test.pl deleted file mode 100644 index 2013b2e..0000000 --- a/test/automated/flymake/warnpred/test.pl +++ /dev/null @@ -1,2 +0,0 @@ -@arr = [1,2,3,4]; -@arr[1] = -1; commit f2301ecc237858a029def9afaabe0fdf91591ebc Author: Juri Linkov Date: Tue Dec 16 01:54:35 2014 +0200 Fix query-replace-regexp when using lisp expressions for replacement * lisp/replace.el (query-replace-read-from): Use query-replace-compile-replacement only on the return value. Fixes: debbugs:19383 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a0a62f..4f8631d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2014-12-15 Juri Linkov + * replace.el (query-replace-read-from): Use query-replace-compile-replacement + only on the return value (bug#19383). + +2014-12-15 Juri Linkov + * isearch.el (isearch-lazy-highlight-search): Extend the bound of the wrapped search by the length of the search string to be able to lazy-highlight the whole search string at point (bug#19353). diff --git a/lisp/replace.el b/lisp/replace.el index 2c7ad19..fa6f11b 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -70,6 +70,8 @@ from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") (defcustom query-replace-from-to-separator (propertize (or (ignore-errors + ;; Ignore errors when attempt to autoload char-displayable-p + ;; fails while preparing to dump. (if (char-displayable-p ?\u2192) " \u2192 " " -> ")) " -> ") 'face 'minibuffer-prompt) @@ -142,6 +144,8 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) + ;; Reevaluating will check char-displayable-p that is + ;; unavailable while preparing to dump. (custom-reevaluate-setting 'query-replace-from-to-separator) (let* ((history-add-new-input nil) (separator @@ -179,8 +183,7 @@ wants to replace FROM with TO." (cdar query-replace-defaults) regexp-flag)) (let* ((to (if (and (string-match separator from) (get-text-property (match-beginning 0) 'separator from)) - (query-replace-compile-replacement - (substring-no-properties from (match-end 0)) regexp-flag))) + (substring-no-properties from (match-end 0)))) (from (if to (substring-no-properties from 0 (match-beginning 0)) (substring-no-properties from)))) (add-to-history query-replace-from-history-variable from nil t) @@ -198,7 +201,7 @@ wants to replace FROM with TO." from (add-to-history query-replace-to-history-variable to nil t) (add-to-history 'query-replace-defaults (cons from to) nil t) - (cons from to))))))) + (cons from (query-replace-compile-replacement to regexp-flag)))))))) (defun query-replace-compile-replacement (to regexp-flag) "Maybe convert a regexp replacement TO to Lisp. commit 10ec0468dfbc0815a772cc46a031aca298af0985 Author: Juri Linkov Date: Tue Dec 16 01:45:12 2014 +0200 Lazy-highlight the whole string at point * lisp/isearch.el (isearch-lazy-highlight-search): Extend the bound of the wrapped search by the length of the search string to be able to lazy-highlight the whole search string at point. Fixes: debbugs:19353 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 364511c..5a0a62f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-12-15 Juri Linkov + + * isearch.el (isearch-lazy-highlight-search): Extend the bound of + the wrapped search by the length of the search string to be able + to lazy-highlight the whole search string at point (bug#19353). + 2014-12-15 Lars Magne Ingebrigtsen * net/shr.el (shr-fold-text): Don't bug out on zero-length text. diff --git a/lisp/isearch.el b/lisp/isearch.el index ef0c4a7..fde9353 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3063,11 +3063,15 @@ Attempt to do the search exactly the way the pending Isearch would." (bound (if isearch-lazy-highlight-forward (min (or isearch-lazy-highlight-end-limit (point-max)) (if isearch-lazy-highlight-wrapped - isearch-lazy-highlight-start + (+ isearch-lazy-highlight-start + ;; Extend bound to match whole string at point + (1- (length isearch-lazy-highlight-last-string))) (window-end))) (max (or isearch-lazy-highlight-start-limit (point-min)) (if isearch-lazy-highlight-wrapped - isearch-lazy-highlight-end + (- isearch-lazy-highlight-end + ;; Extend bound to match whole string at point + (1- (length isearch-lazy-highlight-last-string))) (window-start)))))) ;; Use a loop like in `isearch-search'. (while retry commit 255132f6f48e3fd52d5d5ece61653dc603242353 Author: Artur Malabarba Date: Mon Dec 15 20:54:44 2014 -0200 etc/NEWS: Mention `let-alist. diff --git a/etc/ChangeLog b/etc/ChangeLog index 0a06cbd..10ebff1 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-15 Artur Malabarba + + * NEWS: Mention `let-alist. + 2014-12-14 Alan Mackenzie * NEWS: Add entry for fast-but-imprecise-scrolling. diff --git a/etc/NEWS b/etc/NEWS index 6b1a4e3..ca3294a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -423,6 +423,10 @@ helper functions) obsolete. * New Modes and Packages in Emacs 25.1 ** scss-mode (a minor variant of css-mode) + +** let-alist is a new macro (and a package) that allows one to easily +let-bind the values stored in an alist. + * Incompatible Lisp Changes in Emacs 25.1 commit 07e47aad41e6d350b13531bf8a5eebd042f34794 Author: Stefan Monnier Date: Mon Dec 15 15:41:11 2014 -0500 * src/: Various fixes to use bool type and constants. * src/dispnew.c (update_single_window): Remove arg `force_p' since it's always true. * src/xfaces.c (clear_face_cache): Use bool for the argument type. diff --git a/src/ChangeLog b/src/ChangeLog index 5ce56f4..596ae25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Stefan Monnier + + Various fixes to use bool type and constants. + * dispnew.c (update_single_window): Remove arg `force_p' since it's + always true. + * xfaces.c (clear_face_cache): Use bool for the argument type. + 2014-12-15 Paul Eggert Correct same_at_end when restoring window points @@ -10,14 +17,12 @@ New feature optionally to accelerate auto-repeated scrolling. - * xdisp.c: Remove "static" from declaration of - Qfontification_functions. + * xdisp.c: Remove "static" from declaration of Qfontification_functions. - * window.c (window_scroll): bind fontification-functions to nil + * window.c (window_scroll): Bind fontification-functions to nil when scrolling by whole screens and fast-but-imprecise-scrolling is non-nil. - (syms_of_window): New DEFVAR_BOOL - fast-but-imprecise-scrolling. + (syms_of_window): New DEFVAR_BOOL fast-but-imprecise-scrolling. * lisp.h (bool): Declare Qfontification_functions extern. @@ -28,10 +33,10 @@ [GNUTLS >= 3.0.20]: Declare for WINDOWSNT. (init_gnutls_functions)(gnutls_certificate_set_x509_system_trust) [GNUTLS >= 3.0.20]: Load from shared library for WINDOWSNT. - (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]: Define - new macro. - (Fgnutls_boot) [GNUTLS >= 3.0.20]: Call - gnutls_certificate_set_x509_system_trust. Log an error message if + (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]: + Define new macro. + (Fgnutls_boot) [GNUTLS >= 3.0.20]: + Call gnutls_certificate_set_x509_system_trust. Log an error message if it fails. 2014-12-13 Paul Eggert @@ -41,8 +46,8 @@ 2014-12-13 Eli Zaretskii - * gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move - gnutls-available-p out of the HAVE_GNUTLS conditional, and define + * gnutls.c (Fgnutls_available_p, syms_of_gnutls): + Move gnutls-available-p out of the HAVE_GNUTLS conditional, and define them only once. 2014-12-13 Teodor Zlatanov @@ -58,8 +63,8 @@ 2014-12-13 Eli Zaretskii - * xdisp.c (move_it_in_display_line_to, display_line): Don't - disallow overflow-newline-into-fringe when word-wrap is in + * xdisp.c (move_it_in_display_line_to, display_line): + Don't disallow overflow-newline-into-fringe when word-wrap is in effect. (Bug#19300) 2014-12-11 Stefan Monnier diff --git a/src/callproc.c b/src/callproc.c index 24b8855..a677334 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -852,7 +852,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, (process_coding.dst_pos_byte + process_coding.produced), 0); - display_on_the_fly = 0; + display_on_the_fly = false; process_coding = saved_coding; carryover = nread; /* Make the above condition always fail in the future. */ @@ -884,9 +884,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, /* This variable might have been set to 0 for code detection. In that case, set it back to 1 because we should have already detected a coding system. */ - display_on_the_fly = 1; + display_on_the_fly = true; } - immediate_quit = 1; + immediate_quit = true; QUIT; } give_up: ; diff --git a/src/dispextern.h b/src/dispextern.h index 5510a1f..8fd3ef9 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3371,7 +3371,7 @@ void x_free_colors (struct frame *, unsigned long *, int); void update_face_from_frame_parameter (struct frame *, Lisp_Object, Lisp_Object); Lisp_Object tty_color_name (struct frame *, int); -void clear_face_cache (int); +void clear_face_cache (bool); unsigned long load_color (struct frame *, struct face *, Lisp_Object, enum lface_attribute_index); char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, @@ -3444,11 +3444,11 @@ extern void cancel_hourglass (void); #endif /* HAVE_WINDOW_SYSTEM */ -/* Defined in xmenu.c */ +/* Defined in xmenu.c. */ int popup_activated (void); -/* Defined in dispnew.c */ +/* Defined in dispnew.c. */ extern Lisp_Object buffer_posn_from_coords (struct window *, int *, int *, @@ -3484,7 +3484,7 @@ void blank_row (struct window *, struct glyph_row *, int); void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); void clear_glyph_row (struct glyph_row *); void prepare_desired_row (struct window *, struct glyph_row *, bool); -void update_single_window (struct window *, bool); +void update_single_window (struct window *); void do_pending_window_change (bool); void change_frame_size (struct frame *, int, int, bool, bool, bool, bool); void init_display (void); @@ -3493,7 +3493,7 @@ extern Lisp_Object Qredisplay_dont_pause; extern void spec_glyph_lookup_face (struct window *, GLYPH *); extern void fill_up_frame_row_with_spaces (struct glyph_row *, int); -/* Defined in terminal.c */ +/* Defined in terminal.c. */ extern void ring_bell (struct frame *); extern void update_begin (struct frame *); diff --git a/src/dispnew.c b/src/dispnew.c index d50d06f..a68901a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3051,10 +3051,10 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) struct window *root_window = XWINDOW (f->root_window); if (redisplay_dont_pause) - force_p = 1; + force_p = true; else if (!force_p && detect_input_pending_ignore_squeezables ()) { - paused_p = 1; + paused_p = true; goto do_pause; } @@ -3074,7 +3074,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) /* Update the menu bar on X frames that don't have toolkit support. */ if (WINDOWP (f->menu_bar_window)) - update_window (XWINDOW (f->menu_bar_window), 1); + update_window (XWINDOW (f->menu_bar_window), true); #endif #if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) @@ -3088,7 +3088,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) { Lisp_Object tem; - update_window (w, 1); + update_window (w, true); w->must_be_updated_p = false; /* Swap tool-bar strings. We swap because we want to @@ -3113,7 +3113,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) /* Build F's desired matrix from window matrices. */ build_frame_matrix (f); - /* Update the display */ + /* Update the display. */ update_begin (f); paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1); update_end (f); @@ -3225,7 +3225,7 @@ update_window_tree (struct window *w, bool force_p) If FORCE_P, don't stop updating if input is pending. */ void -update_single_window (struct window *w, bool force_p) +update_single_window (struct window *w) { if (w->must_be_updated_p) { @@ -3234,12 +3234,9 @@ update_single_window (struct window *w, bool force_p) /* Record that this is not a frame-based redisplay. */ set_frame_matrix_frame (NULL); - if (redisplay_dont_pause) - force_p = 1; - /* Update W. */ update_begin (f); - update_window (w, force_p); + update_window (w, true); update_end (f); /* Reset flag in W. */ @@ -6267,8 +6264,15 @@ See `buffer-display-table' for more information. */); Vstandard_display_table = Qnil; DEFVAR_BOOL ("redisplay-dont-pause", redisplay_dont_pause, - doc: /* Non-nil means display update isn't paused when input is detected. */); - redisplay_dont_pause = 1; + doc: /* Nil means display update is paused when input is detected. */); + /* Contrary to expectations, a value of "false" can be detrimental to + responsiveness since aborting a redisplay throws away some of the + work already performed. It's usually more efficient (and gives + more prompt feedback to the user) to let the redisplay terminate, + and just completely skip the next command's redisplay (which is + done regardless of this setting if there's pending input at the + beginning of the next redisplay). */ + redisplay_dont_pause = true; #ifdef CANNOT_DUMP if (noninteractive) diff --git a/src/keyboard.c b/src/keyboard.c index 6dc0b82..beb3459 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -270,7 +270,7 @@ static Lisp_Object Qhelp_form_show; /* File in which we write all commands we read. */ static FILE *dribble; -/* Nonzero if input is available. */ +/* True if input is available. */ bool input_pending; /* Circular buffer for pre-read keyboard input. */ @@ -2403,9 +2403,9 @@ echo_keystrokes_p (void) /* commandflag 0 means do not autosave, but do redisplay. -1 means do not redisplay, but do autosave. -2 means do neither. - 1 means do both. */ + 1 means do both. -/* The argument MAP is a keymap for menu prompting. + The argument MAP is a keymap for menu prompting. PREV_EVENT is the previous input event, or nil if we are reading the first event of a key sequence (or not reading a key sequence). @@ -3878,7 +3878,7 @@ kbd_buffer_get_event (KBOARD **kbp, Lisp_Object obj; #ifdef subprocesses - if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4) + if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE / 4) { /* Start reading input again because we have processed enough to be able to accept new events again. */ diff --git a/src/minibuf.c b/src/minibuf.c index 0b45515..27b5f7b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -713,8 +713,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, { XWINDOW (minibuf_window)->cursor.hpos = 0; XWINDOW (minibuf_window)->cursor.x = 0; - XWINDOW (minibuf_window)->must_be_updated_p = 1; - update_frame (XFRAME (selected_frame), 1, 1); + XWINDOW (minibuf_window)->must_be_updated_p = true; + update_frame (XFRAME (selected_frame), true, true); flush_frame (XFRAME (XWINDOW (minibuf_window)->frame)); } diff --git a/src/process.c b/src/process.c index 7283df4..e59ca58 100644 --- a/src/process.c +++ b/src/process.c @@ -4323,7 +4323,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, while (1) { - bool timeout_reduced_for_timers = 0; + bool timeout_reduced_for_timers = false; /* If calling from keyboard input, do not quit since we want to return C-g as an input character. @@ -4410,7 +4410,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (timespec_cmp (timer_delay, timeout) < 0) { timeout = timer_delay; - timeout_reduced_for_timers = 1; + timeout_reduced_for_timers = true; } } else @@ -6669,7 +6669,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, while (1) { - bool timeout_reduced_for_timers = 0; + bool timeout_reduced_for_timers = false; fd_set waitchannels; int xerrno; @@ -6736,7 +6736,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (timespec_cmp (timer_delay, timeout) < 0) { timeout = timer_delay; - timeout_reduced_for_timers = 1; + timeout_reduced_for_timers = true; } } } diff --git a/src/w32fns.c b/src/w32fns.c index fc10e74..1763370 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6252,8 +6252,8 @@ Text larger than the specified size is clipped. */) } /* Draw into the window. */ - w->must_be_updated_p = 1; - update_single_window (w, 1); + w->must_be_updated_p = true; + update_single_window (w); unblock_input (); diff --git a/src/window.c b/src/window.c index 0b76664..ca2bc74 100644 --- a/src/window.c +++ b/src/window.c @@ -7352,7 +7352,7 @@ the buffer; `temp-buffer-show-hook' is not run unless this function runs it. */ doc: /* Non-nil means to use `mode-line-inactive' face in non-selected windows. If the minibuffer is active, the `minibuffer-scroll-window' mode line is displayed in the `mode-line' face. */); - mode_line_in_non_selected_windows = 1; + mode_line_in_non_selected_windows = true; DEFVAR_LISP ("other-window-scroll-buffer", Vother_window_scroll_buffer, doc: /* If this is a live buffer, \\[scroll-other-window] should scroll its window. */); @@ -7360,7 +7360,7 @@ is displayed in the `mode-line' face. */); DEFVAR_BOOL ("auto-window-vscroll", auto_window_vscroll_p, doc: /* Non-nil means to automatically adjust `window-vscroll' to view tall lines. */); - auto_window_vscroll_p = 1; + auto_window_vscroll_p = true; DEFVAR_INT ("next-screen-context-lines", next_screen_context_lines, doc: /* Number of lines of continuity when scrolling by screenfuls. */); @@ -7483,7 +7483,7 @@ all functions that symmetrically resize a parent window. Note that when a frame's pixel size is not a multiple of the frame's character size, at least one window may get resized pixelwise even if this option is nil. */); - window_resize_pixelwise = 0; + window_resize_pixelwise = false; DEFVAR_BOOL ("fast-but-imprecise-scrolling", Vfast_but_imprecise_scrolling, @@ -7494,7 +7494,7 @@ are actually going to be displayed get fontified. Note that this optimization can cause the portion of the buffer displayed after a scrolling operation to be somewhat inaccurate. */); - Vfast_but_imprecise_scrolling = 0; + Vfast_but_imprecise_scrolling = false; defsubr (&Sselected_window); defsubr (&Sminibuffer_window); diff --git a/src/xdisp.c b/src/xdisp.c index 48a2979..0e3e1a2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -905,7 +905,7 @@ static void iterate_out_of_display_property (struct it *); static void pop_it (struct it *); static void sync_frame_with_window_matrix_rows (struct window *); static void redisplay_internal (void); -static int echo_area_display (int); +static bool echo_area_display (bool); static void redisplay_windows (Lisp_Object); static void redisplay_window (Lisp_Object, bool); static Lisp_Object redisplay_window_error (Lisp_Object); @@ -10275,9 +10275,9 @@ message3_nolog (Lisp_Object m) else clear_message (true, true); - do_pending_window_change (0); - echo_area_display (1); - do_pending_window_change (0); + do_pending_window_change (false); + echo_area_display (true); + do_pending_window_change (false); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); } @@ -11248,13 +11248,13 @@ clear_garbaged_frames (void) is non-zero update selected_frame. Value is non-zero if the mini-windows height has been changed. */ -static int -echo_area_display (int update_frame_p) +static bool +echo_area_display (bool update_frame_p) { Lisp_Object mini_window; struct window *w; struct frame *f; - int window_height_changed_p = 0; + bool window_height_changed_p = false; struct frame *sf = SELECTED_FRAME (); mini_window = FRAME_MINIBUF_WINDOW (sf); @@ -11317,11 +11317,11 @@ echo_area_display (int update_frame_p) /* Window configuration is the same as before. Can do with a display update of the echo area, unless we displayed some mode lines. */ - update_single_window (w, 1); + update_single_window (w); flush_frame (f); } else - update_frame (f, 1, 1); + update_frame (f, true, true); /* If cursor is in the echo area, make sure that the next redisplay displays the minibuffer, so that the cursor will @@ -13435,7 +13435,7 @@ redisplay_internal (void) struct window *w = XWINDOW (selected_window); struct window *sw; struct frame *fr; - int pending; + bool pending; bool must_finish = 0, match_p; struct text_pos tlbufpos, tlendpos; int number_of_visible_frames; @@ -13495,7 +13495,7 @@ redisplay_internal (void) /* Remember the currently selected window. */ sw = w; - pending = 0; + pending = false; last_escape_glyph_frame = NULL; last_escape_glyph_face_id = (1 << FACE_ID_BITS); last_glyphless_glyph_frame = NULL; @@ -13547,7 +13547,7 @@ redisplay_internal (void) } /* Notice any pending interrupt request to change frame size. */ - do_pending_window_change (1); + do_pending_window_change (true); /* do_pending_window_change could change the selected_window due to frame resizing which makes the selected window too small. */ @@ -13594,7 +13594,7 @@ redisplay_internal (void) echo-area doesn't show through. */ && !MINI_WINDOW_P (XWINDOW (selected_window)))) { - int window_height_changed_p = echo_area_display (0); + int window_height_changed_p = echo_area_display (false); if (message_cleared_p) update_miniwindow_p = true; @@ -13802,7 +13802,7 @@ redisplay_internal (void) { if (!must_finish) { - do_pending_window_change (1); + do_pending_window_change (true); /* If selected_window changed, redisplay again. */ if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) @@ -13919,14 +13919,14 @@ redisplay_internal (void) if (f->fonts_changed) { adjust_frame_glyphs (f); - f->fonts_changed = 0; + f->fonts_changed = false; goto retry_frame; } /* See if we have to hscroll. */ if (!f->already_hscrolled_p) { - f->already_hscrolled_p = 1; + f->already_hscrolled_p = true; if (hscroll_windows (f->root_window)) goto retry_frame; } @@ -13938,9 +13938,9 @@ redisplay_internal (void) unrequest_sigio (); STOP_POLLING; - pending |= update_frame (f, 0, 0); - f->cursor_type_changed = 0; - f->updated_p = 1; + pending |= update_frame (f, false, false); + f->cursor_type_changed = false; + f->updated_p = true; } } } @@ -14001,8 +14001,8 @@ redisplay_internal (void) goto retry; XWINDOW (selected_window)->must_be_updated_p = true; - pending = update_frame (sf, 0, 0); - sf->cursor_type_changed = 0; + pending = update_frame (sf, false, false); + sf->cursor_type_changed = false; } /* We may have called echo_area_display at the top of this @@ -14016,8 +14016,8 @@ redisplay_internal (void) if (mini_frame != sf && FRAME_WINDOW_P (mini_frame)) { XWINDOW (mini_window)->must_be_updated_p = true; - pending |= update_frame (mini_frame, 0, 0); - mini_frame->cursor_type_changed = 0; + pending |= update_frame (mini_frame, false, false); + mini_frame->cursor_type_changed = false; if (!pending && hscroll_windows (mini_window)) goto retry; } @@ -14094,7 +14094,7 @@ redisplay_internal (void) } /* Change frame size now if a change is pending. */ - do_pending_window_change (1); + do_pending_window_change (true); /* If we just did a pending size change, or have additional visible frames, or selected_window changed, redisplay again. */ @@ -14110,7 +14110,7 @@ redisplay_internal (void) if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT) { - clear_face_cache (0); + clear_face_cache (false); clear_face_cache_count = 0; } @@ -14154,9 +14154,9 @@ redisplay_preserve_echo_area (int from_where) { /* We have a previously displayed message, but no current message. Redisplay the previous message. */ - display_last_displayed_message_p = 1; + display_last_displayed_message_p = true; redisplay_internal (); - display_last_displayed_message_p = 0; + display_last_displayed_message_p = false; } else redisplay_internal (); diff --git a/src/xfaces.c b/src/xfaces.c index 446107e..fbdd3c8 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -732,7 +732,7 @@ recompute_basic_faces (struct frame *f) try to free unused fonts, too. */ void -clear_face_cache (int clear_fonts_p) +clear_face_cache (bool clear_fonts_p) { #ifdef HAVE_WINDOW_SYSTEM Lisp_Object tail, frame; diff --git a/src/xfns.c b/src/xfns.c index 59715d0..1b17311 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5577,8 +5577,8 @@ Text larger than the specified size is clipped. */) unblock_input (); /* Draw into the window. */ - w->must_be_updated_p = 1; - update_single_window (w, 1); + w->must_be_updated_p = true; + update_single_window (w); /* Restore original current buffer. */ set_buffer_internal_1 (old_buffer); commit 816c1dfc5dfc6d490c653b393ef6876b3f04b7fe Merge: 436b88b e2815bf Author: Alan Mackenzie Date: Mon Dec 15 12:07:18 2014 +0000 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 436b88bf9960c97f4588d8e3d9c0c353e7898792 Author: Alan Mackenzie Date: Mon Dec 15 12:04:52 2014 +0000 "Advice" is a mass noun. Amend text accordingly. cl.texi (Obsolete Macros): Replace "an advice" with "advice". diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 83cdbc6..297bfd2 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Alan Mackenzie + + "Advice" is a mass noun. Amend text accordingly. + * cl.texi (Obsolete Macros): Replace "an advice" with "advice". + 2014-12-12 Paul Eggert * texinfo.tex: Update from gnulib. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index c15918a..21188af 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -4914,7 +4914,7 @@ through the Lisp @code{message} function. For those cases where the dynamic scoping of @code{flet} is desired, @code{cl-flet} is clearly not a substitute. The most direct replacement would be instead to use @code{cl-letf} to temporarily rebind @code{(symbol-function -'@var{fun})}. But in most cases, a better substitute is to use an advice, such +'@var{fun})}. But in most cases, a better substitute is to use advice, such as: @example @@ -4930,7 +4930,7 @@ binding of @code{my-fun-advice-enable}. @c Bug#411. Note that many primitives (e.g., @code{+}) have special byte-compile handling. -Attempts to redefine such functions using @code{flet}, @code{cl-letf}, or an +Attempts to redefine such functions using @code{flet}, @code{cl-letf}, or advice will fail when byte-compiled. @c Or cl-flet. @c In such cases, use @code{labels} instead. commit c3a2c35f1db8f2597b7f17e5806ff83a25345540 Author: Alan Mackenzie Date: Mon Dec 15 11:54:42 2014 +0000 "Advice" is a mass noun. Amend text accordingly. functions.texi: (Advising Functions, Core Advising Primitives) (Advising Named Functions, Advice combinators) (Porting old advice): Replace, e.g., "an advice" with "advice". diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 0d8458f..bc9e991 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Alan Mackenzie + + "Advice" is a mass noun. Amend text accordingly. + * functions.texi: (Advising Functions, Core Advising Primitives) + (Advising Named Functions, Advice combinators) + (Porting old advice): Replace, e.g., "an advice" with "advice". + 2014-12-13 Lars Magne Ingebrigtsen * files.texi (Relative File Names): Mention `directory-name-p'. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 50849d4..0ac084b 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -1204,17 +1204,17 @@ behavior with: The arguments @code{:before} and @code{:around} used in the above examples specify how the two functions are composed, since there are many different -ways to do it. The added function is also called an @emph{advice}. +ways to do it. The added function is also called a piece of @emph{advice}. @menu * Core Advising Primitives:: Primitives to manipulate advice. * Advising Named Functions:: Advising named functions. * Advice combinators:: Ways to compose advice. -* Porting old advices:: Adapting code using the old defadvice. +* Porting old advice:: Adapting code using the old defadvice. @end menu @node Core Advising Primitives -@subsection Primitives to manipulate advices +@subsection Primitives to manipulate advice @defmac add-function where place function &optional props This macro is the handy way to add the advice @var{function} to the function @@ -1245,22 +1245,25 @@ identify which function to remove. Typically used when @var{function} is an anonymous function. @item depth -This specifies how to order the advices, in case several advices are present. -By default, the depth is 0. A depth of 100 indicates that this advice should -be kept as deep as possible, whereas a depth of -100 indicates that it -should stay as the outermost advice. When two advices specify the same depth, -the most recently added advice will be outermost. - -For a @code{:before} advice, being outermost means that this advice will be run -first, before any other advice, whereas being innermost means that it will run -right before the original function, with no other advice run between itself and -the original function. Similarly, for an @code{:after} advice innermost means -that it will run right after the original function, with no other advice run in -between, whereas outermost means that it will be run very last after all -other advices. An innermost @code{:override} advice will only override the -original function and other advices will apply to it, whereas an outermost -@code{:override} advice will override not only the original function but all -other advices applied to it as well. +This specifies how to order the advice, should several pieces of +advice be present. By default, the depth is 0. A depth of 100 +indicates that this piece of advice should be kept as deep as +possible, whereas a depth of -100 indicates that it should stay as the +outermost piece. When two pieces of advice specify the same depth, +the most recently added one will be outermost. + +For @code{:before} advice, being outermost means that this advice will +be run first, before any other advice, whereas being innermost means +that it will run right before the original function, with no other +advice run between itself and the original function. Similarly, for +@code{:after} advice innermost means that it will run right after the +original function, with no other advice run in between, whereas +outermost means that it will be run right at the end after all other +advice. An innermost @code{:override} piece of advice will only +override the original function and other pieces of advice will apply +to it, whereas an outermost @code{:override} piece of advice will +override not only the original function but all other advice applied +to it as well. @end table If @var{function} is not interactive, then the combined function will inherit @@ -1298,7 +1301,7 @@ function, it can also be the @code{name} of the piece of advice. @end defun @defun advice-function-mapc f function-def -Call the function @var{f} for every advice that was added to +Call the function @var{f} for every piece of advice that was added to @var{function-def}. @var{f} is called with two arguments: the advice function and its properties. @end defun @@ -1326,7 +1329,7 @@ instead. This separate set of functions to manipulate pieces of advice applied to named functions, offers the following extra features compared to @code{add-function}: they know how to deal with macros and autoloaded functions, they let @code{describe-function} preserve the original docstring as -well as document the added advice, and they let you add and remove advices +well as document the added advice, and they let you add and remove advice before a function is even defined. @code{advice-add} can be useful for altering the behavior of existing calls @@ -1361,7 +1364,7 @@ up in a confusing situation where some calls (occurring from Lisp code) obey the advice and other calls (from C code) do not. @defmac define-advice symbol (where lambda-list &optional name depth) &rest body -This macro defines an advice and adds it to the function named +This macro defines a piece of advice and adds it to the function named @var{symbol}. The advice is an anonymous function if @var{name} is nil or a function named @code{symbol@@name}. See @code{advice-add} for explanation of other arguments. @@ -1375,23 +1378,23 @@ Add the advice @var{function} to the named function @var{symbol}. @defun advice-remove symbol function Remove the advice @var{function} from the named function @var{symbol}. -@var{function} can also be the @code{name} of an advice. +@var{function} can also be the @code{name} of a piece of advice. @end defun @defun advice-member-p function symbol Return non-@code{nil} if the advice @var{function} is already in the named function @var{symbol}. @var{function} can also be the @code{name} of -an advice. +a piece of advice. @end defun @defun advice-mapc function symbol -Call @var{function} for every advice that was added to the named function -@var{symbol}. @var{function} is called with two arguments: the advice function -and its properties. +Call @var{function} for every piece of advice that was added to the +named function @var{symbol}. @var{function} is called with two +arguments: the advice function and its properties. @end defun @node Advice combinators -@subsection Ways to compose advices +@subsection Ways to compose advice Here are the different possible values for the @var{where} argument of @code{add-function} and @code{advice-add}, specifying how the advice @@ -1503,14 +1506,14 @@ More specifically, the composition of the two functions behaves like: @end table -@node Porting old advices +@node Porting old advice @subsection Adapting code using the old defadvice A lot of code uses the old @code{defadvice} mechanism, which is largely made obsolete by the new @code{advice-add}, whose implementation and semantics is significantly simpler. -An old advice such as: +An old piece of advice such as: @example (defadvice previous-line (before next-line-at-end @@ -1547,11 +1550,11 @@ whereas the new advice mechanism needs: Note that @code{ad-activate} had a global effect: it activated all pieces of advice enabled for that specified function. If you wanted to only activate or -deactivate a particular advice, you needed to @emph{enable} or @emph{disable} -that advice with @code{ad-enable-advice} and @code{ad-disable-advice}. +deactivate a particular piece, you needed to @emph{enable} or @emph{disable} +it with @code{ad-enable-advice} and @code{ad-disable-advice}. The new mechanism does away with this distinction. -An around advice such as: +Around advice such as: @example (defadvice foo (around foo-around) @@ -1577,12 +1580,12 @@ modify the function's arguments (e.g., with @code{ad-set-arg}), and that would affect the argument values seen by the original function, whereas in the new @code{:before}, modifying an argument via @code{setq} in the advice has no effect on the arguments seen by the original function. -When porting a @code{before} advice which relied on this behavior, you'll need -to turn it into a new @code{:around} or @code{:filter-args} advice instead. +When porting @code{before} advice which relied on this behavior, you'll need +to turn it into new @code{:around} or @code{:filter-args} advice instead. -Similarly an old @code{after} advice could modify the returned value by -changing @code{ad-return-value}, whereas a new @code{:after} advice cannot, so -when porting such an old @code{after} advice, you'll need to turn it into a new +Similarly old @code{after} advice could modify the returned value by +changing @code{ad-return-value}, whereas new @code{:after} advice cannot, so +when porting such old @code{after} advice, you'll need to turn it into new @code{:around} or @code{:filter-return} advice instead. @node Obsolete Functions