aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2012-10-09 20:28:06 +0200
committerEli Zaretskii2012-10-09 20:28:06 +0200
commitb97f22cdad55a0964758cef3a19ce3fa1098657d (patch)
tree8d078a5b2aab3f55708a5f8eeaf8ca0f022e6ee3 /lisp
parent87c141ce9750881f6203148e3c49d00710cd472e (diff)
parentb15736e6e33a52021a2a91b0b3360cd5a9803405 (diff)
downloademacs-b97f22cdad55a0964758cef3a19ce3fa1098657d.tar.gz
emacs-b97f22cdad55a0964758cef3a19ce3fa1098657d.zip
Merge from trunk.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog82
-rw-r--r--lisp/bindings.el38
-rw-r--r--lisp/cedet/ChangeLog6
-rw-r--r--lisp/cedet/semantic/bovine/el.el2
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el43
-rw-r--r--lisp/ffap.el18
-rw-r--r--lisp/generic-x.el79
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/shr.el2
-rw-r--r--lisp/net/tramp-cache.el39
-rw-r--r--lisp/net/tramp-gvfs.el8
-rw-r--r--lisp/net/tramp-sh.el95
-rw-r--r--lisp/net/tramp-smb.el23
-rw-r--r--lisp/net/tramp.el55
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/newcomment.el12
-rw-r--r--lisp/progmodes/cc-bytecomp.el24
-rw-r--r--lisp/progmodes/cc-vars.el10
-rw-r--r--lisp/progmodes/python.el163
-rw-r--r--lisp/term/w32-win.el2
-rw-r--r--lisp/w32-fns.el2
22 files changed, 386 insertions, 328 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 406c50ee9c8..ef9e06b7d58 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,85 @@
12012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * newcomment.el (comment-start-skip, comment-end-skip, comment-end):
4 Don't document nil as a useful value (bug#12583).
5
62012-10-09 Michael Albinus <michael.albinus@gmx.de>
7
8 * net/tramp.el (tramp-debug-message):
9 Remove "tramp-with-progress-reporter" from regexp of ignored functions.
10 (with-tramp-progress-reporter): Rename from
11 `tramp-with-progress-reporter'.
12 (with-tramp-file-property, with-tramp-connection-property):
13 Move from tramp-cache.el, rename from `with-file-property' and
14 `with-connection-property', respectively.
15
16 * net/tramp-cache.el: Remove `with-file-property' and
17 `with-connection-property'.
18
19 * net/tramp.el:
20 * net/tramp-gvfs.el:
21 * net/tramp-sh.el:
22 * net/tramp-smb.el: Adapt callees.
23
24 * net/trampver.el: Update release number.
25
262012-10-09 Glenn Morris <rgm@gnu.org>
27
28 * w32-fns.el (set-message-beep):
29 * term/w32-win.el (set-message-beep): Update declarations.
30
312012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
32
33 * bindings.el (mode-line-toggle-read-only, mode-line-toggle-modified)
34 (mode-line-widen, mode-line-input-method-map)
35 (mode-line-coding-system-map, mode-line-remote)
36 (mode-line-unbury-buffer, mode-line-bury-buffer)
37 (mode-line-next-buffer, mode-line-previous-buffer):
38 Replace save-selected-window+select-window => with-selected-window.
39
40 * progmodes/cc-bytecomp.el (cc-bytecomp-defmacro): Remove, unused.
41 * progmodes/cc-vars.el (bq-process): Remove, unused.
42
43 * emacs-lisp/cl-macs.el (cl-defstruct): Obey the :read-only property.
44
452012-10-09 Fabián Ezequiel Gallina <fgallina@cuca>
46
47 Implemented `backward-up-list'-like navigation.
48 * progmodes/python.el (python-nav-up-list)
49 (python-nav-backward-up-list): New functions.
50 (python-mode-map): Define substitute key for backward-up-list to
51 python-nav-backward-up-list.
52
532012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
54
55 * progmodes/python.el (python-fill-paragraph): Rename from
56 python-fill-paragraph-function. Fixed fill-paragraph for
57 decorators (Bug#12605).
58
592012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
60
61 * progmodes/python.el (python-shell-output-filter): Handle extra
62 carriage return in OSX (Bug#12409).
63
642012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
65
66 Fix shell handling of unbalanced quotes and parens in output.
67 * progmodes/python.el (python-rx-constituents): Add string-delimiter.
68 (python-syntax-propertize-function): Use it.
69 (python-shell-output-syntax-table): New var.
70 (inferior-python-mode): Prevent unbalanced parens/quotes from
71 previous output mess with current input context.
72
732012-10-08 Juanma Barranquero <lekktu@gmail.com>
74
75 * generic-x.el (javascript-generic-mode, javascript-generic-mode-hook):
76 Make obsolete aliases of js-mode and js-mode-hook (from js.el).
77
782012-10-08 Michael Albinus <michael.albinus@gmx.de>
79
80 * ffap.el (ffap-replace-file-component): Support Tramp file name
81 syntax, not only ange-ftp's one.
82
12012-10-08 Glenn Morris <rgm@gnu.org> 832012-10-08 Glenn Morris <rgm@gnu.org>
2 84
3 * cus-start.el (message-log-max): Set :version. 85 * cus-start.el (message-log-max): Set :version.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index b4f9d29fe52..de5dd48c291 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -38,23 +38,20 @@ corresponding to the mode line clicked."
38(defun mode-line-toggle-read-only (event) 38(defun mode-line-toggle-read-only (event)
39 "Like `toggle-read-only', for the mode-line." 39 "Like `toggle-read-only', for the mode-line."
40 (interactive "e") 40 (interactive "e")
41 (save-selected-window 41 (with-selected-window (posn-window (event-start event))
42 (select-window (posn-window (event-start event)))
43 (read-only-mode 'toggle))) 42 (read-only-mode 'toggle)))
44 43
45(defun mode-line-toggle-modified (event) 44(defun mode-line-toggle-modified (event)
46 "Toggle the buffer-modified flag from the mode-line." 45 "Toggle the buffer-modified flag from the mode-line."
47 (interactive "e") 46 (interactive "e")
48 (save-selected-window 47 (with-selected-window (posn-window (event-start event))
49 (select-window (posn-window (event-start event)))
50 (set-buffer-modified-p (not (buffer-modified-p))) 48 (set-buffer-modified-p (not (buffer-modified-p)))
51 (force-mode-line-update))) 49 (force-mode-line-update)))
52 50
53(defun mode-line-widen (event) 51(defun mode-line-widen (event)
54 "Widen a buffer from the mode-line." 52 "Widen a buffer from the mode-line."
55 (interactive "e") 53 (interactive "e")
56 (save-selected-window 54 (with-selected-window (posn-window (event-start event))
57 (select-window (posn-window (event-start event)))
58 (widen) 55 (widen)
59 (force-mode-line-update))) 56 (force-mode-line-update)))
60 57
@@ -63,17 +60,13 @@ corresponding to the mode line clicked."
63 (define-key map [mode-line mouse-2] 60 (define-key map [mode-line mouse-2]
64 (lambda (e) 61 (lambda (e)
65 (interactive "e") 62 (interactive "e")
66 (save-selected-window 63 (with-selected-window (posn-window (event-start e))
67 (select-window
68 (posn-window (event-start e)))
69 (toggle-input-method) 64 (toggle-input-method)
70 (force-mode-line-update)))) 65 (force-mode-line-update))))
71 (define-key map [mode-line mouse-3] 66 (define-key map [mode-line mouse-3]
72 (lambda (e) 67 (lambda (e)
73 (interactive "e") 68 (interactive "e")
74 (save-selected-window 69 (with-selected-window (posn-window (event-start e))
75 (select-window
76 (posn-window (event-start e)))
77 (describe-current-input-method)))) 70 (describe-current-input-method))))
78 (purecopy map))) 71 (purecopy map)))
79 72
@@ -82,16 +75,14 @@ corresponding to the mode line clicked."
82 (define-key map [mode-line mouse-1] 75 (define-key map [mode-line mouse-1]
83 (lambda (e) 76 (lambda (e)
84 (interactive "e") 77 (interactive "e")
85 (save-selected-window 78 (with-selected-window (posn-window (event-start e))
86 (select-window (posn-window (event-start e)))
87 (when (and enable-multibyte-characters 79 (when (and enable-multibyte-characters
88 buffer-file-coding-system) 80 buffer-file-coding-system)
89 (describe-coding-system buffer-file-coding-system))))) 81 (describe-coding-system buffer-file-coding-system)))))
90 (define-key map [mode-line mouse-3] 82 (define-key map [mode-line mouse-3]
91 (lambda (e) 83 (lambda (e)
92 (interactive "e") 84 (interactive "e")
93 (save-selected-window 85 (with-selected-window (posn-window (event-start e))
94 (select-window (posn-window (event-start e)))
95 (call-interactively 'set-buffer-file-coding-system)))) 86 (call-interactively 'set-buffer-file-coding-system))))
96 (purecopy map)) 87 (purecopy map))
97 "Local keymap for the coding-system part of the mode line.") 88 "Local keymap for the coding-system part of the mode line.")
@@ -237,8 +228,7 @@ mnemonics of the following coding systems:
237 'mouse-face 'mode-line-highlight 228 'mouse-face 'mode-line-highlight
238 'help-echo (purecopy (lambda (window _object _point) 229 'help-echo (purecopy (lambda (window _object _point)
239 (format "%s" 230 (format "%s"
240 (save-selected-window 231 (with-selected-window window
241 (select-window window)
242 (concat 232 (concat
243 (if (file-remote-p default-directory) 233 (if (file-remote-p default-directory)
244 "Current directory is remote: " 234 "Current directory is remote: "
@@ -474,15 +464,13 @@ By default, this shows the information specified by
474(defun mode-line-unbury-buffer (event) "\ 464(defun mode-line-unbury-buffer (event) "\
475Call `unbury-buffer' in this window." 465Call `unbury-buffer' in this window."
476 (interactive "e") 466 (interactive "e")
477 (save-selected-window 467 (with-selected-window (posn-window (event-start event))
478 (select-window (posn-window (event-start event)))
479 (unbury-buffer))) 468 (unbury-buffer)))
480 469
481(defun mode-line-bury-buffer (event) "\ 470(defun mode-line-bury-buffer (event) "\
482Like `bury-buffer', but temporarily select EVENT's window." 471Like `bury-buffer', but temporarily select EVENT's window."
483 (interactive "e") 472 (interactive "e")
484 (save-selected-window 473 (with-selected-window (posn-window (event-start event))
485 (select-window (posn-window (event-start event)))
486 (bury-buffer))) 474 (bury-buffer)))
487 475
488(defun mode-line-other-buffer () "\ 476(defun mode-line-other-buffer () "\
@@ -493,15 +481,13 @@ Switch to the most recently selected buffer other than the current one."
493(defun mode-line-next-buffer (event) 481(defun mode-line-next-buffer (event)
494 "Like `next-buffer', but temporarily select EVENT's window." 482 "Like `next-buffer', but temporarily select EVENT's window."
495 (interactive "e") 483 (interactive "e")
496 (save-selected-window 484 (with-selected-window (posn-window (event-start event))
497 (select-window (posn-window (event-start event)))
498 (next-buffer))) 485 (next-buffer)))
499 486
500(defun mode-line-previous-buffer (event) 487(defun mode-line-previous-buffer (event)
501 "Like `previous-buffer', but temporarily select EVENT's window." 488 "Like `previous-buffer', but temporarily select EVENT's window."
502 (interactive "e") 489 (interactive "e")
503 (save-selected-window 490 (with-selected-window (posn-window (event-start event))
504 (select-window (posn-window (event-start event)))
505 (previous-buffer))) 491 (previous-buffer)))
506 492
507(defmacro bound-and-true-p (var) 493(defmacro bound-and-true-p (var)
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index ea102dddf2f..14e8d6c1d64 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,9 @@
12012-10-08 David Engster <deng@randomsample.de>>
2
3 * semantic/bovine/el.el: Add `semantic-default-elisp-setup' to
4 `emacs-lisp-mode-hook'. This was accidentally removed during the
5 CEDET update (2012-10-01T18:10:29Z!cyd@gnu.org).
6
12012-10-07 David Engster <deng@randomsample.de> 72012-10-07 David Engster <deng@randomsample.de>
2 8
3 * semantic/wisent/python.el (semantic-ctxt-current-function) 9 * semantic/wisent/python.el (semantic-ctxt-current-function)
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index 7bad1483dc3..ea99df9edb9 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -944,6 +944,8 @@ ELisp variables can be pretty long, so track this one too.")
944 "Setup hook function for Emacs Lisp files and Semantic." 944 "Setup hook function for Emacs Lisp files and Semantic."
945 ) 945 )
946 946
947(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
948
947;;; LISP MODE 949;;; LISP MODE
948;; 950;;
949;; @TODO: Lisp supports syntaxes that Emacs Lisp does not. 951;; @TODO: Lisp supports syntaxes that Emacs Lisp does not.
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index e25ac5f9708..d05fbc42060 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when 260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp 261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) 262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
263;;;;;; "cl-macs" "cl-macs.el" "6951d080daefb5194b1d21fe9b2deae4") 263;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7")
264;;; Generated autoloads from cl-macs.el 264;;; Generated autoloads from cl-macs.el
265 265
266(autoload 'cl--compiler-macro-list* "cl-macs" "\ 266(autoload 'cl--compiler-macro-list* "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 99bae1944e8..592c33d21c5 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2324,26 +2324,29 @@ value, that slot cannot be set via `setf'.
2324 (if (= pos 0) '(car cl-x) 2324 (if (= pos 0) '(car cl-x)
2325 `(nth ,pos cl-x)))) forms) 2325 `(nth ,pos cl-x)))) forms)
2326 (push (cons accessor t) side-eff) 2326 (push (cons accessor t) side-eff)
2327 ;; Don't bother defining a setf-expander, since gv-get can use 2327 (if (cadr (memq :read-only (cddr desc)))
2328 ;; the compiler macro to get the same result. 2328 (push `(gv-define-expander ,accessor
2329 ;;(push `(gv-define-setter ,accessor (cl-val cl-x) 2329 (lambda (_cl-do _cl-x)
2330 ;; ,(if (cadr (memq :read-only (cddr desc))) 2330 (error "%s is a read-only slot" ',accessor)))
2331 ;; `(progn (ignore cl-x cl-val) 2331 forms)
2332 ;; (error "%s is a read-only slot" 2332 ;; For normal slots, we don't need to define a setf-expander,
2333 ;; ',accessor)) 2333 ;; since gv-get can use the compiler macro to get the
2334 ;; ;; If cl is loaded only for compilation, 2334 ;; same result.
2335 ;; ;; the call to cl--struct-setf-expander would 2335 ;; (push `(gv-define-setter ,accessor (cl-val cl-x)
2336 ;; ;; cause a warning because it may not be 2336 ;; ;; If cl is loaded only for compilation,
2337 ;; ;; defined at run time. Suppress that warning. 2337 ;; ;; the call to cl--struct-setf-expander would
2338 ;; `(progn 2338 ;; ;; cause a warning because it may not be
2339 ;; (declare-function 2339 ;; ;; defined at run time. Suppress that warning.
2340 ;; cl--struct-setf-expander "cl-macs" 2340 ;; (progn
2341 ;; (x name accessor pred-form pos)) 2341 ;; (declare-function
2342 ;; (cl--struct-setf-expander 2342 ;; cl--struct-setf-expander "cl-macs"
2343 ;; cl-val cl-x ',name ',accessor 2343 ;; (x name accessor pred-form pos))
2344 ;; ,(and pred-check `',pred-check) 2344 ;; (cl--struct-setf-expander
2345 ;; ,pos)))) 2345 ;; cl-val cl-x ',name ',accessor
2346 ;; forms) 2346 ;; ,(and pred-check `',pred-check)
2347 ;; ,pos)))
2348 ;; forms)
2349 )
2347 (if print-auto 2350 (if print-auto
2348 (nconc print-func 2351 (nconc print-func
2349 (list `(princ ,(format " %s" slot) cl-s) 2352 (list `(princ ,(format " %s" slot) cl-s)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index f3e8d4c194e..4c75609fe01 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -482,18 +482,12 @@ Returned values:
482 482
483(defun ffap-replace-file-component (fullname name) 483(defun ffap-replace-file-component (fullname name)
484 "In remote FULLNAME, replace path with NAME. May return nil." 484 "In remote FULLNAME, replace path with NAME. May return nil."
485 ;; Use ange-ftp or efs if loaded, but do not load them otherwise. 485 ;; Use efs if loaded, but do not load it otherwise.
486 (let (found) 486 (if (fboundp 'efs-replace-path-component)
487 (mapc 487 (funcall efs-replace-path-component fullname name)
488 (function (lambda (sym) (and (fboundp sym) (setq found sym)))) 488 (and (stringp fullname)
489 '( 489 (stringp name)
490 efs-replace-path-component 490 (concat (file-remote-p fullname) name))))
491 ange-ftp-replace-path-component
492 ange-ftp-replace-name-component
493 ))
494 (and found
495 (fset 'ffap-replace-file-component found)
496 (funcall found fullname name))))
497;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new") 491;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new")
498 492
499(defun ffap-file-suffix (file) 493(defun ffap-file-suffix (file)
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index ce1599b9010..878021ec5c5 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -646,83 +646,10 @@ like an INI file. You can add this hook to `find-file-hook'."
646 "Generic mode for Sys V pkginfo files.")) 646 "Generic mode for Sys V pkginfo files."))
647 647
648;; Javascript mode 648;; Javascript mode
649;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU] 649;; Obsolete; defer to js-mode from js.el.
650(when (memq 'javascript-generic-mode generic-extras-enable-list) 650(when (memq 'javascript-generic-mode generic-extras-enable-list)
651 651 (define-obsolete-function-alias 'javascript-generic-mode 'js-mode "24.3")
652(define-generic-mode javascript-generic-mode 652 (define-obsolete-variable-alias 'javascript-generic-mode-hook 'js-mode-hook "24.3"))
653 '("//" ("/*" . "*/"))
654 '("break"
655 "case"
656 "continue"
657 "default"
658 "delete"
659 "do"
660 "else"
661 "export"
662 "for"
663 "function"
664 "if"
665 "import"
666 "in"
667 "new"
668 "return"
669 "switch"
670 "this"
671 "typeof"
672 "var"
673 "void"
674 "while"
675 "with"
676 ;; words reserved for ECMA extensions below
677 "catch"
678 "class"
679 "const"
680 "debugger"
681 "enum"
682 "extends"
683 "finally"
684 "super"
685 "throw"
686 "try"
687 ;; Java Keywords reserved by JavaScript
688 "abstract"
689 "boolean"
690 "byte"
691 "char"
692 "double"
693 "false"
694 "final"
695 "float"
696 "goto"
697 "implements"
698 "instanceof"
699 "int"
700 "interface"
701 "long"
702 "native"
703 "null"
704 "package"
705 "private"
706 "protected"
707 "public"
708 "short"
709 "static"
710 "synchronized"
711 "throws"
712 "transient"
713 "true")
714 '(("^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)"
715 (1 font-lock-function-name-face))
716 ("^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)"
717 (1 font-lock-variable-name-face)))
718 '("\\.js\\'")
719 (list
720 (function
721 (lambda ()
722 (setq imenu-generic-expression
723 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
724 ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1))))))
725 "Generic mode for JavaScript files."))
726 653
727;; VRML files 654;; VRML files
728(when (memq 'vrml-generic-mode generic-extras-enable-list) 655(when (memq 'vrml-generic-mode generic-extras-enable-list)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f79353ebfb3..c6b2a4c37a7 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12012-10-09 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-insert): \r is also not inserted, so don't try to delete
4 it.
5
12012-10-06 Glenn Morris <rgm@gnu.org> 62012-10-06 Glenn Morris <rgm@gnu.org>
2 7
3 * gnus-notifications.el (gnus-notifications): 8 * gnus-notifications.el (gnus-notifications):
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index e7a6c5d2081..03704554459 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -391,7 +391,7 @@ size, and full-buffer size."
391 (shr-indent)) 391 (shr-indent))
392 (end-of-line)) 392 (end-of-line))
393 (insert " "))) 393 (insert " ")))
394 (unless (string-match "[ \t\n ]\\'" text) 394 (unless (string-match "[ \t\r\n ]\\'" text)
395 (delete-char -1))))) 395 (delete-char -1)))))
396 396
397(defun shr-find-fill-point () 397(defun shr-find-fill-point ()
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index fe5eb0049d0..e4fca46ce2d 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -139,27 +139,6 @@ Returns VALUE."
139 value)) 139 value))
140 140
141;;;###tramp-autoload 141;;;###tramp-autoload
142(defmacro with-file-property (vec file property &rest body)
143 "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
144FILE must be a local file name on a connection identified via VEC."
145 `(if (file-name-absolute-p ,file)
146 (let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
147 (when (eq value 'undef)
148 ;; We cannot pass @body as parameter to
149 ;; `tramp-set-file-property' because it mangles our
150 ;; debug messages.
151 (setq value (progn ,@body))
152 (tramp-set-file-property ,vec ,file ,property value))
153 value)
154 ,@body))
155
156;;;###tramp-autoload
157(put 'with-file-property 'lisp-indent-function 3)
158(put 'with-file-property 'edebug-form-spec t)
159(tramp-compat-font-lock-add-keywords
160 'emacs-lisp-mode '("\\<with-file-property\\>"))
161
162;;;###tramp-autoload
163(defun tramp-flush-file-property (vec file) 142(defun tramp-flush-file-property (vec file)
164 "Remove all properties of FILE in the cache context of VEC." 143 "Remove all properties of FILE in the cache context of VEC."
165 ;; Remove file property of symlinks. 144 ;; Remove file property of symlinks.
@@ -250,24 +229,6 @@ PROPERTY is set persistent when KEY is a vector."
250 value)) 229 value))
251 230
252;;;###tramp-autoload 231;;;###tramp-autoload
253(defmacro with-connection-property (key property &rest body)
254 "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
255 `(let ((value (tramp-get-connection-property ,key ,property 'undef)))
256 (when (eq value 'undef)
257 ;; We cannot pass ,@body as parameter to
258 ;; `tramp-set-connection-property' because it mangles our debug
259 ;; messages.
260 (setq value (progn ,@body))
261 (tramp-set-connection-property ,key ,property value))
262 value))
263
264;;;###tramp-autoload
265(put 'with-connection-property 'lisp-indent-function 2)
266(put 'with-connection-property 'edebug-form-spec t)
267(tramp-compat-font-lock-add-keywords
268 'emacs-lisp-mode '("\\<with-connection-property\\>"))
269
270;;;###tramp-autoload
271(defun tramp-flush-connection-property (key) 232(defun tramp-flush-connection-property (key)
272 "Remove all properties identified by KEY. 233 "Remove all properties identified by KEY.
273KEY identifies the connection, it is either a process or a vector." 234KEY identifies the connection, it is either a process or a vector."
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f78122ec704..60b39606d86 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -537,7 +537,7 @@ is no information where to trace the message.")
537 "Like `copy-file' for Tramp files." 537 "Like `copy-file' for Tramp files."
538 (with-parsed-tramp-file-name 538 (with-parsed-tramp-file-name
539 (if (tramp-tramp-file-p filename) filename newname) nil 539 (if (tramp-tramp-file-p filename) filename newname) nil
540 (tramp-with-progress-reporter 540 (with-tramp-progress-reporter
541 v 0 (format "Copying %s to %s" filename newname) 541 v 0 (format "Copying %s to %s" filename newname)
542 (condition-case err 542 (condition-case err
543 (let ((args 543 (let ((args
@@ -741,7 +741,7 @@ is no information where to trace the message.")
741 "Like `rename-file' for Tramp files." 741 "Like `rename-file' for Tramp files."
742 (with-parsed-tramp-file-name 742 (with-parsed-tramp-file-name
743 (if (tramp-tramp-file-p filename) filename newname) nil 743 (if (tramp-tramp-file-p filename) filename newname) nil
744 (tramp-with-progress-reporter 744 (with-tramp-progress-reporter
745 v 0 (format "Renaming %s to %s" filename newname) 745 v 0 (format "Renaming %s to %s" filename newname)
746 (condition-case err 746 (condition-case err
747 (rename-file 747 (rename-file
@@ -1056,7 +1056,7 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
1056 (catch 'mounted 1056 (catch 'mounted
1057 (dolist 1057 (dolist
1058 (elt 1058 (elt
1059 (with-file-property vec "/" "list-mounts" 1059 (with-tramp-file-property vec "/" "list-mounts"
1060 (with-tramp-dbus-call-method vec t 1060 (with-tramp-dbus-call-method vec t
1061 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker 1061 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
1062 tramp-gvfs-interface-mounttracker "listMounts")) 1062 tramp-gvfs-interface-mounttracker "listMounts"))
@@ -1199,7 +1199,7 @@ connection if a previous connection has died for some reason."
1199 (tramp-gvfs-object-path 1199 (tramp-gvfs-object-path
1200 (tramp-make-tramp-file-name method user host "")))) 1200 (tramp-make-tramp-file-name method user host ""))))
1201 1201
1202 (tramp-with-progress-reporter 1202 (with-tramp-progress-reporter
1203 vec 3 1203 vec 3
1204 (if (zerop (length user)) 1204 (if (zerop (length user))
1205 (format "Opening connection for %s using %s" host method) 1205 (format "Opening connection for %s using %s" host method)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2c1af3e83fa..ec321d00506 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1058,7 +1058,7 @@ target of the symlink differ."
1058 "Like `file-truename' for Tramp files." 1058 "Like `file-truename' for Tramp files."
1059 (with-parsed-tramp-file-name (expand-file-name filename) nil 1059 (with-parsed-tramp-file-name (expand-file-name filename) nil
1060 (tramp-make-tramp-file-name method user host 1060 (tramp-make-tramp-file-name method user host
1061 (with-file-property v localname "file-truename" 1061 (with-tramp-file-property v localname "file-truename"
1062 (let ((result nil)) ; result steps in reverse order 1062 (let ((result nil)) ; result steps in reverse order
1063 (tramp-message v 4 "Finding true name for `%s'" filename) 1063 (tramp-message v 4 "Finding true name for `%s'" filename)
1064 (cond 1064 (cond
@@ -1167,7 +1167,7 @@ target of the symlink differ."
1167(defun tramp-sh-handle-file-exists-p (filename) 1167(defun tramp-sh-handle-file-exists-p (filename)
1168 "Like `file-exists-p' for Tramp files." 1168 "Like `file-exists-p' for Tramp files."
1169 (with-parsed-tramp-file-name filename nil 1169 (with-parsed-tramp-file-name filename nil
1170 (with-file-property v localname "file-exists-p" 1170 (with-tramp-file-property v localname "file-exists-p"
1171 (or (not (null (tramp-get-file-property 1171 (or (not (null (tramp-get-file-property
1172 v localname "file-attributes-integer" nil))) 1172 v localname "file-attributes-integer" nil)))
1173 (not (null (tramp-get-file-property 1173 (not (null (tramp-get-file-property
@@ -1185,7 +1185,8 @@ target of the symlink differ."
1185 ;; Don't modify `last-coding-system-used' by accident. 1185 ;; Don't modify `last-coding-system-used' by accident.
1186 (let ((last-coding-system-used last-coding-system-used)) 1186 (let ((last-coding-system-used last-coding-system-used))
1187 (with-parsed-tramp-file-name (expand-file-name filename) nil 1187 (with-parsed-tramp-file-name (expand-file-name filename) nil
1188 (with-file-property v localname (format "file-attributes-%s" id-format) 1188 (with-tramp-file-property
1189 v localname (format "file-attributes-%s" id-format)
1189 (save-excursion 1190 (save-excursion
1190 (tramp-convert-file-attributes 1191 (tramp-convert-file-attributes
1191 v 1192 v
@@ -1481,7 +1482,8 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1481 1482
1482(defun tramp-remote-selinux-p (vec) 1483(defun tramp-remote-selinux-p (vec)
1483 "Check, whether SELINUX is enabled on the remote host." 1484 "Check, whether SELINUX is enabled on the remote host."
1484 (with-connection-property (tramp-get-connection-process vec) "selinux-p" 1485 (with-tramp-connection-property
1486 (tramp-get-connection-process vec) "selinux-p"
1485 (let ((result (tramp-find-executable 1487 (let ((result (tramp-find-executable
1486 vec "getenforce" (tramp-get-remote-path vec) t t))) 1488 vec "getenforce" (tramp-get-remote-path vec) t t)))
1487 (and result 1489 (and result
@@ -1493,7 +1495,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1493(defun tramp-sh-handle-file-selinux-context (filename) 1495(defun tramp-sh-handle-file-selinux-context (filename)
1494 "Like `file-selinux-context' for Tramp files." 1496 "Like `file-selinux-context' for Tramp files."
1495 (with-parsed-tramp-file-name filename nil 1497 (with-parsed-tramp-file-name filename nil
1496 (with-file-property v localname "file-selinux-context" 1498 (with-tramp-file-property v localname "file-selinux-context"
1497 (let ((context '(nil nil nil nil)) 1499 (let ((context '(nil nil nil nil))
1498 (regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):" 1500 (regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):"
1499 "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)"))) 1501 "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)")))
@@ -1537,7 +1539,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1537(defun tramp-sh-handle-file-executable-p (filename) 1539(defun tramp-sh-handle-file-executable-p (filename)
1538 "Like `file-executable-p' for Tramp files." 1540 "Like `file-executable-p' for Tramp files."
1539 (with-parsed-tramp-file-name filename nil 1541 (with-parsed-tramp-file-name filename nil
1540 (with-file-property v localname "file-executable-p" 1542 (with-tramp-file-property v localname "file-executable-p"
1541 ;; Examine `file-attributes' cache to see if request can be 1543 ;; Examine `file-attributes' cache to see if request can be
1542 ;; satisfied without remote operation. 1544 ;; satisfied without remote operation.
1543 (or (tramp-check-cached-permissions v ?x) 1545 (or (tramp-check-cached-permissions v ?x)
@@ -1546,7 +1548,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1546(defun tramp-sh-handle-file-readable-p (filename) 1548(defun tramp-sh-handle-file-readable-p (filename)
1547 "Like `file-readable-p' for Tramp files." 1549 "Like `file-readable-p' for Tramp files."
1548 (with-parsed-tramp-file-name filename nil 1550 (with-parsed-tramp-file-name filename nil
1549 (with-file-property v localname "file-readable-p" 1551 (with-tramp-file-property v localname "file-readable-p"
1550 ;; Examine `file-attributes' cache to see if request can be 1552 ;; Examine `file-attributes' cache to see if request can be
1551 ;; satisfied without remote operation. 1553 ;; satisfied without remote operation.
1552 (or (tramp-check-cached-permissions v ?r) 1554 (or (tramp-check-cached-permissions v ?r)
@@ -1600,13 +1602,13 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1600 ;; desirable to return t immediately for "/method:foo:". It can 1602 ;; desirable to return t immediately for "/method:foo:". It can
1601 ;; be expected that this is always a directory. 1603 ;; be expected that this is always a directory.
1602 (or (zerop (length localname)) 1604 (or (zerop (length localname))
1603 (with-file-property v localname "file-directory-p" 1605 (with-tramp-file-property v localname "file-directory-p"
1604 (tramp-run-test "-d" filename))))) 1606 (tramp-run-test "-d" filename)))))
1605 1607
1606(defun tramp-sh-handle-file-writable-p (filename) 1608(defun tramp-sh-handle-file-writable-p (filename)
1607 "Like `file-writable-p' for Tramp files." 1609 "Like `file-writable-p' for Tramp files."
1608 (with-parsed-tramp-file-name filename nil 1610 (with-parsed-tramp-file-name filename nil
1609 (with-file-property v localname "file-writable-p" 1611 (with-tramp-file-property v localname "file-writable-p"
1610 (if (file-exists-p filename) 1612 (if (file-exists-p filename)
1611 ;; Examine `file-attributes' cache to see if request can be 1613 ;; Examine `file-attributes' cache to see if request can be
1612 ;; satisfied without remote operation. 1614 ;; satisfied without remote operation.
@@ -1619,7 +1621,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1619(defun tramp-sh-handle-file-ownership-preserved-p (filename) 1621(defun tramp-sh-handle-file-ownership-preserved-p (filename)
1620 "Like `file-ownership-preserved-p' for Tramp files." 1622 "Like `file-ownership-preserved-p' for Tramp files."
1621 (with-parsed-tramp-file-name filename nil 1623 (with-parsed-tramp-file-name filename nil
1622 (with-file-property v localname "file-ownership-preserved-p" 1624 (with-tramp-file-property v localname "file-ownership-preserved-p"
1623 (let ((attributes (file-attributes filename))) 1625 (let ((attributes (file-attributes filename)))
1624 ;; Return t if the file doesn't exist, since it's true that no 1626 ;; Return t if the file doesn't exist, since it's true that no
1625 ;; information would be lost by an (attempted) delete and create. 1627 ;; information would be lost by an (attempted) delete and create.
@@ -1637,7 +1639,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1637 (let* ((temp 1639 (let* ((temp
1638 (copy-tree 1640 (copy-tree
1639 (with-parsed-tramp-file-name directory nil 1641 (with-parsed-tramp-file-name directory nil
1640 (with-file-property 1642 (with-tramp-file-property
1641 v localname 1643 v localname
1642 (format "directory-files-and-attributes-%s" id-format) 1644 (format "directory-files-and-attributes-%s" id-format)
1643 (save-excursion 1645 (save-excursion
@@ -1987,7 +1989,7 @@ file names."
1987 (tramp-error 1989 (tramp-error
1988 v 'file-already-exists "File %s already exists" newname)) 1990 v 'file-already-exists "File %s already exists" newname))
1989 1991
1990 (tramp-with-progress-reporter 1992 (with-tramp-progress-reporter
1991 v 0 (format "%s %s to %s" 1993 v 0 (format "%s %s to %s"
1992 (if (eq op 'copy) "Copying" "Renaming") 1994 (if (eq op 'copy) "Copying" "Renaming")
1993 filename newname) 1995 filename newname)
@@ -2505,7 +2507,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2505 nil) 2507 nil)
2506 ((and suffix (nth 2 suffix)) 2508 ((and suffix (nth 2 suffix))
2507 ;; We found an uncompression rule. 2509 ;; We found an uncompression rule.
2508 (tramp-with-progress-reporter 2510 (with-tramp-progress-reporter
2509 v 0 (format "Uncompressing %s" file) 2511 v 0 (format "Uncompressing %s" file)
2510 (when (tramp-send-command-and-check 2512 (when (tramp-send-command-and-check
2511 v (concat (nth 2 suffix) " " 2513 v (concat (nth 2 suffix) " "
@@ -2517,7 +2519,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2517 (t 2519 (t
2518 ;; We don't recognize the file as compressed, so compress it. 2520 ;; We don't recognize the file as compressed, so compress it.
2519 ;; Try gzip. 2521 ;; Try gzip.
2520 (tramp-with-progress-reporter v 0 (format "Compressing %s" file) 2522 (with-tramp-progress-reporter v 0 (format "Compressing %s" file)
2521 (when (tramp-send-command-and-check 2523 (when (tramp-send-command-and-check
2522 v (concat "gzip -f " 2524 v (concat "gzip -f "
2523 (tramp-shell-quote-argument localname))) 2525 (tramp-shell-quote-argument localname)))
@@ -2673,7 +2675,7 @@ the result will be a local, non-Tramp, filename."
2673 (string-match "\\`su\\(do\\)?\\'" method)) 2675 (string-match "\\`su\\(do\\)?\\'" method))
2674 (setq uname (concat uname user))) 2676 (setq uname (concat uname user)))
2675 (setq uname 2677 (setq uname
2676 (with-connection-property v uname 2678 (with-tramp-connection-property v uname
2677 (tramp-send-command 2679 (tramp-send-command
2678 v (format "cd %s; pwd" (tramp-shell-quote-argument uname))) 2680 v (format "cd %s; pwd" (tramp-shell-quote-argument uname)))
2679 (with-current-buffer (tramp-get-buffer v) 2681 (with-current-buffer (tramp-get-buffer v)
@@ -2943,7 +2945,7 @@ the result will be a local, non-Tramp, filename."
2943 ;; Use inline encoding for file transfer. 2945 ;; Use inline encoding for file transfer.
2944 (rem-enc 2946 (rem-enc
2945 (save-excursion 2947 (save-excursion
2946 (tramp-with-progress-reporter 2948 (with-tramp-progress-reporter
2947 v 3 (format "Encoding remote file %s" filename) 2949 v 3 (format "Encoding remote file %s" filename)
2948 (tramp-barf-unless-okay 2950 (tramp-barf-unless-okay
2949 v (format rem-enc (tramp-shell-quote-argument localname)) 2951 v (format rem-enc (tramp-shell-quote-argument localname))
@@ -2957,7 +2959,7 @@ the result will be a local, non-Tramp, filename."
2957 (with-temp-buffer 2959 (with-temp-buffer
2958 (set-buffer-multibyte nil) 2960 (set-buffer-multibyte nil)
2959 (insert-buffer-substring (tramp-get-buffer v)) 2961 (insert-buffer-substring (tramp-get-buffer v))
2960 (tramp-with-progress-reporter 2962 (with-tramp-progress-reporter
2961 v 3 (format "Decoding remote file %s with function %s" 2963 v 3 (format "Decoding remote file %s with function %s"
2962 filename loc-dec) 2964 filename loc-dec)
2963 (funcall loc-dec (point-min) (point-max)) 2965 (funcall loc-dec (point-min) (point-max))
@@ -2975,7 +2977,7 @@ the result will be a local, non-Tramp, filename."
2975 (let (file-name-handler-alist 2977 (let (file-name-handler-alist
2976 (coding-system-for-write 'binary)) 2978 (coding-system-for-write 'binary))
2977 (write-region (point-min) (point-max) tmpfile2)) 2979 (write-region (point-min) (point-max) tmpfile2))
2978 (tramp-with-progress-reporter 2980 (with-tramp-progress-reporter
2979 v 3 (format "Decoding remote file %s with command %s" 2981 v 3 (format "Decoding remote file %s with command %s"
2980 filename loc-dec) 2982 filename loc-dec)
2981 (unwind-protect 2983 (unwind-protect
@@ -3203,7 +3205,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3203 (set-buffer-multibyte nil) 3205 (set-buffer-multibyte nil)
3204 ;; Use encoding function or command. 3206 ;; Use encoding function or command.
3205 (if (functionp loc-enc) 3207 (if (functionp loc-enc)
3206 (tramp-with-progress-reporter 3208 (with-tramp-progress-reporter
3207 v 3 (format "Encoding region using function `%s'" 3209 v 3 (format "Encoding region using function `%s'"
3208 loc-enc) 3210 loc-enc)
3209 (let ((coding-system-for-read 'binary)) 3211 (let ((coding-system-for-read 'binary))
@@ -3221,7 +3223,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3221 (tramp-compat-temporary-file-directory))) 3223 (tramp-compat-temporary-file-directory)))
3222 (funcall loc-enc (point-min) (point-max)))) 3224 (funcall loc-enc (point-min) (point-max))))
3223 3225
3224 (tramp-with-progress-reporter 3226 (with-tramp-progress-reporter
3225 v 3 (format "Encoding region using command `%s'" 3227 v 3 (format "Encoding region using command `%s'"
3226 loc-enc) 3228 loc-enc)
3227 (unless (zerop (tramp-call-local-coding-command 3229 (unless (zerop (tramp-call-local-coding-command
@@ -3235,7 +3237,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3235 ;; Send buffer into remote decoding command which 3237 ;; Send buffer into remote decoding command which
3236 ;; writes to remote file. Because this happens on 3238 ;; writes to remote file. Because this happens on
3237 ;; the remote host, we cannot use the function. 3239 ;; the remote host, we cannot use the function.
3238 (tramp-with-progress-reporter 3240 (with-tramp-progress-reporter
3239 v 3 3241 v 3
3240 (format "Decoding region into remote file %s" filename) 3242 (format "Decoding region into remote file %s" filename)
3241 (goto-char (point-max)) 3243 (goto-char (point-max))
@@ -3335,7 +3337,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3335 "Like `vc-registered' for Tramp files." 3337 "Like `vc-registered' for Tramp files."
3336 (tramp-compat-with-temp-message "" 3338 (tramp-compat-with-temp-message ""
3337 (with-parsed-tramp-file-name file nil 3339 (with-parsed-tramp-file-name file nil
3338 (tramp-with-progress-reporter 3340 (with-tramp-progress-reporter
3339 v 3 (format "Checking `vc-registered' for %s" file) 3341 v 3 (format "Checking `vc-registered' for %s" file)
3340 3342
3341 ;; There could be new files, created by the vc backend. We 3343 ;; There could be new files, created by the vc backend. We
@@ -3433,7 +3435,7 @@ Only send the definition if it has not already been done."
3433 (let ((scripts (tramp-get-connection-property 3435 (let ((scripts (tramp-get-connection-property
3434 (tramp-get-connection-process vec) "scripts" nil))) 3436 (tramp-get-connection-process vec) "scripts" nil)))
3435 (unless (member name scripts) 3437 (unless (member name scripts)
3436 (tramp-with-progress-reporter vec 5 (format "Sending script `%s'" name) 3438 (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
3437 ;; The script could contain a call of Perl. This is masked with `%s'. 3439 ;; The script could contain a call of Perl. This is masked with `%s'.
3438 (tramp-barf-unless-okay 3440 (tramp-barf-unless-okay
3439 vec 3441 vec
@@ -3602,7 +3604,7 @@ file exists and nonzero exit status otherwise."
3602 3604
3603(defun tramp-open-shell (vec shell) 3605(defun tramp-open-shell (vec shell)
3604 "Opens shell SHELL." 3606 "Opens shell SHELL."
3605 (tramp-with-progress-reporter 3607 (with-tramp-progress-reporter
3606 vec 5 (format "Opening remote shell `%s'" shell) 3608 vec 5 (format "Opening remote shell `%s'" shell)
3607 ;; Find arguments for this shell. 3609 ;; Find arguments for this shell.
3608 (let ((tramp-end-of-output tramp-initial-end-of-output) 3610 (let ((tramp-end-of-output tramp-initial-end-of-output)
@@ -3638,7 +3640,7 @@ file exists and nonzero exit status otherwise."
3638 (tramp-file-name-method vec) 'tramp-remote-shell))) 3640 (tramp-file-name-method vec) 'tramp-remote-shell)))
3639 shell) 3641 shell)
3640 (setq shell 3642 (setq shell
3641 (with-connection-property vec "remote-shell" 3643 (with-tramp-connection-property vec "remote-shell"
3642 ;; CCC: "root" does not exist always, see QNAP 459. 3644 ;; CCC: "root" does not exist always, see QNAP 459.
3643 ;; Which check could we apply instead? 3645 ;; Which check could we apply instead?
3644 (tramp-send-command vec "echo ~root" t) 3646 (tramp-send-command vec "echo ~root" t)
@@ -3673,7 +3675,7 @@ file exists and nonzero exit status otherwise."
3673 (tramp-open-shell vec shell)) 3675 (tramp-open-shell vec shell))
3674 3676
3675 ;; Busyboxes tend to behave strange. We check for the existence. 3677 ;; Busyboxes tend to behave strange. We check for the existence.
3676 (with-connection-property vec "busybox" 3678 (with-tramp-connection-property vec "busybox"
3677 (tramp-send-command vec (format "%s --version" shell) t) 3679 (tramp-send-command vec (format "%s --version" shell) t)
3678 (let ((case-fold-search t)) 3680 (let ((case-fold-search t))
3679 (and (string-match "busybox" (buffer-string)) t)))))) 3681 (and (string-match "busybox" (buffer-string)) t))))))
@@ -3798,7 +3800,7 @@ process to set up. VEC specifies the connection."
3798 ;; successfully, sending 625 bytes failed. Emacs makes a hack when 3800 ;; successfully, sending 625 bytes failed. Emacs makes a hack when
3799 ;; this host type is detected locally. It cannot handle remote 3801 ;; this host type is detected locally. It cannot handle remote
3800 ;; hosts, though. 3802 ;; hosts, though.
3801 (with-connection-property proc "chunksize" 3803 (with-tramp-connection-property proc "chunksize"
3802 (cond 3804 (cond
3803 ((and (integerp tramp-chunksize) (> tramp-chunksize 0)) 3805 ((and (integerp tramp-chunksize) (> tramp-chunksize 0))
3804 tramp-chunksize) 3806 tramp-chunksize)
@@ -4327,7 +4329,7 @@ connection if a previous connection has died for some reason."
4327 (when (and (boundp 'non-essential) (symbol-value 'non-essential)) 4329 (when (and (boundp 'non-essential) (symbol-value 'non-essential))
4328 (throw 'non-essential 'non-essential)) 4330 (throw 'non-essential 'non-essential))
4329 4331
4330 (tramp-with-progress-reporter 4332 (with-tramp-progress-reporter
4331 vec 3 4333 vec 3
4332 (if (zerop (length (tramp-file-name-user vec))) 4334 (if (zerop (length (tramp-file-name-user vec)))
4333 (format "Opening connection for %s using %s" 4335 (format "Opening connection for %s using %s"
@@ -4773,7 +4775,7 @@ This is used internally by `tramp-file-mode-from-int'."
4773;; Variables local to connection. 4775;; Variables local to connection.
4774 4776
4775(defun tramp-get-remote-path (vec) 4777(defun tramp-get-remote-path (vec)
4776 (with-connection-property 4778 (with-tramp-connection-property
4777 ;; When `tramp-own-remote-path' is in `tramp-remote-path', we 4779 ;; When `tramp-own-remote-path' is in `tramp-remote-path', we
4778 ;; cache the result for the session only. Otherwise, the result 4780 ;; cache the result for the session only. Otherwise, the result
4779 ;; is cached persistently. 4781 ;; is cached persistently.
@@ -4845,7 +4847,7 @@ This is used internally by `tramp-file-mode-from-int'."
4845 remote-path))))) 4847 remote-path)))))
4846 4848
4847(defun tramp-get-ls-command (vec) 4849(defun tramp-get-ls-command (vec)
4848 (with-connection-property vec "ls" 4850 (with-tramp-connection-property vec "ls"
4849 (tramp-message vec 5 "Finding a suitable `ls' command") 4851 (tramp-message vec 5 "Finding a suitable `ls' command")
4850 (or 4852 (or
4851 (catch 'ls-found 4853 (catch 'ls-found
@@ -4871,7 +4873,7 @@ This is used internally by `tramp-file-mode-from-int'."
4871 4873
4872(defun tramp-get-ls-command-with-dired (vec) 4874(defun tramp-get-ls-command-with-dired (vec)
4873 (save-match-data 4875 (save-match-data
4874 (with-connection-property vec "ls-dired" 4876 (with-tramp-connection-property vec "ls-dired"
4875 (tramp-message vec 5 "Checking, whether `ls --dired' works") 4877 (tramp-message vec 5 "Checking, whether `ls --dired' works")
4876 ;; Some "ls" versions are sensible wrt the order of arguments, 4878 ;; Some "ls" versions are sensible wrt the order of arguments,
4877 ;; they fail when "-al" is after the "--dired" argument (for 4879 ;; they fail when "-al" is after the "--dired" argument (for
@@ -4880,7 +4882,7 @@ This is used internally by `tramp-file-mode-from-int'."
4880 vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec)))))) 4882 vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec))))))
4881 4883
4882(defun tramp-get-test-command (vec) 4884(defun tramp-get-test-command (vec)
4883 (with-connection-property vec "test" 4885 (with-tramp-connection-property vec "test"
4884 (tramp-message vec 5 "Finding a suitable `test' command") 4886 (tramp-message vec 5 "Finding a suitable `test' command")
4885 (if (tramp-send-command-and-check vec "test 0") 4887 (if (tramp-send-command-and-check vec "test 0")
4886 "test" 4888 "test"
@@ -4890,7 +4892,7 @@ This is used internally by `tramp-file-mode-from-int'."
4890 ;; Does `test A -nt B' work? Use abominable `find' construct if it 4892 ;; Does `test A -nt B' work? Use abominable `find' construct if it
4891 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command, 4893 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
4892 ;; for otherwise the shell crashes. 4894 ;; for otherwise the shell crashes.
4893 (with-connection-property vec "test-nt" 4895 (with-tramp-connection-property vec "test-nt"
4894 (or 4896 (or
4895 (progn 4897 (progn
4896 (tramp-send-command 4898 (tramp-send-command
@@ -4908,17 +4910,17 @@ This is used internally by `tramp-file-mode-from-int'."
4908 "tramp_test_nt %s %s")))) 4910 "tramp_test_nt %s %s"))))
4909 4911
4910(defun tramp-get-file-exists-command (vec) 4912(defun tramp-get-file-exists-command (vec)
4911 (with-connection-property vec "file-exists" 4913 (with-tramp-connection-property vec "file-exists"
4912 (tramp-message vec 5 "Finding command to check if file exists") 4914 (tramp-message vec 5 "Finding command to check if file exists")
4913 (tramp-find-file-exists-command vec))) 4915 (tramp-find-file-exists-command vec)))
4914 4916
4915(defun tramp-get-remote-ln (vec) 4917(defun tramp-get-remote-ln (vec)
4916 (with-connection-property vec "ln" 4918 (with-tramp-connection-property vec "ln"
4917 (tramp-message vec 5 "Finding a suitable `ln' command") 4919 (tramp-message vec 5 "Finding a suitable `ln' command")
4918 (tramp-find-executable vec "ln" (tramp-get-remote-path vec)))) 4920 (tramp-find-executable vec "ln" (tramp-get-remote-path vec))))
4919 4921
4920(defun tramp-get-remote-perl (vec) 4922(defun tramp-get-remote-perl (vec)
4921 (with-connection-property vec "perl" 4923 (with-tramp-connection-property vec "perl"
4922 (tramp-message vec 5 "Finding a suitable `perl' command") 4924 (tramp-message vec 5 "Finding a suitable `perl' command")
4923 (let ((result 4925 (let ((result
4924 (or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec)) 4926 (or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec))
@@ -4926,16 +4928,16 @@ This is used internally by `tramp-file-mode-from-int'."
4926 vec "perl" (tramp-get-remote-path vec))))) 4928 vec "perl" (tramp-get-remote-path vec)))))
4927 ;; We must check also for some Perl modules. 4929 ;; We must check also for some Perl modules.
4928 (when result 4930 (when result
4929 (with-connection-property vec "perl-file-spec" 4931 (with-tramp-connection-property vec "perl-file-spec"
4930 (tramp-send-command-and-check 4932 (tramp-send-command-and-check
4931 vec (format "%s -e 'use File::Spec;'" result))) 4933 vec (format "%s -e 'use File::Spec;'" result)))
4932 (with-connection-property vec "perl-cwd-realpath" 4934 (with-tramp-connection-property vec "perl-cwd-realpath"
4933 (tramp-send-command-and-check 4935 (tramp-send-command-and-check
4934 vec (format "%s -e 'use Cwd \"realpath\";'" result)))) 4936 vec (format "%s -e 'use Cwd \"realpath\";'" result))))
4935 result))) 4937 result)))
4936 4938
4937(defun tramp-get-remote-stat (vec) 4939(defun tramp-get-remote-stat (vec)
4938 (with-connection-property vec "stat" 4940 (with-tramp-connection-property vec "stat"
4939 (tramp-message vec 5 "Finding a suitable `stat' command") 4941 (tramp-message vec 5 "Finding a suitable `stat' command")
4940 (let ((result (tramp-find-executable 4942 (let ((result (tramp-find-executable
4941 vec "stat" (tramp-get-remote-path vec))) 4943 vec "stat" (tramp-get-remote-path vec)))
@@ -4953,7 +4955,7 @@ This is used internally by `tramp-file-mode-from-int'."
4953 result))) 4955 result)))
4954 4956
4955(defun tramp-get-remote-readlink (vec) 4957(defun tramp-get-remote-readlink (vec)
4956 (with-connection-property vec "readlink" 4958 (with-tramp-connection-property vec "readlink"
4957 (tramp-message vec 5 "Finding a suitable `readlink' command") 4959 (tramp-message vec 5 "Finding a suitable `readlink' command")
4958 (let ((result (tramp-find-executable 4960 (let ((result (tramp-find-executable
4959 vec "readlink" (tramp-get-remote-path vec)))) 4961 vec "readlink" (tramp-get-remote-path vec))))
@@ -4963,12 +4965,12 @@ This is used internally by `tramp-file-mode-from-int'."
4963 result)))) 4965 result))))
4964 4966
4965(defun tramp-get-remote-trash (vec) 4967(defun tramp-get-remote-trash (vec)
4966 (with-connection-property vec "trash" 4968 (with-tramp-connection-property vec "trash"
4967 (tramp-message vec 5 "Finding a suitable `trash' command") 4969 (tramp-message vec 5 "Finding a suitable `trash' command")
4968 (tramp-find-executable vec "trash" (tramp-get-remote-path vec)))) 4970 (tramp-find-executable vec "trash" (tramp-get-remote-path vec))))
4969 4971
4970(defun tramp-get-remote-id (vec) 4972(defun tramp-get-remote-id (vec)
4971 (with-connection-property vec "id" 4973 (with-tramp-connection-property vec "id"
4972 (tramp-message vec 5 "Finding POSIX `id' command") 4974 (tramp-message vec 5 "Finding POSIX `id' command")
4973 (or 4975 (or
4974 (catch 'id-found 4976 (catch 'id-found
@@ -4982,7 +4984,7 @@ This is used internally by `tramp-file-mode-from-int'."
4982 (tramp-error vec 'file-error "Couldn't find a POSIX `id' command")))) 4984 (tramp-error vec 'file-error "Couldn't find a POSIX `id' command"))))
4983 4985
4984(defun tramp-get-remote-uid (vec id-format) 4986(defun tramp-get-remote-uid (vec id-format)
4985 (with-connection-property vec (format "uid-%s" id-format) 4987 (with-tramp-connection-property vec (format "uid-%s" id-format)
4986 (let ((res (tramp-send-command-and-read 4988 (let ((res (tramp-send-command-and-read
4987 vec 4989 vec
4988 (format "%s -u%s %s" 4990 (format "%s -u%s %s"
@@ -4994,7 +4996,7 @@ This is used internally by `tramp-file-mode-from-int'."
4994 (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) 4996 (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
4995 4997
4996(defun tramp-get-remote-gid (vec id-format) 4998(defun tramp-get-remote-gid (vec id-format)
4997 (with-connection-property vec (format "gid-%s" id-format) 4999 (with-tramp-connection-property vec (format "gid-%s" id-format)
4998 (let ((res (tramp-send-command-and-read 5000 (let ((res (tramp-send-command-and-read
4999 vec 5001 vec
5000 (format "%s -g%s %s" 5002 (format "%s -g%s %s"
@@ -5020,7 +5022,7 @@ the length of the file to be compressed.
5020If no corresponding command is found, nil is returned." 5022If no corresponding command is found, nil is returned."
5021 (when (and (integerp tramp-inline-compress-start-size) 5023 (when (and (integerp tramp-inline-compress-start-size)
5022 (> size tramp-inline-compress-start-size)) 5024 (> size tramp-inline-compress-start-size))
5023 (with-connection-property (tramp-get-connection-process vec) prop 5025 (with-tramp-connection-property (tramp-get-connection-process vec) prop
5024 (tramp-find-inline-compress vec) 5026 (tramp-find-inline-compress vec)
5025 (tramp-get-connection-property 5027 (tramp-get-connection-property
5026 (tramp-get-connection-process vec) prop nil)))) 5028 (tramp-get-connection-process vec) prop nil))))
@@ -5041,7 +5043,8 @@ function cell is returned to be applied on a buffer."
5041 ;; no inline coding is found. 5043 ;; no inline coding is found.
5042 (ignore-errors 5044 (ignore-errors
5043 (let ((coding 5045 (let ((coding
5044 (with-connection-property (tramp-get-connection-process vec) prop 5046 (with-tramp-connection-property
5047 (tramp-get-connection-process vec) prop
5045 (tramp-find-inline-encoding vec) 5048 (tramp-find-inline-encoding vec)
5046 (tramp-get-connection-property 5049 (tramp-get-connection-property
5047 (tramp-get-connection-process vec) prop nil))) 5050 (tramp-get-connection-process vec) prop nil)))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index f1d54b6fd3c..567f8f2969a 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -355,7 +355,7 @@ pass to the OPERATION."
355 (let ((t1 (tramp-tramp-file-p dirname)) 355 (let ((t1 (tramp-tramp-file-p dirname))
356 (t2 (tramp-tramp-file-p newname))) 356 (t2 (tramp-tramp-file-p newname)))
357 (with-parsed-tramp-file-name (if t1 dirname newname) nil 357 (with-parsed-tramp-file-name (if t1 dirname newname) nil
358 (tramp-with-progress-reporter 358 (with-tramp-progress-reporter
359 v 0 (format "Copying %s to %s" dirname newname) 359 v 0 (format "Copying %s to %s" dirname newname)
360 (cond 360 (cond
361 ;; We must use a local temporary directory. 361 ;; We must use a local temporary directory.
@@ -491,7 +491,7 @@ KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
491PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored." 491PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
492 (setq filename (expand-file-name filename) 492 (setq filename (expand-file-name filename)
493 newname (expand-file-name newname)) 493 newname (expand-file-name newname))
494 (tramp-with-progress-reporter 494 (with-tramp-progress-reporter
495 (tramp-dissect-file-name (if (file-remote-p filename) filename newname)) 495 (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
496 0 (format "Copying %s to %s" filename newname) 496 0 (format "Copying %s to %s" filename newname)
497 497
@@ -642,7 +642,8 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
642 (unless id-format (setq id-format 'integer)) 642 (unless id-format (setq id-format 'integer))
643 (ignore-errors 643 (ignore-errors
644 (with-parsed-tramp-file-name filename nil 644 (with-parsed-tramp-file-name filename nil
645 (with-file-property v localname (format "file-attributes-%s" id-format) 645 (with-tramp-file-property
646 v localname (format "file-attributes-%s" id-format)
646 (if (and (tramp-smb-get-share v) (tramp-smb-get-stat-capability v)) 647 (if (and (tramp-smb-get-share v) (tramp-smb-get-stat-capability v))
647 (tramp-smb-do-file-attributes-with-stat v id-format) 648 (tramp-smb-do-file-attributes-with-stat v id-format)
648 ;; Reading just the filename entry via "dir localname" is not 649 ;; Reading just the filename entry via "dir localname" is not
@@ -753,7 +754,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
753 v 'file-error 754 v 'file-error
754 "Cannot make local copy of non-existing file `%s'" filename)) 755 "Cannot make local copy of non-existing file `%s'" filename))
755 (let ((tmpfile (tramp-compat-make-temp-file filename))) 756 (let ((tmpfile (tramp-compat-make-temp-file filename)))
756 (tramp-with-progress-reporter 757 (with-tramp-progress-reporter
757 v 3 (format "Fetching %s to tmp file %s" filename tmpfile) 758 v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
758 (unless (tramp-smb-send-command 759 (unless (tramp-smb-send-command
759 v (format "get \"%s\" \"%s\"" 760 v (format "get \"%s\" \"%s\""
@@ -771,7 +772,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
771 (all-completions 772 (all-completions
772 filename 773 filename
773 (with-parsed-tramp-file-name directory nil 774 (with-parsed-tramp-file-name directory nil
774 (with-file-property v localname "file-name-all-completions" 775 (with-tramp-file-property v localname "file-name-all-completions"
775 (save-match-data 776 (save-match-data
776 (let ((entries (tramp-smb-get-file-entries directory))) 777 (let ((entries (tramp-smb-get-file-entries directory)))
777 (mapcar 778 (mapcar
@@ -1119,7 +1120,7 @@ target of the symlink differ."
1119 (if (file-remote-p filename) filename newname)) 1120 (if (file-remote-p filename) filename newname))
1120 'file-already-exists newname)) 1121 'file-already-exists newname))
1121 1122
1122 (tramp-with-progress-reporter 1123 (with-tramp-progress-reporter
1123 (tramp-dissect-file-name (if (file-remote-p filename) filename newname)) 1124 (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
1124 0 (format "Renaming %s to %s" filename newname) 1125 0 (format "Renaming %s to %s" filename newname)
1125 1126
@@ -1253,7 +1254,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1253 (list start end tmpfile append 'no-message lockname confirm) 1254 (list start end tmpfile append 'no-message lockname confirm)
1254 (list start end tmpfile append 'no-message lockname))) 1255 (list start end tmpfile append 'no-message lockname)))
1255 1256
1256 (tramp-with-progress-reporter 1257 (with-tramp-progress-reporter
1257 v 3 (format "Moving tmp file %s to %s" tmpfile filename) 1258 v 3 (format "Moving tmp file %s to %s" tmpfile filename)
1258 (unwind-protect 1259 (unwind-protect
1259 (unless (tramp-smb-send-command 1260 (unless (tramp-smb-send-command
@@ -1312,7 +1313,7 @@ Either the shares are listed, or the `dir' command is executed.
1312Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." 1313Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
1313 (with-parsed-tramp-file-name (file-name-as-directory directory) nil 1314 (with-parsed-tramp-file-name (file-name-as-directory directory) nil
1314 (setq localname (or localname "/")) 1315 (setq localname (or localname "/"))
1315 (with-file-property v localname "file-entries" 1316 (with-tramp-file-property v localname "file-entries"
1316 (with-current-buffer (tramp-get-connection-buffer v) 1317 (with-current-buffer (tramp-get-connection-buffer v)
1317 (let* ((share (tramp-smb-get-share v)) 1318 (let* ((share (tramp-smb-get-share v))
1318 (cache (tramp-get-connection-property v "share-cache" nil)) 1319 (cache (tramp-get-connection-property v "share-cache" nil))
@@ -1497,7 +1498,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
1497 ;; When we are not logged in yet, we return nil. 1498 ;; When we are not logged in yet, we return nil.
1498 (if (let ((p (tramp-get-connection-process vec))) 1499 (if (let ((p (tramp-get-connection-process vec)))
1499 (and p (processp p) (memq (process-status p) '(run open)))) 1500 (and p (processp p) (memq (process-status p) '(run open))))
1500 (with-connection-property 1501 (with-tramp-connection-property
1501 (tramp-get-connection-process vec) "cifs-capabilities" 1502 (tramp-get-connection-process vec) "cifs-capabilities"
1502 (save-match-data 1503 (save-match-data
1503 (when (tramp-smb-send-command vec "posix") 1504 (when (tramp-smb-send-command vec "posix")
@@ -1515,7 +1516,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
1515 ;; When we are not logged in yet, we return nil. 1516 ;; When we are not logged in yet, we return nil.
1516 (if (let ((p (tramp-get-connection-process vec))) 1517 (if (let ((p (tramp-get-connection-process vec)))
1517 (and p (processp p) (memq (process-status p) '(run open)))) 1518 (and p (processp p) (memq (process-status p) '(run open))))
1518 (with-connection-property 1519 (with-tramp-connection-property
1519 (tramp-get-connection-process vec) "stat-capability" 1520 (tramp-get-connection-process vec) "stat-capability"
1520 (tramp-smb-send-command vec "stat .")))) 1521 (tramp-smb-send-command vec "stat ."))))
1521 1522
@@ -1625,7 +1626,7 @@ If ARGUMENT is non-nil, use it as argument for
1625 (setq args (append args (list argument)))) 1626 (setq args (append args (list argument))))
1626 1627
1627 ;; OK, let's go. 1628 ;; OK, let's go.
1628 (tramp-with-progress-reporter 1629 (with-tramp-progress-reporter
1629 vec 3 1630 vec 3
1630 (format "Opening connection for //%s%s/%s" 1631 (format "Opening connection for //%s%s/%s"
1631 (if (not (zerop (length user))) (concat user "@") "") 1632 (if (not (zerop (length user))) (concat user "@") "")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b1532eb2ae4..874c0aa7fef 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1353,8 +1353,7 @@ ARGS to actually emit the message (if applicable)."
1353 "tramp-debug-message" 1353 "tramp-debug-message"
1354 "tramp-error" 1354 "tramp-error"
1355 "tramp-error-with-buffer" 1355 "tramp-error-with-buffer"
1356 "tramp-message" 1356 "tramp-message")
1357 "tramp-with-progress-reporter")
1358 t) 1357 t)
1359 "$") 1358 "$")
1360 fn))) 1359 fn)))
@@ -1498,7 +1497,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user',
1498 (when (string-match message (or (current-message) "")) 1497 (when (string-match message (or (current-message) ""))
1499 (tramp-compat-funcall 'progress-reporter-update reporter value)))) 1498 (tramp-compat-funcall 'progress-reporter-update reporter value))))
1500 1499
1501(defmacro tramp-with-progress-reporter (vec level message &rest body) 1500(defmacro with-tramp-progress-reporter (vec level message &rest body)
1502 "Executes BODY, spinning a progress reporter with MESSAGE. 1501 "Executes BODY, spinning a progress reporter with MESSAGE.
1503If LEVEL does not fit for visible messages, or if this is a 1502If LEVEL does not fit for visible messages, or if this is a
1504nested call of the macro, there are only traces without a visible 1503nested call of the macro, there are only traces without a visible
@@ -1527,7 +1526,42 @@ progress reporter."
1527 (tramp-message ,vec ,level "%s...done" ,message)))) 1526 (tramp-message ,vec ,level "%s...done" ,message))))
1528 1527
1529(tramp-compat-font-lock-add-keywords 1528(tramp-compat-font-lock-add-keywords
1530 'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>")) 1529 'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>"))
1530
1531(defmacro with-tramp-file-property (vec file property &rest body)
1532 "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
1533FILE must be a local file name on a connection identified via VEC."
1534 `(if (file-name-absolute-p ,file)
1535 (let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
1536 (when (eq value 'undef)
1537 ;; We cannot pass @body as parameter to
1538 ;; `tramp-set-file-property' because it mangles our
1539 ;; debug messages.
1540 (setq value (progn ,@body))
1541 (tramp-set-file-property ,vec ,file ,property value))
1542 value)
1543 ,@body))
1544
1545(put 'with-tramp-file-property 'lisp-indent-function 3)
1546(put 'with-tramp-file-property 'edebug-form-spec t)
1547(tramp-compat-font-lock-add-keywords
1548 'emacs-lisp-mode '("\\<with-tramp-file-property\\>"))
1549
1550(defmacro with-tramp-connection-property (key property &rest body)
1551 "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
1552 `(let ((value (tramp-get-connection-property ,key ,property 'undef)))
1553 (when (eq value 'undef)
1554 ;; We cannot pass ,@body as parameter to
1555 ;; `tramp-set-connection-property' because it mangles our debug
1556 ;; messages.
1557 (setq value (progn ,@body))
1558 (tramp-set-connection-property ,key ,property value))
1559 value))
1560
1561(put 'with-tramp-connection-property 'lisp-indent-function 2)
1562(put 'with-tramp-connection-property 'edebug-form-spec t)
1563(tramp-compat-font-lock-add-keywords
1564 'emacs-lisp-mode '("\\<with-tramp-connection-property\\>"))
1531 1565
1532(defalias 'tramp-drop-volume-letter 1566(defalias 'tramp-drop-volume-letter
1533 (if (memq system-type '(cygwin windows-nt)) 1567 (if (memq system-type '(cygwin windows-nt))
@@ -2860,7 +2894,7 @@ User is always nil."
2860 (setq filename (expand-file-name filename)) 2894 (setq filename (expand-file-name filename))
2861 (let (result local-copy remote-copy) 2895 (let (result local-copy remote-copy)
2862 (with-parsed-tramp-file-name filename nil 2896 (with-parsed-tramp-file-name filename nil
2863 (tramp-with-progress-reporter 2897 (with-tramp-progress-reporter
2864 v 3 (format "Inserting `%s'" filename) 2898 v 3 (format "Inserting `%s'" filename)
2865 (unwind-protect 2899 (unwind-protect
2866 (if (not (file-exists-p filename)) 2900 (if (not (file-exists-p filename))
@@ -2983,7 +3017,7 @@ User is always nil."
2983 (if (not (file-exists-p file)) 3017 (if (not (file-exists-p file))
2984 nil 3018 nil
2985 (let ((tramp-message-show-message (not nomessage))) 3019 (let ((tramp-message-show-message (not nomessage)))
2986 (tramp-with-progress-reporter v 0 (format "Loading %s" file) 3020 (with-tramp-progress-reporter v 0 (format "Loading %s" file)
2987 (let ((local-copy (file-local-copy file))) 3021 (let ((local-copy (file-local-copy file)))
2988 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil. 3022 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
2989 (unwind-protect 3023 (unwind-protect
@@ -3127,7 +3161,7 @@ beginning of local filename are not substituted."
3127 "Send the login name." 3161 "Send the login name."
3128 (when (not (stringp tramp-current-user)) 3162 (when (not (stringp tramp-current-user))
3129 (setq tramp-current-user 3163 (setq tramp-current-user
3130 (with-connection-property vec "login-as" 3164 (with-tramp-connection-property vec "login-as"
3131 (save-window-excursion 3165 (save-window-excursion
3132 (let ((enable-recursive-minibuffers t)) 3166 (let ((enable-recursive-minibuffers t))
3133 (pop-to-buffer (tramp-get-connection-buffer vec)) 3167 (pop-to-buffer (tramp-get-connection-buffer vec))
@@ -3417,13 +3451,13 @@ the remote host use line-endings as defined in the variable
3417(defun tramp-get-inode (vec) 3451(defun tramp-get-inode (vec)
3418 "Returns the virtual inode number. 3452 "Returns the virtual inode number.
3419If it doesn't exist, generate a new one." 3453If it doesn't exist, generate a new one."
3420 (with-file-property vec (tramp-file-name-localname vec) "inode" 3454 (with-tramp-file-property vec (tramp-file-name-localname vec) "inode"
3421 (setq tramp-inodes (1+ tramp-inodes)))) 3455 (setq tramp-inodes (1+ tramp-inodes))))
3422 3456
3423(defun tramp-get-device (vec) 3457(defun tramp-get-device (vec)
3424 "Returns the virtual device number. 3458 "Returns the virtual device number.
3425If it doesn't exist, generate a new one." 3459If it doesn't exist, generate a new one."
3426 (with-connection-property (tramp-get-connection-process vec) "device" 3460 (with-tramp-connection-property (tramp-get-connection-process vec) "device"
3427 (cons -1 (setq tramp-devices (1+ tramp-devices))))) 3461 (cons -1 (setq tramp-devices (1+ tramp-devices)))))
3428 3462
3429(defun tramp-equal-remote (file1 file2) 3463(defun tramp-equal-remote (file1 file2)
@@ -3545,7 +3579,7 @@ would yield `t'. On the other hand, the following check results in nil:
3545 3579
3546(defun tramp-get-remote-tmpdir (vec) 3580(defun tramp-get-remote-tmpdir (vec)
3547 "Return directory for temporary files on the remote host identified by VEC." 3581 "Return directory for temporary files on the remote host identified by VEC."
3548 (with-connection-property vec "tmpdir" 3582 (with-tramp-connection-property vec "tmpdir"
3549 (let ((dir (tramp-make-tramp-file-name 3583 (let ((dir (tramp-make-tramp-file-name
3550 (tramp-file-name-method vec) 3584 (tramp-file-name-method vec)
3551 (tramp-file-name-user vec) 3585 (tramp-file-name-user vec)
@@ -3833,7 +3867,6 @@ Only works for Bourne-like shells."
3833;; * In Emacs 21, `insert-directory' shows total number of bytes used 3867;; * In Emacs 21, `insert-directory' shows total number of bytes used
3834;; by the files in that directory. Add this here. 3868;; by the files in that directory. Add this here.
3835;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) 3869;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
3836;; * Make ffap.el grok Tramp filenames. (Eli Tziperman)
3837;; * abbreviate-file-name 3870;; * abbreviate-file-name
3838;; * Better error checking. At least whenever we see something 3871;; * Better error checking. At least whenever we see something
3839;; strange when doing zerop, we should kill the process and start 3872;; strange when doing zerop, we should kill the process and start
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 2d0a8e3d23d..331884691f4 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.6" 34(defconst tramp-version "2.2.7-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.6 is not fit for %s" 47 (format "Tramp 2.2.7-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 6d2eed71948..a754c89c4ae 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -117,20 +117,20 @@ Comments might be indented to a different value in order not to go beyond
117If there are any \\(...\\) pairs, the comment delimiter text is held to begin 117If there are any \\(...\\) pairs, the comment delimiter text is held to begin
118at the place matched by the close of the first pair.") 118at the place matched by the close of the first pair.")
119;;;###autoload 119;;;###autoload
120(put 'comment-start-skip 'safe-local-variable 'string-or-null-p) 120(put 'comment-start-skip 'safe-local-variable 'stringp)
121 121
122;;;###autoload 122;;;###autoload
123(defvar comment-end-skip nil 123(defvar comment-end-skip nil
124 "Regexp to match the end of a comment plus everything back to its body.") 124 "Regexp to match the end of a comment plus everything back to its body.")
125;;;###autoload 125;;;###autoload
126(put 'comment-end-skip 'safe-local-variable 'string-or-null-p) 126(put 'comment-end-skip 'safe-local-variable 'stringp)
127 127
128;;;###autoload 128;;;###autoload
129(defvar comment-end (purecopy "") 129(defvar comment-end (purecopy "")
130 "String to insert to end a new comment. 130 "String to insert to end a new comment.
131Should be an empty string if comments are terminated by end-of-line.") 131Should be an empty string if comments are terminated by end-of-line.")
132;;;###autoload 132;;;###autoload
133(put 'comment-end 'safe-local-variable 'string-or-null-p) 133(put 'comment-end 'safe-local-variable 'stringp)
134 134
135;;;###autoload 135;;;###autoload
136(defvar comment-indent-function 'comment-indent-default 136(defvar comment-indent-function 'comment-indent-default
@@ -327,9 +327,9 @@ terminated by the end of line (i.e. `comment-end' is empty)."
327;;;###autoload 327;;;###autoload
328(defun comment-normalize-vars (&optional noerror) 328(defun comment-normalize-vars (&optional noerror)
329 "Check and setup the variables needed by other commenting functions. 329 "Check and setup the variables needed by other commenting functions.
330Any command calling functions from newcomment.el, being entry points, should 330Any command calling functions from newcomment.el should call this function
331call this function before any other, so the rest of the code can assume that 331before any other, so the rest of the code can assume that the variables are
332the variables are properly set." 332properly set."
333 (unless (and (not comment-start) noerror) 333 (unless (and (not comment-start) noerror)
334 (unless comment-start 334 (unless comment-start
335 (let ((cs (read-string "No comment syntax is defined. Use: "))) 335 (let ((cs (read-string "No comment syntax is defined. Use: ")))
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el
index bd9805673a4..4236f1c983f 100644
--- a/lisp/progmodes/cc-bytecomp.el
+++ b/lisp/progmodes/cc-bytecomp.el
@@ -338,30 +338,6 @@ at compile time, e.g. for macros and inline functions."
338 (cc-bytecomp-debug-msg 338 (cc-bytecomp-debug-msg
339 "cc-bytecomp-defun: Covered function %s" ',fun)))))) 339 "cc-bytecomp-defun: Covered function %s" ',fun))))))
340 340
341(put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
342(defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
343 "Bind the symbol as a macro during compilation (and evaluation) of the
344file. Don't use outside `eval-when-compile'."
345 `(let ((orig-fun (assq ',fun cc-bytecomp-original-functions)))
346 (if (not orig-fun)
347 (setq orig-fun
348 (list ',fun
349 nil
350 (if (fboundp ',fun)
351 (progn
352 (cc-bytecomp-debug-msg
353 "cc-bytecomp-defmacro: Saving %s" ',fun)
354 (symbol-function ',fun))
355 (cc-bytecomp-debug-msg
356 "cc-bytecomp-defmacro: Saving %s as unbound" ',fun)
357 'unbound))
358 cc-bytecomp-original-functions
359 (cons orig-fun cc-bytecomp-original-functions)))
360 (defmacro ,fun ,@temp-macro)
361 (cc-bytecomp-debug-msg
362 "cc-bytecomp-defmacro: Bound macro %s" ',fun)
363 (setcar (cdr orig-fun) (symbol-function ',fun))))
364
365(defmacro cc-bytecomp-put (symbol propname value) 341(defmacro cc-bytecomp-put (symbol propname value)
366 "Set a property on a symbol during compilation (and evaluation) of 342 "Set a property on a symbol during compilation (and evaluation) of
367the file. Don't use outside `eval-when-compile'." 343the file. Don't use outside `eval-when-compile'."
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 5201e4a26ed..d56c1124a9c 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -49,16 +49,6 @@
49 (require 'custom) 49 (require 'custom)
50 (require 'widget)) 50 (require 'widget))
51 51
52(cc-eval-when-compile
53 ;; Need the function form of `backquote', which isn't standardized
54 ;; between Emacsen. It's called `bq-process' in XEmacs, and
55 ;; `backquote-process' in Emacs. `backquote-process' returns a
56 ;; slightly more convoluted form, so let `bq-process' be the norm.
57 (if (fboundp 'backquote-process)
58 (cc-bytecomp-defmacro bq-process (form)
59 `(cdr (backquote-process ,form)))))
60
61
62;;; Helpers 52;;; Helpers
63 53
64;; This widget exists in newer versions of the Custom library 54;; This widget exists in newer versions of the Custom library
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6b0dc954ca7..5bf64c18f99 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -235,6 +235,9 @@
235 (substitute-key-definition 'forward-sentence 235 (substitute-key-definition 'forward-sentence
236 'python-nav-forward-block 236 'python-nav-forward-block
237 map global-map) 237 map global-map)
238 (substitute-key-definition 'backward-up-list
239 'python-nav-backward-up-list
240 map global-map)
238 (define-key map "\C-c\C-j" 'imenu) 241 (define-key map "\C-c\C-j" 'imenu)
239 ;; Indent specific 242 ;; Indent specific
240 (define-key map "\177" 'python-indent-dedent-line-backspace) 243 (define-key map "\177" 'python-indent-dedent-line-backspace)
@@ -337,19 +340,28 @@
337 "==" ">=" "is" "not"))) 340 "==" ">=" "is" "not")))
338 ;; FIXME: Use regexp-opt. 341 ;; FIXME: Use regexp-opt.
339 (assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" 342 (assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**="
340 ">>=" "<<=" "&=" "^=" "|=")))) 343 ">>=" "<<=" "&=" "^=" "|=")))
341 "Additional Python specific sexps for `python-rx'")) 344 (string-delimiter . ,(rx (and
342 345 ;; Match even number of backslashes.
343(defmacro python-rx (&rest regexps) 346 (or (not (any ?\\ ?\' ?\")) point
344 "Python mode specialized rx macro. 347 ;; Quotes might be preceded by a escaped quote.
348 (and (or (not (any ?\\)) point) ?\\
349 (* ?\\ ?\\) (any ?\' ?\")))
350 (* ?\\ ?\\)
351 ;; Match single or triple quotes of any kind.
352 (group (or "\"" "\"\"\"" "'" "'''"))))))
353 "Additional Python specific sexps for `python-rx'")
354
355 (defmacro python-rx (&rest regexps)
356 "Python mode specialized rx macro.
345This variant of `rx' supports common python named REGEXPS." 357This variant of `rx' supports common python named REGEXPS."
346 (let ((rx-constituents (append python-rx-constituents rx-constituents))) 358 (let ((rx-constituents (append python-rx-constituents rx-constituents)))
347 (cond ((null regexps) 359 (cond ((null regexps)
348 (error "No regexp")) 360 (error "No regexp"))
349 ((cdr regexps) 361 ((cdr regexps)
350 (rx-to-string `(and ,@regexps) t)) 362 (rx-to-string `(and ,@regexps) t))
351 (t 363 (t
352 (rx-to-string (car regexps) t))))) 364 (rx-to-string (car regexps) t))))))
353 365
354 366
355;;; Font-lock and syntax 367;;; Font-lock and syntax
@@ -498,16 +510,7 @@ The type returned can be `comment', `string' or `paren'."
498 510
499(defconst python-syntax-propertize-function 511(defconst python-syntax-propertize-function
500 (syntax-propertize-rules 512 (syntax-propertize-rules
501 ((rx 513 ((python-rx string-delimiter)
502 (and
503 ;; Match even number of backslashes.
504 (or (not (any ?\\ ?\' ?\")) point
505 ;; Quotes might be preceded by a escaped quote.
506 (and (or (not (any ?\\)) point) ?\\
507 (* ?\\ ?\\) (any ?\' ?\")))
508 (* ?\\ ?\\)
509 ;; Match single or triple quotes of any kind.
510 (group (or "\"" "\"\"\"" "'" "'''"))))
511 (0 (ignore (python-syntax-stringify)))))) 514 (0 (ignore (python-syntax-stringify))))))
512 515
513(defsubst python-syntax-count-quotes (quote-char &optional point limit) 516(defsubst python-syntax-count-quotes (quote-char &optional point limit)
@@ -1409,6 +1412,67 @@ move backward N times."
1409 (python-nav--backward-sexp) 1412 (python-nav--backward-sexp)
1410 (setq arg (1+ arg)))) 1413 (setq arg (1+ arg))))
1411 1414
1415(defun python-nav--up-list (&optional dir)
1416 "Internal implementation of `python-nav-up-list'.
1417DIR is always 1 or -1 and comes sanitized from
1418`python-nav-up-list' calls."
1419 (let ((context (python-syntax-context-type))
1420 (forward-p (> dir 0)))
1421 (cond
1422 ((memq context '(string comment)))
1423 ((eq context 'paren)
1424 (let ((forward-sexp-function))
1425 (up-list dir)))
1426 ((and forward-p (python-info-end-of-block-p))
1427 (let ((parent-end-pos
1428 (save-excursion
1429 (let ((indentation (and
1430 (python-nav-beginning-of-block)
1431 (current-indentation))))
1432 (while (and indentation
1433 (> indentation 0)
1434 (>= (current-indentation) indentation)
1435 (python-nav-backward-block)))
1436 (python-nav-end-of-block)))))
1437 (and (> (or parent-end-pos (point)) (point))
1438 (goto-char parent-end-pos))))
1439 (forward-p (python-nav-end-of-block))
1440 ((and (not forward-p)
1441 (> (current-indentation) 0)
1442 (python-info-beginning-of-block-p))
1443 (let ((prev-block-pos
1444 (save-excursion
1445 (let ((indentation (current-indentation)))
1446 (while (and (python-nav-backward-block)
1447 (> (current-indentation) indentation))))
1448 (point))))
1449 (and (> (point) prev-block-pos)
1450 (goto-char prev-block-pos))))
1451 ((not forward-p) (python-nav-beginning-of-block)))))
1452
1453(defun python-nav-up-list (&optional arg)
1454 "Move forward out of one level of parentheses (or blocks).
1455With ARG, do this that many times.
1456A negative argument means move backward but still to a less deep spot.
1457This command assumes point is not in a string or comment."
1458 (interactive "^p")
1459 (or arg (setq arg 1))
1460 (while (> arg 0)
1461 (python-nav--up-list 1)
1462 (setq arg (1- arg)))
1463 (while (< arg 0)
1464 (python-nav--up-list -1)
1465 (setq arg (1+ arg))))
1466
1467(defun python-nav-backward-up-list (&optional arg)
1468 "Move backward out of one level of parentheses (or blocks).
1469With ARG, do this that many times.
1470A negative argument means move backward but still to a less deep spot.
1471This command assumes point is not in a string or comment."
1472 (interactive "^p")
1473 (or arg (setq arg 1))
1474 (python-nav-up-list (- arg)))
1475
1412 1476
1413;;; Shell integration 1477;;; Shell integration
1414 1478
@@ -1609,6 +1673,20 @@ OUTPUT is a string with the contents of the buffer."
1609 1673
1610(defvar python-shell--parent-buffer nil) 1674(defvar python-shell--parent-buffer nil)
1611 1675
1676(defvar python-shell-output-syntax-table
1677 (let ((table (make-syntax-table python-dotty-syntax-table)))
1678 (modify-syntax-entry ?\' "." table)
1679 (modify-syntax-entry ?\" "." table)
1680 (modify-syntax-entry ?\( "." table)
1681 (modify-syntax-entry ?\[ "." table)
1682 (modify-syntax-entry ?\{ "." table)
1683 (modify-syntax-entry ?\) "." table)
1684 (modify-syntax-entry ?\] "." table)
1685 (modify-syntax-entry ?\} "." table)
1686 table)
1687 "Syntax table for shell output.
1688It makes parens and quotes be treated as punctuation chars.")
1689
1612(define-derived-mode inferior-python-mode comint-mode "Inferior Python" 1690(define-derived-mode inferior-python-mode comint-mode "Inferior Python"
1613 "Major mode for Python inferior process. 1691 "Major mode for Python inferior process.
1614Runs a Python interpreter as a subprocess of Emacs, with Python 1692Runs a Python interpreter as a subprocess of Emacs, with Python
@@ -1637,7 +1715,6 @@ variable.
1637 python-shell-prompt-regexp 1715 python-shell-prompt-regexp
1638 python-shell-prompt-block-regexp 1716 python-shell-prompt-block-regexp
1639 python-shell-prompt-pdb-regexp)) 1717 python-shell-prompt-pdb-regexp))
1640 (set-syntax-table python-mode-syntax-table)
1641 (setq mode-line-process '(":%s")) 1718 (setq mode-line-process '(":%s"))
1642 (make-local-variable 'comint-output-filter-functions) 1719 (make-local-variable 'comint-output-filter-functions)
1643 (add-hook 'comint-output-filter-functions 1720 (add-hook 'comint-output-filter-functions
@@ -1658,10 +1735,21 @@ variable.
1658 (make-local-variable 'python-pdbtrack-tracked-buffer) 1735 (make-local-variable 'python-pdbtrack-tracked-buffer)
1659 (make-local-variable 'python-shell-internal-last-output) 1736 (make-local-variable 'python-shell-internal-last-output)
1660 (when python-shell-enable-font-lock 1737 (when python-shell-enable-font-lock
1738 (set-syntax-table python-mode-syntax-table)
1661 (set (make-local-variable 'font-lock-defaults) 1739 (set (make-local-variable 'font-lock-defaults)
1662 '(python-font-lock-keywords nil nil nil nil)) 1740 '(python-font-lock-keywords nil nil nil nil))
1663 (set (make-local-variable 'syntax-propertize-function) 1741 (set (make-local-variable 'syntax-propertize-function)
1664 python-syntax-propertize-function)) 1742 (syntax-propertize-rules
1743 (comint-prompt-regexp
1744 (0 (ignore
1745 (put-text-property
1746 comint-last-input-start end 'syntax-table
1747 python-shell-output-syntax-table)
1748 (font-lock-unfontify-region comint-last-input-start end))))
1749 ((python-rx string-delimiter)
1750 (0 (ignore
1751 (and (not (eq (get-text-property start 'field) 'output))
1752 (python-syntax-stringify))))))))
1665 (compilation-shell-minor-mode 1)) 1753 (compilation-shell-minor-mode 1))
1666 1754
1667(defun python-shell-make-comint (cmd proc-name &optional pop internal) 1755(defun python-shell-make-comint (cmd proc-name &optional pop internal)
@@ -1842,7 +1930,9 @@ detecting a prompt at the end of the buffer."
1842 python-shell-output-filter-buffer 1930 python-shell-output-filter-buffer
1843 (concat python-shell-output-filter-buffer string)) 1931 (concat python-shell-output-filter-buffer string))
1844 (when (string-match 1932 (when (string-match
1845 (format "\n\\(?:%s\\|%s\\|%s\\)$" 1933 ;; XXX: It seems on OSX an extra carriage return is attached
1934 ;; at the end of output, this handles that too.
1935 (format "\r?\n\\(?:%s\\|%s\\|%s\\)$"
1846 python-shell-prompt-regexp 1936 python-shell-prompt-regexp
1847 python-shell-prompt-block-regexp 1937 python-shell-prompt-block-regexp
1848 python-shell-prompt-pdb-regexp) 1938 python-shell-prompt-pdb-regexp)
@@ -2246,28 +2336,28 @@ inferior python process is updated properly."
2246 2336
2247(defcustom python-fill-comment-function 'python-fill-comment 2337(defcustom python-fill-comment-function 'python-fill-comment
2248 "Function to fill comments. 2338 "Function to fill comments.
2249This is the function used by `python-fill-paragraph-function' to 2339This is the function used by `python-fill-paragraph' to
2250fill comments." 2340fill comments."
2251 :type 'symbol 2341 :type 'symbol
2252 :group 'python) 2342 :group 'python)
2253 2343
2254(defcustom python-fill-string-function 'python-fill-string 2344(defcustom python-fill-string-function 'python-fill-string
2255 "Function to fill strings. 2345 "Function to fill strings.
2256This is the function used by `python-fill-paragraph-function' to 2346This is the function used by `python-fill-paragraph' to
2257fill strings." 2347fill strings."
2258 :type 'symbol 2348 :type 'symbol
2259 :group 'python) 2349 :group 'python)
2260 2350
2261(defcustom python-fill-decorator-function 'python-fill-decorator 2351(defcustom python-fill-decorator-function 'python-fill-decorator
2262 "Function to fill decorators. 2352 "Function to fill decorators.
2263This is the function used by `python-fill-paragraph-function' to 2353This is the function used by `python-fill-paragraph' to
2264fill decorators." 2354fill decorators."
2265 :type 'symbol 2355 :type 'symbol
2266 :group 'python) 2356 :group 'python)
2267 2357
2268(defcustom python-fill-paren-function 'python-fill-paren 2358(defcustom python-fill-paren-function 'python-fill-paren
2269 "Function to fill parens. 2359 "Function to fill parens.
2270This is the function used by `python-fill-paragraph-function' to 2360This is the function used by `python-fill-paragraph' to
2271fill parens." 2361fill parens."
2272 :type 'symbol 2362 :type 'symbol
2273 :group 'python) 2363 :group 'python)
@@ -2344,7 +2434,7 @@ SYMMETRIC:
2344 :safe (lambda (val) 2434 :safe (lambda (val)
2345 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil)))) 2435 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil))))
2346 2436
2347(defun python-fill-paragraph-function (&optional justify) 2437(defun python-fill-paragraph (&optional justify)
2348 "`fill-paragraph-function' handling multi-line strings and possibly comments. 2438 "`fill-paragraph-function' handling multi-line strings and possibly comments.
2349If any of the current line is in or at the end of a multi-line string, 2439If any of the current line is in or at the end of a multi-line string,
2350fill the string or the paragraph of it that point is in, preserving 2440fill the string or the paragraph of it that point is in, preserving
@@ -2363,8 +2453,7 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2363 (funcall python-fill-string-function justify)) 2453 (funcall python-fill-string-function justify))
2364 ;; Decorators 2454 ;; Decorators
2365 ((equal (char-after (save-excursion 2455 ((equal (char-after (save-excursion
2366 (back-to-indentation) 2456 (python-nav-beginning-of-statement))) ?@)
2367 (point))) ?@)
2368 (funcall python-fill-decorator-function justify)) 2457 (funcall python-fill-decorator-function justify))
2369 ;; Parens 2458 ;; Parens
2370 ((or (python-syntax-context 'paren) 2459 ((or (python-syntax-context 'paren)
@@ -2376,12 +2465,12 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2376 (t t)))) 2465 (t t))))
2377 2466
2378(defun python-fill-comment (&optional justify) 2467(defun python-fill-comment (&optional justify)
2379 "Comment fill function for `python-fill-paragraph-function'. 2468 "Comment fill function for `python-fill-paragraph'.
2380JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2469JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2381 (fill-comment-paragraph justify)) 2470 (fill-comment-paragraph justify))
2382 2471
2383(defun python-fill-string (&optional justify) 2472(defun python-fill-string (&optional justify)
2384 "String fill function for `python-fill-paragraph-function'. 2473 "String fill function for `python-fill-paragraph'.
2385JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2474JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2386 (let* ((marker (point-marker)) 2475 (let* ((marker (point-marker))
2387 (str-start-pos 2476 (str-start-pos
@@ -2451,12 +2540,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2451 (indent-according-to-mode))))) t) 2540 (indent-according-to-mode))))) t)
2452 2541
2453(defun python-fill-decorator (&optional justify) 2542(defun python-fill-decorator (&optional justify)
2454 "Decorator fill function for `python-fill-paragraph-function'. 2543 "Decorator fill function for `python-fill-paragraph'.
2455JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2544JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2456 t) 2545 t)
2457 2546
2458(defun python-fill-paren (&optional justify) 2547(defun python-fill-paren (&optional justify)
2459 "Paren fill function for `python-fill-paragraph-function'. 2548 "Paren fill function for `python-fill-paragraph'.
2460JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2549JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2461 (save-restriction 2550 (save-restriction
2462 (narrow-to-region (progn 2551 (narrow-to-region (progn
@@ -3107,7 +3196,7 @@ if that value is non-nil."
3107 3196
3108 (set (make-local-variable 'paragraph-start) "\\s-*$") 3197 (set (make-local-variable 'paragraph-start) "\\s-*$")
3109 (set (make-local-variable 'fill-paragraph-function) 3198 (set (make-local-variable 'fill-paragraph-function)
3110 'python-fill-paragraph-function) 3199 'python-fill-paragraph)
3111 3200
3112 (set (make-local-variable 'beginning-of-defun-function) 3201 (set (make-local-variable 'beginning-of-defun-function)
3113 #'python-beginning-of-defun-function) 3202 #'python-beginning-of-defun-function)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 841a45c23a2..ad6e1125027 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -89,7 +89,7 @@
89(make-obsolete 'w32-default-color-map nil "24.1") 89(make-obsolete 'w32-default-color-map nil "24.1")
90 90
91(declare-function w32-send-sys-command "w32fns.c") 91(declare-function w32-send-sys-command "w32fns.c")
92(declare-function set-message-beep "w32console.c") 92(declare-function set-message-beep "w32fns.c")
93 93
94;; Conditional on new-fontset so bootstrapping works on non-GUI compiles 94;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
95(if (fboundp 'new-fontset) 95(if (fboundp 'new-fontset)
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index 813a8fd4d96..5d9b68e9de5 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -32,7 +32,7 @@
32 32
33;;;; Function keys 33;;;; Function keys
34 34
35(declare-function set-message-beep "w32console.c") 35(declare-function set-message-beep "w32fns.c")
36(declare-function w32-get-locale-info "w32proc.c") 36(declare-function w32-get-locale-info "w32proc.c")
37(declare-function w32-get-valid-locale-ids "w32proc.c") 37(declare-function w32-get-valid-locale-ids "w32proc.c")
38 38