commit 05d76dba6604f78e4b2b7b9f8b30c916cad7d32a (HEAD, refs/remotes/origin/master) Author: Tino Calancha Date: Mon Jul 4 16:08:55 2016 +0900 Calc: Update mode line after change mode * lisp/calc/calc-ext.el (calc-change-mode): Call 'calc-set-mode-line'. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 3cafd96..cc0972e 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1633,6 +1633,7 @@ calc-kill calc-kill-region calc-yank)))) (not (equal var '(calc-mode-save-mode))) (calc-save-modes)))) (if calc-embedded-info (calc-embedded-modes-change var)) + (calc-set-mode-line) (symbol-value (car var))))) (defun calc-toggle-banner () commit ca1b9b38dcf372b09028acf088f386ef09f2de84 Author: Mark Oteiza Date: Sun Jul 3 18:53:39 2016 -0400 * lisp/simple.el (save-mark-and-excursion): Add declare forms. diff --git a/lisp/simple.el b/lisp/simple.el index bc3e7b8..0da7097 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5223,6 +5223,7 @@ store it in a Lisp variable. Example: (defmacro save-mark-and-excursion (&rest body) "Like `save-excursion', but also save and restore the mark state. This macro does what `save-excursion' did before Emacs 25.1." + (declare (indent 0) (debug t)) (let ((saved-marker-sym (make-symbol "saved-marker"))) `(let ((,saved-marker-sym (save-mark-and-excursion--save))) (unwind-protect commit 838f122873edbc0cff1ebe3645803e674e812774 Author: Paul Eggert Date: Mon Jul 4 00:46:57 2016 +0200 Re-fix open-network-stream responsiveness Problem reported by Christer Ekholm (Bug#23864). * src/process.c (wait_reading_process_output): Further fix for typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when wait == INFINITY and got_output_end_time is invalid. See: http://bugs.gnu.org/23864#20 diff --git a/src/process.c b/src/process.c index 376e872..bdbdefa 100644 --- a/src/process.c +++ b/src/process.c @@ -5269,20 +5269,22 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, haven't lowered our timeout due to timers or SIGIO and have waited a long amount of time due to repeated timers. */ - struct timespec cmp_time; - bool have_cmp_time = false; + struct timespec huge_timespec + = make_timespec (TYPE_MAXIMUM (time_t), 2 * TIMESPEC_RESOLUTION); + struct timespec cmp_time = huge_timespec; if (wait < TIMEOUT) break; - else if (wait == TIMEOUT) - cmp_time = end_time, have_cmp_time = true; - else if (!process_skipped && got_some_output > 0 - && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) + if (wait == TIMEOUT) + cmp_time = end_time; + if (!process_skipped && got_some_output > 0 + && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) { if (!timespec_valid_p (got_output_end_time)) break; - cmp_time = got_output_end_time, have_cmp_time = true; + if (timespec_cmp (got_output_end_time, cmp_time) < 0) + cmp_time = got_output_end_time; } - if (have_cmp_time) + if (timespec_cmp (cmp_time, huge_timespec) < 0) { now = current_timespec (); if (timespec_cmp (cmp_time, now) <= 0) commit 9e54c5250d87e64a4a7f2423f217c4444bcf3449 Author: Alan Mackenzie Date: Sun Jul 3 18:13:51 2016 +0000 Remove redundant forms from CC Mode for faster fontification * lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove four arms of the "main" cond form in the function, which have been redundant since the extraction of c-font-lock-cut-off-declarators from the function on 2016-06-15/16. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index f122a95..dfc2c06 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1403,50 +1403,6 @@ casts and declarations are fontified. Used on level 2 and higher." (c-fontify-recorded-types-and-refs) nil)) - ;; Restore point, since at this point in the code it has been - ;; left undefined by c-forward-decl-or-cast-1 above. - ((progn (goto-char start-pos) nil)) - - ;; If point is inside a bracelist, there's no point checking it - ;; being at a declarator. - ((let ((paren-state (c-parse-state))) - (setq lbrace (c-cheap-inside-bracelist-p paren-state))) - ;; Move past this bracelist to prevent an endless loop. - (goto-char lbrace) - (unless (c-safe (progn (forward-list) t)) - (goto-char start-pos) - (c-forward-token-2)) - nil) - - ;; If point is just after a ")" which is followed by an - ;; identifier which isn't a label, or at the matching "(", we're - ;; at either a macro invocation, a cast, or a - ;; for/while/etc. statement. The cast case is handled above. - ;; None of these cases can contain a declarator. - ((or (and (eq (char-before match-pos) ?\)) - (c-on-identifier) - (save-excursion (not (c-forward-label)))) - (and (eq (char-after) ?\() - (save-excursion - (and - (progn (c-backward-token-2) (c-on-identifier)) - (save-excursion (not (c-forward-label))) - (progn (c-backward-token-2) - (eq (char-after) ?\()))))) - (c-forward-token-2) ; Must prevent looping. - nil) - - ((and (not c-enums-contain-decls) - ;; An optimization quickly to eliminate scans of long enum - ;; declarations in the next cond arm. - (let ((paren-state (c-parse-state))) - (and - (numberp (car paren-state)) - (save-excursion - (goto-char (car paren-state)) - (c-backward-over-enum-header))))) - (c-forward-token-2) - nil) (t t))) ;; It was a false alarm. Check if we're in a label (or other commit 4b9ac23960d2998f899287ffcf696ad33b63a69a Author: Alan Mackenzie Date: Sun Jul 3 13:11:28 2016 +0000 Speed up CC Mode fontification with less accurate functions extending region * lisp/progmodes/cc-fonts.el (c-font-lock-cut-off-declarators) (c-font-lock-enclosing-decls) * lisp/progmodes/cc-mode.el (c-fl-decl-start): Replace invocations of c-beginning-of-decl-1 with less accurate invocations of c-syntactic-skip-backwards to speed up fontification. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 52f0b0d..f122a95 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1522,28 +1522,28 @@ casts and declarations are fontified. Used on level 2 and higher." (unless (or (eobp) (looking-at "\\s(\\|\\s)")) (forward-char)) - (setq bod-res (car (c-beginning-of-decl-1 decl-search-lim))) - (if (and (eq bod-res 'same) - (save-excursion - (c-backward-syntactic-ws) - (eq (char-before) ?\}))) - (c-beginning-of-decl-1 decl-search-lim)) - - ;; We're now putatively at the declaration. - (setq paren-state (c-parse-state)) - ;; At top level or inside a "{"? - (if (or (not (setq encl-pos - (c-most-enclosing-brace paren-state))) - (eq (char-after encl-pos) ?\{)) - (progn - (when (looking-at c-typedef-key) ; "typedef" - (setq is-typedef t) - (goto-char (match-end 0)) - (c-forward-syntactic-ws)) - ;; At a real declaration? - (if (memq (c-forward-type t) '(t known found decltype)) - (c-font-lock-declarators limit t is-typedef))) - nil))))) + (c-syntactic-skip-backward "^;{}" decl-search-lim t) + (when (eq (char-before) ?}) + (c-go-list-backward) ; brace block of struct, etc.? + (c-syntactic-skip-backward "^;{}" decl-search-lim t)) + (when (or (bobp) + (memq (char-before) '(?\; ?{ ?}))) + (c-forward-syntactic-ws) + ;; We're now putatively at the declaration. + (setq paren-state (c-parse-state)) + ;; At top level or inside a "{"? + (if (or (not (setq encl-pos + (c-most-enclosing-brace paren-state))) + (eq (char-after encl-pos) ?\{)) + (progn + (when (looking-at c-typedef-key) ; "typedef" + (setq is-typedef t) + (goto-char (match-end 0)) + (c-forward-syntactic-ws)) + ;; At a real declaration? + (if (memq (c-forward-type t) '(t known found decltype)) + (c-font-lock-declarators limit t is-typedef))))))) + nil)) (defun c-font-lock-enclosing-decls (limit) ;; Fontify the declarators of (nested) declarations we're in the middle of. @@ -1557,7 +1557,7 @@ casts and declarations are fontified. Used on level 2 and higher." ;; Fontification". (let* ((paren-state (c-parse-state)) (decl-search-lim (c-determine-limit 1000)) - decl-context in-typedef ps-elt) + in-typedef ps-elt) ;; Are we in any nested struct/union/class/etc. braces? (while paren-state (setq ps-elt (car paren-state) @@ -1565,15 +1565,18 @@ casts and declarations are fontified. Used on level 2 and higher." (when (and (atom ps-elt) (eq (char-after ps-elt) ?\{)) (goto-char ps-elt) - (setq decl-context (c-beginning-of-decl-1 decl-search-lim) - in-typedef (looking-at c-typedef-key)) - (if in-typedef (c-forward-token-2)) - (when (and c-opt-block-decls-with-vars-key - (looking-at c-opt-block-decls-with-vars-key)) - (goto-char ps-elt) - (when (c-safe (c-forward-sexp)) - (c-forward-syntactic-ws) - (c-font-lock-declarators limit t in-typedef))))))) + (c-syntactic-skip-backward "^;{}" decl-search-lim) + (when (or (bobp) + (memq (char-before) '(?\; ?}))) + (c-forward-syntactic-ws) + (setq in-typedef (looking-at c-typedef-key)) + (if in-typedef (c-forward-token-2)) + (when (and c-opt-block-decls-with-vars-key + (looking-at c-opt-block-decls-with-vars-key)) + (goto-char ps-elt) + (when (c-safe (c-forward-sexp)) + (c-forward-syntactic-ws) + (c-font-lock-declarators limit t in-typedef)))))))) (defun c-font-lock-raw-strings (limit) ;; Fontify C++ raw strings. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 5ad7a01..6711a02 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1310,9 +1310,10 @@ Note that the style variables are always made local to the buffer." (while ;; Go to a less nested declaration each time round this loop. (and - (eq (car (c-beginning-of-decl-1 bod-lim)) 'same) + (c-syntactic-skip-backward "^;{}" bod-lim t) (> (point) bod-lim) - (progn (setq bo-decl (point)) + (progn (c-forward-syntactic-ws) + (setq bo-decl (point)) ;; Are we looking at a keyword such as "template" or ;; "typedef" which can decorate a type, or the type itself? (when (or (looking-at c-prefix-spec-kwds-re) commit b56a8bcd0e68451d0360ab6ed98c88d890324838 Author: Tino Calancha Date: Sun Jul 3 21:42:02 2016 +0900 Ibuffer: unmark all buffers without confirmation * lisp/ibuffer.el (ibuffer-unmark-all-marks): New command (Bug#23680). (ibuffer-mouse-popup-menu): Use it. (ibuffer-mode): Update mode doc. (ibuffer-mode-map): Bind 'ibuffer-unmark-all-marks' to 'U'. Rebind 'ibuffer-do-replace-regexp' to 'r'. ; * etc/NEWS: Add entry for this change. diff --git a/etc/NEWS b/etc/NEWS index 555d6bb..7e11f62 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -193,6 +193,11 @@ questions, with a handy way to display help texts. ** Ibuffer --- +*** A new command 'ibuffer-unmark-all-marks' to unmark +all buffers without asking confirmation; bound to +'U'; 'ibuffer-do-replace-regexp' bound to 'r'. + +--- *** A new command `ibuffer-mark-by-content-regexp' to mark buffers whose content matches a regexp; bound to '% c' and '% g'. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 126b5a3..2f875f4 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -471,6 +471,7 @@ directory, like `default-directory'." (define-key map (kbd "DEL") 'ibuffer-unmark-backward) (define-key map (kbd "M-DEL") 'ibuffer-unmark-all) (define-key map (kbd "* *") 'ibuffer-unmark-all) + (define-key map (kbd "U") 'ibuffer-unmark-all-marks) (define-key map (kbd "* M") 'ibuffer-mark-by-mode) (define-key map (kbd "* m") 'ibuffer-mark-modified-buffers) (define-key map (kbd "* u") 'ibuffer-mark-unsaved-buffers) @@ -568,7 +569,7 @@ directory, like `default-directory'." (define-key map (kbd "R") 'ibuffer-do-rename-uniquely) (define-key map (kbd "S") 'ibuffer-do-save) (define-key map (kbd "T") 'ibuffer-do-toggle-read-only) - (define-key map (kbd "U") 'ibuffer-do-replace-regexp) + (define-key map (kbd "r") 'ibuffer-do-replace-regexp) (define-key map (kbd "V") 'ibuffer-do-revert) (define-key map (kbd "W") 'ibuffer-do-view-and-eval) (define-key map (kbd "X") 'ibuffer-do-shell-command-pipe) @@ -753,6 +754,8 @@ directory, like `default-directory'." :help "Mark buffers which have not been viewed recently")) (define-key-after map [menu-bar mark unmark-all] '(menu-item "Unmark All" ibuffer-unmark-all)) + (define-key-after map [menu-bar mark unmark-all-marks] + '(menu-item "Unmark All buffers" ibuffer-unmark-all-marks)) (define-key-after map [menu-bar mark dashes] '("--")) @@ -973,8 +976,7 @@ width and the longest string in LIST." (popup-menu ibuffer-mode-groups-popup)) (let ((inhibit-read-only t)) (ibuffer-save-marks - ;; hm. we could probably do this in a better fashion - (ibuffer-unmark-all ?\r) + (ibuffer-unmark-all-marks) (save-excursion (goto-char eventpt) (ibuffer-set-mark ibuffer-marked-char)) @@ -1335,6 +1337,12 @@ With optional ARG, make read-only only if ARG is not negative." t))))) (ibuffer-redisplay t)) +(defun ibuffer-unmark-all-marks () + "Remove all marks from all marked buffers in Ibuffer." + (interactive) + ;; hm. we could probably do this in a better fashion + (ibuffer-unmark-all ?\r)) + (defun ibuffer-toggle-marks (&optional group) "Toggle which buffers are marked. In other words, unmarked buffers become marked, and marked buffers @@ -2426,7 +2434,8 @@ Marking commands: `\\[ibuffer-unmark-forward]' - Unmark the buffer at point. `\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the previous line. - `\\[ibuffer-unmark-all]' - Unmark all marked buffers. + `\\[ibuffer-unmark-all]' - Unmark buffers marked with MARK. + `\\[ibuffer-unmark-all-marks]' - Unmark all marked buffers. `\\[ibuffer-mark-by-mode]' - Mark buffers by major mode. `\\[ibuffer-mark-unsaved-buffers]' - Mark all \"unsaved\" buffers. This means that the buffer is modified, and has an associated file. commit 1e97ecb964a478e8b2f08b628695ac02b923eabe Author: Paul Eggert Date: Sun Jul 3 10:49:21 2016 +0200 Fix open-network-stream responsiveness Problem reported by Constantin Kulikov (Bug#23684). * src/process.c (wait_reading_process_output): Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when wait == INFINITY and got_output_end_time is invalid. In this case the code should break, not continue. diff --git a/src/process.c b/src/process.c index ed0c529..376e872 100644 --- a/src/process.c +++ b/src/process.c @@ -5269,16 +5269,20 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, haven't lowered our timeout due to timers or SIGIO and have waited a long amount of time due to repeated timers. */ + struct timespec cmp_time; + bool have_cmp_time = false; if (wait < TIMEOUT) break; - struct timespec cmp_time - = (wait == TIMEOUT - ? end_time - : (!process_skipped && got_some_output > 0 - && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) - ? got_output_end_time - : invalid_timespec ()); - if (timespec_valid_p (cmp_time)) + else if (wait == TIMEOUT) + cmp_time = end_time, have_cmp_time = true; + else if (!process_skipped && got_some_output > 0 + && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) + { + if (!timespec_valid_p (got_output_end_time)) + break; + cmp_time = got_output_end_time, have_cmp_time = true; + } + if (have_cmp_time) { now = current_timespec (); if (timespec_cmp (cmp_time, now) <= 0)