aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/auth-source.el2
-rw-r--r--lisp/calendar/parse-time.el12
-rw-r--r--lisp/comint.el11
-rw-r--r--lisp/emacs-lisp/debug.el54
-rw-r--r--lisp/emacs-lisp/let-alist.el2
-rw-r--r--lisp/emacs-lisp/subr-x.el5
-rw-r--r--lisp/gnus/gnus-art.el7
-rw-r--r--lisp/image-dired.el8
-rw-r--r--lisp/net/tramp.el30
-rw-r--r--lisp/progmodes/cc-align.el12
-rw-r--r--lisp/progmodes/cc-engine.el101
-rw-r--r--lisp/progmodes/cc-styles.el1
-rw-r--r--lisp/progmodes/cc-vars.el2
-rw-r--r--lisp/shell.el2
-rw-r--r--lisp/vc/diff-mode.el26
15 files changed, 151 insertions, 124 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index c26935fcc97..7402ab21d74 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -2129,7 +2129,7 @@ MODE can be \"login\" or \"password\"."
2129 (if user 2129 (if user
2130 (auth-source-search 2130 (auth-source-search
2131 :host host 2131 :host host
2132 :user "yourusername" 2132 :user user
2133 :max 1 2133 :max 1
2134 :require '(:user :secret) 2134 :require '(:user :secret)
2135 :create nil) 2135 :create nil)
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index 7651c5da1f4..b781cb0eb48 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -1,4 +1,4 @@
1;;; parse-time.el --- parsing time strings 1;;; parse-time.el --- parsing time strings -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1996, 2000-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1996, 2000-2017 Free Software Foundation, Inc.
4 4
@@ -203,12 +203,9 @@ any values that are unknown are returned as nil."
203 (time-second 2digit) 203 (time-second 2digit)
204 (time-secfrac "\\(\\.[0-9]+\\)?") 204 (time-secfrac "\\(\\.[0-9]+\\)?")
205 (time-numoffset (concat "\\([-+]\\)" time-hour ":?" time-minute "?")) 205 (time-numoffset (concat "\\([-+]\\)" time-hour ":?" time-minute "?"))
206 (time-offset (concat "Z" time-numoffset))
207 (partial-time (concat time-hour colon time-minute colon time-second 206 (partial-time (concat time-hour colon time-minute colon time-second
208 time-secfrac)) 207 time-secfrac))
209 (full-date (concat date-fullyear dash date-month dash date-mday)) 208 (full-date (concat date-fullyear dash date-month dash date-mday)))
210 (full-time (concat partial-time time-offset))
211 (date-time (concat full-date "T" full-time)))
212 (list (concat "^" full-date) 209 (list (concat "^" full-date)
213 (concat "T" partial-time) 210 (concat "T" partial-time)
214 (concat "\\(Z\\|" time-numoffset "\\)"))) 211 (concat "\\(Z\\|" time-numoffset "\\)")))
@@ -225,7 +222,7 @@ If DATE-STRING cannot be parsed, it falls back to
225 (time-re (nth 1 parse-time-iso8601-regexp)) 222 (time-re (nth 1 parse-time-iso8601-regexp))
226 (tz-re (nth 2 parse-time-iso8601-regexp)) 223 (tz-re (nth 2 parse-time-iso8601-regexp))
227 re-start 224 re-start
228 time seconds minute hour fractional-seconds 225 time seconds minute hour
229 day month year day-of-week dst tz) 226 day month year day-of-week dst tz)
230 ;; We need to populate 'time' with 227 ;; We need to populate 'time' with
231 ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) 228 ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ)
@@ -240,9 +237,6 @@ If DATE-STRING cannot be parsed, it falls back to
240 (setq hour (string-to-number (match-string 1 date-string)) 237 (setq hour (string-to-number (match-string 1 date-string))
241 minute (string-to-number (match-string 2 date-string)) 238 minute (string-to-number (match-string 2 date-string))
242 seconds (string-to-number (match-string 3 date-string)) 239 seconds (string-to-number (match-string 3 date-string))
243 fractional-seconds (string-to-number (or
244 (match-string 4 date-string)
245 "0"))
246 re-start (match-end 0)) 240 re-start (match-end 0))
247 (when (string-match tz-re date-string re-start) 241 (when (string-match tz-re date-string re-start)
248 (if (string= "Z" (match-string 1 date-string)) 242 (if (string= "Z" (match-string 1 date-string))
diff --git a/lisp/comint.el b/lisp/comint.el
index c82c3d09df3..830f4ca88f9 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1879,7 +1879,6 @@ Similarly for Soar, Scheme, etc."
1879 (let ((echo-len (- comint-last-input-end 1879 (let ((echo-len (- comint-last-input-end
1880 comint-last-input-start))) 1880 comint-last-input-start)))
1881 ;; Wait for all input to be echoed: 1881 ;; Wait for all input to be echoed:
1882
1883 (while (and (> (+ comint-last-input-end echo-len) 1882 (while (and (> (+ comint-last-input-end echo-len)
1884 (point-max)) 1883 (point-max))
1885 (accept-process-output proc) 1884 (accept-process-output proc)
@@ -1891,7 +1890,6 @@ Similarly for Soar, Scheme, etc."
1891 ;; (+ comint-last-input-start 1890 ;; (+ comint-last-input-start
1892 ;; (- (point-max) comint-last-input-end)) 1891 ;; (- (point-max) comint-last-input-end))
1893 nil comint-last-input-end (point-max))))) 1892 nil comint-last-input-end (point-max)))))
1894
1895 (if (and 1893 (if (and
1896 (<= (+ comint-last-input-end echo-len) 1894 (<= (+ comint-last-input-end echo-len)
1897 (point-max)) 1895 (point-max))
@@ -1903,7 +1901,6 @@ Similarly for Soar, Scheme, etc."
1903 ;; Certain parts of the text to be deleted may have 1901 ;; Certain parts of the text to be deleted may have
1904 ;; been mistaken for prompts. We have to prevent 1902 ;; been mistaken for prompts. We have to prevent
1905 ;; problems when `comint-prompt-read-only' is non-nil. 1903 ;; problems when `comint-prompt-read-only' is non-nil.
1906
1907 (let ((inhibit-read-only t)) 1904 (let ((inhibit-read-only t))
1908 (delete-region comint-last-input-end 1905 (delete-region comint-last-input-end
1909 (+ comint-last-input-end echo-len)) 1906 (+ comint-last-input-end echo-len))
@@ -1912,7 +1909,6 @@ Similarly for Soar, Scheme, etc."
1912 (goto-char comint-last-input-end) 1909 (goto-char comint-last-input-end)
1913 (comint-update-fence))))))) 1910 (comint-update-fence)))))))
1914 1911
1915
1916 ;; This used to call comint-output-filter-functions, 1912 ;; This used to call comint-output-filter-functions,
1917 ;; but that scrolled the buffer in undesirable ways. 1913 ;; but that scrolled the buffer in undesirable ways.
1918 (run-hook-with-args 'comint-output-filter-functions ""))))) 1914 (run-hook-with-args 'comint-output-filter-functions "")))))
@@ -2243,7 +2239,10 @@ the current line with any initial string matching the regexp
2243 (null (get-char-property (setq bof (field-beginning)) 'field))) 2239 (null (get-char-property (setq bof (field-beginning)) 'field)))
2244 (field-string-no-properties bof) 2240 (field-string-no-properties bof)
2245 (comint-bol) 2241 (comint-bol)
2246 (buffer-substring-no-properties (point) (line-end-position))))) 2242 (buffer-substring-no-properties (point)
2243 (if comint-use-prompt-regexp
2244 (line-end-position)
2245 (field-end))))))
2247 2246
2248(defun comint-copy-old-input () 2247(defun comint-copy-old-input ()
2249 "Insert after prompt old input at point as new input to be edited. 2248 "Insert after prompt old input at point as new input to be edited.
@@ -2670,7 +2669,7 @@ This command is like `M-.' in bash."
2670 (set-marker comint-insert-previous-argument-last-start-pos (point)) 2669 (set-marker comint-insert-previous-argument-last-start-pos (point))
2671 ;; Insert the argument. 2670 ;; Insert the argument.
2672 (let ((input-string (comint-previous-input-string 0))) 2671 (let ((input-string (comint-previous-input-string 0)))
2673 (when (string-match "[ \t\n]*&[ \t\n]*$" input-string) 2672 (when (string-match "[ \t\n]*&" input-string)
2674 ;; strip terminating '&' 2673 ;; strip terminating '&'
2675 (setq input-string (substring input-string 0 (match-beginning 0)))) 2674 (setq input-string (substring input-string 0 (match-beginning 0))))
2676 (insert (comint-arguments input-string index index))) 2675 (insert (comint-arguments input-string index index)))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index faa323f733a..cb77148c285 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -816,60 +816,6 @@ Redefining FUNCTION also cancels it."
816 '((depth . -100))) 816 '((depth . -100)))
817 function) 817 function)
818 818
819;;;###autoload
820;; (defun debug-on-set (symbol)
821;; "Request FUNCTION to invoke debugger each time it is called.
822
823;; When called interactively, prompt for FUNCTION in the minibuffer.
824
825;; This works by modifying the definition of FUNCTION. If you tell the
826;; debugger to continue, FUNCTION's execution proceeds. If FUNCTION is a
827;; normal function or a macro written in Lisp, you can also step through
828;; its execution. FUNCTION can also be a primitive that is not a special
829;; form, in which case stepping is not possible. Break-on-entry for
830;; primitive functions only works when that function is called from Lisp.
831
832;; Use \\[cancel-debug-on-entry] to cancel the effect of this command.
833;; Redefining FUNCTION also cancels it."
834;; (interactive
835;; (let ((v (variable-at-point))
836;; (enable-recursive-minibuffers t)
837;; (orig-buffer (current-buffer))
838;; val)
839;; (setq val (completing-read
840;; (if (symbolp v)
841;; (format
842;; "Debug on set to symbol (default %s): " v)
843;; "Debug on set to symbol: ")
844;; #'help--symbol-completion-table
845;; (lambda (vv)
846;; ;; In case the variable only exists in the buffer
847;; ;; the command we switch back to that buffer before
848;; ;; we examine the variable.
849;; (with-current-buffer orig-buffer
850;; (or (get vv 'variable-documentation)
851;; (and (boundp vv) (not (keywordp vv))))))
852;; t nil nil
853;; (if (symbolp v) (symbol-name v))))
854;; (list (if (equal val "")
855;; v (intern val)))))
856
857
858
859;; (interactive
860;; (let* ((var-default (variable-at-point))
861;; (var (completing-read
862;; (if var-default
863;; (format "Debug on set to symbol (default %s): " var-default)
864;; "Debug on set to symbol: ")
865;; nil
866;; #'boundp
867;; t nil nil (symbol-name var-default))))
868;; (list (if (equal var "") var-default (intern var)))))
869;; (advice-add function :before #'debug--implement-debug-on-entry
870;; '((depth . -100)))
871;; function)
872
873(defun debug--function-list () 819(defun debug--function-list ()
874 "List of functions currently set for debug on entry." 820 "List of functions currently set for debug on entry."
875 (let ((funs '())) 821 (let ((funs '()))
diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el
index a45fc0a05c3..cf82fe3ec63 100644
--- a/lisp/emacs-lisp/let-alist.el
+++ b/lisp/emacs-lisp/let-alist.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Artur Malabarba <emacs@endlessparentheses.com> 5;; Author: Artur Malabarba <emacs@endlessparentheses.com>
6;; Package-Requires: ((emacs "24.1")) 6;; Package-Requires: ((emacs "24.1"))
7;; Version: 1.0.4 7;; Version: 1.0.5
8;; Keywords: extensions lisp 8;; Keywords: extensions lisp
9;; Prefix: let-alist 9;; Prefix: let-alist
10;; Separator: - 10;; Separator: -
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 7736225b5fa..52331b9ad36 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -214,6 +214,11 @@ user enters `recenter', `scroll-up', or `scroll-down' responses,
214perform the requested window recentering or scrolling and ask 214perform the requested window recentering or scrolling and ask
215again. 215again.
216 216
217When `use-dialog-box' is t (the default), this function can pop
218up a dialog window to collect the user input. That functionality
219requires `display-popup-menus-p' to return t. Otherwise, a text
220dialog will be used.
221
217The return value is the matching entry from the CHOICES list. 222The return value is the matching entry from the CHOICES list.
218 223
219Usage example: 224Usage example:
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 43e1231914c..a4ff840f755 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1713,9 +1713,10 @@ regexp."
1713 ;; (modify-syntax-entry ?- "w" table) 1713 ;; (modify-syntax-entry ?- "w" table)
1714 (modify-syntax-entry ?> ")<" table) 1714 (modify-syntax-entry ?> ")<" table)
1715 (modify-syntax-entry ?< "(>" table) 1715 (modify-syntax-entry ?< "(>" table)
1716 ;; make M-. in article buffers work for `foo' strings 1716 ;; make M-. in article buffers work for `foo' strings,
1717 (modify-syntax-entry ?' " " table) 1717 ;; and still allow C-s C-w to yank ' to the search ring
1718 (modify-syntax-entry ?` " " table) 1718 (modify-syntax-entry ?' "'" table)
1719 (modify-syntax-entry ?` "'" table)
1719 table) 1720 table)
1720 "Syntax table used in article mode buffers. 1721 "Syntax table used in article mode buffers.
1721Initialized from `text-mode-syntax-table'.") 1722Initialized from `text-mode-syntax-table'.")
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 901225fa2e9..2a4064560a7 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -94,6 +94,7 @@
94;; * WARNING: The "database" format used might be changed so keep a 94;; * WARNING: The "database" format used might be changed so keep a
95;; backup of `image-dired-db-file' when testing new versions. 95;; backup of `image-dired-db-file' when testing new versions.
96;; 96;;
97;; * `image-dired-display-image-mode' does not support animation
97;; 98;;
98;; TODO 99;; TODO
99;; ==== 100;; ====
@@ -228,7 +229,7 @@ Used together with `image-dired-cmd-create-thumbnail-options'."
228 :group 'image-dired) 229 :group 'image-dired)
229 230
230(defcustom image-dired-cmd-create-thumbnail-options 231(defcustom image-dired-cmd-create-thumbnail-options
231 '("-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t") 232 '("-size" "%wx%h" "%f[0]" "-resize" "%wx%h>" "-strip" "jpeg:%t")
232 "Options of command used to create thumbnail image. 233 "Options of command used to create thumbnail image.
233Used with `image-dired-cmd-create-thumbnail-program'. 234Used with `image-dired-cmd-create-thumbnail-program'.
234Available format specifiers are: %w which is replaced by 235Available format specifiers are: %w which is replaced by
@@ -246,7 +247,7 @@ Used together with `image-dired-cmd-create-temp-image-options'."
246 :group 'image-dired) 247 :group 'image-dired)
247 248
248(defcustom image-dired-cmd-create-temp-image-options 249(defcustom image-dired-cmd-create-temp-image-options
249 '("-size" "%wx%h" "%f" "-resize" "%wx%h>" "-strip" "jpeg:%t") 250 '("-size" "%wx%h" "%f[0]" "-resize" "%wx%h>" "-strip" "jpeg:%t")
250 "Options of command used to create temporary image for display window. 251 "Options of command used to create temporary image for display window.
251Used together with `image-dired-cmd-create-temp-image-program', 252Used together with `image-dired-cmd-create-temp-image-program',
252Available format specifiers are: %w and %h which are replaced by 253Available format specifiers are: %w and %h which are replaced by
@@ -316,7 +317,7 @@ Available format specifiers are described in
316 :group 'image-dired) 317 :group 'image-dired)
317 318
318(defcustom image-dired-cmd-create-standard-thumbnail-options 319(defcustom image-dired-cmd-create-standard-thumbnail-options
319 (append '("-size" "%wx%h" "%f") 320 (append '("-size" "%wx%h" "%f[0]")
320 (unless (or image-dired-cmd-pngcrush-program 321 (unless (or image-dired-cmd-pngcrush-program
321 image-dired-cmd-pngnq-program) 322 image-dired-cmd-pngnq-program)
322 (list 323 (list
@@ -1626,6 +1627,7 @@ Resized or in full-size."
1626 :group 'image-dired 1627 :group 'image-dired
1627 (buffer-disable-undo) 1628 (buffer-disable-undo)
1628 (image-mode-setup-winprops) 1629 (image-mode-setup-winprops)
1630 (setq cursor-type nil)
1629 (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) 1631 (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t))
1630 1632
1631(defvar image-dired-minor-mode-map 1633(defvar image-dired-minor-mode-map
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fc7fdd30850..48dcd5edd11 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3614,18 +3614,36 @@ connection buffer."
3614 3614
3615;;; Utility functions: 3615;;; Utility functions:
3616 3616
3617(defun tramp-accept-process-output (&optional proc timeout timeout-msecs) 3617(defun tramp-accept-process-output (proc timeout)
3618 "Like `accept-process-output' for Tramp processes. 3618 "Like `accept-process-output' for Tramp processes.
3619This is needed in order to hide `last-coding-system-used', which is set 3619This is needed in order to hide `last-coding-system-used', which is set
3620for process communication also." 3620for process communication also."
3621 ;; FIXME: There are problems, when an asynchronous process runs in
3622 ;; parallel, and also timers are active. See
3623 ;; <http://lists.gnu.org/archive/html/tramp-devel/2017-01/msg00010.html>.
3624 (when (and timer-event-last
3625 (string-prefix-p "*tramp/" (process-name proc))
3626 (let (result)
3627 (maphash
3628 (lambda (key _value)
3629 (and (processp key)
3630 (not (string-prefix-p "*tramp/" (process-name key)))
3631 (tramp-compat-process-live-p key)
3632 (setq result t)))
3633 tramp-cache-data)
3634 result))
3635 (sit-for 0.01 'nodisp))
3621 (with-current-buffer (process-buffer proc) 3636 (with-current-buffer (process-buffer proc)
3622 (let (buffer-read-only last-coding-system-used) 3637 (let (buffer-read-only last-coding-system-used)
3623 ;; Under Windows XP, accept-process-output doesn't return 3638 ;; Under Windows XP, accept-process-output doesn't return
3624 ;; sometimes. So we add an additional timeout. 3639 ;; sometimes. So we add an additional timeout. JUST-THIS-ONE
3625 (with-timeout ((or timeout 1)) 3640 ;; is set due to Bug#12145.
3626 (accept-process-output proc timeout timeout-msecs (and proc t))) 3641 (tramp-message
3627 (tramp-message proc 10 "%s %s\n%s" 3642 proc 10 "%s %s %s\n%s"
3628 proc (process-status proc) (buffer-string))))) 3643 proc (process-status proc)
3644 (with-timeout (timeout)
3645 (accept-process-output proc timeout nil t))
3646 (buffer-string)))))
3629 3647
3630(defun tramp-check-for-regexp (proc regexp) 3648(defun tramp-check-for-regexp (proc regexp)
3631 "Check, whether REGEXP is contained in process buffer of PROC. 3649 "Check, whether REGEXP is contained in process buffer of PROC.
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index 7cb36c4396b..0f7e4b598dc 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -1221,6 +1221,18 @@ Works with: arglist-cont, arglist-cont-nonempty."
1221 1221
1222 (vector (progn (goto-char alignto) (current-column))))))) 1222 (vector (progn (goto-char alignto) (current-column)))))))
1223 1223
1224(defun c-lineup-under-anchor (langelem)
1225 "Line up the current line directly under the anchor position in LANGELEM.
1226
1227This is like 0, except it supersedes any indentation already calculated for
1228previous syntactic elements in the syntactic context.
1229
1230Works with: Any syntactic symbol which has an anchor position."
1231 (save-excursion
1232 (goto-char (c-langelem-pos langelem))
1233 (vector (current-column))))
1234
1235
1224(defun c-lineup-dont-change (langelem) 1236(defun c-lineup-dont-change (langelem)
1225 "Do not change the indentation of the current line. 1237 "Do not change the indentation of the current line.
1226 1238
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index fd7aa50840f..dfd7aebd569 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10260,13 +10260,22 @@ comment at the start of cc-engine.el for more info."
10260 (t nil))))) 10260 (t nil)))))
10261 10261
10262 (setq pos (point)) 10262 (setq pos (point))
10263 (if (and after-type-id-pos 10263 (cond
10264 (goto-char after-type-id-pos) 10264 ((and after-type-id-pos
10265 (setq res (c-back-over-member-initializers)) 10265 (goto-char after-type-id-pos)
10266 (goto-char res) 10266 (setq res (c-back-over-member-initializers))
10267 (eq (car (c-beginning-of-decl-1 lim)) 'same)) 10267 (goto-char res)
10268 (cons (point) nil) ; Return value. 10268 (eq (car (c-beginning-of-decl-1 lim)) 'same))
10269 10269 (cons (point) nil)) ; Return value.
10270
10271 ((and after-type-id-pos
10272 (progn
10273 (c-backward-syntactic-ws)
10274 (eq (char-before) ?\()))
10275 ;; Single identifier between '(' and '{'. We have a bracelist.
10276 (cons after-type-id-pos nil))
10277
10278 (t
10270 (goto-char pos) 10279 (goto-char pos)
10271 ;; Checks to do on all sexps before the brace, up to the 10280 ;; Checks to do on all sexps before the brace, up to the
10272 ;; beginning of the statement. 10281 ;; beginning of the statement.
@@ -10368,7 +10377,7 @@ comment at the start of cc-engine.el for more info."
10368 ; languages where 10377 ; languages where
10369 ; `c-opt-inexpr-brace-list-key' is 10378 ; `c-opt-inexpr-brace-list-key' is
10370 ; non-nil and we have macros. 10379 ; non-nil and we have macros.
10371 (t t))) ;; The caller can go up one level. 10380 (t t)))) ;; The caller can go up one level.
10372 ))) 10381 )))
10373 10382
10374(defun c-inside-bracelist-p (containing-sexp paren-state) 10383(defun c-inside-bracelist-p (containing-sexp paren-state)
@@ -10493,6 +10502,30 @@ comment at the start of cc-engine.el for more info."
10493 (c-at-statement-start-p)) 10502 (c-at-statement-start-p))
10494(make-obsolete 'c-looking-at-bos 'c-at-statement-start-p "22.1") 10503(make-obsolete 'c-looking-at-bos 'c-at-statement-start-p "22.1")
10495 10504
10505(defun c-looking-at-statement-block ()
10506 ;; Point is at an opening brace. If this is a statement block (i.e. the
10507 ;; elements in it are terminated by semicolons) return t. Otherwise, return
10508 ;; nil.
10509 (let ((here (point)))
10510 (prog1
10511 (if (c-go-list-forward)
10512 (let ((there (point)))
10513 (backward-char)
10514 (c-syntactic-skip-backward
10515 "^;," here t)
10516 (cond
10517 ((eq (char-before) ?\;) t)
10518 ((eq (char-before) ?,) nil)
10519 (t (goto-char here)
10520 (forward-char)
10521 (and (c-syntactic-re-search-forward "{" there t t)
10522 (progn (backward-char)
10523 (c-looking-at-statement-block))))))
10524 (forward-char)
10525 (and (c-syntactic-re-search-forward "[;,]" nil t t)
10526 (eq (char-before) ?\;)))
10527 (goto-char here))))
10528
10496(defun c-looking-at-inexpr-block (lim containing-sexp &optional check-at-end) 10529(defun c-looking-at-inexpr-block (lim containing-sexp &optional check-at-end)
10497 ;; Return non-nil if we're looking at the beginning of a block 10530 ;; Return non-nil if we're looking at the beginning of a block
10498 ;; inside an expression. The value returned is actually a cons of 10531 ;; inside an expression. The value returned is actually a cons of
@@ -10648,15 +10681,7 @@ comment at the start of cc-engine.el for more info."
10648 (and (c-major-mode-is 'c++-mode) 10681 (and (c-major-mode-is 'c++-mode)
10649 (save-excursion 10682 (save-excursion
10650 (goto-char block-follows) 10683 (goto-char block-follows)
10651 (if (c-go-list-forward) 10684 (not (c-looking-at-statement-block)))))
10652 (progn
10653 (backward-char)
10654 (c-syntactic-skip-backward
10655 "^;," block-follows t)
10656 (not (eq (char-before) ?\;)))
10657 (or (not (c-syntactic-re-search-forward
10658 "[;,]" nil t t))
10659 (not (eq (char-before) ?\;)))))))
10660 nil 10685 nil
10661 (cons 'inexpr-statement (point))))) 10686 (cons 'inexpr-statement (point)))))
10662 10687
@@ -10792,17 +10817,20 @@ comment at the start of cc-engine.el for more info."
10792 syntax-extra-args 10817 syntax-extra-args
10793 stop-at-boi-only 10818 stop-at-boi-only
10794 containing-sexp 10819 containing-sexp
10795 paren-state) 10820 paren-state
10821 &optional fixed-anchor)
10796 ;; Add the indicated SYNTAX-SYMBOL to `c-syntactic-context', extending it as 10822 ;; Add the indicated SYNTAX-SYMBOL to `c-syntactic-context', extending it as
10797 ;; needed with further syntax elements of the types `substatement', 10823 ;; needed with further syntax elements of the types `substatement',
10798 ;; `inexpr-statement', `arglist-cont-nonempty', `statement-block-intro', and 10824 ;; `inexpr-statement', `arglist-cont-nonempty', `statement-block-intro',
10799 ;; `defun-block-intro'. 10825 ;; `defun-block-intro', and `brace-list-intro'.
10800 ;; 10826 ;;
10801 ;; Do the generic processing to anchor the given syntax symbol on 10827 ;; Do the generic processing to anchor the given syntax symbol on the
10802 ;; the preceding statement: Skip over any labels and containing 10828 ;; preceding statement: First skip over any labels and containing statements
10803 ;; statements on the same line, and then search backward until we 10829 ;; on the same line. If FIXED-ANCHOR is non-nil, use this as the
10804 ;; find a statement or block start that begins at boi without a 10830 ;; anchor-point for the given syntactic symbol, and don't make syntactic
10805 ;; label or comment. 10831 ;; entries for constructs beginning on lines before that containing
10832 ;; ANCHOR-POINT. Otherwise search backward until we find a statement or
10833 ;; block start that begins at boi without a label or comment.
10806 ;; 10834 ;;
10807 ;; Point is assumed to be at the prospective anchor point for the 10835 ;; Point is assumed to be at the prospective anchor point for the
10808 ;; given SYNTAX-SYMBOL. More syntax entries are added if we need to 10836 ;; given SYNTAX-SYMBOL. More syntax entries are added if we need to
@@ -10831,6 +10859,7 @@ comment at the start of cc-engine.el for more info."
10831 10859
10832 (let ((syntax-last c-syntactic-context) 10860 (let ((syntax-last c-syntactic-context)
10833 (boi (c-point 'boi)) 10861 (boi (c-point 'boi))
10862 (anchor-boi (c-point 'boi))
10834 ;; Set when we're on a label, so that we don't stop there. 10863 ;; Set when we're on a label, so that we don't stop there.
10835 ;; FIXME: To be complete we should check if we're on a label 10864 ;; FIXME: To be complete we should check if we're on a label
10836 ;; now at the start. 10865 ;; now at the start.
@@ -10908,7 +10937,9 @@ comment at the start of cc-engine.el for more info."
10908 (c-add-syntax 'substatement nil)))) 10937 (c-add-syntax 'substatement nil))))
10909 ))) 10938 )))
10910 10939
10911 containing-sexp) 10940 containing-sexp
10941 (or (null fixed-anchor)
10942 (> containing-sexp anchor-boi)))
10912 10943
10913 ;; Now we have to go out of this block. 10944 ;; Now we have to go out of this block.
10914 (goto-char containing-sexp) 10945 (goto-char containing-sexp)
@@ -10982,6 +11013,14 @@ comment at the start of cc-engine.el for more info."
10982 (cdr (assoc (match-string 1) 11013 (cdr (assoc (match-string 1)
10983 c-other-decl-block-key-in-symbols-alist)) 11014 c-other-decl-block-key-in-symbols-alist))
10984 (max (c-point 'boi paren-pos) (point)))) 11015 (max (c-point 'boi paren-pos) (point))))
11016 ((save-excursion
11017 (goto-char paren-pos)
11018 (c-looking-at-or-maybe-in-bracelist containing-sexp))
11019 (if (save-excursion
11020 (goto-char paren-pos)
11021 (c-looking-at-statement-block))
11022 (c-add-syntax 'defun-block-intro nil)
11023 (c-add-syntax 'brace-list-intro nil)))
10985 (t (c-add-syntax 'defun-block-intro nil)))) 11024 (t (c-add-syntax 'defun-block-intro nil))))
10986 11025
10987 (c-add-syntax 'statement-block-intro nil))) 11026 (c-add-syntax 'statement-block-intro nil)))
@@ -11001,7 +11040,10 @@ comment at the start of cc-engine.el for more info."
11001 (setq q (cdr (car p))) ; e.g. (nil 28) [from (arglist-cont-nonempty nil 28)] 11040 (setq q (cdr (car p))) ; e.g. (nil 28) [from (arglist-cont-nonempty nil 28)]
11002 (while q 11041 (while q
11003 (unless (car q) 11042 (unless (car q)
11004 (setcar q (point))) 11043 (setcar q (if (or (cdr p)
11044 (null fixed-anchor))
11045 (point)
11046 fixed-anchor)))
11005 (setq q (cdr q))) 11047 (setq q (cdr q)))
11006 (setq p (cdr p)))) 11048 (setq p (cdr p))))
11007 ))) 11049 )))
@@ -12354,7 +12396,8 @@ comment at the start of cc-engine.el for more info."
12354 (c-forward-syntactic-ws (c-point 'eol)) 12396 (c-forward-syntactic-ws (c-point 'eol))
12355 (c-looking-at-special-brace-list (point))))) 12397 (c-looking-at-special-brace-list (point)))))
12356 (c-add-syntax 'brace-entry-open (point)) 12398 (c-add-syntax 'brace-entry-open (point))
12357 (c-add-syntax 'brace-list-entry (point)) 12399 (c-add-stmt-syntax 'brace-list-entry nil t containing-sexp
12400 paren-state (point))
12358 )) 12401 ))
12359 )))) 12402 ))))
12360 12403
@@ -12848,7 +12891,7 @@ Cannot combine absolute offsets %S and %S in `add' method"
12848 ;; 12891 ;;
12849 ;; Note that topmost-intro always has an anchor position at bol, for 12892 ;; Note that topmost-intro always has an anchor position at bol, for
12850 ;; historical reasons. It's often used together with other symbols 12893 ;; historical reasons. It's often used together with other symbols
12851 ;; that has more sane positions. Since we always use the first 12894 ;; that have more sane positions. Since we always use the first
12852 ;; found anchor position, we rely on that these other symbols always 12895 ;; found anchor position, we rely on that these other symbols always
12853 ;; precede topmost-intro in the LANGELEMS list. 12896 ;; precede topmost-intro in the LANGELEMS list.
12854 ;; 12897 ;;
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index d3505490505..b3848a74f97 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -67,6 +67,7 @@
67 (arglist-close . c-lineup-arglist) 67 (arglist-close . c-lineup-arglist)
68 (inline-open . 0) 68 (inline-open . 0)
69 (brace-list-open . +) 69 (brace-list-open . +)
70 (brace-list-intro . c-lineup-arglist-intro-after-paren)
70 (topmost-intro-cont 71 (topmost-intro-cont
71 . (first c-lineup-topmost-intro-cont 72 . (first c-lineup-topmost-intro-cont
72 c-lineup-gnu-DEFUN-intro-cont)))) 73 c-lineup-gnu-DEFUN-intro-cont))))
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index a6a96d15188..1114b21381d 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1115,7 +1115,7 @@ can always override the use of `c-default-style' by making calls to
1115 ;; Anchor pos: At the brace list decl start(*). 1115 ;; Anchor pos: At the brace list decl start(*).
1116 (brace-list-intro . +) 1116 (brace-list-intro . +)
1117 ;; Anchor pos: At the brace list decl start(*). 1117 ;; Anchor pos: At the brace list decl start(*).
1118 (brace-list-entry . 0) 1118 (brace-list-entry . c-lineup-under-anchor)
1119 ;; Anchor pos: At the first non-ws char after the open paren if 1119 ;; Anchor pos: At the first non-ws char after the open paren if
1120 ;; the first token is on the same line, otherwise boi at that 1120 ;; the first token is on the same line, otherwise boi at that
1121 ;; token. 1121 ;; token.
diff --git a/lisp/shell.el b/lisp/shell.el
index c7ba64ecf4e..c8a8555d632 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1000,8 +1000,6 @@ command again."
1000 (let ((pt (point)) 1000 (let ((pt (point))
1001 (regexp 1001 (regexp
1002 (concat 1002 (concat
1003 ;; comint-process-echoes is the thing that breaks the
1004 ;; throbber
1005 (if comint-process-echoes 1003 (if comint-process-echoes
1006 ;; Skip command echo if the process echoes 1004 ;; Skip command echo if the process echoes
1007 (concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)") 1005 (concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)")
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index e609ca9f943..7ffa115bde4 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -437,6 +437,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
437(defconst diff-hunk-header-re 437(defconst diff-hunk-header-re
438 (concat "^\\(?:" diff-hunk-header-re-unified ".*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$")) 438 (concat "^\\(?:" diff-hunk-header-re-unified ".*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$"))
439(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* \n]\\).+\n" (substring diff-hunk-header-re 1))) 439(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* \n]\\).+\n" (substring diff-hunk-header-re 1)))
440
441(defconst diff-separator-re "^--+ ?$")
442
440(defvar diff-narrowed-to nil) 443(defvar diff-narrowed-to nil)
441 444
442(defun diff-hunk-style (&optional style) 445(defun diff-hunk-style (&optional style)
@@ -1537,15 +1540,20 @@ Only works for unified diffs."
1537 (pcase (char-after) 1540 (pcase (char-after)
1538 (?\s (cl-decf before) (cl-decf after) t) 1541 (?\s (cl-decf before) (cl-decf after) t)
1539 (?- 1542 (?-
1540 (if (and (looking-at diff-file-header-re) 1543 (cond
1541 (zerop before) (zerop after)) 1544 ((and (looking-at diff-separator-re)
1542 ;; No need to query: this is a case where two patches 1545 (zerop before) (zerop after))
1543 ;; are concatenated and only counting the lines will 1546 nil)
1544 ;; give the right result. Let's just add an empty 1547 ((and (looking-at diff-file-header-re)
1545 ;; line so that our code which doesn't count lines 1548 (zerop before) (zerop after))
1546 ;; will not get confused. 1549 ;; No need to query: this is a case where two patches
1547 (progn (save-excursion (insert "\n")) nil) 1550 ;; are concatenated and only counting the lines will
1548 (cl-decf before) t)) 1551 ;; give the right result. Let's just add an empty
1552 ;; line so that our code which doesn't count lines
1553 ;; will not get confused.
1554 (save-excursion (insert "\n")) nil)
1555 (t
1556 (cl-decf before) t)))
1549 (?+ (cl-decf after) t) 1557 (?+ (cl-decf after) t)
1550 (_ 1558 (_
1551 (cond 1559 (cond