aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael R. Mauger2017-04-02 18:10:57 -0400
committerMichael R. Mauger2017-04-02 18:10:57 -0400
commit77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4 (patch)
tree27da92c2a61d664b700860c2d527a4d36000ca37 /lisp
parentc5a31f8292c94d19b80a3dbe0b3026693cc1090e (diff)
parent8e394a7f35c2ba9297d222faa2689e177f268924 (diff)
downloademacs-77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4.tar.gz
emacs-77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/Makefile.in8
-rw-r--r--lisp/cedet/semantic/wisent/wisent.el2
-rw-r--r--lisp/dired-x.el85
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/emacs-lisp/edebug.el4
-rw-r--r--lisp/emacs-lisp/ert.el22
-rw-r--r--lisp/emacs-lisp/lisp-mode.el35
-rw-r--r--lisp/emacs-lisp/pcase.el4
-rw-r--r--lisp/emacs-lisp/seq.el2
-rw-r--r--lisp/emacs-lisp/thunk.el2
-rw-r--r--lisp/ffap.el41
-rw-r--r--lisp/filenotify.el437
-rw-r--r--lisp/files-x.el14
-rw-r--r--lisp/files.el7
-rw-r--r--lisp/gnus/gnus-start.el2
-rw-r--r--lisp/gnus/gnus-util.el5
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/ibuffer.el2
-rw-r--r--lisp/info.el24
-rw-r--r--lisp/ldefs-boot.el206
-rw-r--r--lisp/man.el5
-rw-r--r--lisp/net/shr.el24
-rw-r--r--lisp/net/tramp-adb.el14
-rw-r--r--lisp/net/tramp-cache.el2
-rw-r--r--lisp/net/tramp-cmds.el2
-rw-r--r--lisp/net/tramp-compat.el2
-rw-r--r--lisp/net/tramp-ftp.el2
-rw-r--r--lisp/net/tramp-gvfs.el12
-rw-r--r--lisp/net/tramp-sh.el21
-rw-r--r--lisp/net/tramp-smb.el9
-rw-r--r--lisp/net/tramp-uu.el2
-rw-r--r--lisp/net/tramp.el115
-rw-r--r--lisp/net/trampver.el2
-rw-r--r--lisp/play/dunnet.el39
-rw-r--r--lisp/progmodes/cc-defs.el2
-rw-r--r--lisp/progmodes/cc-engine.el32
-rw-r--r--lisp/progmodes/cc-fonts.el216
-rw-r--r--lisp/progmodes/cc-mode.el1
-rw-r--r--lisp/progmodes/cc-vars.el12
-rw-r--r--lisp/progmodes/js.el13
-rw-r--r--lisp/progmodes/perl-mode.el8
-rw-r--r--lisp/progmodes/python.el16
-rw-r--r--lisp/replace.el3
-rw-r--r--lisp/ses.el11
-rw-r--r--lisp/shell.el67
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/textmodes/css-mode.el12
-rw-r--r--lisp/textmodes/ispell.el32
-rw-r--r--lisp/url/url-auth.el403
-rw-r--r--lisp/url/url-domsuf.el2
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-ptch.el13
52 files changed, 1157 insertions, 847 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index cbe7718981e..185554ca63a 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -47,6 +47,9 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
47am__v_at_0 = @ 47am__v_at_0 = @
48am__v_at_1 = 48am__v_at_1 =
49 49
50
51FIND_DELETE = @FIND_DELETE@
52
50# You can specify a different executable on the make command line, 53# You can specify a different executable on the make command line,
51# e.g. "make EMACS=../src/emacs ...". 54# e.g. "make EMACS=../src/emacs ...".
52 55
@@ -343,7 +346,7 @@ compile: $(LOADDEFS) autoloads compile-first
343# unconditionally. Some files don't actually get compiled because they 346# unconditionally. Some files don't actually get compiled because they
344# set the local variable no-byte-compile. 347# set the local variable no-byte-compile.
345compile-always: 348compile-always:
346 cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc 349 find $(lisp) -name '*.elc' $(FIND_DELETE)
347 $(MAKE) compile 350 $(MAKE) compile
348 351
349.PHONY: backup-compiled-files compile-after-backup 352.PHONY: backup-compiled-files compile-after-backup
@@ -433,7 +436,8 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el
433.PHONY: bootstrap-clean distclean maintainer-clean 436.PHONY: bootstrap-clean distclean maintainer-clean
434 437
435bootstrap-clean: 438bootstrap-clean:
436 -cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL) 439 find $(lisp) -name '*.elc' $(FIND_DELETE)
440 -cd $(lisp) && rm -f $(AUTOGENEL)
437 441
438distclean: 442distclean:
439 -rm -f ./Makefile $(lisp)/loaddefs.el~ 443 -rm -f ./Makefile $(lisp)/loaddefs.el~
diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el
index 36dff019792..08cad524aed 100644
--- a/lisp/cedet/semantic/wisent/wisent.el
+++ b/lisp/cedet/semantic/wisent/wisent.el
@@ -114,7 +114,7 @@ If OBJ is a symbol check its value."
114 (and (vectorp obj) (= 4 (length obj)) 114 (and (vectorp obj) (= 4 (length obj))
115 (vectorp (aref obj 0)) (vectorp (aref obj 1)) 115 (vectorp (aref obj 0)) (vectorp (aref obj 1))
116 (= (length (aref obj 0)) (length (aref obj 1))) 116 (= (length (aref obj 0)) (length (aref obj 1)))
117 (listp (aref obj 2)) (vectorp (aref obj 3)))) 117 (listp (aref obj 2)) (obarrayp (aref obj 3))))
118 118
119(defsubst wisent-region (&rest positions) 119(defsubst wisent-region (&rest positions)
120 "Return the start/end positions of the region including POSITIONS. 120 "Return the start/end positions of the region including POSITIONS.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 6c8fb0e7dae..527685acf37 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -332,46 +332,73 @@ See also the functions:
332 332
333;;; EXTENSION MARKING FUNCTIONS. 333;;; EXTENSION MARKING FUNCTIONS.
334 334
335(defun dired--mark-suffix-interactive-spec ()
336 (let* ((default
337 (let ((file (dired-get-filename nil t)))
338 (when file
339 (file-name-extension file))))
340 (suffix
341 (read-string (format "%s extension%s: "
342 (if (equal current-prefix-arg '(4))
343 "UNmarking"
344 "Marking")
345 (if default
346 (format " (default %s)" default)
347 "")) nil nil default))
348 (marker
349 (pcase current-prefix-arg
350 ('(4) ?\s)
351 ('(16)
352 (let* ((dflt (char-to-string dired-marker-char))
353 (input (read-string
354 (format
355 "Marker character to use (default %s): " dflt)
356 nil nil dflt)))
357 (aref input 0)))
358 (_ dired-marker-char))))
359 (list suffix marker)))
360
335;; Mark files with some extension. 361;; Mark files with some extension.
336(defun dired-mark-extension (extension &optional marker-char) 362(defun dired-mark-extension (extension &optional marker-char)
337 "Mark all files with a certain EXTENSION for use in later commands. 363 "Mark all files with a certain EXTENSION for use in later commands.
338A `.' is *not* automatically prepended to the string entered. 364A `.' is automatically prepended to EXTENSION when not present.
339EXTENSION may also be a list of extensions instead of a single one. 365EXTENSION may also be a list of extensions instead of a single one.
340Optional MARKER-CHAR is marker to use. 366Optional MARKER-CHAR is marker to use.
341Interactively, ask for EXTENSION. 367Interactively, ask for EXTENSION.
342Prefixed with one C-u, unmark files instead. 368Prefixed with one C-u, unmark files instead.
343Prefixed with two C-u's, prompt for MARKER-CHAR and mark files with it." 369Prefixed with two C-u's, prompt for MARKER-CHAR and mark files with it."
344 (interactive 370 (interactive (dired--mark-suffix-interactive-spec))
345 (let* ((default 371 (unless (listp extension)
346 (let ((file (dired-get-filename nil t))) 372 (setq extension (list extension)))
347 (when file 373 (dired-mark-files-regexp
348 (file-name-extension file)))) 374 (concat ".";; don't match names with nothing but an extension
349 (suffix 375 "\\("
350 (read-string (format "%s extension%s: " 376 (mapconcat
351 (if (equal current-prefix-arg '(4)) 377 (lambda (x)
352 "UNmarking" 378 (regexp-quote
353 "Marking") 379 (if (string-prefix-p "." x) x (concat "." x))))
354 (if default 380 extension "\\|")
355 (format " (default %s)" default) 381 "\\)$")
356 "")) nil nil default)) 382 marker-char))
357 (marker 383
358 (pcase current-prefix-arg 384;; Mark files ending with some suffix.
359 ('(4) ?\s) 385(defun dired-mark-suffix (suffix &optional marker-char)
360 ('(16) 386 "Mark all files with a certain SUFFIX for use in later commands.
361 (let* ((dflt (char-to-string dired-marker-char)) 387A `.' is *not* automatically prepended to the string entered; see
362 (input (read-string 388also `dired-mark-extension', which is similar but automatically
363 (format 389prepends `.' when not present.
364 "Marker character to use (default %s): " dflt) 390SUFFIX may also be a list of suffixes instead of a single one.
365 nil nil dflt))) 391Optional MARKER-CHAR is marker to use.
366 (aref input 0))) 392Interactively, ask for SUFFIX.
367 (_ dired-marker-char)))) 393Prefixed with one C-u, unmark files instead.
368 (list suffix marker))) 394Prefixed with two C-u's, prompt for MARKER-CHAR and mark files with it."
369 (or (listp extension) 395 (interactive (dired--mark-suffix-interactive-spec))
370 (setq extension (list extension))) 396 (unless (listp suffix)
397 (setq suffix (list suffix)))
371 (dired-mark-files-regexp 398 (dired-mark-files-regexp
372 (concat ".";; don't match names with nothing but an extension 399 (concat ".";; don't match names with nothing but an extension
373 "\\(" 400 "\\("
374 (mapconcat 'regexp-quote extension "\\|") 401 (mapconcat 'regexp-quote suffix "\\|")
375 "\\)$") 402 "\\)$")
376 marker-char)) 403 marker-char))
377 404
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index f45ae359f6c..2c2996ebab4 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -443,7 +443,7 @@ Return the compile-time value of FORM."
443 ;; Macroexpand (not macroexpand-all!) form at toplevel in case it 443 ;; Macroexpand (not macroexpand-all!) form at toplevel in case it
444 ;; expands into a toplevel-equivalent `progn'. See CLHS section 444 ;; expands into a toplevel-equivalent `progn'. See CLHS section
445 ;; 3.2.3.1, "Processing of Top Level Forms". The semantics are very 445 ;; 3.2.3.1, "Processing of Top Level Forms". The semantics are very
446 ;; subtle: see test/automated/bytecomp-tests.el for interesting 446 ;; subtle: see test/lisp/emacs-lisp/bytecomp-tests.el for interesting
447 ;; cases. 447 ;; cases.
448 (setf form (macroexp-macroexpand form byte-compile-macro-environment)) 448 (setf form (macroexp-macroexpand form byte-compile-macro-environment))
449 (if (eq (car-safe form) 'progn) 449 (if (eq (car-safe form) 'progn)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 60133055623..4116e31d0a9 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -733,9 +733,9 @@ Maybe clear the markers and delete the symbol's edebug property?"
733 ((eq class 'string) (read (current-buffer))) 733 ((eq class 'string) (read (current-buffer)))
734 ((eq class 'quote) (forward-char 1) 734 ((eq class 'quote) (forward-char 1)
735 (list 'quote (edebug-read-sexp))) 735 (list 'quote (edebug-read-sexp)))
736 ((eq class 'backquote) 736 ((eq class 'backquote) (forward-char 1)
737 (list '\` (edebug-read-sexp))) 737 (list '\` (edebug-read-sexp)))
738 ((eq class 'comma) 738 ((eq class 'comma) (forward-char 1)
739 (list '\, (edebug-read-sexp))) 739 (list '\, (edebug-read-sexp)))
740 (t ; anything else, just read it. 740 (t ; anything else, just read it.
741 (read (current-buffer)))))) 741 (read (current-buffer))))))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index cadd66ca6ed..e7387e463cb 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1236,7 +1236,7 @@ SELECTOR is the selector that was used to select TESTS."
1236 (funcall listener 'test-ended stats test result)) 1236 (funcall listener 'test-ended stats test result))
1237 (setf (ert--stats-current-test stats) nil)))) 1237 (setf (ert--stats-current-test stats) nil))))
1238 1238
1239(defun ert-run-tests (selector listener) 1239(defun ert-run-tests (selector listener &optional interactively)
1240 "Run the tests specified by SELECTOR, sending progress updates to LISTENER." 1240 "Run the tests specified by SELECTOR, sending progress updates to LISTENER."
1241 (let* ((tests (ert-select-tests selector t)) 1241 (let* ((tests (ert-select-tests selector t))
1242 (stats (ert--make-stats tests selector))) 1242 (stats (ert--make-stats tests selector)))
@@ -1247,10 +1247,14 @@ SELECTOR is the selector that was used to select TESTS."
1247 (let ((ert--current-run-stats stats)) 1247 (let ((ert--current-run-stats stats))
1248 (force-mode-line-update) 1248 (force-mode-line-update)
1249 (unwind-protect 1249 (unwind-protect
1250 (progn 1250 (cl-loop for test in tests do
1251 (cl-loop for test in tests do 1251 (ert-run-or-rerun-test stats test listener)
1252 (ert-run-or-rerun-test stats test listener)) 1252 (when (and interactively
1253 (setq abortedp nil)) 1253 (ert-test-quit-p
1254 (ert-test-most-recent-result test))
1255 (y-or-n-p "Abort testing? "))
1256 (cl-return))
1257 finally (setq abortedp nil))
1254 (setf (ert--stats-aborted-p stats) abortedp) 1258 (setf (ert--stats-aborted-p stats) abortedp)
1255 (setf (ert--stats-end-time stats) (current-time)) 1259 (setf (ert--stats-end-time stats) (current-time))
1256 (funcall listener 'run-ended stats abortedp))) 1260 (funcall listener 'run-ended stats abortedp)))
@@ -1442,7 +1446,8 @@ Returns the stats object."
1442 (ert-test-result-expected-p 1446 (ert-test-result-expected-p
1443 test result)) 1447 test result))
1444 (1+ (ert--stats-test-pos stats test)) 1448 (1+ (ert--stats-test-pos stats test))
1445 (ert-test-name test))))))))) 1449 (ert-test-name test)))))))
1450 nil))
1446 1451
1447;;;###autoload 1452;;;###autoload
1448(defun ert-run-tests-batch-and-exit (&optional selector) 1453(defun ert-run-tests-batch-and-exit (&optional selector)
@@ -2033,9 +2038,8 @@ and how to display message."
2033 test result))) 2038 test result)))
2034 (ert--results-update-stats-display-maybe ewoc stats) 2039 (ert--results-update-stats-display-maybe ewoc stats)
2035 (ewoc-invalidate ewoc node)))))))) 2040 (ewoc-invalidate ewoc node))))))))
2036 (ert-run-tests 2041 (ert-run-tests selector listener t)))
2037 selector 2042
2038 listener)))
2039;;;###autoload 2043;;;###autoload
2040(defalias 'ert 'ert-run-tests-interactively) 2044(defalias 'ert 'ert-run-tests-interactively)
2041 2045
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index eb07c18b03d..b7a5eb774da 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -259,6 +259,24 @@ This will generate compile-time constants from BINDINGS."
259 (funcall loop bindings))))))) 259 (funcall loop bindings)))))))
260 (funcall loop bindings))) 260 (funcall loop bindings)))
261 261
262(defun elisp--font-lock-backslash ()
263 (let* ((beg0 (match-beginning 0))
264 (end0 (match-end 0))
265 (ppss (save-excursion (syntax-ppss beg0))))
266 (and (nth 3 ppss) ;Inside a string.
267 (not (nth 5 ppss)) ;The \ is not itself \-escaped.
268 ;; Don't highlight the \( introduced because of
269 ;; `open-paren-in-column-0-is-defun-start'.
270 (not (eq ?\n (char-before beg0)))
271 (equal (ignore-errors
272 (car (read-from-string
273 (format "\"%s\""
274 (buffer-substring-no-properties
275 beg0 end0)))))
276 (buffer-substring-no-properties (1+ beg0) end0))
277 `(face ,font-lock-warning-face
278 help-echo "This \\ has no effect"))))
279
262(let-when-compile 280(let-when-compile
263 ((lisp-fdefs '("defmacro" "defun")) 281 ((lisp-fdefs '("defmacro" "defun"))
264 (lisp-vdefs '("defvar")) 282 (lisp-vdefs '("defvar"))
@@ -413,17 +431,7 @@ This will generate compile-time constants from BINDINGS."
413 (1 font-lock-constant-face prepend)) 431 (1 font-lock-constant-face prepend))
414 ;; Ineffective backslashes (typically in need of doubling). 432 ;; Ineffective backslashes (typically in need of doubling).
415 ("\\(\\\\\\)\\([^\"\\]\\)" 433 ("\\(\\\\\\)\\([^\"\\]\\)"
416 (1 (let ((ppss (save-excursion (syntax-ppss (match-beginning 0))))) 434 (1 (elisp--font-lock-backslash) prepend))
417 (and (nth 3 ppss) ;Inside a string.
418 (not (nth 5 ppss)) ;The \ is not itself \-escaped.
419 (equal (ignore-errors
420 (car (read-from-string
421 (format "\"%s\""
422 (match-string-no-properties 0)))))
423 (match-string-no-properties 2))
424 `(face ,font-lock-warning-face
425 help-echo "This \\ has no effect")))
426 prepend))
427 ;; Words inside ‘’ and `' tend to be symbol names. 435 ;; Words inside ‘’ and `' tend to be symbol names.
428 (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" 436 (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)"
429 lisp-mode-symbol-regexp "\\)['’]") 437 lisp-mode-symbol-regexp "\\)['’]")
@@ -1083,7 +1091,8 @@ ENDPOS is encountered."
1083 (init-depth (car state)) 1091 (init-depth (car state))
1084 (next-depth init-depth) 1092 (next-depth init-depth)
1085 (last-depth init-depth) 1093 (last-depth init-depth)
1086 (last-syntax-point (point))) 1094 (last-syntax-point (point))
1095 (real-endpos endpos))
1087 (unless endpos 1096 (unless endpos
1088 ;; Get error now if we don't have a complete sexp after point. 1097 ;; Get error now if we don't have a complete sexp after point.
1089 (save-excursion (forward-sexp 1) 1098 (save-excursion (forward-sexp 1)
@@ -1116,6 +1125,8 @@ ENDPOS is encountered."
1116 last-depth (- last-depth next-depth) 1125 last-depth (- last-depth next-depth)
1117 next-depth init-depth)) 1126 next-depth init-depth))
1118 (forward-line 1) 1127 (forward-line 1)
1128 (when (and (not real-endpos) (<= next-depth init-depth))
1129 (goto-char endpos))
1119 (when (< (point) endpos) 1130 (when (< (point) endpos)
1120 (let ((depth-delta (- next-depth last-depth))) 1131 (let ((depth-delta (- next-depth last-depth)))
1121 (cond ((< depth-delta 0) 1132 (cond ((< depth-delta 0)
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 289265abf27..fc5474ecc43 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -175,8 +175,8 @@ Emacs Lisp manual for more information and examples."
175 ;; (when (gethash (car cases) pcase--memoize-2) 175 ;; (when (gethash (car cases) pcase--memoize-2)
176 ;; (message "pcase-memoize failed because of eq test on %S" 176 ;; (message "pcase-memoize failed because of eq test on %S"
177 ;; (car cases))) 177 ;; (car cases)))
178 (when data 178 ;; (when data
179 (message "pcase-memoize: equal first branch, yet different")) 179 ;; (message "pcase-memoize: equal first branch, yet different"))
180 (let ((expansion (pcase--expand exp cases))) 180 (let ((expansion (pcase--expand exp cases)))
181 (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize) 181 (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize)
182 ;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-1) 182 ;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-1)
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 41187646624..10de2484798 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -52,7 +52,7 @@
52;; - `seq-copy' 52;; - `seq-copy'
53;; - `seq-into' 53;; - `seq-into'
54;; 54;;
55;; All functions are tested in test/automated/seq-tests.el 55;; All functions are tested in test/lisp/emacs-lisp/seq-tests.el
56 56
57;;; Code: 57;;; Code:
58 58
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el
index be0a90fefde..f4c075d22ce 100644
--- a/lisp/emacs-lisp/thunk.el
+++ b/lisp/emacs-lisp/thunk.el
@@ -42,8 +42,6 @@
42;; 42;;
43;; (thunk-force delayed) 43;; (thunk-force delayed)
44 44
45;; Tests are located at test/automated/thunk-tests.el
46
47;;; Code: 45;;; Code:
48 46
49(defmacro thunk-delay (&rest body) 47(defmacro thunk-delay (&rest body)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index d7222bfb681..1ea32b75f12 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1110,32 +1110,67 @@ The arguments CHARS, BEG and END are handled as described in
1110 1110
1111(defun ffap-string-at-point (&optional mode) 1111(defun ffap-string-at-point (&optional mode)
1112 "Return a string of characters from around point. 1112 "Return a string of characters from around point.
1113
1113MODE (defaults to value of `major-mode') is a symbol used to look up 1114MODE (defaults to value of `major-mode') is a symbol used to look up
1114string syntax parameters in `ffap-string-at-point-mode-alist'. 1115string syntax parameters in `ffap-string-at-point-mode-alist'.
1116
1115If MODE is not found, we use `file' instead of MODE. 1117If MODE is not found, we use `file' instead of MODE.
1118
1116If the region is active, return a string from the region. 1119If the region is active, return a string from the region.
1117Set the variable `ffap-string-at-point' and the variable 1120
1121If the point is in a comment, ensure that the returned string does not
1122contain the comment start characters (especially for major modes that
1123have '//' as comment start characters).
1124
1125Set the variables `ffap-string-at-point' and
1118`ffap-string-at-point-region'. 1126`ffap-string-at-point-region'.
1127
1119When the region is active and larger than `ffap-max-region-length', 1128When the region is active and larger than `ffap-max-region-length',
1120return an empty string, and set `ffap-string-at-point-region' to '(1 1)." 1129return an empty string, and set `ffap-string-at-point-region' to '(1 1)."
1121 (let* ((args 1130 (let* ((args
1122 (cdr 1131 (cdr
1123 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) 1132 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
1124 (assq 'file ffap-string-at-point-mode-alist)))) 1133 (assq 'file ffap-string-at-point-mode-alist))))
1134 (region-selected (use-region-p))
1125 (pt (point)) 1135 (pt (point))
1126 (beg (if (use-region-p) 1136 (beg (if region-selected
1127 (region-beginning) 1137 (region-beginning)
1128 (save-excursion 1138 (save-excursion
1129 (skip-chars-backward (car args)) 1139 (skip-chars-backward (car args))
1130 (skip-chars-forward (nth 1 args) pt) 1140 (skip-chars-forward (nth 1 args) pt)
1131 (point)))) 1141 (point))))
1132 (end (if (use-region-p) 1142 (end (if region-selected
1133 (region-end) 1143 (region-end)
1134 (save-excursion 1144 (save-excursion
1135 (skip-chars-forward (car args)) 1145 (skip-chars-forward (car args))
1136 (skip-chars-backward (nth 2 args) pt) 1146 (skip-chars-backward (nth 2 args) pt)
1137 (point)))) 1147 (point))))
1138 (region-len (- (max beg end) (min beg end)))) 1148 (region-len (- (max beg end) (min beg end))))
1149
1150 ;; If the initial characters of the to-be-returned string are the
1151 ;; current major mode's comment starter characters, *and* are
1152 ;; not part of a comment, remove those from the returned string
1153 ;; (Bug#24057).
1154 ;; Example comments in `c-mode' (which considers lines beginning
1155 ;; with "//" as comments):
1156 ;; //tmp - This is a comment. It does not contain any path reference.
1157 ;; ///tmp - This is a comment. The "/tmp" portion in that is a path.
1158 ;; ////tmp - This is a comment. The "//tmp" portion in that is a path.
1159 (when (and
1160 ;; Proceed if no region is selected by the user.
1161 (null region-selected)
1162 ;; Check if END character is part of a comment.
1163 (save-excursion
1164 (nth 4 (syntax-ppss end))))
1165 ;; Move BEG to beginning of comment (after the comment start
1166 ;; characters), or END, whichever comes first.
1167 (save-excursion
1168 (let ((state (syntax-ppss beg)))
1169 ;; (nth 4 (syntax-ppss)) will be nil for comment start chars.
1170 (unless (nth 4 state)
1171 (parse-partial-sexp beg end nil nil state :commentstop)
1172 (setq beg (point))))))
1173
1139 (if (and (natnump ffap-max-region-length) 1174 (if (and (natnump ffap-max-region-length)
1140 (< region-len ffap-max-region-length)) ; Bug#25243. 1175 (< region-len ffap-max-region-length)) ; Bug#25243.
1141 (setf ffap-string-at-point-region (list beg end) 1176 (setf ffap-string-at-point-region (list beg end)
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 7eb6229976a..8bbe348f332 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -28,6 +28,7 @@
28;;; Code: 28;;; Code:
29 29
30(require 'cl-lib) 30(require 'cl-lib)
31(require 'subr-x)
31 32
32(defconst file-notify--library 33(defconst file-notify--library
33 (cond 34 (cond
@@ -40,41 +41,43 @@ The value is the name of the low-level file notification package
40to be used for local file systems. Remote file notifications 41to be used for local file systems. Remote file notifications
41could use another implementation.") 42could use another implementation.")
42 43
44(cl-defstruct (file-notify--watch
45 (:constructor nil)
46 (:constructor
47 file-notify--watch-make (directory filename callback)))
48 ;; Watched directory
49 directory
50 ;; Watched relative filename, nil if watching the directory.
51 filename
52 ;; Function to propagate events to
53 callback)
54
55(defun file-notify--watch-absolute-filename (watch)
56 "Return the absolute filename observed by WATCH."
57 (if (file-notify--watch-filename watch)
58 (expand-file-name
59 (file-notify--watch-filename watch)
60 (file-notify--watch-directory watch))
61 (file-notify--watch-directory watch)))
62
43(defvar file-notify-descriptors (make-hash-table :test 'equal) 63(defvar file-notify-descriptors (make-hash-table :test 'equal)
44 "Hash table for registered file notification descriptors. 64 "Hash table for registered file notification descriptors.
45A key in this hash table is the descriptor as returned from 65A key in this hash table is the descriptor as returned from
46`inotify', `kqueue', `gfilenotify', `w32notify' or a file name 66`inotify', `kqueue', `gfilenotify', `w32notify' or a file name
47handler. The value in the hash table is a list 67handler. The value in the hash table is `file-notify--watch'
48 68struct.")
49 (DIR (FILE . CALLBACK) (FILE . CALLBACK) ...)
50
51Several values for a given DIR happen only for `inotify', when
52different files from the same directory are watched.")
53 69
54(defun file-notify--rm-descriptor (descriptor) 70(defun file-notify--rm-descriptor (descriptor)
55 "Remove DESCRIPTOR from `file-notify-descriptors'. 71 "Remove DESCRIPTOR from `file-notify-descriptors'.
56DESCRIPTOR should be an object returned by `file-notify-add-watch'. 72DESCRIPTOR should be an object returned by `file-notify-add-watch'.
57If it is registered in `file-notify-descriptors', a stopped event is sent." 73If it is registered in `file-notify-descriptors', a stopped event is sent."
58 (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) 74 (when-let (watch (gethash descriptor file-notify-descriptors))
59 (registered (gethash desc file-notify-descriptors)) 75 ;; Send `stopped' event.
60 (file (if (consp descriptor) (cdr descriptor) (cl-caadr registered))) 76 (unwind-protect
61 (dir (car registered)))
62
63 (when (consp registered)
64 ;; Send `stopped' event.
65 (when (consp (assoc file (cdr registered)))
66 (funcall 77 (funcall
67 (cdr (assoc file (cdr registered))) 78 (file-notify--watch-callback watch)
68 `(,descriptor stopped ,(if file (expand-file-name file dir) dir)))) 79 `(,descriptor stopped ,(file-notify--watch-absolute-filename watch)))
69 80 (remhash descriptor file-notify-descriptors))))
70 ;; Modify `file-notify-descriptors'.
71 (if (not file)
72 (remhash desc file-notify-descriptors)
73 (setcdr registered
74 (delete (assoc file (cdr registered)) (cdr registered)))
75 (if (null (cdr registered))
76 (remhash desc file-notify-descriptors)
77 (puthash desc registered file-notify-descriptors))))))
78 81
79;; This function is used by `inotify', `kqueue', `gfilenotify' and 82;; This function is used by `inotify', `kqueue', `gfilenotify' and
80;; `w32notify' events. 83;; `w32notify' events.
@@ -88,7 +91,8 @@ If EVENT is a filewatch event, call its callback. It has the format
88Otherwise, signal a `file-notify-error'." 91Otherwise, signal a `file-notify-error'."
89 (interactive "e") 92 (interactive "e")
90 ;;(message "file-notify-handle-event %S" event) 93 ;;(message "file-notify-handle-event %S" event)
91 (if (and (eq (car event) 'file-notify) 94 (if (and (consp event)
95 (eq (car event) 'file-notify)
92 (>= (length event) 3)) 96 (>= (length event) 3))
93 (funcall (nth 2 event) (nth 1 event)) 97 (funcall (nth 2 event) (nth 1 event))
94 (signal 'file-notify-error 98 (signal 'file-notify-error
@@ -96,33 +100,32 @@ Otherwise, signal a `file-notify-error'."
96 100
97;; Needed for `inotify' and `w32notify'. In the latter case, COOKIE is nil. 101;; Needed for `inotify' and `w32notify'. In the latter case, COOKIE is nil.
98(defvar file-notify--pending-event nil 102(defvar file-notify--pending-event nil
99 "A pending file notification events for a future `renamed' action. 103 "A pending file notification event for a future `renamed' action.
100It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).") 104It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
101 105
102(defun file-notify--event-watched-file (event) 106(defun file-notify--event-watched-file (event)
103 "Return file or directory being watched. 107 "Return file or directory being watched.
104Could be different from the directory watched by the backend library." 108Could be different from the directory watched by the backend library."
105 (let* ((desc (if (consp (car event)) (caar event) (car event))) 109 (when-let (watch (gethash (car event) file-notify-descriptors))
106 (registered (gethash desc file-notify-descriptors)) 110 (file-notify--watch-absolute-filename watch)))
107 (file (if (consp (car event)) (cdar event) (cl-caadr registered)))
108 (dir (car registered)))
109 (if file (expand-file-name file dir) dir)))
110 111
111(defun file-notify--event-file-name (event) 112(defun file-notify--event-file-name (event)
112 "Return file name of file notification event, or nil." 113 "Return file name of file notification event, or nil."
113 (directory-file-name 114 (when-let (watch (gethash (car event) file-notify-descriptors))
114 (expand-file-name 115 (directory-file-name
115 (or (and (stringp (nth 2 event)) (nth 2 event)) "") 116 (expand-file-name
116 (car (gethash (car event) file-notify-descriptors))))) 117 (or (and (stringp (nth 2 event)) (nth 2 event)) "")
118 (file-notify--watch-directory watch)))))
117 119
118;; Only `gfilenotify' could return two file names. 120;; Only `gfilenotify' could return two file names.
119(defun file-notify--event-file1-name (event) 121(defun file-notify--event-file1-name (event)
120 "Return second file name of file notification event, or nil. 122 "Return second file name of file notification event, or nil.
121This is available in case a file has been moved." 123This is available in case a file has been moved."
122 (and (stringp (nth 3 event)) 124 (when-let (watch (gethash (car event) file-notify-descriptors))
123 (directory-file-name 125 (and (stringp (nth 3 event))
124 (expand-file-name 126 (directory-file-name
125 (nth 3 event) (car (gethash (car event) file-notify-descriptors)))))) 127 (expand-file-name
128 (nth 3 event) (file-notify--watch-directory watch))))))
126 129
127;; Cookies are offered by `inotify' only. 130;; Cookies are offered by `inotify' only.
128(defun file-notify--event-cookie (event) 131(defun file-notify--event-cookie (event)
@@ -130,21 +133,6 @@ This is available in case a file has been moved."
130This is available in case a file has been moved." 133This is available in case a file has been moved."
131 (nth 3 event)) 134 (nth 3 event))
132 135
133;; `inotify' returns the same descriptor when the file (directory)
134;; uses the same inode. We want to distinguish, and apply a virtual
135;; descriptor which make the difference.
136(defun file-notify--descriptor (desc file)
137 "Return the descriptor to be used in `file-notify-*-watch'.
138For `gfilenotify' and `w32notify' it is the same descriptor as
139used in the low-level file notification package."
140 (if (and (natnump desc) (eq file-notify--library 'inotify))
141 (cons desc
142 (and (stringp file)
143 (car (assoc
144 (file-name-nondirectory file)
145 (gethash desc file-notify-descriptors)))))
146 desc))
147
148;; The callback function used to map between specific flags of the 136;; The callback function used to map between specific flags of the
149;; respective file notifications, and the ones we return. 137;; respective file notifications, and the ones we return.
150(defun file-notify-callback (event) 138(defun file-notify-callback (event)
@@ -152,138 +140,123 @@ used in the low-level file notification package."
152EVENT is the cadr of the event in `file-notify-handle-event' 140EVENT is the cadr of the event in `file-notify-handle-event'
153\(DESCRIPTOR ACTIONS FILE [FILE1-OR-COOKIE])." 141\(DESCRIPTOR ACTIONS FILE [FILE1-OR-COOKIE])."
154 (let* ((desc (car event)) 142 (let* ((desc (car event))
155 (registered (gethash desc file-notify-descriptors)) 143 (watch (gethash desc file-notify-descriptors))
156 (actions (nth 1 event)) 144 (actions (nth 1 event))
157 (file (file-notify--event-file-name event)) 145 (file (file-notify--event-file-name event))
158 file1 callback pending-event stopped) 146 file1 pending-event stopped)
159 147
160 ;; Make actions a list. 148 ;; Make actions a list.
161 (unless (consp actions) (setq actions (cons actions nil))) 149 (unless (consp actions) (setq actions (cons actions nil)))
162 150
163 ;; Loop over registered entries. In fact, more than one entry 151 (when watch
164 ;; happens only for `inotify'.
165 (dolist (entry (cdr registered))
166
167 ;; Check, that event is meant for us.
168 (unless (setq callback (cdr entry))
169 (setq actions nil))
170
171 ;; Loop over actions. In fact, more than one action happens only 152 ;; Loop over actions. In fact, more than one action happens only
172 ;; for `inotify' and `kqueue'. 153 ;; for `inotify' and `kqueue'.
173 (dolist (action actions) 154 (while actions
174 155 (let ((action (pop actions)))
175 ;; Send pending event, if it doesn't match. 156 ;; Send pending event, if it doesn't match.
176 (when (and file-notify--pending-event 157 (when (and file-notify--pending-event
177 ;; The cookie doesn't match. 158 ;; The cookie doesn't match.
178 (not (eq (file-notify--event-cookie 159 (not (equal (file-notify--event-cookie
179 (car file-notify--pending-event)) 160 (car file-notify--pending-event))
180 (file-notify--event-cookie event))) 161 (file-notify--event-cookie event)))
181 (or 162 (or
182 ;; inotify. 163 ;; inotify.
183 (and (eq (nth 1 (car file-notify--pending-event)) 164 (and (eq (nth 1 (car file-notify--pending-event))
184 'moved-from) 165 'moved-from)
185 (not (eq action 'moved-to))) 166 (not (eq action 'moved-to)))
186 ;; w32notify. 167 ;; w32notify.
187 (and (eq (nth 1 (car file-notify--pending-event)) 168 (and (eq (nth 1 (car file-notify--pending-event))
188 'renamed-from) 169 'renamed-from)
189 (not (eq action 'renamed-to))))) 170 (not (eq action 'renamed-to)))))
190 (setq pending-event file-notify--pending-event 171 (setq pending-event file-notify--pending-event
191 file-notify--pending-event nil) 172 file-notify--pending-event nil)
192 (setcar (cdar pending-event) 'deleted)) 173 (setcar (cdar pending-event) 'deleted))
193 174
194 ;; Map action. We ignore all events which cannot be mapped. 175 ;; Map action. We ignore all events which cannot be mapped.
195 (setq action 176 (setq action
196 (cond 177 (cond
197 ((memq action 178 ((memq action
198 '(attribute-changed changed created deleted renamed)) 179 '(attribute-changed changed created deleted renamed))
199 action) 180 action)
200 ((memq action '(moved rename)) 181 ((memq action '(moved rename))
201 ;; The kqueue rename event does not return file1 in 182 ;; The kqueue rename event does not return file1 in
202 ;; case a file monitor is established. 183 ;; case a file monitor is established.
203 (if (setq file1 (file-notify--event-file1-name event)) 184 (if (setq file1 (file-notify--event-file1-name event))
204 'renamed 'deleted)) 185 'renamed 'deleted))
205 ((eq action 'ignored) 186 ((eq action 'ignored)
206 (setq stopped t actions nil)) 187 (setq stopped t actions nil))
207 ((memq action '(attrib link)) 'attribute-changed) 188 ((memq action '(attrib link)) 'attribute-changed)
208 ((memq action '(create added)) 'created) 189 ((memq action '(create added)) 'created)
209 ((memq action '(modify modified write)) 'changed) 190 ((memq action '(modify modified write)) 'changed)
210 ((memq action '(delete delete-self move-self removed)) 'deleted) 191 ((memq action
211 ;; Make the event pending. 192 '(delete delete-self move-self removed)) 'deleted)
212 ((memq action '(moved-from renamed-from)) 193 ;; Make the event pending.
213 (setq file-notify--pending-event 194 ((memq action '(moved-from renamed-from))
214 `((,desc ,action ,file ,(file-notify--event-cookie event)) 195 (setq file-notify--pending-event
215 ,callback)) 196 `((,desc ,action ,file
216 nil) 197 ,(file-notify--event-cookie event))
217 ;; Look for pending event. 198 ,(file-notify--watch-callback watch)))
218 ((memq action '(moved-to renamed-to)) 199 nil)
219 (if (null file-notify--pending-event) 200 ;; Look for pending event.
220 'created 201 ((memq action '(moved-to renamed-to))
221 (setq file1 file 202 (if (null file-notify--pending-event)
222 file (file-notify--event-file-name 203 'created
223 (car file-notify--pending-event))) 204 (setq file1 file
224 ;; If the source is handled by another watch, we 205 file (file-notify--event-file-name
225 ;; must fire the rename event there as well. 206 (car file-notify--pending-event)))
226 (when (not (equal (file-notify--descriptor desc file1) 207 ;; If the source is handled by another watch, we
227 (file-notify--descriptor 208 ;; must fire the rename event there as well.
228 (caar file-notify--pending-event) 209 (unless (equal desc (caar file-notify--pending-event))
229 (file-notify--event-file-name 210 (setq pending-event
230 file-notify--pending-event)))) 211 `((,(caar file-notify--pending-event)
231 (setq pending-event 212 renamed ,file ,file1)
232 `((,(caar file-notify--pending-event) 213 ,(cadr file-notify--pending-event))))
233 renamed ,file ,file1) 214 (setq file-notify--pending-event nil)
234 ,(cadr file-notify--pending-event)))) 215 'renamed))))
235 (setq file-notify--pending-event nil) 216
236 'renamed)))) 217 ;; Apply pending callback.
237 218 (when pending-event
238 ;; Apply pending callback. 219 (funcall (cadr pending-event) (car pending-event))
239 (when pending-event 220 (setq pending-event nil))
240 (setcar 221
241 (car pending-event) 222 ;; Apply callback.
242 (file-notify--descriptor 223 (when (and action
243 (caar pending-event) 224 (or
244 (file-notify--event-file-name file-notify--pending-event))) 225 ;; If there is no relative file name for that
245 (funcall (cadr pending-event) (car pending-event)) 226 ;; watch, we watch the whole directory.
246 (setq pending-event nil)) 227 (null (file-notify--watch-filename watch))
247 228 ;; File matches.
248 ;; Apply callback. 229 (string-equal
249 (when (and action 230 (file-notify--watch-filename watch)
250 (or 231 (file-name-nondirectory file))
251 ;; If there is no relative file name for that watch, 232 ;; Directory matches.
252 ;; we watch the whole directory. 233 (string-equal
253 (null (nth 0 entry)) 234 (file-name-nondirectory file)
254 ;; File matches. 235 (file-name-nondirectory
255 (string-equal 236 (file-notify--watch-directory watch)))
256 (nth 0 entry) (file-name-nondirectory file)) 237 ;; File1 matches.
257 ;; Directory matches. 238 (and (stringp file1)
258 (string-equal 239 (string-equal
259 (file-name-nondirectory file) 240 (file-notify--watch-filename watch)
260 (file-name-nondirectory (car registered))) 241 (file-name-nondirectory file1)))))
261 ;; File1 matches. 242 ;;(message
262 (and (stringp file1) 243 ;;"file-notify-callback %S %S %S %S %S"
263 (string-equal 244 ;;desc action file file1 watch)
264 (nth 0 entry) (file-name-nondirectory file1))))) 245 (if file1
265 ;;(message 246 (funcall (file-notify--watch-callback watch)
266 ;;"file-notify-callback %S %S %S %S %S" 247 `(,desc ,action ,file ,file1))
267 ;;(file-notify--descriptor desc (car entry)) 248 (funcall (file-notify--watch-callback watch)
268 ;;action file file1 registered) 249 `(,desc ,action ,file))))
269 (if file1 250
270 (funcall 251 ;; Send `stopped' event.
271 callback 252 (when (or stopped
272 `(,(file-notify--descriptor desc (car entry)) 253 (and (memq action '(deleted renamed))
273 ,action ,file ,file1)) 254 ;; Not, when a file is backed up.
274 (funcall 255 (not (and (stringp file1) (backup-file-name-p file1)))
275 callback 256 ;; Watched file or directory is concerned.
276 `(,(file-notify--descriptor desc (car entry)) ,action ,file)))) 257 (string-equal
277 258 file (file-notify--event-watched-file event))))
278 ;; Send `stopped' event. 259 (file-notify-rm-watch desc)))))))
279 (when (or stopped
280 (and (memq action '(deleted renamed))
281 ;; Not, when a file is backed up.
282 (not (and (stringp file1) (backup-file-name-p file1)))
283 ;; Watched file or directory is concerned.
284 (string-equal
285 file (file-notify--event-watched-file event))))
286 (file-notify-rm-watch (file-notify--descriptor desc (car entry))))))))
287 260
288;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor 261;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor
289;; for every `file-notify-add-watch', while `inotify' returns a unique 262;; for every `file-notify-add-watch', while `inotify' returns a unique
@@ -339,7 +312,7 @@ FILE is the name of the file whose event is being reported."
339 (if (file-directory-p file) 312 (if (file-directory-p file)
340 file 313 file
341 (file-name-directory file)))) 314 (file-name-directory file))))
342 desc func l-flags registered entry) 315 desc func l-flags)
343 316
344 (unless (file-directory-p dir) 317 (unless (file-directory-p dir)
345 (signal 'file-notify-error `("Directory does not exist" ,dir))) 318 (signal 'file-notify-error `("Directory does not exist" ,dir)))
@@ -347,13 +320,7 @@ FILE is the name of the file whose event is being reported."
347 (if handler 320 (if handler
348 ;; A file name handler could exist even if there is no local 321 ;; A file name handler could exist even if there is no local
349 ;; file notification support. 322 ;; file notification support.
350 (setq desc (funcall 323 (setq desc (funcall handler 'file-notify-add-watch dir flags callback))
351 handler 'file-notify-add-watch
352 ;; kqueue does not report file changes in
353 ;; directory monitor. So we must watch the file
354 ;; itself.
355 (if (eq file-notify--library 'kqueue) file dir)
356 flags callback))
357 324
358 ;; Check, whether Emacs has been compiled with file notification 325 ;; Check, whether Emacs has been compiled with file notification
359 ;; support. 326 ;; support.
@@ -391,70 +358,52 @@ FILE is the name of the file whose event is being reported."
391 358
392 ;; Call low-level function. 359 ;; Call low-level function.
393 (setq desc (funcall 360 (setq desc (funcall
361 ;; kqueue does not report file changes in directory
362 ;; monitor. So we must watch the file itself.
394 func (if (eq file-notify--library 'kqueue) file dir) 363 func (if (eq file-notify--library 'kqueue) file dir)
395 l-flags 'file-notify-callback))) 364 l-flags 'file-notify-callback)))
396 365
397 ;; Modify `file-notify-descriptors'. 366 ;; Modify `file-notify-descriptors'.
398 (setq file (unless (file-directory-p file) (file-name-nondirectory file)) 367 (let ((watch (file-notify--watch-make
399 desc (if (consp desc) (car desc) desc) 368 dir
400 registered (gethash desc file-notify-descriptors) 369 (unless (file-directory-p file) (file-name-nondirectory file))
401 entry `(,file . ,callback)) 370 callback)))
402 (unless (member entry (cdr registered)) 371 (puthash desc watch file-notify-descriptors))
403 (puthash desc `(,dir ,entry . ,(cdr registered)) file-notify-descriptors))
404
405 ;; Return descriptor. 372 ;; Return descriptor.
406 (file-notify--descriptor desc file))) 373 desc))
407 374
408(defun file-notify-rm-watch (descriptor) 375(defun file-notify-rm-watch (descriptor)
409 "Remove an existing watch specified by its DESCRIPTOR. 376 "Remove an existing watch specified by its DESCRIPTOR.
410DESCRIPTOR should be an object returned by `file-notify-add-watch'." 377DESCRIPTOR should be an object returned by `file-notify-add-watch'."
411 (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) 378 (when-let (watch (gethash descriptor file-notify-descriptors))
412 (file (if (consp descriptor) (cdr descriptor))) 379 (let ((handler (find-file-name-handler
413 (registered (gethash desc file-notify-descriptors)) 380 (file-notify--watch-directory watch)
414 (dir (car registered)) 381 'file-notify-rm-watch)))
415 (handler (and (stringp dir) 382 (condition-case nil
416 (find-file-name-handler dir 'file-notify-rm-watch)))) 383 (if handler
417 384 ;; A file name handler could exist even if there is no
418 (when (stringp dir) 385 ;; local file notification support.
419 ;; Call low-level function. 386 (funcall handler 'file-notify-rm-watch descriptor)
420 (when (or (not file) 387
421 (and (= (length (cdr registered)) 1) 388 (funcall
422 (assoc file (cdr registered)))) 389 (cond
423 (condition-case nil 390 ((eq file-notify--library 'inotify) 'inotify-rm-watch)
424 (if handler 391 ((eq file-notify--library 'kqueue) 'kqueue-rm-watch)
425 ;; A file name handler could exist even if there is no local 392 ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
426 ;; file notification support. 393 ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
427 (funcall handler 'file-notify-rm-watch descriptor) 394 descriptor))
428 395 (file-notify-error nil)))
429 (funcall 396 ;; Modify `file-notify-descriptors'.
430 (cond 397 (file-notify--rm-descriptor descriptor)))
431 ((eq file-notify--library 'inotify) 'inotify-rm-watch)
432 ((eq file-notify--library 'kqueue) 'kqueue-rm-watch)
433 ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
434 ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
435 desc))
436 (file-notify-error nil)))
437
438 ;; Modify `file-notify-descriptors'.
439 (file-notify--rm-descriptor descriptor))))
440 398
441(defun file-notify-valid-p (descriptor) 399(defun file-notify-valid-p (descriptor)
442 "Check a watch specified by its DESCRIPTOR. 400 "Check a watch specified by its DESCRIPTOR.
443DESCRIPTOR should be an object returned by `file-notify-add-watch'." 401DESCRIPTOR should be an object returned by `file-notify-add-watch'."
444 (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) 402 (when-let (watch (gethash descriptor file-notify-descriptors))
445 (file (if (consp descriptor) (cdr descriptor))) 403 (let ((handler (find-file-name-handler
446 (registered (gethash desc file-notify-descriptors)) 404 (file-notify--watch-directory watch)
447 (dir (car registered)) 405 'file-notify-valid-p)))
448 handler) 406 (and (if handler
449
450 (when (stringp dir)
451 (setq handler (find-file-name-handler dir 'file-notify-valid-p))
452
453 (and (or ;; It is a directory.
454 (not file)
455 ;; The file is registered.
456 (assoc file (cdr registered)))
457 (if handler
458 ;; A file name handler could exist even if there is no 407 ;; A file name handler could exist even if there is no
459 ;; local file notification support. 408 ;; local file notification support.
460 (funcall handler 'file-notify-valid-p descriptor) 409 (funcall handler 'file-notify-valid-p descriptor)
@@ -464,9 +413,19 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
464 ((eq file-notify--library 'kqueue) 'kqueue-valid-p) 413 ((eq file-notify--library 'kqueue) 'kqueue-valid-p)
465 ((eq file-notify--library 'gfilenotify) 'gfile-valid-p) 414 ((eq file-notify--library 'gfilenotify) 'gfile-valid-p)
466 ((eq file-notify--library 'w32notify) 'w32notify-valid-p)) 415 ((eq file-notify--library 'w32notify) 'w32notify-valid-p))
467 desc)) 416 descriptor))
468 t)))) 417 t))))
469 418
419
420;; TODO:
421;; * Watching a /dir/file may receive events for dir.
422;; (This may be the desired behaviour.)
423;; * Watching a file in a already watched directory
424;; If the file is created and *then* a watch is added to that file, the
425;; watch might receive events which occurred prior to it being created,
426;; due to the way events are propagated during idle time. Note: This
427;; may be perfectly acceptable.
428
470;; The end: 429;; The end:
471(provide 'filenotify) 430(provide 'filenotify)
472 431
diff --git a/lisp/files-x.el b/lisp/files-x.el
index a0cad708425..b7c6f51e658 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -585,7 +585,7 @@ Return a new ordered plist list containing only property names from PROPERTIES."
585 nil 585 nil
586 (mapcar 586 (mapcar
587 (lambda (property) 587 (lambda (property)
588 (when (plist-member criteria property) 588 (when (and (plist-member criteria property) (plist-get criteria property))
589 (list property (plist-get criteria property)))) 589 (list property (plist-get criteria property))))
590 properties))) 590 properties)))
591 591
@@ -606,12 +606,10 @@ using this connection, see `connection-local-criteria-alist'."
606 606
607;;;###autoload 607;;;###autoload
608(defun connection-local-set-profiles (criteria &rest profiles) 608(defun connection-local-set-profiles (criteria &rest profiles)
609 "Add PROFILES for remote servers. 609 "Add PROFILES for CRITERIA.
610CRITERIA is either a regular expression identifying a remote 610CRITERIA is a plist identifying a connection and the application
611server, or a function with one argument IDENTIFICATION, which 611using this connection, see `connection-local-criteria-alist'.
612returns non-nil when a remote server shall apply PROFILE's 612PROFILES are the names of connection profiles (a symbol).
613variables. If CRITERIA is nil, it always applies.
614PROFILES are the names of a connection profile (a symbol).
615 613
616When a connection to a remote server is opened and CRITERIA 614When a connection to a remote server is opened and CRITERIA
617matches to that server, the connection-local variables from 615matches to that server, the connection-local variables from
@@ -678,7 +676,7 @@ will not be changed."
678;;;###autoload 676;;;###autoload
679(defmacro with-connection-local-profiles (profiles &rest body) 677(defmacro with-connection-local-profiles (profiles &rest body)
680 "Apply connection-local variables according to PROFILES in current buffer. 678 "Apply connection-local variables according to PROFILES in current buffer.
681Execute BODY, and unwind connection local variables." 679Execute BODY, and unwind connection-local variables."
682 (declare (indent 1) (debug t)) 680 (declare (indent 1) (debug t))
683 `(let ((enable-connection-local-variables t) 681 `(let ((enable-connection-local-variables t)
684 (old-buffer-local-variables (buffer-local-variables)) 682 (old-buffer-local-variables (buffer-local-variables))
diff --git a/lisp/files.el b/lisp/files.el
index 0a023a88b10..b4872e46b01 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -279,8 +279,13 @@ The value `never' means do not make them."
279 (const :tag "If existing" nil) 279 (const :tag "If existing" nil)
280 (other :tag "Always" t)) 280 (other :tag "Always" t))
281 :group 'backup) 281 :group 'backup)
282
283(defun version-control-safe-local-p (x)
284 "Return whether X is safe as local value for `version-control'."
285 (or (booleanp x) (equal x 'never)))
286
282(put 'version-control 'safe-local-variable 287(put 'version-control 'safe-local-variable
283 (lambda (x) (or (booleanp x) (equal x 'never)))) 288 #'version-control-safe-local-p)
284 289
285(defcustom dired-kept-versions 2 290(defcustom dired-kept-versions 2
286 "When cleaning directory, number of versions to keep." 291 "When cleaning directory, number of versions to keep."
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index be46339cd38..90f3cb48c27 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -3196,7 +3196,7 @@ If this variable is nil, don't do anything."
3196 3196
3197(defun gnus-display-time-event-handler () 3197(defun gnus-display-time-event-handler ()
3198 (if (and (fboundp 'display-time-event-handler) 3198 (if (and (fboundp 'display-time-event-handler)
3199 (gnus-boundp 'display-time-timer)) 3199 (bound-and-true-p display-time-timer))
3200 (display-time-event-handler))) 3200 (display-time-event-handler)))
3201 3201
3202(defun gnus-check-reasonable-setup () 3202(defun gnus-check-reasonable-setup ()
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 20eceb58edd..b509d8ad448 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -84,11 +84,6 @@ This is a compatibility function for different Emacsen."
84 (declare (obsolete replace-regexp-in-string "26.1")) 84 (declare (obsolete replace-regexp-in-string "26.1"))
85 (replace-regexp-in-string regexp newtext string nil literal)) 85 (replace-regexp-in-string regexp newtext string nil literal))
86 86
87(defun gnus-boundp (variable)
88 "Return non-nil if VARIABLE is bound and non-nil."
89 (and (boundp variable)
90 (symbol-value variable)))
91
92(defmacro gnus-eval-in-buffer-window (buffer &rest forms) 87(defmacro gnus-eval-in-buffer-window (buffer &rest forms)
93 "Pop to BUFFER, evaluate FORMS, and then return to the original window." 88 "Pop to BUFFER, evaluate FORMS, and then return to the original window."
94 (let ((tempvar (make-symbol "GnusStartBufferWindow")) 89 (let ((tempvar (make-symbol "GnusStartBufferWindow"))
diff --git a/lisp/help.el b/lisp/help.el
index d3aaa1e251d..26be3b0e07f 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1419,7 +1419,7 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"."
1419 1419
1420(defun help-function-arglist (def &optional preserve-names) 1420(defun help-function-arglist (def &optional preserve-names)
1421 "Return a formal argument list for the function DEF. 1421 "Return a formal argument list for the function DEF.
1422IF PRESERVE-NAMES is non-nil, return a formal arglist that uses 1422If PRESERVE-NAMES is non-nil, return a formal arglist that uses
1423the same names as used in the original source code, when possible." 1423the same names as used in the original source code, when possible."
1424 ;; Handle symbols aliased to other symbols. 1424 ;; Handle symbols aliased to other symbols.
1425 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) 1425 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def)))
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 66916b2bca1..c83c21315a1 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1689,7 +1689,7 @@ If point is on a group name, this function operates on that group."
1689 ;; generate a call to the column function. 1689 ;; generate a call to the column function.
1690 (ibuffer-aif (assq sym ibuffer-inline-columns) 1690 (ibuffer-aif (assq sym ibuffer-inline-columns)
1691 (nth 1 it) 1691 (nth 1 it)
1692 `(,sym buffer mark))) 1692 `(or (,sym buffer mark) "")))
1693 ;; You're not expected to understand this. Hell, I 1693 ;; You're not expected to understand this. Hell, I
1694 ;; don't even understand it, and I wrote it five 1694 ;; don't even understand it, and I wrote it five
1695 ;; minutes ago. 1695 ;; minutes ago.
diff --git a/lisp/info.el b/lisp/info.el
index 8dc85f48a43..a6bab290a72 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1998,19 +1998,20 @@ If DIRECTION is `backward', search in the reverse direction."
1998 Info-isearch-initial-node 1998 Info-isearch-initial-node
1999 bound 1999 bound
2000 (and found (> found opoint-min) (< found opoint-max))) 2000 (and found (> found opoint-min) (< found opoint-max)))
2001 (signal 'search-failed (list regexp "end of node"))) 2001 (user-error "Search failed: `%s' (end of node)" regexp))
2002 2002
2003 ;; If no subfiles, give error now. 2003 ;; If no subfiles, give error now.
2004 (unless (or found Info-current-subfile) 2004 (unless (or found Info-current-subfile)
2005 (if isearch-mode 2005 (if isearch-mode
2006 (signal 'search-failed (list regexp "end of manual")) 2006 (user-error "Search failed: `%s' (end of manual)" regexp)
2007 (let ((search-spaces-regexp Info-search-whitespace-regexp)) 2007 (let ((search-spaces-regexp Info-search-whitespace-regexp))
2008 (if backward 2008 (unless (if backward
2009 (re-search-backward regexp) 2009 (re-search-backward regexp nil t)
2010 (re-search-forward regexp))))) 2010 (re-search-forward regexp nil t))
2011 (user-error "Search failed: `%s'" regexp)))))
2011 2012
2012 (if (and bound (not found)) 2013 (if (and bound (not found))
2013 (signal 'search-failed (list regexp))) 2014 (user-error "Search failed: `%s'" regexp))
2014 2015
2015 (unless (or found bound) 2016 (unless (or found bound)
2016 (unwind-protect 2017 (unwind-protect
@@ -2054,9 +2055,8 @@ If DIRECTION is `backward', search in the reverse direction."
2054 (setq list nil))) 2055 (setq list nil)))
2055 (if found 2056 (if found
2056 (message "") 2057 (message "")
2057 (signal 'search-failed (if isearch-mode 2058 (user-error "Search failed: `%s'%s"
2058 (list regexp "end of manual") 2059 regexp (if isearch-mode " (end of manual)" ""))))
2059 (list regexp)))))
2060 (if (not found) 2060 (if (not found)
2061 (progn (Info-read-subfile osubfile) 2061 (progn (Info-read-subfile osubfile)
2062 (goto-char opoint) 2062 (goto-char opoint)
@@ -2699,7 +2699,8 @@ Because of ambiguities, this should be concatenated with something like
2699 (orignode Info-current-node) 2699 (orignode Info-current-node)
2700 nextnode) 2700 nextnode)
2701 (goto-char (point-min)) 2701 (goto-char (point-min))
2702 (search-forward "\n* Menu:") 2702 (unless (search-forward "\n* Menu:" nil t)
2703 (user-error "No menu in this node"))
2703 (cond 2704 (cond
2704 ((eq (car-safe action) 'boundaries) nil) 2705 ((eq (car-safe action) 'boundaries) nil)
2705 ((eq action 'lambda) 2706 ((eq action 'lambda)
@@ -5237,9 +5238,6 @@ BUFFER is the buffer speedbar is requesting buttons for."
5237 (erase-buffer)) 5238 (erase-buffer))
5238 (Info-speedbar-hierarchy-buttons nil 0)) 5239 (Info-speedbar-hierarchy-buttons nil 0))
5239 5240
5240;; FIXME: Really? Why here?
5241(add-to-list 'debug-ignored-errors 'search-failed)
5242
5243;;;; Desktop support 5241;;;; Desktop support
5244 5242
5245(defun Info-desktop-buffer-misc-data (_desktop-dirname) 5243(defun Info-desktop-buffer-misc-data (_desktop-dirname)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 01a3e5d1506..411969a5420 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -5224,7 +5224,9 @@ You might also use mode hooks to specify it in certain modes, like this:
5224 (concat \"make -k \" 5224 (concat \"make -k \"
5225 (if buffer-file-name 5225 (if buffer-file-name
5226 (shell-quote-argument 5226 (shell-quote-argument
5227 (file-name-sans-extension buffer-file-name))))))))") 5227 (file-name-sans-extension buffer-file-name))))))))
5228
5229It's often useful to leave a space at the end of the value.")
5228 5230
5229(custom-autoload 'compile-command "compile" t) 5231(custom-autoload 'compile-command "compile" t)
5230(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command)))) 5232(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command))))
@@ -12465,12 +12467,10 @@ Copy directory-local variables to the -*- line.
12465Non-nil means enable use of connection-local variables.") 12467Non-nil means enable use of connection-local variables.")
12466 12468
12467(autoload 'connection-local-set-profiles "files-x" "\ 12469(autoload 'connection-local-set-profiles "files-x" "\
12468Add PROFILES for remote servers. 12470Add PROFILES for CRITERIA.
12469CRITERIA is either a regular expression identifying a remote 12471CRITERIA is a plist identifying a connection and the application
12470server, or a function with one argument IDENTIFICATION, which 12472using this connection, see `connection-local-criteria-alist'.
12471returns non-nil when a remote server shall apply PROFILE's 12473PROFILES are the names of connection profiles (a symbol).
12472variables. If CRITERIA is nil, it always applies.
12473PROFILES are the names of a connection profile (a symbol).
12474 12474
12475When a connection to a remote server is opened and CRITERIA 12475When a connection to a remote server is opened and CRITERIA
12476matches to that server, the connection-local variables from 12476matches to that server, the connection-local variables from
@@ -12504,7 +12504,7 @@ will not be changed.
12504 12504
12505(autoload 'with-connection-local-profiles "files-x" "\ 12505(autoload 'with-connection-local-profiles "files-x" "\
12506Apply connection-local variables according to PROFILES in current buffer. 12506Apply connection-local variables according to PROFILES in current buffer.
12507Execute BODY, and unwind connection local variables. 12507Execute BODY, and unwind connection-local variables.
12508 12508
12509\(fn PROFILES &rest BODY)" nil t) 12509\(fn PROFILES &rest BODY)" nil t)
12510 12510
@@ -15857,14 +15857,6 @@ This discards the buffer's undo information.
15857 15857
15858;;;*** 15858;;;***
15859 15859
15860;;;### (autoloads "actual autoloads are elsewhere" "hfy-cmap" "hfy-cmap.el"
15861;;;;;; (0 0 0 0))
15862;;; Generated autoloads from hfy-cmap.el
15863
15864(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "hfy-cmap" '("hfy-" "htmlfontify-unload-rgb-file")))
15865
15866;;;***
15867
15868;;;### (autoloads nil "hi-lock" "hi-lock.el" (0 0 0 0)) 15860;;;### (autoloads nil "hi-lock" "hi-lock.el" (0 0 0 0))
15869;;; Generated autoloads from hi-lock.el 15861;;; Generated autoloads from hi-lock.el
15870 15862
@@ -21868,7 +21860,7 @@ QUALITY can be:
21868 `approximate', in which case we may cut some corners to avoid 21860 `approximate', in which case we may cut some corners to avoid
21869 excessive work. 21861 excessive work.
21870 `exact', in which case we may end up re-(en/de)coding a large 21862 `exact', in which case we may end up re-(en/de)coding a large
21871 part of the file/buffer. 21863 part of the file/buffer, this can be expensive and slow.
21872 nil, in which case we may return nil rather than an approximation. 21864 nil, in which case we may return nil rather than an approximation.
21873 21865
21874\(fn BYTE &optional QUALITY CODING-SYSTEM)" nil nil) 21866\(fn BYTE &optional QUALITY CODING-SYSTEM)" nil nil)
@@ -21882,7 +21874,7 @@ QUALITY can be:
21882 `approximate', in which case we may cut some corners to avoid 21874 `approximate', in which case we may cut some corners to avoid
21883 excessive work. 21875 excessive work.
21884 `exact', in which case we may end up re-(en/de)coding a large 21876 `exact', in which case we may end up re-(en/de)coding a large
21885 part of the file/buffer. 21877 part of the file/buffer, this can be expensive and slow.
21886 nil, in which case we may return nil rather than an approximation. 21878 nil, in which case we may return nil rather than an approximation.
21887 21879
21888\(fn POSITION &optional QUALITY CODING-SYSTEM)" nil nil) 21880\(fn POSITION &optional QUALITY CODING-SYSTEM)" nil nil)
@@ -33879,7 +33871,7 @@ It can have the following values:
33879 33871
33880(custom-autoload 'tramp-syntax "tramp" t) 33872(custom-autoload 'tramp-syntax "tramp" t)
33881 33873
33882(defconst tramp-file-name-regexp-unified (if (memq system-type '(cygwin windows-nt)) "\\`/\\(\\[.*\\]\\|[^/|:]\\{2,\\}[^/|]*\\):" "\\`/[^/|:][^/|]*:") "\ 33874(defconst tramp-file-name-regexp-unified "\\`/.+:.*:" "\
33883Value for `tramp-file-name-regexp' for unified remoting. 33875Value for `tramp-file-name-regexp' for unified remoting.
33884See `tramp-file-name-structure' for more explanations. 33876See `tramp-file-name-structure' for more explanations.
33885 33877
@@ -33889,23 +33881,23 @@ On W32 systems, the volume letter must be ignored.")
33889Value for `tramp-file-name-regexp' for separate remoting. 33881Value for `tramp-file-name-regexp' for separate remoting.
33890See `tramp-file-name-structure' for more explanations.") 33882See `tramp-file-name-structure' for more explanations.")
33891 33883
33892(defvar tramp-file-name-regexp (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "\ 33884(defvar tramp-file-name-regexp (cond ((eq tramp-syntax 'ftp) tramp-file-name-regexp-unified) ((eq tramp-syntax 'sep) tramp-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "\
33893Regular expression matching file names handled by Tramp. 33885Regular expression matching file names handled by Tramp.
33894This regexp should match Tramp file names but no other file 33886This regexp should match Tramp file names but no other file
33895names. When calling `tramp-register-file-name-handlers', the 33887names. When calling `tramp-register-file-name-handlers', the
33896initial value is overwritten by the car of `tramp-file-name-structure'.") 33888initial value is overwritten by the car of `tramp-file-name-structure'.")
33897 33889
33898(defconst tramp-completion-file-name-regexp-unified (if (memq system-type '(cygwin windows-nt)) "\\`/[^/]\\{2,\\}\\'" "\\`/[^/]*\\'") "\ 33890(defconst tramp-completion-file-name-regexp-unified (concat "\\`/\\(" "\\([^/|:]+:[^/|:]*|\\)*" (if (memq system-type '(cygwin windows-nt)) "\\(-\\|[^/|:]\\{2,\\}\\)" "[^/|:]+") "\\(:[^/|:]*\\)?" "\\)?\\'") "\
33899Value for `tramp-completion-file-name-regexp' for unified remoting. 33891Value for `tramp-completion-file-name-regexp' for unified remoting.
33900See `tramp-file-name-structure' for more explanations. 33892See `tramp-file-name-structure' for more explanations.
33901 33893
33902On W32 systems, the volume letter must be ignored.") 33894On W32 systems, the volume letter must be ignored.")
33903 33895
33904(defconst tramp-completion-file-name-regexp-separate "\\`/\\([[][^]]*\\)?\\'" "\ 33896(defconst tramp-completion-file-name-regexp-separate "\\`/\\[\\([^]]*\\)?\\'" "\
33905Value for `tramp-completion-file-name-regexp' for separate remoting. 33897Value for `tramp-completion-file-name-regexp' for separate remoting.
33906See `tramp-file-name-structure' for more explanations.") 33898See `tramp-file-name-structure' for more explanations.")
33907 33899
33908(defconst tramp-completion-file-name-regexp (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified) ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "\ 33900(defconst tramp-completion-file-name-regexp (cond ((eq tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified) ((eq tramp-syntax 'sep) tramp-completion-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "\
33909Regular expression matching file names handled by Tramp completion. 33901Regular expression matching file names handled by Tramp completion.
33910This regexp should match partial Tramp file names only. 33902This regexp should match partial Tramp file names only.
33911 33903
@@ -33916,20 +33908,31 @@ updated after changing this variable.
33916 33908
33917Also see `tramp-file-name-structure'.") 33909Also see `tramp-file-name-structure'.")
33918 33910
33919(defun tramp-completion-run-real-handler (operation args) "\ 33911(defconst tramp-completion-file-name-handler-alist '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "\
33920Invoke `tramp-file-name-handler' for OPERATION. 33912Alist of completion handler functions.
33913Used for file names matching `tramp-completion-file-name-regexp'.
33914Operations not mentioned here will be handled by Tramp's file
33915name handler functions, or the normal Emacs functions.")
33916
33917(defun tramp-run-real-handler (operation args) "\
33918Invoke normal file name handler for OPERATION.
33921First arg specifies the OPERATION, second arg is a list of arguments to 33919First arg specifies the OPERATION, second arg is a list of arguments to
33922pass to the OPERATION." (let* ((inhibit-file-name-handlers (\` (tramp-completion-file-name-handler cygwin-mount-name-hook-function cygwin-mount-map-drive-hook-function \, (and (eq inhibit-file-name-operation operation) inhibit-file-name-handlers)))) (inhibit-file-name-operation operation)) (apply operation args))) 33920pass to the OPERATION." (let* ((inhibit-file-name-handlers (\` (tramp-file-name-handler tramp-vc-file-name-handler tramp-completion-file-name-handler cygwin-mount-name-hook-function cygwin-mount-map-drive-hook-function \, (and (eq inhibit-file-name-operation operation) inhibit-file-name-handlers)))) (inhibit-file-name-operation operation)) (apply operation args)))
33923(defun tramp-completion-file-name-handler (operation &rest args)
33924 (if (tramp-completion-mode-p)
33925 (apply 'tramp-autoload-file-name-handler operation args)
33926 (tramp-completion-run-real-handler operation args)))
33927 33921
33928(defun tramp-autoload-file-name-handler (operation &rest args) "\ 33922(autoload 'tramp-file-name-handler "tramp" "\
33929Load Tramp file name handler, and perform OPERATION." (if (and (not (and (stringp (car args)) (string-equal (car args) "/"))) (let ((default-directory temporary-file-directory)) (and (null load-in-progress) (load "tramp" (quote noerror) (quote nomessage))))) (apply operation args) (tramp-completion-run-real-handler operation args))) 33923Invoke Tramp file name handler.
33924Falls back to normal file name handler if no Tramp file name handler exists.
33925
33926\(fn OPERATION &rest ARGS)" nil nil)
33927
33928(autoload 'tramp-completion-file-name-handler "tramp" "\
33929Invoke Tramp file name completion handler.
33930Falls back to normal file name handler if no Tramp file name handler exists.
33931
33932\(fn OPERATION &rest ARGS)" nil nil)
33930 33933
33931(defun tramp-register-autoload-file-name-handlers nil "\ 33934(defun tramp-register-autoload-file-name-handlers nil "\
33932Add Tramp file name handlers to `file-name-handler-alist' during autoload." (add-to-list (quote file-name-handler-alist) (cons tramp-file-name-regexp (quote tramp-autoload-file-name-handler))) (put (quote tramp-autoload-file-name-handler) (quote safe-magic) t) (add-to-list (quote file-name-handler-alist) (cons tramp-completion-file-name-regexp (quote tramp-completion-file-name-handler))) (put (quote tramp-completion-file-name-handler) (quote safe-magic) t)) 33935Add Tramp file name handlers to `file-name-handler-alist' during autoload." (add-to-list (quote file-name-handler-alist) (cons tramp-file-name-regexp (quote tramp-file-name-handler))) (put (quote tramp-file-name-handler) (quote safe-magic) t) (put (quote tramp-file-name-handler) (quote operations) (quote (file-name-all-completions file-name-completion file-remote-p))) (add-to-list (quote file-name-handler-alist) (cons tramp-completion-file-name-regexp (quote tramp-completion-file-name-handler))) (put (quote tramp-completion-file-name-handler) (quote safe-magic) t) (put (quote tramp-completion-file-name-handler) (quote operations) (mapcar (quote car) tramp-completion-file-name-handler-alist)))
33933 33936
33934(tramp-register-autoload-file-name-handlers) 33937(tramp-register-autoload-file-name-handlers)
33935 33938
@@ -33939,15 +33942,7 @@ Unload Tramp file name handlers from `file-name-handler-alist'.
33939\(fn)" nil nil) 33942\(fn)" nil nil)
33940 33943
33941(defvar tramp-completion-mode nil "\ 33944(defvar tramp-completion-mode nil "\
33942If non-nil, external packages signal that they are in file name completion. 33945If non-nil, external packages signal that they are in file name completion.")
33943
33944This is necessary, because Tramp uses a heuristic depending on last
33945input event. This fails when external packages use other characters
33946but <TAB>, <SPACE> or ?\\? for file name completion. This variable
33947should never be set globally, the intention is to let-bind it.")
33948
33949(defun tramp-completion-mode-p nil "\
33950Check, whether method / user name / host name completion is active." (or (and (boundp (quote non-essential)) (symbol-value (quote non-essential))) tramp-completion-mode (equal last-input-event (quote tab))))
33951 33946
33952(autoload 'tramp-unload-tramp "tramp" "\ 33947(autoload 'tramp-unload-tramp "tramp" "\
33953Discard Tramp from loading remote files. 33948Discard Tramp from loading remote files.
@@ -37759,7 +37754,7 @@ The major browsing mode used is essentially the standard Man mode.
37759Choose the filename for the man page using completion, based on the 37754Choose the filename for the man page using completion, based on the
37760topic selected from the directories specified in `woman-manpath' and 37755topic selected from the directories specified in `woman-manpath' and
37761`woman-path'. The directory expansions and topics are cached for 37756`woman-path'. The directory expansions and topics are cached for
37762speed, but a non-nil interactive argument forces the caches to be 37757speed. With a prefix argument, force the caches to be
37763updated (e.g. to re-interpret the current directory). 37758updated (e.g. to re-interpret the current directory).
37764 37759
37765Used non-interactively, arguments are optional: if given then TOPIC 37760Used non-interactively, arguments are optional: if given then TOPIC
@@ -38050,17 +38045,16 @@ Zone out, completely.
38050;;;*** 38045;;;***
38051 38046
38052;;;### (autoloads nil nil ("abbrev.el" "bindings.el" "buff-menu.el" 38047;;;### (autoloads nil nil ("abbrev.el" "bindings.el" "buff-menu.el"
38053;;;;;; "button.el" "calc/calc-aent.el" "calc/calc-embed.el" "calc/calc-loaddefs.el" 38048;;;;;; "button.el" "calc/calc-aent.el" "calc/calc-embed.el" "calc/calc-misc.el"
38054;;;;;; "calc/calc-misc.el" "calc/calc-yank.el" "calendar/cal-loaddefs.el" 38049;;;;;; "calc/calc-yank.el" "calendar/cal-loaddefs.el" "calendar/diary-loaddefs.el"
38055;;;;;; "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "case-table.el" 38050;;;;;; "calendar/hol-loaddefs.el" "case-table.el" "cedet/ede/base.el"
38056;;;;;; "cedet/ede/base.el" "cedet/ede/config.el" "cedet/ede/cpp-root.el" 38051;;;;;; "cedet/ede/config.el" "cedet/ede/cpp-root.el" "cedet/ede/custom.el"
38057;;;;;; "cedet/ede/custom.el" "cedet/ede/dired.el" "cedet/ede/emacs.el" 38052;;;;;; "cedet/ede/dired.el" "cedet/ede/emacs.el" "cedet/ede/files.el"
38058;;;;;; "cedet/ede/files.el" "cedet/ede/generic.el" "cedet/ede/linux.el" 38053;;;;;; "cedet/ede/generic.el" "cedet/ede/linux.el" "cedet/ede/locate.el"
38059;;;;;; "cedet/ede/loaddefs.el" "cedet/ede/locate.el" "cedet/ede/make.el" 38054;;;;;; "cedet/ede/make.el" "cedet/ede/shell.el" "cedet/ede/speedbar.el"
38060;;;;;; "cedet/ede/shell.el" "cedet/ede/speedbar.el" "cedet/ede/system.el" 38055;;;;;; "cedet/ede/system.el" "cedet/ede/util.el" "cedet/semantic/analyze.el"
38061;;;;;; "cedet/ede/util.el" "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el" 38056;;;;;; "cedet/semantic/analyze/complete.el" "cedet/semantic/analyze/refs.el"
38062;;;;;; "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el" 38057;;;;;; "cedet/semantic/bovine.el" "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/el.el"
38063;;;;;; "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/el.el"
38064;;;;;; "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make.el" 38058;;;;;; "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make.el"
38065;;;;;; "cedet/semantic/bovine/scm.el" "cedet/semantic/complete.el" 38059;;;;;; "cedet/semantic/bovine/scm.el" "cedet/semantic/complete.el"
38066;;;;;; "cedet/semantic/ctxt.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" 38060;;;;;; "cedet/semantic/ctxt.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
@@ -38071,40 +38065,38 @@ Zone out, completely.
38071;;;;;; "cedet/semantic/find.el" "cedet/semantic/format.el" "cedet/semantic/html.el" 38065;;;;;; "cedet/semantic/find.el" "cedet/semantic/format.el" "cedet/semantic/html.el"
38072;;;;;; "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el" "cedet/semantic/idle.el" 38066;;;;;; "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el" "cedet/semantic/idle.el"
38073;;;;;; "cedet/semantic/imenu.el" "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" 38067;;;;;; "cedet/semantic/imenu.el" "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el"
38074;;;;;; "cedet/semantic/loaddefs.el" "cedet/semantic/mru-bookmark.el" 38068;;;;;; "cedet/semantic/mru-bookmark.el" "cedet/semantic/scope.el"
38075;;;;;; "cedet/semantic/scope.el" "cedet/semantic/senator.el" "cedet/semantic/sort.el" 38069;;;;;; "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el"
38076;;;;;; "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el" 38070;;;;;; "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/global.el"
38077;;;;;; "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el" 38071;;;;;; "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el"
38078;;;;;; "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el" 38072;;;;;; "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el"
38079;;;;;; "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el" 38073;;;;;; "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
38080;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el" 38074;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
38081;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el" 38075;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
38082;;;;;; "cedet/semantic/wisent/python.el" "cedet/srecode/compile.el" 38076;;;;;; "cedet/semantic/wisent/python.el" "cedet/srecode/compile.el"
38083;;;;;; "cedet/srecode/cpp.el" "cedet/srecode/document.el" "cedet/srecode/el.el" 38077;;;;;; "cedet/srecode/cpp.el" "cedet/srecode/document.el" "cedet/srecode/el.el"
38084;;;;;; "cedet/srecode/expandproto.el" "cedet/srecode/getset.el" 38078;;;;;; "cedet/srecode/expandproto.el" "cedet/srecode/getset.el"
38085;;;;;; "cedet/srecode/insert.el" "cedet/srecode/java.el" "cedet/srecode/loaddefs.el" 38079;;;;;; "cedet/srecode/insert.el" "cedet/srecode/java.el" "cedet/srecode/map.el"
38086;;;;;; "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/srt.el" 38080;;;;;; "cedet/srecode/mode.el" "cedet/srecode/srt.el" "cedet/srecode/template.el"
38087;;;;;; "cedet/srecode/template.el" "cedet/srecode/texi.el" "composite.el" 38081;;;;;; "cedet/srecode/texi.el" "composite.el" "cus-face.el" "cus-start.el"
38088;;;;;; "cus-face.el" "cus-start.el" "custom.el" "dired-aux.el" "dired-loaddefs.el" 38082;;;;;; "custom.el" "dired-aux.el" "dired-x.el" "electric.el" "emacs-lisp/backquote.el"
38089;;;;;; "dired-x.el" "electric.el" "emacs-lisp/backquote.el" "emacs-lisp/byte-run.el" 38083;;;;;; "emacs-lisp/byte-run.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-macs.el"
38090;;;;;; "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el"
38091;;;;;; "emacs-lisp/cl-preloaded.el" "emacs-lisp/cl-seq.el" "emacs-lisp/eieio-compat.el" 38084;;;;;; "emacs-lisp/cl-preloaded.el" "emacs-lisp/cl-seq.el" "emacs-lisp/eieio-compat.el"
38092;;;;;; "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-loaddefs.el" 38085;;;;;; "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-opt.el" "emacs-lisp/eldoc.el"
38093;;;;;; "emacs-lisp/eieio-opt.el" "emacs-lisp/eldoc.el" "emacs-lisp/float-sup.el" 38086;;;;;; "emacs-lisp/float-sup.el" "emacs-lisp/lisp-mode.el" "emacs-lisp/lisp.el"
38094;;;;;; "emacs-lisp/lisp-mode.el" "emacs-lisp/lisp.el" "emacs-lisp/macroexp.el" 38087;;;;;; "emacs-lisp/macroexp.el" "emacs-lisp/map-ynp.el" "emacs-lisp/nadvice.el"
38095;;;;;; "emacs-lisp/map-ynp.el" "emacs-lisp/nadvice.el" "emacs-lisp/syntax.el" 38088;;;;;; "emacs-lisp/syntax.el" "emacs-lisp/timer.el" "env.el" "epa-hook.el"
38096;;;;;; "emacs-lisp/timer.el" "env.el" "epa-hook.el" "eshell/em-alias.el" 38089;;;;;; "eshell/em-alias.el" "eshell/em-banner.el" "eshell/em-basic.el"
38097;;;;;; "eshell/em-banner.el" "eshell/em-basic.el" "eshell/em-cmpl.el" 38090;;;;;; "eshell/em-cmpl.el" "eshell/em-dirs.el" "eshell/em-glob.el"
38098;;;;;; "eshell/em-dirs.el" "eshell/em-glob.el" "eshell/em-hist.el" 38091;;;;;; "eshell/em-hist.el" "eshell/em-ls.el" "eshell/em-pred.el"
38099;;;;;; "eshell/em-ls.el" "eshell/em-pred.el" "eshell/em-prompt.el" 38092;;;;;; "eshell/em-prompt.el" "eshell/em-rebind.el" "eshell/em-script.el"
38100;;;;;; "eshell/em-rebind.el" "eshell/em-script.el" "eshell/em-smart.el" 38093;;;;;; "eshell/em-smart.el" "eshell/em-term.el" "eshell/em-tramp.el"
38101;;;;;; "eshell/em-term.el" "eshell/em-tramp.el" "eshell/em-unix.el" 38094;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "facemenu.el" "faces.el"
38102;;;;;; "eshell/em-xtra.el" "eshell/esh-groups.el" "facemenu.el" 38095;;;;;; "files.el" "font-core.el" "font-lock.el" "format.el" "frame.el"
38103;;;;;; "faces.el" "files.el" "font-core.el" "font-lock.el" "format.el" 38096;;;;;; "help.el" "hfy-cmap.el" "htmlfontify-loaddefs.el" "ibuf-ext.el"
38104;;;;;; "frame.el" "help.el" "hfy-cmap.el" "htmlfontify-loaddefs.el" 38097;;;;;; "indent.el" "international/characters.el" "international/charprop.el"
38105;;;;;; "ibuf-ext.el" "ibuffer-loaddefs.el" "indent.el" "international/characters.el" 38098;;;;;; "international/charscript.el" "international/cp51932.el"
38106;;;;;; "international/charprop.el" "international/charscript.el" 38099;;;;;; "international/eucjp-ms.el" "international/mule-cmds.el"
38107;;;;;; "international/cp51932.el" "international/eucjp-ms.el" "international/mule-cmds.el"
38108;;;;;; "international/mule-conf.el" "international/mule.el" "international/uni-bidi.el" 38100;;;;;; "international/mule-conf.el" "international/mule.el" "international/uni-bidi.el"
38109;;;;;; "international/uni-brackets.el" "international/uni-category.el" 38101;;;;;; "international/uni-brackets.el" "international/uni-category.el"
38110;;;;;; "international/uni-combining.el" "international/uni-comment.el" 38102;;;;;; "international/uni-combining.el" "international/uni-comment.el"
@@ -38132,32 +38124,30 @@ Zone out, completely.
38132;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/rfc1345.el" "leim/quail/sgml-input.el" 38124;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/rfc1345.el" "leim/quail/sgml-input.el"
38133;;;;;; "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" "leim/quail/tamil-dvorak.el" 38125;;;;;; "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" "leim/quail/tamil-dvorak.el"
38134;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el" 38126;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el"
38135;;;;;; "loadup.el" "mail/blessmail.el" "mail/rmail-loaddefs.el" 38127;;;;;; "loadup.el" "mail/blessmail.el" "mail/rmailedit.el" "mail/rmailkwd.el"
38136;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el" 38128;;;;;; "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el"
38137;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el" 38129;;;;;; "mail/rmailsum.el" "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el"
38138;;;;;; "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" "mh-e/mh-loaddefs.el" 38130;;;;;; "mh-e/mh-loaddefs.el" "minibuffer.el" "mouse.el" "net/tramp-loaddefs.el"
38139;;;;;; "minibuffer.el" "mouse.el" "net/tramp-loaddefs.el" "newcomment.el" 38131;;;;;; "newcomment.el" "obarray.el" "org/ob-core.el" "org/ob-keys.el"
38140;;;;;; "obarray.el" "org/ob-core.el" "org/ob-keys.el" "org/ob-lob.el" 38132;;;;;; "org/ob-lob.el" "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el"
38141;;;;;; "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" "org/org-archive.el" 38133;;;;;; "org/org-archive.el" "org/org-attach.el" "org/org-bbdb.el"
38142;;;;;; "org/org-attach.el" "org/org-bbdb.el" "org/org-clock.el" 38134;;;;;; "org/org-clock.el" "org/org-datetree.el" "org/org-element.el"
38143;;;;;; "org/org-datetree.el" "org/org-element.el" "org/org-feed.el" 38135;;;;;; "org/org-feed.el" "org/org-footnote.el" "org/org-id.el" "org/org-indent.el"
38144;;;;;; "org/org-footnote.el" "org/org-id.el" "org/org-indent.el" 38136;;;;;; "org/org-install.el" "org/org-irc.el" "org/org-mobile.el"
38145;;;;;; "org/org-install.el" "org/org-irc.el" "org/org-loaddefs.el" 38137;;;;;; "org/org-plot.el" "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el"
38146;;;;;; "org/org-mobile.el" "org/org-plot.el" "org/org-table.el" 38138;;;;;; "org/ox-beamer.el" "org/ox-html.el" "org/ox-icalendar.el"
38147;;;;;; "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" "org/ox-html.el" 38139;;;;;; "org/ox-latex.el" "org/ox-man.el" "org/ox-md.el" "org/ox-odt.el"
38148;;;;;; "org/ox-icalendar.el" "org/ox-latex.el" "org/ox-man.el" "org/ox-md.el" 38140;;;;;; "org/ox-org.el" "org/ox-publish.el" "org/ox-texinfo.el" "org/ox.el"
38149;;;;;; "org/ox-odt.el" "org/ox-org.el" "org/ox-publish.el" "org/ox-texinfo.el" 38141;;;;;; "progmodes/elisp-mode.el" "progmodes/prog-mode.el" "ps-def.el"
38150;;;;;; "org/ox.el" "progmodes/elisp-mode.el" "progmodes/prog-mode.el" 38142;;;;;; "ps-mule.el" "register.el" "replace.el" "rfn-eshadow.el"
38151;;;;;; "ps-def.el" "ps-mule.el" "ps-print-loaddefs.el" "register.el" 38143;;;;;; "select.el" "simple.el" "startup.el" "subdirs.el" "subr.el"
38152;;;;;; "replace.el" "rfn-eshadow.el" "select.el" "simple.el" "startup.el" 38144;;;;;; "textmodes/fill.el" "textmodes/page.el" "textmodes/paragraphs.el"
38153;;;;;; "subdirs.el" "subr.el" "textmodes/fill.el" "textmodes/page.el" 38145;;;;;; "textmodes/reftex-auc.el" "textmodes/reftex-cite.el" "textmodes/reftex-dcr.el"
38154;;;;;; "textmodes/paragraphs.el" "textmodes/reftex-auc.el" "textmodes/reftex-cite.el" 38146;;;;;; "textmodes/reftex-global.el" "textmodes/reftex-index.el"
38155;;;;;; "textmodes/reftex-dcr.el" "textmodes/reftex-global.el" "textmodes/reftex-index.el" 38147;;;;;; "textmodes/reftex-parse.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
38156;;;;;; "textmodes/reftex-loaddefs.el" "textmodes/reftex-parse.el" 38148;;;;;; "textmodes/reftex-toc.el" "textmodes/text-mode.el" "uniquify.el"
38157;;;;;; "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el" 38149;;;;;; "vc/ediff-hook.el" "vc/vc-hooks.el" "version.el" "widget.el"
38158;;;;;; "textmodes/text-mode.el" "uniquify.el" "vc/ediff-hook.el" 38150;;;;;; "window.el") (0 0 0 0))
38159;;;;;; "vc/vc-hooks.el" "version.el" "widget.el" "window.el") (0
38160;;;;;; 0 0 0))
38161 38151
38162;;;*** 38152;;;***
38163 38153
diff --git a/lisp/man.el b/lisp/man.el
index 4f6e1187e0d..0e1c92956b3 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -832,10 +832,7 @@ indicating optional parts and whitespace being interpreted
832somewhat loosely. 832somewhat loosely.
833 833
834foo[, bar [, ...]] [other stuff] (sec) - description 834foo[, bar [, ...]] [other stuff] (sec) - description
835foo(sec)[, bar(sec) [, ...]] [other stuff] - description 835foo(sec)[, bar(sec) [, ...]] [other stuff] - description"
836
837For more details and some regression tests, please see
838test/automated/man-tests.el in the emacs repository."
839 (goto-char (point-min)) 836 (goto-char (point-min))
840 ;; See man-tests for data about which systems use which format (hopefully we 837 ;; See man-tests for data about which systems use which format (hopefully we
841 ;; will be able to simplify the code if/when some of those formats aren't 838 ;; will be able to simplify the code if/when some of those formats aren't
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 6ec647e8028..7472c4133ad 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -933,17 +933,19 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
933 (let ((data (shr-parse-image-data))) 933 (let ((data (shr-parse-image-data)))
934 (with-current-buffer buffer 934 (with-current-buffer buffer
935 (save-excursion 935 (save-excursion
936 (let ((alt (buffer-substring start end)) 936 (save-restriction
937 (properties (text-properties-at start)) 937 (widen)
938 (inhibit-read-only t)) 938 (let ((alt (buffer-substring start end))
939 (delete-region start end) 939 (properties (text-properties-at start))
940 (goto-char start) 940 (inhibit-read-only t))
941 (funcall shr-put-image-function data alt flags) 941 (delete-region start end)
942 (while properties 942 (goto-char start)
943 (let ((type (pop properties)) 943 (funcall shr-put-image-function data alt flags)
944 (value (pop properties))) 944 (while properties
945 (unless (memq type '(display image-size)) 945 (let ((type (pop properties))
946 (put-text-property start (point) type value)))))))))) 946 (value (pop properties)))
947 (unless (memq type '(display image-size))
948 (put-text-property start (point) type value)))))))))))
947 (kill-buffer image-buffer))) 949 (kill-buffer image-buffer)))
948 950
949(defun shr-image-from-data (data) 951(defun shr-image-from-data (data)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index bf89ab37123..240e017279c 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1,4 +1,4 @@
1;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp 1;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2011-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
4 4
@@ -94,9 +94,6 @@ It is used for TCP/IP devices."
94 tramp-adb-method '((tramp-adb-parse-device-names "")))) 94 tramp-adb-method '((tramp-adb-parse-device-names ""))))
95 95
96;;;###tramp-autoload 96;;;###tramp-autoload
97(add-to-list 'tramp-foreign-file-name-handler-alist
98 (cons 'tramp-adb-file-name-p 'tramp-adb-file-name-handler))
99
100(defconst tramp-adb-file-name-handler-alist 97(defconst tramp-adb-file-name-handler-alist
101 '((access-file . ignore) 98 '((access-file . ignore)
102 (add-name-to-file . tramp-adb-handle-copy-file) 99 (add-name-to-file . tramp-adb-handle-copy-file)
@@ -190,6 +187,10 @@ pass to the OPERATION."
190 (tramp-run-real-handler operation args)))) 187 (tramp-run-real-handler operation args))))
191 188
192;;;###tramp-autoload 189;;;###tramp-autoload
190(tramp-register-foreign-file-name-handler
191 'tramp-adb-file-name-p 'tramp-adb-file-name-handler)
192
193;;;###tramp-autoload
193(defun tramp-adb-parse-device-names (_ignore) 194(defun tramp-adb-parse-device-names (_ignore)
194 "Return a list of (nil host) tuples allowed to access." 195 "Return a list of (nil host) tuples allowed to access."
195 (with-timeout (10) 196 (with-timeout (10)
@@ -209,7 +210,7 @@ pass to the OPERATION."
209 (tramp-message v 6 "\n%s" (buffer-string)) 210 (tramp-message v 6 "\n%s" (buffer-string))
210 (goto-char (point-min)) 211 (goto-char (point-min))
211 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) 212 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
212 (add-to-list 'result (list nil (match-string 1)))) 213 (push (list nil (match-string 1)) result))
213 214
214 ;; Replace ":" by "#". 215 ;; Replace ":" by "#".
215 (mapc 216 (mapc
@@ -1060,8 +1061,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1060 ;; unwanted entries first. 1061 ;; unwanted entries first.
1061 (tramp-flush-connection-property nil) 1062 (tramp-flush-connection-property nil)
1062 (with-tramp-connection-property (tramp-get-connection-process vec) "device" 1063 (with-tramp-connection-property (tramp-get-connection-process vec) "device"
1063 (let* ((method (tramp-file-name-method vec)) 1064 (let* ((host (tramp-file-name-host vec))
1064 (host (tramp-file-name-host vec))
1065 (port (tramp-file-name-port vec)) 1065 (port (tramp-file-name-port vec))
1066 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) 1066 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
1067 (replace-regexp-in-string 1067 (replace-regexp-in-string
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index ce7df02e094..64268cfc25a 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -1,4 +1,4 @@
1;;; tramp-cache.el --- file information caching for Tramp 1;;; tramp-cache.el --- file information caching for Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2000, 2005-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2005-2017 Free Software Foundation, Inc.
4 4
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 576f9b1eadc..c41b5b5659e 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -1,4 +1,4 @@
1;;; tramp-cmds.el --- Interactive commands for Tramp 1;;; tramp-cmds.el --- Interactive commands for Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2007-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
4 4
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 8e5b3e45d13..8f346eb4409 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -1,4 +1,4 @@
1;;; tramp-compat.el --- Tramp compatibility functions 1;;; tramp-compat.el --- Tramp compatibility functions -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2007-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
4 4
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 85e4f2b0f0c..231383fde3d 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -1,4 +1,4 @@
1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP 1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 7725d40f198..59d8771cf1d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1,4 +1,4 @@
1;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon 1;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2009-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2017 Free Software Foundation, Inc.
4 4
@@ -452,6 +452,7 @@ Every entry is a list (NAME ADDRESS).")
452 452
453 453
454;; New handlers should be added here. 454;; New handlers should be added here.
455;;;###tramp-autoload
455(defconst tramp-gvfs-file-name-handler-alist 456(defconst tramp-gvfs-file-name-handler-alist
456 '((access-file . ignore) 457 '((access-file . ignore)
457 (add-name-to-file . tramp-gvfs-handle-copy-file) 458 (add-name-to-file . tramp-gvfs-handle-copy-file)
@@ -548,12 +549,10 @@ pass to the OPERATION."
548 (save-match-data (apply (cdr fn) args)) 549 (save-match-data (apply (cdr fn) args))
549 (tramp-run-real-handler operation args)))) 550 (tramp-run-real-handler operation args))))
550 551
551;; This might be moved to tramp.el. It shall be the first file name
552;; handler.
553;;;###tramp-autoload 552;;;###tramp-autoload
554(when (featurep 'dbusbind) 553(when (featurep 'dbusbind)
555 (add-to-list 'tramp-foreign-file-name-handler-alist 554 (tramp-register-foreign-file-name-handler
556 (cons 'tramp-gvfs-file-name-p 'tramp-gvfs-file-name-handler))) 555 'tramp-gvfs-file-name-p 'tramp-gvfs-file-name-handler))
557 556
558 557
559;; D-Bus helper function. 558;; D-Bus helper function.
@@ -1874,12 +1873,9 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
1874 (lambda (x) 1873 (lambda (x)
1875 (let* ((list (split-string x ";")) 1874 (let* ((list (split-string x ";"))
1876 (host (nth 6 list)) 1875 (host (nth 6 list))
1877 (port (nth 8 list))
1878 (text (tramp-compat-funcall 1876 (text (tramp-compat-funcall
1879 'split-string (nth 9 list) "\" \"" 'omit "\"")) 1877 'split-string (nth 9 list) "\" \"" 'omit "\""))
1880 user) 1878 user)
1881; (when (and port (not (string-equal port "0")))
1882; (setq host (format "%s%s%s" host tramp-prefix-port-regexp port)))
1883 ;; A user is marked in a TXT field like "u=guest". 1879 ;; A user is marked in a TXT field like "u=guest".
1884 (while text 1880 (while text
1885 (when (string-match "u=\\(.+\\)$" (car text)) 1881 (when (string-match "u=\\(.+\\)$" (car text))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index af27d3e28ec..e4a48b7f8e2 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1,4 +1,4 @@
1;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections 1;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -33,6 +33,9 @@
33(eval-when-compile 33(eval-when-compile
34 (require 'cl) 34 (require 'cl)
35 (require 'dired)) 35 (require 'dired))
36
37(declare-function dired-remove-file "dired-aux")
38(defvar dired-compress-file-suffixes)
36(defvar vc-handled-backends) 39(defvar vc-handled-backends)
37(defvar vc-bzr-program) 40(defvar vc-bzr-program)
38(defvar vc-git-program) 41(defvar vc-git-program)
@@ -978,6 +981,7 @@ here-document, otherwise the command could exceed maximum length
978of command line.") 981of command line.")
979 982
980;; New handlers should be added here. 983;; New handlers should be added here.
984;;;###tramp-autoload
981(defconst tramp-sh-file-name-handler-alist 985(defconst tramp-sh-file-name-handler-alist
982 '(;; `access-file' performed by default handler. 986 '(;; `access-file' performed by default handler.
983 (add-name-to-file . tramp-sh-handle-add-name-to-file) 987 (add-name-to-file . tramp-sh-handle-add-name-to-file)
@@ -1051,11 +1055,6 @@ of command line.")
1051 "Alist of handler functions. 1055 "Alist of handler functions.
1052Operations not mentioned here will be handled by the normal Emacs functions.") 1056Operations not mentioned here will be handled by the normal Emacs functions.")
1053 1057
1054;; This must be the last entry, because `identity' always matches.
1055;;;###tramp-autoload
1056(add-to-list 'tramp-foreign-file-name-handler-alist
1057 '(identity . tramp-sh-file-name-handler) 'append)
1058
1059;;; File Name Handler Functions: 1058;;; File Name Handler Functions:
1060 1059
1061(defun tramp-sh-handle-make-symbolic-link 1060(defun tramp-sh-handle-make-symbolic-link
@@ -2593,9 +2592,6 @@ The method used must be an out-of-band method."
2593 2592
2594;; Dired. 2593;; Dired.
2595 2594
2596(defvar dired-compress-file-suffixes)
2597(declare-function dired-remove-file "dired-aux")
2598
2599(defun tramp-sh-handle-dired-compress-file (file) 2595(defun tramp-sh-handle-dired-compress-file (file)
2600 "Like `dired-compress-file' for Tramp files." 2596 "Like `dired-compress-file' for Tramp files."
2601 ;; Code stolen mainly from dired-aux.el. 2597 ;; Code stolen mainly from dired-aux.el.
@@ -3536,6 +3532,11 @@ Fall back to normal file name handler if no Tramp handler exists."
3536 (tramp-run-real-handler operation args))))) 3532 (tramp-run-real-handler operation args)))))
3537 (setq tramp-locked tl)))) 3533 (setq tramp-locked tl))))
3538 3534
3535;; This must be the last entry, because `identity' always matches.
3536;;;###tramp-autoload
3537(tramp-register-foreign-file-name-handler
3538 'identity 'tramp-sh-file-name-handler 'append)
3539
3539(defun tramp-vc-file-name-handler (operation &rest args) 3540(defun tramp-vc-file-name-handler (operation &rest args)
3540 "Invoke special file name handler, which collects files to be handled." 3541 "Invoke special file name handler, which collects files to be handled."
3541 (save-match-data 3542 (save-match-data
@@ -5221,7 +5222,7 @@ Nonexistent directories are removed from spec."
5221 "Determine remote locale, supporting UTF8 if possible." 5222 "Determine remote locale, supporting UTF8 if possible."
5222 (with-tramp-connection-property vec "locale" 5223 (with-tramp-connection-property vec "locale"
5223 (tramp-send-command vec "locale -a") 5224 (tramp-send-command vec "locale -a")
5224 (let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8")) 5225 (let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8" "C.UTF-8"))
5225 locale) 5226 locale)
5226 (with-current-buffer (tramp-get-connection-buffer vec) 5227 (with-current-buffer (tramp-get-connection-buffer vec)
5227 (while candidates 5228 (while candidates
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 91f69567573..4205376d655 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1,4 +1,4 @@
1;;; tramp-smb.el --- Tramp access functions for SMB servers 1;;; tramp-smb.el --- Tramp access functions for SMB servers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
@@ -157,6 +157,7 @@ call, letting the SMB client use the default one."
157 "NT_STATUS_OBJECT_NAME_COLLISION" 157 "NT_STATUS_OBJECT_NAME_COLLISION"
158 "NT_STATUS_OBJECT_NAME_INVALID" 158 "NT_STATUS_OBJECT_NAME_INVALID"
159 "NT_STATUS_OBJECT_NAME_NOT_FOUND" 159 "NT_STATUS_OBJECT_NAME_NOT_FOUND"
160 "NT_STATUS_PASSWORD_MUST_CHANGE"
160 "NT_STATUS_SHARING_VIOLATION" 161 "NT_STATUS_SHARING_VIOLATION"
161 "NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE" 162 "NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE"
162 "NT_STATUS_UNSUCCESSFUL" 163 "NT_STATUS_UNSUCCESSFUL"
@@ -217,6 +218,7 @@ This list is used for smbcacls actions.
217See `tramp-actions-before-shell' for more info.") 218See `tramp-actions-before-shell' for more info.")
218 219
219;; New handlers should be added here. 220;; New handlers should be added here.
221;;;###tramp-autoload
220(defconst tramp-smb-file-name-handler-alist 222(defconst tramp-smb-file-name-handler-alist
221 '(;; `access-file' performed by default handler. 223 '(;; `access-file' performed by default handler.
222 (add-name-to-file . tramp-smb-handle-add-name-to-file) 224 (add-name-to-file . tramp-smb-handle-add-name-to-file)
@@ -340,9 +342,8 @@ pass to the OPERATION."
340 342
341;;;###tramp-autoload 343;;;###tramp-autoload
342(unless (memq system-type '(cygwin windows-nt)) 344(unless (memq system-type '(cygwin windows-nt))
343 (add-to-list 'tramp-foreign-file-name-handler-alist 345 (tramp-register-foreign-file-name-handler
344 (cons 'tramp-smb-file-name-p 'tramp-smb-file-name-handler))) 346 'tramp-smb-file-name-p 'tramp-smb-file-name-handler))
345
346 347
347;; File name primitives. 348;; File name primitives.
348 349
diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el
index 0aa2cc09924..5e5f05da4a8 100644
--- a/lisp/net/tramp-uu.el
+++ b/lisp/net/tramp-uu.el
@@ -1,4 +1,4 @@
1;;; tramp-uu.el --- uuencode in Lisp 1;;; tramp-uu.el --- uuencode in Lisp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fdd4661decb..0ca5a6d3acb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1,4 +1,4 @@
1;;; tramp.el --- Transparent Remote Access, Multiple Protocol 1;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -60,7 +60,10 @@
60;; Pacify byte-compiler. 60;; Pacify byte-compiler.
61(eval-when-compile 61(eval-when-compile
62 (require 'cl)) 62 (require 'cl))
63(defvar auto-save-file-name-transforms)
63(defvar eshell-path-env) 64(defvar eshell-path-env)
65(defvar ls-lisp-use-insert-directory-program)
66(defvar outline-regexp)
64 67
65;;; User Customizable Internal Variables: 68;;; User Customizable Internal Variables:
66 69
@@ -1052,8 +1055,7 @@ means to use always cached values for the directory contents."
1052 1055
1053;;;###autoload 1056;;;###autoload
1054(defconst tramp-completion-file-name-handler-alist 1057(defconst tramp-completion-file-name-handler-alist
1055 '(;(expand-file-name . tramp-completion-handle-expand-file-name) 1058 '((file-name-all-completions
1056 (file-name-all-completions
1057 . tramp-completion-handle-file-name-all-completions) 1059 . tramp-completion-handle-file-name-all-completions)
1058 (file-name-completion . tramp-completion-handle-file-name-completion)) 1060 (file-name-completion . tramp-completion-handle-file-name-completion))
1059 "Alist of completion handler functions. 1061 "Alist of completion handler functions.
@@ -1374,8 +1376,6 @@ Point must be at the beginning of a header line.
1374The outline level is equal to the verbosity of the Tramp message." 1376The outline level is equal to the verbosity of the Tramp message."
1375 (1+ (string-to-number (match-string 1)))) 1377 (1+ (string-to-number (match-string 1))))
1376 1378
1377(defvar outline-regexp)
1378
1379(defun tramp-get-debug-buffer (vec) 1379(defun tramp-get-debug-buffer (vec)
1380 "Get the debug buffer for VEC." 1380 "Get the debug buffer for VEC."
1381 (with-current-buffer 1381 (with-current-buffer
@@ -1871,13 +1871,12 @@ temporary file names. If `file-coding-system-alist' contains an
1871expression, which matches more than the file name suffix, the 1871expression, which matches more than the file name suffix, the
1872coding system might not be determined. This function repairs it." 1872coding system might not be determined. This function repairs it."
1873 (let (result) 1873 (let (result)
1874 (dolist (elt file-coding-system-alist result) 1874 (dolist (elt file-coding-system-alist (nreverse result))
1875 (when (and (consp elt) (string-match (car elt) filename)) 1875 (when (and (consp elt) (string-match (car elt) filename))
1876 ;; We found a matching entry in `file-coding-system-alist'. 1876 ;; We found a matching entry in `file-coding-system-alist'.
1877 ;; So we add a similar entry, but with the temporary file name 1877 ;; So we add a similar entry, but with the temporary file name
1878 ;; as regexp. 1878 ;; as regexp.
1879 (add-to-list 1879 (push (cons (regexp-quote tmpname) (cdr elt)) result)))))
1880 'result (cons (regexp-quote tmpname) (cdr elt)) 'append)))))
1881 1880
1882;;;###autoload 1881;;;###autoload
1883(progn (defun tramp-run-real-handler (operation args) 1882(progn (defun tramp-run-real-handler (operation args)
@@ -1995,6 +1994,7 @@ ARGS are the arguments OPERATION has been called with."
1995 (tramp-compat-condition-case-unless-debug ,var ,bodyform ,@handlers))) 1994 (tramp-compat-condition-case-unless-debug ,var ,bodyform ,@handlers)))
1996 1995
1997;; Main function. 1996;; Main function.
1997;;;###autoload
1998(defun tramp-file-name-handler (operation &rest args) 1998(defun tramp-file-name-handler (operation &rest args)
1999 "Invoke Tramp file name handler. 1999 "Invoke Tramp file name handler.
2000Falls back to normal file name handler if no Tramp file name handler exists." 2000Falls back to normal file name handler if no Tramp file name handler exists."
@@ -2113,20 +2113,7 @@ preventing reentrant calls of Tramp.")
2113Together with `tramp-locked', this implements a locking mechanism 2113Together with `tramp-locked', this implements a locking mechanism
2114preventing reentrant calls of Tramp.") 2114preventing reentrant calls of Tramp.")
2115 2115
2116;; Avoid recursive loading of tramp.el. 2116;;;###autoload
2117;; FIXME: This must go better. Checking for `operation' is wrong.
2118;;;###autoload(defun tramp-completion-file-name-handler (operation &rest args)
2119;;;###autoload (let ((fn
2120;;;###autoload (assoc
2121;;;###autoload operation tramp-completion-file-name-handler-alist)))
2122;;;###autoload (if (and
2123;;;###autoload tramp-mode fn (null load-in-progress)
2124;;;###autoload (member
2125;;;###autoload operation
2126;;;###autoload '(file-name-all-completions file-name-completion)))
2127;;;###autoload (apply 'tramp-autoload-file-name-handler operation args)
2128;;;###autoload (tramp-run-real-handler operation args))))
2129
2130(defun tramp-completion-file-name-handler (operation &rest args) 2117(defun tramp-completion-file-name-handler (operation &rest args)
2131 "Invoke Tramp file name completion handler. 2118 "Invoke Tramp file name completion handler.
2132Falls back to normal file name handler if no Tramp file name handler exists." 2119Falls back to normal file name handler if no Tramp file name handler exists."
@@ -2135,36 +2122,26 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2135 (save-match-data (apply (cdr fn) args)) 2122 (save-match-data (apply (cdr fn) args))
2136 (tramp-run-real-handler operation args)))) 2123 (tramp-run-real-handler operation args))))
2137 2124
2138;;;###autoload 2125;; `tramp-file-name-handler' must be registered before evaluation of
2139(progn (defun tramp-autoload-file-name-handler (operation &rest args) 2126;; site-start and init files, because there might exist remote files
2140 "Load Tramp file name handler, and perform OPERATION." 2127;; already, f.e. files kept via recentf-mode.
2141 (if (and
2142 ;; Do not load tramp.el just for "/".
2143 (not (and (stringp (car args)) (string-equal (car args) "/")))
2144 ;; Avoid recursive loading of tramp.el.
2145 (let ((default-directory temporary-file-directory))
2146 (and (null load-in-progress) (load "tramp" 'noerror 'nomessage))))
2147 (apply operation args)
2148 ;; tramp.el not needed or not available for loading, fall back.
2149 (tramp-run-real-handler operation args))))
2150
2151;; `tramp-autoload-file-name-handler' must be registered before
2152;; evaluation of site-start and init files, because there might exist
2153;; remote files already, f.e. files kept via recentf-mode. We cannot
2154;; autoload `tramp-file-name-handler', because it would result in
2155;; recursive loading of tramp.el when `default-directory' is set to
2156;; remote.
2157;;;###autoload 2128;;;###autoload
2158(progn (defun tramp-register-autoload-file-name-handlers () 2129(progn (defun tramp-register-autoload-file-name-handlers ()
2159 "Add Tramp file name handlers to `file-name-handler-alist' during autoload." 2130 "Add Tramp file name handlers to `file-name-handler-alist' during autoload."
2160 (add-to-list 'file-name-handler-alist 2131 (add-to-list 'file-name-handler-alist
2161 (cons tramp-file-name-regexp 2132 (cons tramp-file-name-regexp 'tramp-file-name-handler))
2162 'tramp-autoload-file-name-handler)) 2133 (put 'tramp-file-name-handler 'safe-magic t)
2163 (put 'tramp-autoload-file-name-handler 'safe-magic t) 2134 ;; Mark `operations' the handler is responsible for. It's a short list ...
2135 (put 'tramp-file-name-handler 'operations
2136 '(file-name-all-completions file-name-completion file-remote-p))
2137
2164 (add-to-list 'file-name-handler-alist 2138 (add-to-list 'file-name-handler-alist
2165 (cons tramp-completion-file-name-regexp 2139 (cons tramp-completion-file-name-regexp
2166 'tramp-completion-file-name-handler)) 2140 'tramp-completion-file-name-handler))
2167 (put 'tramp-completion-file-name-handler 'safe-magic t))) 2141 (put 'tramp-completion-file-name-handler 'safe-magic t)
2142 ;; Mark `operations' the handler is responsible for.
2143 (put 'tramp-completion-file-name-handler 'operations
2144 (mapcar 'car tramp-completion-file-name-handler-alist))))
2168 2145
2169;;;###autoload 2146;;;###autoload
2170(tramp-register-autoload-file-name-handlers) 2147(tramp-register-autoload-file-name-handlers)
@@ -2174,22 +2151,29 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2174 ;; Remove autoloaded handlers from file name handler alist. Useful, 2151 ;; Remove autoloaded handlers from file name handler alist. Useful,
2175 ;; if `tramp-syntax' has been changed. 2152 ;; if `tramp-syntax' has been changed.
2176 (dolist (fnh '(tramp-file-name-handler 2153 (dolist (fnh '(tramp-file-name-handler
2177 tramp-completion-file-name-handler 2154 tramp-completion-file-name-handler))
2178 tramp-autoload-file-name-handler))
2179 (let ((a1 (rassq fnh file-name-handler-alist))) 2155 (let ((a1 (rassq fnh file-name-handler-alist)))
2180 (setq file-name-handler-alist (delq a1 file-name-handler-alist)))) 2156 (setq file-name-handler-alist (delq a1 file-name-handler-alist))))
2157
2181 ;; The initial value of `tramp-file-name-regexp' is too simple 2158 ;; The initial value of `tramp-file-name-regexp' is too simple
2182 ;; minded, but we cannot give it the real value in the autoload 2159 ;; minded, but we cannot give it the real value in the autoload
2183 ;; pattern. See Bug#24889. 2160 ;; pattern. See Bug#24889.
2184 (setq tramp-file-name-regexp (car tramp-file-name-structure)) 2161 (setq tramp-file-name-regexp (car tramp-file-name-structure))
2185 ;; Add the handlers. 2162 ;; Add the handlers. We do not add anything to the `operations'
2163 ;; property of `tramp-file-name-handler', this shall be done by the
2164 ;; respective foreign handlers.
2186 (add-to-list 'file-name-handler-alist 2165 (add-to-list 'file-name-handler-alist
2187 (cons tramp-file-name-regexp 'tramp-file-name-handler)) 2166 (cons tramp-file-name-regexp 'tramp-file-name-handler))
2188 (put 'tramp-file-name-handler 'safe-magic t) 2167 (put 'tramp-file-name-handler 'safe-magic t)
2168
2189 (add-to-list 'file-name-handler-alist 2169 (add-to-list 'file-name-handler-alist
2190 (cons tramp-completion-file-name-regexp 2170 (cons tramp-completion-file-name-regexp
2191 'tramp-completion-file-name-handler)) 2171 'tramp-completion-file-name-handler))
2192 (put 'tramp-completion-file-name-handler 'safe-magic t) 2172 (put 'tramp-completion-file-name-handler 'safe-magic t)
2173 ;; Mark `operations' the handler is responsible for.
2174 (put 'tramp-completion-file-name-handler 'operations
2175 (mapcar 'car tramp-completion-file-name-handler-alist))
2176
2193 ;; If jka-compr or epa-file are already loaded, move them to the 2177 ;; If jka-compr or epa-file are already loaded, move them to the
2194 ;; front of `file-name-handler-alist'. 2178 ;; front of `file-name-handler-alist'.
2195 (dolist (fnh '(epa-file-handler jka-compr-handler)) 2179 (dolist (fnh '(epa-file-handler jka-compr-handler))
@@ -2200,6 +2184,24 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2200 2184
2201(eval-after-load 'tramp (tramp-register-file-name-handlers)) 2185(eval-after-load 'tramp (tramp-register-file-name-handlers))
2202 2186
2187;;;###tramp-autoload
2188(progn (defun tramp-register-foreign-file-name-handler
2189 (func handler &optional append)
2190 "Register (FUNC . HANDLER) in `tramp-foreign-file-name-handler-alist'.
2191FUNC is the function, which determines whether HANDLER is to be called.
2192Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
2193 (add-to-list
2194 'tramp-foreign-file-name-handler-alist `(,func . ,handler) append)
2195 ;; Mark `operations' the handler is responsible for.
2196 (put 'tramp-file-name-handler
2197 'operations
2198 (cl-delete-duplicates
2199 (append
2200 (get 'tramp-file-name-handler 'operations)
2201 (mapcar
2202 'car
2203 (symbol-value (intern (concat (symbol-name handler) "-alist")))))))))
2204
2203(defun tramp-exists-file-name-handler (operation &rest args) 2205(defun tramp-exists-file-name-handler (operation &rest args)
2204 "Check, whether OPERATION runs a file name handler." 2206 "Check, whether OPERATION runs a file name handler."
2205 ;; The file name handler is determined on base of either an 2207 ;; The file name handler is determined on base of either an
@@ -2258,15 +2260,6 @@ not in completion mode."
2258 (tramp-get-connection-process 2260 (tramp-get-connection-process
2259 (tramp-dissect-file-name filename))))))) 2261 (tramp-dissect-file-name filename)))))))
2260 2262
2261(defun tramp-completion-handle-expand-file-name (name &optional dir)
2262 "Like `expand-file-name' for Tramp files."
2263 ;; If DIR is not given, use `default-directory' or "/".
2264 (setq dir (or dir default-directory "/"))
2265 (cond
2266 ((file-name-absolute-p name) name)
2267 ((zerop (length name)) dir)
2268 (t (concat (file-name-as-directory dir) name))))
2269
2270;; Method, host name and user name completion. 2263;; Method, host name and user name completion.
2271;; `tramp-completion-dissect-file-name' returns a list of 2264;; `tramp-completion-dissect-file-name' returns a list of
2272;; tramp-file-name structures. For all of them we return possible completions. 2265;; tramp-file-name structures. For all of them we return possible completions.
@@ -2328,9 +2321,9 @@ not in completion mode."
2328 (when elt 2321 (when elt
2329 (string-match tramp-prefix-regexp elt) 2322 (string-match tramp-prefix-regexp elt)
2330 (setq elt (replace-match (concat tramp-prefix-format hop) nil nil elt)) 2323 (setq elt (replace-match (concat tramp-prefix-format hop) nil nil elt))
2331 (add-to-list 2324 (push
2332 'result1 2325 (substring elt (length (tramp-drop-volume-letter directory)))
2333 (substring elt (length (tramp-drop-volume-letter directory)))))) 2326 result1)))
2334 2327
2335 ;; Complete local parts. 2328 ;; Complete local parts.
2336 (append 2329 (append
@@ -2955,8 +2948,6 @@ User is always nil."
2955 backup-directory-alist))) 2948 backup-directory-alist)))
2956 (tramp-run-real-handler 'find-backup-file-name (list filename))))) 2949 (tramp-run-real-handler 'find-backup-file-name (list filename)))))
2957 2950
2958(defvar ls-lisp-use-insert-directory-program)
2959
2960(defun tramp-handle-insert-directory 2951(defun tramp-handle-insert-directory
2961 (filename switches &optional wildcard full-directory-p) 2952 (filename switches &optional wildcard full-directory-p)
2962 "Like `insert-directory' for Tramp files." 2953 "Like `insert-directory' for Tramp files."
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 35ad2f0acff..35b5eb6728a 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -1,4 +1,4 @@
1;;; trampver.el --- Transparent Remote Access, Multiple Protocol 1;;; trampver.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
2;;; lisp/trampver.el. Generated from trampver.el.in by configure. 2;;; lisp/trampver.el. Generated from trampver.el.in by configure.
3 3
4;; Copyright (C) 2003-2017 Free Software Foundation, Inc. 4;; Copyright (C) 2003-2017 Free Software Foundation, Inc.
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 677946262c5..8f013bb09f2 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -2106,28 +2106,23 @@ for a moment, then straighten yourself up.\n")
2106 (dun-mprincl "That answer is incorrect."))))) 2106 (dun-mprincl "That answer is incorrect.")))))
2107 2107
2108(defun dun-endgame-question () 2108(defun dun-endgame-question ()
2109(if (not dun-endgame-questions) 2109 (let ((questions dun-endgame-questions))
2110 (progn 2110 (if (null questions)
2111 (dun-mprincl "Your question is:") 2111 (progn
2112 (dun-mprincl "No more questions, just do ‘answer foo’.") 2112 (dun-mprincl "Your question is:")
2113 (setq dun-correct-answer '("foo"))) 2113 (dun-mprincl "No more questions, just do ‘answer foo’.")
2114 (let (which i newques) 2114 (setq dun-correct-answer '("foo")))
2115 (setq i 0) 2115 (let* ((which (random (length questions)))
2116 (setq newques nil) 2116 (question (nth which questions)))
2117 (setq which (random (length dun-endgame-questions))) 2117 (dun-mprincl "Your question is:")
2118 (dun-mprincl "Your question is:") 2118 (dun-mprincl (setq dun-endgame-question (car question)))
2119 (dun-mprincl (setq dun-endgame-question (car 2119 (setq dun-correct-answer (cdr question))
2120 (nth which 2120 (let ((i 0) res)
2121 dun-endgame-questions)))) 2121 (dolist (q questions)
2122 (setq dun-correct-answer (cdr (nth which dun-endgame-questions))) 2122 (when (/= i which)
2123 (while (< i which) 2123 (push q res))
2124 (setq newques (append newques (list (nth i dun-endgame-questions)))) 2124 (setq i (1+ i)))
2125 (setq i (1+ i))) 2125 (setq dun-endgame-questions (nreverse res)))))))
2126 (setq i (1+ which))
2127 (while (< i (length dun-endgame-questions))
2128 (setq newques (append newques (list (nth i dun-endgame-questions))))
2129 (setq i (1+ i)))
2130 (setq dun-endgame-questions newques))))
2131 2126
2132(defun dun-power (_args) 2127(defun dun-power (_args)
2133 (if (not (= dun-current-room pc-area)) 2128 (if (not (= dun-current-room pc-area))
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 3fdd56124c4..8dd56106af4 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -94,7 +94,7 @@
94 94
95;;; Variables also used at compile time. 95;;; Variables also used at compile time.
96 96
97(defconst c-version "5.32.99" 97(defconst c-version "5.33"
98 "CC Mode version number.") 98 "CC Mode version number.")
99 99
100(defconst c-version-sym (intern c-version)) 100(defconst c-version-sym (intern c-version))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index bdc77dc5028..de15d1d82fc 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -6243,9 +6243,9 @@ comment at the start of cc-engine.el for more info."
6243 (eq (char-before) ?<)) 6243 (eq (char-before) ?<))
6244 (c-backward-token-2) 6244 (c-backward-token-2)
6245 (when (eq (char-after) ?<) 6245 (when (eq (char-after) ?<)
6246 (c-clear-<-pair-props-if-match-after beg))) 6246 (c-clear-<-pair-props-if-match-after beg)
6247 (setq new-beg (point))))
6247 (c-forward-syntactic-ws) 6248 (c-forward-syntactic-ws)
6248 (setq new-beg (point))
6249 6249
6250 ;; ...Then the ones with < before end and > after end. 6250 ;; ...Then the ones with < before end and > after end.
6251 (goto-char (if end-lit-limits (cdr end-lit-limits) end)) 6251 (goto-char (if end-lit-limits (cdr end-lit-limits) end))
@@ -6254,9 +6254,9 @@ comment at the start of cc-engine.el for more info."
6254 (eq (char-before) ?>)) 6254 (eq (char-before) ?>))
6255 (c-end-of-current-token) 6255 (c-end-of-current-token)
6256 (when (eq (char-before) ?>) 6256 (when (eq (char-before) ?>)
6257 (c-clear->-pair-props-if-match-before end (1- (point))))) 6257 (c-clear->-pair-props-if-match-before end (1- (point)))
6258 (setq new-end (point))))
6258 (c-backward-syntactic-ws) 6259 (c-backward-syntactic-ws)
6259 (setq new-end (point))
6260 6260
6261 ;; Extend the fontification region, if needed. 6261 ;; Extend the fontification region, if needed.
6262 (and new-beg 6262 (and new-beg
@@ -8863,7 +8863,29 @@ comment at the start of cc-engine.el for more info."
8863 ;; it as a declaration if "a" has been used as a type 8863 ;; it as a declaration if "a" has been used as a type
8864 ;; somewhere else (if it's a known type we won't get here). 8864 ;; somewhere else (if it's a known type we won't get here).
8865 (setq maybe-expression t) 8865 (setq maybe-expression t)
8866 (throw 'at-decl-or-cast t))) 8866 (throw 'at-decl-or-cast t))
8867
8868 ;; CASE 17.5
8869 (when (and c-asymmetry-fontification-flag
8870 got-prefix-before-parens
8871 at-type
8872 (or (not got-suffix)
8873 at-decl-start))
8874 (let ((space-before-id
8875 (save-excursion
8876 (goto-char name-start)
8877 (or (bolp) (memq (char-before) '(?\ ?\t)))))
8878 (space-after-type
8879 (save-excursion
8880 (goto-char type-start)
8881 (and (c-forward-type)
8882 (progn (c-backward-syntactic-ws) t)
8883 (or (eolp)
8884 (memq (char-after) '(?\ ?\t)))))))
8885 (when (not (eq (not space-before-id)
8886 (not space-after-type)))
8887 (setq maybe-expression t)
8888 (throw 'at-decl-or-cast t)))))
8867 8889
8868 ;; CASE 18 8890 ;; CASE 18
8869 (when (and (not (memq context '(nil top))) 8891 (when (and (not (memq context '(nil top)))
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index f623b9f3332..923f077b411 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1117,6 +1117,124 @@ casts and declarations are fontified. Used on level 2 and higher."
1117 (setq pos (point)))))) ; acts to make the `while' form continue. 1117 (setq pos (point)))))) ; acts to make the `while' form continue.
1118 nil) 1118 nil)
1119 1119
1120(defun c-get-fontification-context (match-pos not-front-decl &optional toplev)
1121 ;; Return a cons (CONTEXT . RESTRICTED-<>-ARGLISTS) for MATCH-POS.
1122 ;; NOT-FRONT-DECL is non-nil when a declaration later in the buffer than
1123 ;; MATCH-POS has already been parsed. TOPLEV is non-nil when MATCH-POS is
1124 ;; known to be at "top level", i.e. outside any braces, or directly inside a
1125 ;; namespace, class, etc.
1126 ;;
1127 ;; CONTEXT is the fontification context of MATCH-POS, and is one of the
1128 ;; following:
1129 ;; 'decl In a comma-separated declaration context (typically
1130 ;; inside a function declaration arglist).
1131 ;; '<> In an angle bracket arglist.
1132 ;; 'arglist Some other type of arglist.
1133 ;; 'top Some other context and point is at the top-level (either
1134 ;; outside any braces or directly inside a class or namespace,
1135 ;; etc.)
1136 ;; nil Some other context or unknown context. Includes
1137 ;; within the parens of an if, for, ... construct.
1138 ;; 'not-decl Definitely not in a declaration.
1139 ;;
1140 ;; RESTRICTED-<>-ARGLISTS is non-nil when a scan of template/generic
1141 ;; arguments lists (i.e. lists enclosed by <...>) is more strict about what
1142 ;; characters it allows within the list.
1143 (let ((type (and (> match-pos (point-min))
1144 (c-get-char-property (1- match-pos) 'c-type))))
1145 (cond ((not (memq (char-before match-pos) '(?\( ?, ?\[ ?< ?{)))
1146 (cons (and toplev 'top) nil))
1147 ;; A control flow expression or a decltype
1148 ((and (eq (char-before match-pos) ?\()
1149 (save-excursion
1150 (goto-char match-pos)
1151 (backward-char)
1152 (c-backward-token-2)
1153 (or (looking-at c-block-stmt-2-key)
1154 (looking-at c-block-stmt-1-2-key)
1155 (looking-at c-typeof-key))))
1156 (cons nil t))
1157 ;; Near BOB.
1158 ((<= match-pos (point-min))
1159 (cons 'arglist t))
1160 ;; Got a cached hit in a declaration arglist.
1161 ((eq type 'c-decl-arg-start)
1162 (cons 'decl nil))
1163 ;; We're inside (probably) a brace list.
1164 ((eq type 'c-not-decl)
1165 (cons 'not-decl nil))
1166 ;; Inside a C++11 lambda function arglist.
1167 ((and (c-major-mode-is 'c++-mode)
1168 (eq (char-before match-pos) ?\()
1169 (save-excursion
1170 (goto-char match-pos)
1171 (c-backward-token-2)
1172 (and
1173 (c-safe (goto-char (scan-sexps (point) -1)))
1174 (c-looking-at-c++-lambda-capture-list))))
1175 (c-put-char-property (1- match-pos) 'c-type
1176 'c-decl-arg-start)
1177 (cons 'decl nil))
1178 ;; We're inside a brace list.
1179 ((and (eq (char-before match-pos) ?{)
1180 (save-excursion
1181 (goto-char (1- match-pos))
1182 (consp
1183 (c-looking-at-or-maybe-in-bracelist))))
1184 (c-put-char-property (1- match-pos) 'c-type
1185 'c-not-decl)
1186 (cons 'not-decl nil))
1187 ;; We're inside an "ordinary" open brace.
1188 ((eq (char-before match-pos) ?{)
1189 (cons (and toplev 'top) nil))
1190 ;; Inside an angle bracket arglist.
1191 ((or (eq type 'c-<>-arg-sep)
1192 (eq (char-before match-pos) ?<))
1193 (cons '<> nil))
1194 ;; Got a cached hit in some other type of arglist.
1195 (type
1196 (cons 'arglist t))
1197 (not-front-decl
1198 ;; The point is within the range of a previously
1199 ;; encountered type decl expression, so the arglist
1200 ;; is probably one that contains declarations.
1201 ;; However, if `c-recognize-paren-inits' is set it
1202 ;; might also be an initializer arglist.
1203 ;;
1204 ;; The result of this check is cached with a char
1205 ;; property on the match token, so that we can look
1206 ;; it up again when refontifying single lines in a
1207 ;; multiline declaration.
1208 (c-put-char-property (1- match-pos)
1209 'c-type 'c-decl-arg-start)
1210 (cons 'decl nil))
1211 ;; Got an open paren preceded by an arith operator.
1212 ((and (eq (char-before match-pos) ?\()
1213 (save-excursion
1214 (and (zerop (c-backward-token-2 2))
1215 (looking-at c-arithmetic-op-regexp))))
1216 (cons nil nil))
1217 ;; At start of a declaration inside a declaration paren.
1218 ((save-excursion
1219 (and (memq (char-before match-pos) '(?\( ?\,))
1220 (c-go-up-list-backward match-pos)
1221 (eq (char-after) ?\()
1222 (let ((type (c-get-char-property (point) 'c-type)))
1223 (or (memq type '(c-decl-arg-start c-decl-type-start))
1224 (and
1225 (progn (c-backward-syntactic-ws) t)
1226 (c-back-over-compound-identifier)
1227 (progn
1228 (c-backward-syntactic-ws)
1229 (or (bobp)
1230 (progn
1231 (setq type (c-get-char-property (1- (point))
1232 'c-type))
1233 (memq type '(c-decl-arg-start
1234 c-decl-type-start))))))))))
1235 (cons 'decl nil))
1236 (t (cons 'arglist t)))))
1237
1120(defun c-font-lock-declarations (limit) 1238(defun c-font-lock-declarations (limit)
1121 ;; Fontify all the declarations, casts and labels from the point to LIMIT. 1239 ;; Fontify all the declarations, casts and labels from the point to LIMIT.
1122 ;; Assumes that strings and comments have been fontified already. 1240 ;; Assumes that strings and comments have been fontified already.
@@ -1231,95 +1349,15 @@ casts and declarations are fontified. Used on level 2 and higher."
1231 ;; "<" for the sake of C++-style template arglists. 1349 ;; "<" for the sake of C++-style template arglists.
1232 ;; Ignore "(" when it's part of a control flow construct 1350 ;; Ignore "(" when it's part of a control flow construct
1233 ;; (e.g. "for ("). 1351 ;; (e.g. "for (").
1234 (let ((type (and (> match-pos (point-min)) 1352 (let ((got-context
1235 (c-get-char-property (1- match-pos) 'c-type)))) 1353 (c-get-fontification-context
1236 (cond ((not (memq (char-before match-pos) '(?\( ?, ?\[ ?< ?{))) 1354 match-pos
1237 (setq context (and toplev 'top) 1355 (< match-pos (if inside-macro
1238 c-restricted-<>-arglists nil)) 1356 max-type-decl-end-before-token
1239 ;; A control flow expression or a decltype 1357 max-type-decl-end))
1240 ((and (eq (char-before match-pos) ?\() 1358 toplev)))
1241 (save-excursion 1359 (setq context (car got-context)
1242 (goto-char match-pos) 1360 c-restricted-<>-arglists (cdr got-context)))
1243 (backward-char)
1244 (c-backward-token-2)
1245 (or (looking-at c-block-stmt-2-key)
1246 (looking-at c-block-stmt-1-2-key)
1247 (looking-at c-typeof-key))))
1248 (setq context nil
1249 c-restricted-<>-arglists t))
1250 ;; Near BOB.
1251 ((<= match-pos (point-min))
1252 (setq context 'arglist
1253 c-restricted-<>-arglists t))
1254 ;; Got a cached hit in a declaration arglist.
1255 ((eq type 'c-decl-arg-start)
1256 (setq context 'decl
1257 c-restricted-<>-arglists nil))
1258 ;; We're inside (probably) a brace list.
1259 ((eq type 'c-not-decl)
1260 (setq context 'not-decl
1261 c-restricted-<>-arglists nil))
1262 ;; Inside a C++11 lambda function arglist.
1263 ((and (c-major-mode-is 'c++-mode)
1264 (eq (char-before match-pos) ?\()
1265 (save-excursion
1266 (goto-char match-pos)
1267 (c-backward-token-2)
1268 (and
1269 (c-safe (goto-char (scan-sexps (point) -1)))
1270 (c-looking-at-c++-lambda-capture-list))))
1271 (setq context 'decl
1272 c-restricted-<>-arglists nil)
1273 (c-put-char-property (1- match-pos) 'c-type
1274 'c-decl-arg-start))
1275 ;; We're inside a brace list.
1276 ((and (eq (char-before match-pos) ?{)
1277 (save-excursion
1278 (goto-char (1- match-pos))
1279 (consp
1280 (c-looking-at-or-maybe-in-bracelist))))
1281 (setq context 'not-decl
1282 c-restricted-<>-arglists nil)
1283 (c-put-char-property (1- match-pos) 'c-type
1284 'c-not-decl))
1285 ;; We're inside an "ordinary" open brace.
1286 ((eq (char-before match-pos) ?{)
1287 (setq context (and toplev 'top)
1288 c-restricted-<>-arglists nil))
1289 ;; Inside an angle bracket arglist.
1290 ((or (eq type 'c-<>-arg-sep)
1291 (eq (char-before match-pos) ?<))
1292 (setq context '<>
1293 c-restricted-<>-arglists nil))
1294 ;; Got a cached hit in some other type of arglist.
1295 (type
1296 (setq context 'arglist
1297 c-restricted-<>-arglists t))
1298 ((if inside-macro
1299 (< match-pos max-type-decl-end-before-token)
1300 (< match-pos max-type-decl-end))
1301 ;; The point is within the range of a previously
1302 ;; encountered type decl expression, so the arglist
1303 ;; is probably one that contains declarations.
1304 ;; However, if `c-recognize-paren-inits' is set it
1305 ;; might also be an initializer arglist.
1306 (setq context 'decl
1307 c-restricted-<>-arglists nil)
1308 ;; The result of this check is cached with a char
1309 ;; property on the match token, so that we can look
1310 ;; it up again when refontifying single lines in a
1311 ;; multiline declaration.
1312 (c-put-char-property (1- match-pos)
1313 'c-type 'c-decl-arg-start))
1314 ;; Got an open paren preceded by an arith operator.
1315 ((and (eq (char-before match-pos) ?\()
1316 (save-excursion
1317 (and (zerop (c-backward-token-2 2))
1318 (looking-at c-arithmetic-op-regexp))))
1319 (setq context nil
1320 c-restricted-<>-arglists nil))
1321 (t (setq context 'arglist
1322 c-restricted-<>-arglists t))))
1323 1361
1324 ;; Check we haven't missed a preceding "typedef". 1362 ;; Check we haven't missed a preceding "typedef".
1325 (when (not (looking-at c-typedef-key)) 1363 (when (not (looking-at c-typedef-key))
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 8326e6a6f29..20c63d4dbe2 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1363,6 +1363,7 @@ Note that the style variables are always made local to the buffer."
1363 ;; This function is called indirectly from font locking stuff - either from 1363 ;; This function is called indirectly from font locking stuff - either from
1364 ;; c-after-change (to prepare for after-change font-locking) or from font 1364 ;; c-after-change (to prepare for after-change font-locking) or from font
1365 ;; lock context (etc.) fontification. 1365 ;; lock context (etc.) fontification.
1366 (goto-char pos)
1366 (let ((lit-start (c-literal-start)) 1367 (let ((lit-start (c-literal-start))
1367 (new-pos pos) 1368 (new-pos pos)
1368 capture-opener 1369 capture-opener
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 1114b21381d..ccd4fd29940 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1634,6 +1634,18 @@ names)."))
1634 :type 'c-extra-types-widget 1634 :type 'c-extra-types-widget
1635 :group 'c) 1635 :group 'c)
1636 1636
1637(defcustom c-asymmetry-fontification-flag t
1638 "Whether to fontify certain ambiguous constructs by white space asymmetry.
1639
1640In the fontification engine, it is sometimes impossible to determine
1641whether a construct is a declaration or an expression. This happens
1642particularly in C++, due to ambiguities in the language. When such a
1643construct is like \"foo * bar\" or \"foo &bar\", and this variable is non-nil
1644(the default), the construct will be fontified as a declaration if there is
1645white space either before or after the operator, but not both."
1646 :type 'boolean
1647 :group 'c)
1648
1637(defvar c-noise-macro-with-parens-name-re "\\<\\>") 1649(defvar c-noise-macro-with-parens-name-re "\\<\\>")
1638(defvar c-noise-macro-name-re "\\<\\>") 1650(defvar c-noise-macro-name-re "\\<\\>")
1639 1651
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index aed42a85076..3c720c05610 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1713,7 +1713,7 @@ This performs fontification according to `js--class-styles'."
1713 (not (any ?\] ?\\)) 1713 (not (any ?\] ?\\))
1714 (and "\\" not-newline))) 1714 (and "\\" not-newline)))
1715 "]"))) 1715 "]")))
1716 (group "/")) 1716 (group (zero-or-one "/")))
1717 "Regular expression matching a JavaScript regexp literal.") 1717 "Regular expression matching a JavaScript regexp literal.")
1718 1718
1719(defun js-syntax-propertize-regexp (end) 1719(defun js-syntax-propertize-regexp (end)
@@ -1721,12 +1721,13 @@ This performs fontification according to `js--class-styles'."
1721 (when (eq (nth 3 ppss) ?/) 1721 (when (eq (nth 3 ppss) ?/)
1722 ;; A /.../ regexp. 1722 ;; A /.../ regexp.
1723 (goto-char (nth 8 ppss)) 1723 (goto-char (nth 8 ppss))
1724 (when (and (looking-at js--syntax-propertize-regexp-regexp) 1724 (when (looking-at js--syntax-propertize-regexp-regexp)
1725 ;; Don't touch text after END. 1725 ;; Don't touch text after END.
1726 (<= (match-end 1) end)) 1726 (when (> end (match-end 1))
1727 (put-text-property (match-beginning 1) (match-end 1) 1727 (setq end (match-end 1)))
1728 (put-text-property (match-beginning 1) end
1728 'syntax-table (string-to-syntax "\"/")) 1729 'syntax-table (string-to-syntax "\"/"))
1729 (goto-char (match-end 0)))))) 1730 (goto-char end)))))
1730 1731
1731(defun js-syntax-propertize (start end) 1732(defun js-syntax-propertize (start end)
1732 ;; JavaScript allows immediate regular expression objects, written /.../. 1733 ;; JavaScript allows immediate regular expression objects, written /.../.
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index a516f07e72f..b75f32ee200 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -255,9 +255,11 @@
255 ;; format statements 255 ;; format statements
256 ("^[ \t]*format.*=[ \t]*\\(\n\\)" 256 ("^[ \t]*format.*=[ \t]*\\(\n\\)"
257 (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) 257 (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end))))
258 ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. 258 ;; Propertize perl prototype chars `$%&*;+@\[]' as punctuation
259 ;; Be careful not to match "sub { (...) ... }". 259 ;; in `sub' arg-specs like `sub myfun ($)' and `sub ($)'. But
260 ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))" 260 ;; don't match subroutine signatures like `sub add ($a, $b)', or
261 ;; anonymous subs like "sub { (...) ... }".
262 ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;+@\\]+\\))"
261 (1 ".")) 263 (1 "."))
262 ;; Turn __DATA__ trailer into a comment. 264 ;; Turn __DATA__ trailer into a comment.
263 ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)" 265 ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 228a4484616..2697f1a3107 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1491,10 +1491,18 @@ Optional argument NOEND is internal and makes the logic to not
1491jump to the end of line when moving forward searching for the end 1491jump to the end of line when moving forward searching for the end
1492of the statement." 1492of the statement."
1493 (interactive "^") 1493 (interactive "^")
1494 (let (string-start bs-pos) 1494 (let (string-start bs-pos (last-string-end 0))
1495 (while (and (or noend (goto-char (line-end-position))) 1495 (while (and (or noend (goto-char (line-end-position)))
1496 (not (eobp)) 1496 (not (eobp))
1497 (cond ((setq string-start (python-syntax-context 'string)) 1497 (cond ((setq string-start (python-syntax-context 'string))
1498 ;; The assertion can only fail if syntax table
1499 ;; text properties and the `syntax-ppss' cache
1500 ;; are somehow out of whack. This has been
1501 ;; observed when using `syntax-ppss' during
1502 ;; narrowing.
1503 (cl-assert (> string-start last-string-end)
1504 :show-args
1505 "Overlapping strings detected")
1498 (goto-char string-start) 1506 (goto-char string-start)
1499 (if (python-syntax-context 'paren) 1507 (if (python-syntax-context 'paren)
1500 ;; Ended up inside a paren, roll again. 1508 ;; Ended up inside a paren, roll again.
@@ -1504,8 +1512,10 @@ of the statement."
1504 (goto-char (+ (point) 1512 (goto-char (+ (point)
1505 (python-syntax-count-quotes 1513 (python-syntax-count-quotes
1506 (char-after (point)) (point)))) 1514 (char-after (point)) (point))))
1507 (or (re-search-forward (rx (syntax string-delimiter)) nil t) 1515 (setq last-string-end
1508 (goto-char (point-max))))) 1516 (or (re-search-forward
1517 (rx (syntax string-delimiter)) nil t)
1518 (goto-char (point-max))))))
1509 ((python-syntax-context 'paren) 1519 ((python-syntax-context 'paren)
1510 ;; The statement won't end before we've escaped 1520 ;; The statement won't end before we've escaped
1511 ;; at least one level of parenthesis. 1521 ;; at least one level of parenthesis.
diff --git a/lisp/replace.el b/lisp/replace.el
index 0841ba11b8b..a7b8ae6a347 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -848,7 +848,6 @@ called interactively by passing a non-nil INTERACTIVE argument.
848This function starts looking for the next match from the end of 848This function starts looking for the next match from the end of
849the previous match. Hence, it ignores matches that overlap 849the previous match. Hence, it ignores matches that overlap
850a previously found match." 850a previously found match."
851
852 (interactive 851 (interactive
853 (progn 852 (progn
854 (barf-if-buffer-read-only) 853 (barf-if-buffer-read-only)
@@ -923,7 +922,6 @@ a non-nil INTERACTIVE argument.
923If a match is split across lines, all the lines it lies in are deleted. 922If a match is split across lines, all the lines it lies in are deleted.
924They are deleted _before_ looking for the next match. Hence, a match 923They are deleted _before_ looking for the next match. Hence, a match
925starting on the same line at which another match ended is ignored." 924starting on the same line at which another match ended is ignored."
926
927 (interactive 925 (interactive
928 (progn 926 (progn
929 (barf-if-buffer-read-only) 927 (barf-if-buffer-read-only)
@@ -971,7 +969,6 @@ end of (the accessible portion of) the buffer.
971This function starts looking for the next match from the end of 969This function starts looking for the next match from the end of
972the previous match. Hence, it ignores matches that overlap 970the previous match. Hence, it ignores matches that overlap
973a previously found match." 971a previously found match."
974
975 (interactive 972 (interactive
976 (keep-lines-read-args "How many matches for regexp")) 973 (keep-lines-read-args "How many matches for regexp"))
977 (save-excursion 974 (save-excursion
diff --git a/lisp/ses.el b/lisp/ses.el
index 76d4ca577d7..66fc0c5ebdf 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -1,4 +1,3 @@
1
2;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- 1;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*-
3 2
4;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
@@ -2273,15 +2272,19 @@ print area if NONARROW is nil."
2273;; (defvar maxrow) 2272;; (defvar maxrow)
2274;; (defvar maxcol) 2273;; (defvar maxcol)
2275 2274
2276(defun ses-recalculate-cell () 2275(defun ses-recalculate-cell (&optional ses--curcell)
2277 "Recalculate and reprint the current cell or range. 2276 "Recalculate and reprint the current cell or range.
2278 2277
2278If SES--CURCELL is non nil use it as current cell or range
2279without any check, otherwise function (ses-check-curcell 'range)
2280is called.
2281
2279For an individual cell, shows the error if the formula or printer 2282For an individual cell, shows the error if the formula or printer
2280signals one, or otherwise shows the cell's complete value. For a range, the 2283signals one, or otherwise shows the cell's complete value. For a range, the
2281cells are recalculated in \"natural\" order, so cells that other cells refer 2284cells are recalculated in \"natural\" order, so cells that other cells refer
2282to are recalculated first." 2285to are recalculated first."
2283 (interactive "*") 2286 (interactive "*")
2284 (ses-check-curcell 'range) 2287 (or ses--curcell (ses-check-curcell 'range))
2285 (ses-begin-change) 2288 (ses-begin-change)
2286 (ses-initialize-Dijkstra-attempt) 2289 (ses-initialize-Dijkstra-attempt)
2287 (let (sig cur-rowcol) 2290 (let (sig cur-rowcol)
@@ -2334,7 +2337,7 @@ to are recalculated first."
2334 (let ((startcell (ses--cell-at-pos (point))) 2337 (let ((startcell (ses--cell-at-pos (point)))
2335 (ses--curcell (cons 'A1 (ses-cell-symbol (1- ses--numrows) 2338 (ses--curcell (cons 'A1 (ses-cell-symbol (1- ses--numrows)
2336 (1- ses--numcols))))) 2339 (1- ses--numcols)))))
2337 (ses-recalculate-cell) 2340 (ses-recalculate-cell ses--curcell)
2338 (ses-jump-safe startcell))) 2341 (ses-jump-safe startcell)))
2339 2342
2340(defun ses-truncate-cell () 2343(defun ses-truncate-cell ()
diff --git a/lisp/shell.el b/lisp/shell.el
index c8a8555d632..55a053295fa 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -711,36 +711,43 @@ Otherwise, one argument `-i' is passed to the shell.
711 ;; If the current buffer is a dead shell buffer, use it. 711 ;; If the current buffer is a dead shell buffer, use it.
712 (current-buffer))) 712 (current-buffer)))
713 713
714 ;; On remote hosts, the local `shell-file-name' might be useless. 714 (with-current-buffer buffer
715 (if (and (called-interactively-p 'any) 715 (when (file-remote-p default-directory)
716 (file-remote-p default-directory) 716 ;; Apply connection-local variables.
717 (null explicit-shell-file-name) 717 (hack-connection-local-variables-apply
718 (null (getenv "ESHELL"))) 718 `(:application 'tramp
719 (with-current-buffer buffer 719 :protocol ,(file-remote-p default-directory 'method)
720 (set (make-local-variable 'explicit-shell-file-name) 720 :user ,(file-remote-p default-directory 'user)
721 (expand-file-name 721 :machine ,(file-remote-p default-directory 'host)))
722 (file-local-name 722
723 (read-file-name 723 ;; On remote hosts, the local `shell-file-name' might be useless.
724 "Remote shell path: " default-directory shell-file-name 724 (if (and (called-interactively-p 'any)
725 t shell-file-name)))))) 725 (null explicit-shell-file-name)
726 726 (null (getenv "ESHELL")))
727 ;; The buffer's window must be correctly set when we call comint (so 727 (set (make-local-variable 'explicit-shell-file-name)
728 ;; that comint sets the COLUMNS env var properly). 728 (expand-file-name
729 (pop-to-buffer buffer) 729 (file-local-name
730 (unless (comint-check-proc buffer) 730 (read-file-name
731 (let* ((prog (or explicit-shell-file-name 731 "Remote shell path: " default-directory shell-file-name
732 (getenv "ESHELL") shell-file-name)) 732 t shell-file-name))))))
733 (name (file-name-nondirectory prog)) 733
734 (startfile (concat "~/.emacs_" name)) 734 ;; The buffer's window must be correctly set when we call comint
735 (xargs-name (intern-soft (concat "explicit-" name "-args")))) 735 ;; (so that comint sets the COLUMNS env var properly).
736 (unless (file-exists-p startfile) 736 (pop-to-buffer buffer)
737 (setq startfile (concat user-emacs-directory "init_" name ".sh"))) 737 (unless (comint-check-proc buffer)
738 (apply 'make-comint-in-buffer "shell" buffer prog 738 (let* ((prog (or explicit-shell-file-name
739 (if (file-exists-p startfile) startfile) 739 (getenv "ESHELL") shell-file-name))
740 (if (and xargs-name (boundp xargs-name)) 740 (name (file-name-nondirectory prog))
741 (symbol-value xargs-name) 741 (startfile (concat "~/.emacs_" name))
742 '("-i"))) 742 (xargs-name (intern-soft (concat "explicit-" name "-args"))))
743 (shell-mode))) 743 (unless (file-exists-p startfile)
744 (setq startfile (concat user-emacs-directory "init_" name ".sh")))
745 (apply 'make-comint-in-buffer "shell" buffer prog
746 (if (file-exists-p startfile) startfile)
747 (if (and xargs-name (boundp xargs-name))
748 (symbol-value xargs-name)
749 '("-i")))
750 (shell-mode))))
744 buffer) 751 buffer)
745 752
746;;; Directory tracking 753;;; Directory tracking
diff --git a/lisp/simple.el b/lisp/simple.el
index 369fbf71923..48c1a9b15d6 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -833,7 +833,7 @@ Leave one space or none, according to the context."
833 (interactive "*") 833 (interactive "*")
834 (save-excursion 834 (save-excursion
835 (delete-horizontal-space) 835 (delete-horizontal-space)
836 (if (or (looking-at "^\\|\\s)") 836 (if (or (looking-at "^\\|$\\|\\s)")
837 (save-excursion (forward-char -1) 837 (save-excursion (forward-char -1)
838 (looking-at "$\\|\\s(\\|\\s'"))) 838 (looking-at "$\\|\\s(\\|\\s'")))
839 nil 839 nil
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 91ebbf6f940..b1feca7ca6b 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -43,11 +43,13 @@
43 :group 'languages) 43 :group 'languages)
44 44
45(defconst css-pseudo-class-ids 45(defconst css-pseudo-class-ids
46 '("active" "checked" "disabled" "empty" "enabled" "first" 46 '("active" "checked" "default" "disabled" "empty" "enabled" "first"
47 "first-child" "first-of-type" "focus" "hover" "indeterminate" "lang" 47 "first-child" "first-of-type" "focus" "focus-within" "hover"
48 "last-child" "last-of-type" "left" "link" "not" "nth-child" 48 "in-range" "indeterminate" "invalid" "lang" "last-child"
49 "nth-last-child" "nth-last-of-type" "nth-of-type" "only-child" 49 "last-of-type" "left" "link" "not" "nth-child" "nth-last-child"
50 "only-of-type" "right" "root" "target" "visited") 50 "nth-last-of-type" "nth-of-type" "only-child" "only-of-type"
51 "optional" "out-of-range" "read-only" "read-write" "required"
52 "right" "root" "scope" "target" "valid" "visited")
51 "Identifiers for pseudo-classes.") 53 "Identifiers for pseudo-classes.")
52 54
53(defconst css-pseudo-element-ids 55(defconst css-pseudo-element-ids
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 9747bd6cc12..db733fe661b 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1094,10 +1094,10 @@ in the list must have an affix file where Hunspell affix files are kept."
1094 1094
1095(defun ispell-find-hunspell-dictionaries () 1095(defun ispell-find-hunspell-dictionaries ()
1096 "Look for installed Hunspell dictionaries. 1096 "Look for installed Hunspell dictionaries.
1097Will initialize `ispell-hunspell-dictionary-alist' and 1097Will initialize `ispell-hunspell-dictionary-alist' according
1098`ispell-hunspell-dictionary-alist' after values found 1098to dictionaries found, and will remove aliases from the list
1099and remove `ispell-dicts-name2locale-equivs-alist' 1099in `ispell-dicts-name2locale-equivs-alist' if an explicit
1100entries if a specific dictionary was found." 1100dictionary from that list was found."
1101 (let ((hunspell-found-dicts 1101 (let ((hunspell-found-dicts
1102 (split-string 1102 (split-string
1103 (with-temp-buffer 1103 (with-temp-buffer
@@ -1110,18 +1110,27 @@ entries if a specific dictionary was found."
1110 "[\n\r]+" 1110 "[\n\r]+"
1111 t)) 1111 t))
1112 hunspell-default-dict 1112 hunspell-default-dict
1113 hunspell-default-dict-entry) 1113 hunspell-default-dict-entry
1114 hunspell-multi-dict)
1114 (dolist (dict hunspell-found-dicts) 1115 (dolist (dict hunspell-found-dicts)
1115 (let* ((full-name (file-name-nondirectory dict)) 1116 (let* ((full-name (file-name-nondirectory dict))
1116 (basename (file-name-sans-extension full-name)) 1117 (basename (file-name-sans-extension full-name))
1117 (affix-file (concat dict ".aff"))) 1118 (affix-file (concat dict ".aff")))
1118 (if (string-match "\\.aff$" dict) 1119 (if (string-match "\\.aff$" dict)
1119 ;; Found default dictionary 1120 ;; Found default dictionary
1120 (if hunspell-default-dict 1121 (progn
1121 (error "ispell-fhd: Default dict already defined as %s. Not using %s.\n" 1122 (if hunspell-default-dict
1122 hunspell-default-dict dict) 1123 (setq hunspell-multi-dict
1123 (setq affix-file dict) 1124 (concat (or hunspell-multi-dict
1124 (setq hunspell-default-dict (list basename affix-file))) 1125 (car hunspell-default-dict))
1126 "," basename))
1127 (setq affix-file dict)
1128 ;; FIXME: The cdr of the list we cons below is never
1129 ;; used. Why do we need a list?
1130 (setq hunspell-default-dict (list basename affix-file)))
1131 (ispell-print-if-debug
1132 "++ ispell-fhd: default dict-entry:%s name:%s basename:%s\n"
1133 dict full-name basename))
1125 (if (and (not (assoc basename ispell-hunspell-dict-paths-alist)) 1134 (if (and (not (assoc basename ispell-hunspell-dict-paths-alist))
1126 (file-exists-p affix-file)) 1135 (file-exists-p affix-file))
1127 ;; Entry has an associated .aff file and no previous value. 1136 ;; Entry has an associated .aff file and no previous value.
@@ -1161,7 +1170,8 @@ entries if a specific dictionary was found."
1161 (cl-pushnew (list dict-equiv-key affix-file) 1170 (cl-pushnew (list dict-equiv-key affix-file)
1162 ispell-hunspell-dict-paths-alist :test #'equal))))) 1171 ispell-hunspell-dict-paths-alist :test #'equal)))))
1163 ;; Parse and set values for default dictionary. 1172 ;; Parse and set values for default dictionary.
1164 (setq hunspell-default-dict (car hunspell-default-dict)) 1173 (setq hunspell-default-dict (or hunspell-multi-dict
1174 (car hunspell-default-dict)))
1165 (setq hunspell-default-dict-entry 1175 (setq hunspell-default-dict-entry
1166 (ispell-parse-hunspell-affix-file hunspell-default-dict)) 1176 (ispell-parse-hunspell-affix-file hunspell-default-dict))
1167 ;; Create an alist of found dicts with only names, except for default dict. 1177 ;; Create an alist of found dicts with only names, except for default dict.
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index 7b6cdd53790..2885d4e12e2 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -131,8 +131,8 @@ instead of the filename inheritance method."
131;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 131;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
132;;; Digest authorization code 132;;; Digest authorization code
133;;; ------------------------ 133;;; ------------------------
134;;; This implements the DIGEST authorization type. See the internet draft 134;;; This implements the DIGEST authorization type. See RFC 2617
135;;; ftp://ds.internic.net/internet-drafts/draft-ietf-http-digest-aa-01.txt 135;;; https://www.ietf.org/rfc/rfc2617.txt
136;;; for the complete documentation on this type. 136;;; for the complete documentation on this type.
137;;; 137;;;
138;;; This is very secure 138;;; This is very secure
@@ -143,107 +143,306 @@ Its value is an assoc list of assoc lists. The first assoc list is
143keyed by the server name. The cdr of this is an assoc list based 143keyed by the server name. The cdr of this is an assoc list based
144on the \"directory\" specified by the url we are looking up.") 144on the \"directory\" specified by the url we are looking up.")
145 145
146(defsubst url-digest-auth-colonjoin (&rest args)
147 "Concatenate ARGS as strings with colon as a separator."
148 (mapconcat 'identity args ":"))
149
150(defsubst url-digest-auth-kd (data secret)
151 "Apply digest algorithm to DATA using SECRET and return the result."
152 (md5 (url-digest-auth-colonjoin secret data)))
153
154(defsubst url-digest-auth-make-ha1 (user realm password)
155 "Compute checksum out of strings USER, REALM, and PASSWORD."
156 (md5 (url-digest-auth-colonjoin user realm password)))
157
158(defsubst url-digest-auth-make-ha2 (method digest-uri)
159 "Compute checksum out of strings METHOD and DIGEST-URI."
160 (md5 (url-digest-auth-colonjoin method digest-uri)))
161
162(defsubst url-digest-auth-make-request-digest (ha1 ha2 nonce)
163 "Construct the request-digest from hash strings HA1, HA2, and NONCE.
164This is the value that server receives as a proof that user knows
165a password."
166 (url-digest-auth-kd (url-digest-auth-colonjoin nonce ha2) ha1))
167
168(defsubst url-digest-auth-make-request-digest-qop (qop ha1 ha2 nonce nc cnonce)
169 "Construct the request-digest with qop.
170QOP describes the \"quality of protection\" and algorithm to use.
171All of the strings QOP, HA1, HA2, NONCE, NC, and CNONCE are
172combined into a single hash value that proves to a server the
173user knows a password. It's worth noting that HA2 already
174depends on value of QOP."
175 (url-digest-auth-kd (url-digest-auth-colonjoin
176 nonce nc cnonce qop ha2) ha1))
177
178(defsubst url-digest-auth-directory-id (url realm)
179 "Make an identifier for selecting a key in key cache.
180The identifier is made either from URL or REALM. It represents a
181protection space within a server so that one server can have
182multiple authorizations."
183 (or realm (or (url-file-directory (url-filename url)) "/")))
184
185(defsubst url-digest-auth-server-id (url)
186 "Make an identifier for selecting a server in key cache.
187The identifier is made from URL's host and port. Together with
188`url-digest-auth-directory-id' these identify a single key in the
189key cache `url-digest-auth-storage'."
190 (format "%s:%d" (url-host url) (url-port url)))
191
192(defun url-digest-auth-make-cnonce ()
193 "Compute a new unique client nonce value."
194 (base64-encode-string
195 (apply 'format "%016x%04x%04x%05x%05x" (random) (current-time)) t))
196
197(defun url-digest-auth-nonce-count (nonce)
198 "The number requests sent to server with the given NONCE.
199This count includes the request we're preparing here.
200
201Currently, this is not implemented and will always return 1.
202
203Value returned is in string format with leading zeroes, such as
204\"00000001\"."
205 (format "%08x" 1))
206
207(defun url-digest-auth-name-value-string (pairs)
208 "Concatenate name-value pairs in association list PAIRS.
209
210Output is formatted as \"name1=\\\"value1\\\", name2=\\\"value2\\\", ...\""
211 (mapconcat (lambda (pair)
212 (format "%s=\"%s\""
213 (symbol-name (car pair))
214 (cdr pair)))
215 pairs ", "))
216
217(defun url-digest-auth-source-creds (url)
218 "Find credentials for URL object from the Emacs auth-source.
219Return value is a plist that has `:user' and `:secret' properties
220if credentials were found. Otherwise nil."
221 (let ((server (url-digest-auth-server-id url))
222 (type (url-type url)))
223 (list :user (url-do-auth-source-search server type :user)
224 :secret (url-do-auth-source-search server type :secret))))
225
226(defun url-digest-prompt-creds (url realm &optional creds)
227 "Prompt credentials for URL and REALM, defaulting to CREDS.
228CREDS is a plist that may have properties `:user' and `:secret'."
229 ;; Set explicitly in case creds were nil. This makes the second
230 ;; plist-put modify the same plist.
231 (setq creds
232 (plist-put creds :user
233 (read-string (url-auth-user-prompt url realm)
234 (or (plist-get creds :user)
235 (user-real-login-name)))))
236 (plist-put creds :secret
237 (read-passwd "Password: " nil (plist-get creds :secret))))
238
239(defun url-digest-auth-directory-id-assoc (dirkey keylist)
240 "Find the best match for DIRKEY in key alist KEYLIST.
241
242The string DIRKEY should be obtained using
243`url-digest-auth-directory-id'. The key list to search through
244is the alist KEYLIST where car of each element may match DIRKEY.
245If DIRKEY represents a realm, the list is searched only for an
246exact match. For directory names, an ancestor is sufficient for
247a match."
248 (or
249 ;; Check exact match first.
250 (assoc dirkey keylist)
251 ;; No exact match found. Continue to look for partial match if
252 ;; dirkey is not a realm.
253 (and (string-match "/" dirkey)
254 (let (match)
255 (while (and (null match) keylist)
256 (if (or
257 ;; Any realm candidate matches. Why?
258 (not (string-match "/" (caar keylist)))
259 ;; Parent directory matches.
260 (string-prefix-p (caar keylist) dirkey))
261 (setq match (car keylist))
262 (setq keylist (cdr keylist))))
263 match))))
264
265(defun url-digest-cached-key (url realm)
266 "Find best match for URL and REALM from `url-digest-auth-storage'.
267The return value is a list consisting of a realm (or a directory)
268a user name, and hashed authentication tokens HA1 and HA2.
269Modifying the contents of the returned list will modify the cache
270variable `url-digest-auth-storage' itself."
271 (url-digest-auth-directory-id-assoc
272 (url-digest-auth-directory-id url realm)
273 (cdr (assoc (url-digest-auth-server-id url) url-digest-auth-storage))))
274
275(defun url-digest-cache-key (key url)
276 "Add key to `url-digest-auth-storage'.
277KEY has the same format as returned by `url-digest-cached-key'.
278The key is added to cache hierarchy under server id, deduced from
279URL."
280 (let ((serverid (url-digest-auth-server-id url)))
281 (push (list serverid key) url-digest-auth-storage)))
282
146(defun url-digest-auth-create-key (username password realm method uri) 283(defun url-digest-auth-create-key (username password realm method uri)
147 "Create a key for digest authentication method" 284 "Create a key for digest authentication method.
148 (let* ((info (if (stringp uri) 285The USERNAME and PASSWORD are the credentials for REALM and are
149 (url-generic-parse-url uri) 286used in making a hashed value named HA1. The HTTP METHOD and URI
150 uri)) 287makes a second hashed value HA2. These hashes are used in making
151 (a1 (md5 (concat username ":" realm ":" password))) 288the authentication key that can be stored without saving the
152 (a2 (md5 (concat method ":" (url-filename info))))) 289password in plain text. The return value is a list (HA1 HA2).
153 (list a1 a2))) 290
154 291For backward compatibility, URI is allowed to be a URL cl-struct
155(defun url-digest-auth (url &optional prompt overwrite realm args) 292object."
156 "Get the username/password for the specified URL. 293 (and username password realm
157If optional argument PROMPT is non-nil, ask for the username/password 294 (list (url-digest-auth-make-ha1 username realm password)
158to use for the URL and its descendants. If optional third argument 295 (url-digest-auth-make-ha2 method (cond ((stringp uri) uri)
159OVERWRITE is non-nil, overwrite the old username/password pair if it 296 (t (url-filename uri)))))))
160is found in the assoc list. If REALM is specified, use that as the realm 297
161instead of hostname:portnum." 298(defun url-digest-auth-build-response (key url realm attrs)
162 (if args 299 "Compute authorization string for the given challenge using KEY.
163 (let* ((href (if (stringp url) 300
164 (url-generic-parse-url url) 301The string looks like 'Digest username=\"John\", realm=\"The
165 url)) 302Realm\", ...'
166 (server (url-host href)) 303
167 (type (url-type href)) 304Part of the challenge is already solved in a pre-computed KEY
168 (port (url-port href)) 305which is list of a realm (or a directory), user name, and hash
169 (file (url-filename href)) 306tokens HA1 and HA2.
170 (enable-recursive-minibuffers t) 307
171 user pass byserv retval data) 308Some fields are filled as is from the given URL, REALM, and
172 (setq file (cond 309using the contents of alist ATTRS.
173 (realm realm) 310
174 ((string-match "/$" file) file) 311ATTRS is expected to contain at least the server's \"nonce\"
175 (t (url-file-directory file))) 312value. It also might contain the optional \"opaque\" value.
176 server (format "%s:%d" server port) 313Newer implementations conforming to RFC 2617 should also contain
177 byserv (cdr-safe (assoc server url-digest-auth-storage))) 314qop (Quality Of Protection) and related attributes.
178 (cond 315
179 ((and prompt (not byserv)) 316Restrictions on Quality of Protection scheme: The qop value
180 (setq user (or 317\"auth-int\" or algorithm any other than \"MD5\" are not
181 (url-do-auth-source-search server type :user) 318implemented."
182 (read-string (url-auth-user-prompt url realm) 319
183 (user-real-login-name))) 320 (when key
184 pass (or 321 (let ((user (nth 1 key))
185 (url-do-auth-source-search server type :secret) 322 (ha1 (nth 2 key))
186 (read-passwd "Password: ")) 323 (ha2 (nth 3 key))
187 url-digest-auth-storage 324 (digest-uri (url-filename url))
188 (cons (list server 325 (qop (cdr-safe (assoc "qop" attrs)))
189 (cons file 326 (nonce (cdr-safe (assoc "nonce" attrs)))
190 (setq retval 327 (opaque (cdr-safe (assoc "opaque" attrs))))
191 (cons user 328
192 (url-digest-auth-create-key 329 (concat
193 user pass realm 330 "Digest "
194 (or url-request-method "GET") 331 (url-digest-auth-name-value-string
195 url))))) 332 (append (list (cons 'username user)
196 url-digest-auth-storage))) 333 (cons 'realm realm)
197 (byserv 334 (cons 'nonce nonce)
198 (setq retval (cdr-safe (assoc file byserv))) 335 (cons 'uri digest-uri))
199 (if (and (not retval) ; no exact match, check directories 336
200 (string-match "/" file)) ; not looking for a realm 337 (cond
201 (while (and byserv (not retval)) 338 ((null qop)
202 (setq data (car (car byserv))) 339 (list (cons 'response (url-digest-auth-make-request-digest
203 (if (or (not (string-match "/" data)) 340 ha1 ha2 nonce))))
204 (and 341 ((string= qop "auth")
205 (>= (length file) (length data)) 342 (let ((nc (url-digest-auth-nonce-count nonce))
206 (string= data (substring file 0 (length data))))) 343 (cnonce (url-digest-auth-make-cnonce)))
207 (setq retval (cdr (car byserv)))) 344 (list (cons 'qop qop)
208 (setq byserv (cdr byserv)))) 345 (cons 'nc nc)
209 (if overwrite 346 (cons 'cnonce cnonce)
210 (if (and (not retval) prompt) 347 (cons 'response
211 (setq user (or 348 (url-digest-auth-make-request-digest-qop
212 (url-do-auth-source-search server type :user) 349 qop ha1 ha2 nonce nc cnonce)))))
213 (read-string (url-auth-user-prompt url realm) 350 (t (message "Quality of protection \"%s\" is not implemented." qop)
214 (user-real-login-name))) 351 nil))
215 pass (or 352
216 (url-do-auth-source-search server type :secret) 353
217 (read-passwd "Password: ")) 354 (if opaque (list (cons 'opaque opaque)))))))))
218 retval (setq retval 355
219 (cons user 356(defun url-digest-find-creds (url prompt &optional realm)
220 (url-digest-auth-create-key 357 "Find or ask credentials for URL.
221 user pass realm 358
222 (or url-request-method "GET") 359Primary method for finding credentials is from Emacs auth-source.
223 url))) 360If password isn't found, and PROMPT is non-nil, query credentials
224 byserv (assoc server url-digest-auth-storage)) 361via minibuffer. Optional REALM may be used when prompting as a
225 (setcdr byserv 362hint to the user.
226 (cons (cons file retval) (cdr byserv)))))) 363
227 (t (setq retval nil))) 364Return value is nil in case either user name or password wasn't
228 (if retval 365found. Otherwise, it's a plist containing `:user' and `:secret'.
229 (if (cdr-safe (assoc "opaque" args)) 366Additional `:source' property denotes the origin of the
230 (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")) 367credentials and its value can be either symbol `authsource' or
231 (opaque (cdr-safe (assoc "opaque" args)))) 368`interactive'."
232 (format 369 (let ((creds (url-digest-auth-source-creds url)))
233 (concat "Digest username=\"%s\", realm=\"%s\"," 370
234 "nonce=\"%s\", uri=\"%s\"," 371 ;; If credentials weren't found and prompting is allowed, prompt
235 "response=\"%s\", opaque=\"%s\"") 372 ;; the user.
236 (nth 0 retval) realm nonce (url-filename href) 373 (if (and prompt
237 (md5 (concat (nth 1 retval) ":" nonce ":" 374 (or (null creds)
238 (nth 2 retval))) opaque)) 375 (null (plist-get creds :secret))))
239 (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))) 376 (progn
240 (format 377 (setq creds (url-digest-prompt-creds url realm creds))
241 (concat "Digest username=\"%s\", realm=\"%s\"," 378 (plist-put creds :source 'interactive))
242 "nonce=\"%s\", uri=\"%s\"," 379 (plist-put creds :source 'authsource))
243 "response=\"%s\"") 380
244 (nth 0 retval) realm nonce (url-filename href) 381 (and (plist-get creds :user)
245 (md5 (concat (nth 1 retval) ":" nonce ":" 382 (plist-get creds :secret)
246 (nth 2 retval)))))))))) 383 creds)))
384
385(defun url-digest-find-new-key (url realm prompt)
386 "Find credentials and create a new authorization key for given URL and REALM.
387
388Return value is the new key, or nil if credentials weren't found.
389\"New\" in this context means a key that's not yet found in cache
390variable `url-digest-auth-storage'. You may use `url-digest-cache-key'
391to put it there.
392
393This function uses `url-digest-find-creds' to find the
394credentials. It first looks in auth-source. If not found, and
395PROMPT is non-nil, user is asked for credentials interactively
396via minibuffer."
397 (let (creds)
398 (unwind-protect
399 (if (setq creds (url-digest-find-creds url prompt realm))
400 (cons (url-digest-auth-directory-id url realm)
401 (cons (plist-get creds :user)
402 (url-digest-auth-create-key
403 (plist-get creds :user)
404 (plist-get creds :secret)
405 realm
406 (or url-request-method "GET")
407 (url-filename url)))))
408 (if (and creds
409 ;; Don't clear secret for `authsource' since it will
410 ;; corrupt any future fetches for it.
411 (not (eq (plist-get creds :source) 'authsource)))
412 (clear-string (plist-get creds :secret))))))
413
414(defun url-digest-auth (url &optional prompt overwrite realm attrs)
415 "Get the HTTP Digest response string for the specified URL.
416
417If optional argument PROMPT is non-nil, ask for the username and
418password to use for the URL and its descendants but only if one
419cannot be found from cache. Look also in Emacs auth-source.
420
421If optional third argument OVERWRITE is non-nil, overwrite the
422old credentials, if they're found in cache, with new ones from
423user prompt or from Emacs auth-source.
424
425If REALM is specified, use that instead of the URL descendant
426method to match cached credentials.
427
428Alist ATTRS contains additional attributes for the authentication
429challenge such as nonce and opaque."
430 (if attrs
431 (let* ((href (if (stringp url) (url-generic-parse-url url) url))
432 (enable-recursive-minibuffers t)
433 (key (url-digest-cached-key href realm)))
434
435 (if (or (null key) overwrite)
436 (let ((newkey (url-digest-find-new-key href realm (cond
437 (key nil)
438 (t prompt)))))
439 (if (and newkey key overwrite)
440 (setcdr key (cdr newkey))
441 (if (and newkey (null key))
442 (url-digest-cache-key (setq key newkey) href)))))
443
444 (if key
445 (url-digest-auth-build-response key href realm attrs)))))
247 446
248(defvar url-registered-auth-schemes nil 447(defvar url-registered-auth-schemes nil
249 "A list of the registered authorization schemes and various and sundry 448 "A list of the registered authorization schemes and various and sundry
diff --git a/lisp/url/url-domsuf.el b/lisp/url/url-domsuf.el
index 25a6a423eb4..b24f24531a6 100644
--- a/lisp/url/url-domsuf.el
+++ b/lisp/url/url-domsuf.el
@@ -89,7 +89,7 @@
89 89
90;; Tests: 90;; Tests:
91 91
92;; TODO convert to a proper test/automated test. 92;; TODO convert to a proper test.
93;; (url-domsuf-cookie-allowed-p "com") => nil 93;; (url-domsuf-cookie-allowed-p "com") => nil
94;; (url-domsuf-cookie-allowed-p "foo.bar.bd") => t 94;; (url-domsuf-cookie-allowed-p "foo.bar.bd") => t
95;; (url-domsuf-cookie-allowed-p "bar.bd") => nil 95;; (url-domsuf-cookie-allowed-p "bar.bd") => nil
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 31c33e6a720..aa8d77882ec 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -504,7 +504,7 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
504;; "index ", "old mode", "new mode", "new file mode" and 504;; "index ", "old mode", "new mode", "new file mode" and
505;; "deleted file mode" are output by git-diff. 505;; "deleted file mode" are output by git-diff.
506(defconst diff-file-junk-re 506(defconst diff-file-junk-re
507 (concat "Index: \\|=\\{20,\\}\\|" ; SVN 507 (concat "Index: \\|Prereq: \\|=\\{20,\\}\\|" ; SVN
508 "diff \\|index \\|\\(?:deleted file\\|new\\(?: file\\)?\\|old\\) mode\\|=== modified file")) 508 "diff \\|index \\|\\(?:deleted file\\|new\\(?: file\\)?\\|old\\) mode\\|=== modified file"))
509 509
510;; If point is in a diff header, then return beginning 510;; If point is in a diff header, then return beginning
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 9d2ec51b596..36aebf4aed1 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -25,6 +25,8 @@
25;;; Code: 25;;; Code:
26 26
27 27
28(require 'diff-mode) ; For `diff-file-junk-re'.
29
28(provide 'ediff-ptch) 30(provide 'ediff-ptch)
29 31
30(defgroup ediff-ptch nil 32(defgroup ediff-ptch nil
@@ -225,14 +227,11 @@ program."
225 (if (and beg2 end2) 227 (if (and beg2 end2)
226 (buffer-substring beg2 end2) 228 (buffer-substring beg2 end2)
227 "/dev/null"))) 229 "/dev/null")))
228 ;; check for any `Index:' or `Prereq:' lines, but don't use them 230 ;; Remove file junk (Bug#26084).
229 (if (re-search-backward "^Index:" mark1-end 'noerror) 231 (while (re-search-backward
230 (move-marker mark2 (match-beginning 0))) 232 (concat "^" diff-file-junk-re) mark1-end t)
231 (if (re-search-backward "^Prereq:" mark1-end 'noerror) 233 (move-marker mark2 (match-beginning 0)))
232 (move-marker mark2 (match-beginning 0)))
233
234 (goto-char mark2-end) 234 (goto-char mark2-end)
235
236 (if filenames 235 (if filenames
237 (setq patch-map 236 (setq patch-map
238 (cons (ediff-make-new-meta-list-element 237 (cons (ediff-make-new-meta-list-element