commit 91718f5f451aa99aaf9e4c48ecfc4d5c0535dc79 (HEAD, refs/remotes/origin/master) Author: Stephen Leake Date: Thu Jul 30 01:25:47 2015 -0500 vc-mtn-find-revision handle null rev. * lisp/vc/vc-mtn.el (vc-mtn-find-revision): handle null rev diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 944a83e..685ef3b 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -207,7 +207,10 @@ switches." comment)))) (defun vc-mtn-find-revision (file rev buffer) - (vc-mtn-command buffer 0 file "cat" "-r" rev)) + ;; null rev means latest revision + (if rev + (vc-mtn-command buffer 0 file "cat" "-r" rev) + (vc-mtn-command buffer 0 file "cat"))) ;; (defun vc-mtn-checkout (file &optional rev) ;; ) commit 3b9d689c2abb294250de6c690d77e9175952be72 Author: Stephen Leake Date: Wed Jul 29 19:23:19 2015 -0500 Add docs for display-buffer action display-buffer-use-some-frame * lisp/window.el (display-buffer-use-some-frame): improve doc string * doc/lispref/windows.texi (Display Action Functions): add display-buffer-use-some-frame * etc/NEWS: mention display-buffer-use-some-frame diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 750397c..41f02aa 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2301,6 +2301,23 @@ the function specified in @code{pop-up-frame-function} is added to the newly created frame's parameters. @end defun +@defun display-buffer-use-some-frame buffer alist +This function tries to ``display'' @var{buffer} by trying to find a +frame that meets a predicate (by default any frame other than the +current frame). + +If @var{alist} has a non-@code{nil} @code{`inhibit-switch-frame} entry, +avoid raising the frame. + +If @var{alist} has a non-nil @code{frame-predicate} entry, its value is a +function taking one argument (a frame), returning non-nil if the +frame is a candidate; this function replaces the default predicate. + +If this function chooses a window on another frame, it makes that frame +visible and, unless @var{alist} contains an @code{inhibit-switch-frame} +entry (@pxref{Choosing Window Options}), raises that frame if necessary. +@end defun + @defun display-buffer-pop-up-window buffer alist This function tries to display @var{buffer} by splitting the largest or least recently-used window (typically one on the selected frame). diff --git a/etc/NEWS b/etc/NEWS index 5bb7a00..6dbe6b3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -84,6 +84,11 @@ command line when `initial-buffer-choice' is non-nil. * Changes in Emacs 25.1 +** New display-buffer action function display-buffer-use-some-frame +This displays the buffer in an existing frame other than the current +frame, and allows the caller to specify a frame predicate to exclude +frames. + ** New doc command `describe-symbol'. Works for functions, vars, faces, etc... ** `isearch' and `query-replace' now perform character folding in matches. diff --git a/lisp/window.el b/lisp/window.el index 986c553..238e53c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6489,19 +6489,17 @@ its documentation for additional customization information." ;;; `display-buffer' action functions: (defun display-buffer-use-some-frame (buffer alist) - "Display BUFFER in an existing frame other than the current frame. -If successful, return the window used; otherwise return nil. + "Display BUFFER in an existing frame that meets a predicate +(by default any frame other than the current frame). If +successful, return the window used; otherwise return nil. If ALIST has a non-nil `inhibit-switch-frame' entry, avoid raising the frame. -If ALIST has a non-nil `pop-up-frame-parameters' entry, the -corresponding value is an alist of frame parameters to give the -new frame. - -If ALIST has a non-nil `frame-predicate' entry, the corresponding -value is a function taking one argument (a frame), returning -non-nil if the frame is a candidate." +If ALIST has a non-nil `frame-predicate' entry, its value is a +function taking one argument (a frame), returning non-nil if the +frame is a candidate; this function replaces the default +predicate." (let* ((predicate (or (cdr (assoc 'frame-predicate alist)) (lambda (frame) (and commit 72fea2fac543558cd2c4bd55e6f714f9f43efbc3 Author: Stephen Leake Date: Wed Jul 29 18:30:36 2015 -0500 Add display-buffer action display-buffer-use-some-frame * lisp/window.el (display-buffer-use-some-frame): new diff --git a/lisp/window.el b/lisp/window.el index f15dd9b..986c553 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6488,6 +6488,39 @@ its documentation for additional customization information." ;;; `display-buffer' action functions: +(defun display-buffer-use-some-frame (buffer alist) + "Display BUFFER in an existing frame other than the current frame. +If successful, return the window used; otherwise return nil. + +If ALIST has a non-nil `inhibit-switch-frame' entry, avoid +raising the frame. + +If ALIST has a non-nil `pop-up-frame-parameters' entry, the +corresponding value is an alist of frame parameters to give the +new frame. + +If ALIST has a non-nil `frame-predicate' entry, the corresponding +value is a function taking one argument (a frame), returning +non-nil if the frame is a candidate." + (let* ((predicate (or (cdr (assoc 'frame-predicate alist)) + (lambda (frame) + (and + (not (eq frame (selected-frame))) + (not (window-dedicated-p + (or + (get-lru-window frame) + (frame-first-window frame))))) + ))) + (frame (car (filtered-frame-list predicate))) + (window (and frame (get-lru-window frame)))) + (when window + (prog1 + (window--display-buffer + buffer window 'frame alist display-buffer-mark-dedicated) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame frame)))) + )) + (defun display-buffer-same-window (buffer alist) "Display BUFFER in the selected window. This fails if ALIST has a non-nil `inhibit-same-window' entry, or commit 11d40d38c809df93956b4dbad7a3be0722d066ff Author: Stephen Leake Date: Fri Jul 24 11:01:16 2015 -0500 Handle vc-mtn error more gently * lisp/vc/vc-mtn.el (vc-mtn-mode-line-string): return "" when branch is nil diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 93bd1f6..944a83e 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -179,15 +179,18 @@ switches." (defun vc-mtn-mode-line-string (file) "Return a string for `vc-mode-line' to put in the mode line for FILE." (let ((branch (vc-mtn-workfile-branch file))) - (dolist (rule vc-mtn-mode-line-rewrite) - (if (string-match (car rule) branch) - (setq branch (replace-match (cdr rule) t nil branch)))) - (format "Mtn%c%s" - (pcase (vc-state file) - ((or `up-to-date `needs-update) ?-) - (`added ?@) - (_ ?:)) - branch))) + (if branch + (progn + (dolist (rule vc-mtn-mode-line-rewrite) + (if (string-match (car rule) branch) + (setq branch (replace-match (cdr rule) t nil branch)))) + (format "Mtn%c%s" + (pcase (vc-state file) + ((or `up-to-date `needs-update) ?-) + (`added ?@) + (_ ?:)) + branch)) + ""))) (defun vc-mtn-register (files &optional _comment) (vc-mtn-command nil 0 files "add")) commit a53d1d325e0d1c0db6b407a776d6cfd3d12a90e0 Author: Michael Albinus Date: Wed Jul 29 21:07:01 2015 +0200 Fix Tramp problems with multihops, and nc. * lisp/net/tramp-cache.el (tramp-get-file-property) (tramp-set-file-property, tramp-flush-file-property) (tramp-get-connection-property, tramp-set-connection-property) (tramp-flush-connection-property): Remove hop from vector. * lisp/net/tramp-gw.el (tramp-gw-process-filter): Ignore errors. * lisp/net/tramp-sh.el (tramp-methods) : Separate STDERR. (tramp-do-copy-or-rename-file-out-of-band): Increase timeout of netstat to 60". (tramp-sh-handle-start-file-process): Do not show hops in prompt. * lisp/net/tramp.el (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory, tramp-handle-file-remote-p): Keep hop in result. * test/automated/tramp-tests.el (tramp-test02-file-name-dissect): Add hop tests. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 279d9f4..f777468 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -121,9 +121,10 @@ matching entries of `tramp-connection-properties'." (defun tramp-get-file-property (key file property default) "Get the PROPERTY of FILE from the cache context of KEY. Returns DEFAULT if not set." - ;; Unify localname. + ;; Unify localname. Remove hop from vector. (setq key (copy-sequence key)) (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) + (aset key 4 nil) (let* ((hash (tramp-get-hash-table key)) (value (when (hash-table-p hash) (gethash property hash)))) (if @@ -153,9 +154,10 @@ Returns DEFAULT if not set." (defun tramp-set-file-property (key file property value) "Set the PROPERTY of FILE to VALUE, in the cache context of KEY. Returns VALUE." - ;; Unify localname. + ;; Unify localname. Remove hop from vector. (setq key (copy-sequence key)) (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) +p (aset key 4 nil) (let ((hash (tramp-get-hash-table key))) ;; We put the timestamp there. (puthash property (cons (current-time) value) hash) @@ -176,9 +178,10 @@ Returns VALUE." (when (and (stringp truename) (not (string-equal file (directory-file-name truename)))) (tramp-flush-file-property key truename)) - ;; Unify localname. + ;; Unify localname. Remove hop from vector. (setq key (copy-sequence key)) (aset key 3 file) + (aset key 4 nil) (tramp-message key 8 "%s" file) (remhash key tramp-cache-data))) @@ -240,11 +243,12 @@ This is suppressed for temporary buffers." "Get the named PROPERTY for the connection. KEY identifies the connection, it is either a process or a vector. If the value is not set for the connection, returns DEFAULT." - ;; Unify key by removing localname from vector. Work with a copy in - ;; order to avoid side effects. + ;; Unify key by removing localname and hop from vector. Work with a + ;; copy in order to avoid side effects. (when (vectorp key) (setq key (copy-sequence key)) - (aset key 3 nil)) + (aset key 3 nil) + (aset key 4 nil)) (let* ((hash (tramp-get-hash-table key)) (value (if (hash-table-p hash) (gethash property hash default) @@ -257,11 +261,12 @@ If the value is not set for the connection, returns DEFAULT." "Set the named PROPERTY of a connection to VALUE. KEY identifies the connection, it is either a process or a vector. PROPERTY is set persistent when KEY is a vector." - ;; Unify key by removing localname from vector. Work with a copy in - ;; order to avoid side effects. + ;; Unify key by removing localname and hop from vector. Work with a + ;; copy in order to avoid side effects. (when (vectorp key) (setq key (copy-sequence key)) - (aset key 3 nil)) + (aset key 3 nil) + (aset key 4 nil)) (let ((hash (tramp-get-hash-table key))) (puthash property value hash) (setq tramp-cache-data-changed t) @@ -278,11 +283,12 @@ KEY identifies the connection, it is either a process or a vector." (defun tramp-flush-connection-property (key) "Remove all properties identified by KEY. KEY identifies the connection, it is either a process or a vector." - ;; Unify key by removing localname from vector. Work with a copy in - ;; order to avoid side effects. + ;; Unify key by removing localname and hop from vector. Work with a + ;; copy in order to avoid side effects. (when (vectorp key) (setq key (copy-sequence key)) - (aset key 3 nil)) + (aset key 3 nil) + (aset key 4 nil)) (tramp-message key 7 "%s %s" key (let ((hash (gethash key tramp-cache-data)) diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el index 16eff8c..5e22f6a 100644 --- a/lisp/net/tramp-gw.el +++ b/lisp/net/tramp-gw.el @@ -126,8 +126,11 @@ (defun tramp-gw-process-filter (proc string) (let ((tramp-verbose 0)) - (process-send-string - (tramp-get-connection-property proc "process" nil) string))) + ;; The other process might have been stopped already. We don't + ;; want to be interrupted then. + (ignore-errors + (process-send-string + (tramp-get-connection-property proc "process" nil) string)))) ;;;###tramp-autoload (defun tramp-gw-open-connection (vec gw-vec target-vec) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 670ff4b..bb939bf 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -273,7 +273,7 @@ The string is used in `tramp-methods'.") ;; We use "-p" as required for newer busyboxes. For older ;; busybox/nc versions, the value must be (("-l") ("%r")). This ;; can be achieved by tweaking `tramp-connection-properties'. - (tramp-remote-copy-args (("-l") ("-p" "%r"))) + (tramp-remote-copy-args (("-l") ("-p" "%r") ("2>/dev/null"))) (tramp-default-port 23))) ;;;###tramp-autoload (add-to-list 'tramp-methods @@ -2477,10 +2477,10 @@ The method used must be an out-of-band method." " ")) (tramp-send-command v remote-copy-program) (with-timeout - (1 (tramp-error - v 'file-error - "Listener process not running on remote host: `%s'" - remote-copy-program)) + (60 (tramp-error + v 'file-error + "Listener process not running on remote host: `%s'" + remote-copy-program)) (tramp-send-command v (format "netstat -l | grep -q :%s" listener)) (while (not (tramp-send-command-and-check v nil)) (tramp-send-command @@ -2911,10 +2911,15 @@ the result will be a local, non-Tramp, file name." (setq i (+ i 250)))) (cdr args))) ;; Use a human-friendly prompt, for example for `shell'. - (prompt (format "PS1=%s" - (format "%s %s" - (file-remote-p default-directory) - tramp-initial-end-of-output))) + ;; We discard hops, if existing, that's why we cannot use + ;; `file-remote-p'. + (prompt (format "PS1=%s %s" + (tramp-make-tramp-file-name + (tramp-file-name-method v) + (tramp-file-name-user v) + (tramp-file-name-host v) + (tramp-file-name-localname v)) + tramp-initial-end-of-output)) ;; We use as environment the difference to toplevel ;; `process-environment'. env diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index beb87f6..e157321 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2927,7 +2927,8 @@ User is always nil." (tramp-file-name-user v) (tramp-file-name-host v) (tramp-run-real-handler - 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))))) + 'file-name-as-directory (list (or (tramp-file-name-localname v) ""))) + (tramp-file-name-hop v)))) (defun tramp-handle-file-name-completion (filename directory &optional predicate) @@ -2955,7 +2956,8 @@ User is always nil." (tramp-file-name-user v) (tramp-file-name-host v) (tramp-run-real-handler - 'file-name-directory (list (or (tramp-file-name-localname v) "")))))) + 'file-name-directory (list (or (tramp-file-name-localname v) ""))) + (tramp-file-name-hop v)))) (defun tramp-handle-file-name-nondirectory (file) "Like `file-name-nondirectory' but aware of Tramp files." @@ -2992,7 +2994,8 @@ User is always nil." ((eq identification 'user) user) ((eq identification 'host) host) ((eq identification 'localname) localname) - (t (tramp-make-tramp-file-name method user host ""))))))))) + ((eq identification 'hop) hop) + (t (tramp-make-tramp-file-name method user host "" hop))))))))) (defun tramp-handle-file-symlink-p (filename) "Like `file-symlink-p' for Tramp files." diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index a03dbf3..e6f77e4 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -213,6 +213,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method::" 'user) "default-user")) (should (string-equal (file-remote-p "/method::" 'host) "default-host")) (should (string-equal (file-remote-p "/method::" 'localname) "")) + (should (string-equal (file-remote-p "/method::" 'hop) nil)) ;; Expand `tramp-default-method' and `tramp-default-user'. (should (string-equal @@ -222,6 +223,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/host:" 'user) "default-user")) (should (string-equal (file-remote-p "/host:" 'host) "host")) (should (string-equal (file-remote-p "/host:" 'localname) "")) + (should (string-equal (file-remote-p "/host:" 'hop) nil)) ;; Expand `tramp-default-method' and `tramp-default-host'. (should (string-equal @@ -231,6 +233,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/user@:" 'user) "user")) (should (string-equal (file-remote-p "/user@:" 'host) "default-host")) (should (string-equal (file-remote-p "/user@:" 'localname) "")) + (should (string-equal (file-remote-p "/user@:" 'hop) nil)) ;; Expand `tramp-default-method'. (should (string-equal @@ -241,6 +244,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/user@host:" 'user) "user")) (should (string-equal (file-remote-p "/user@host:" 'host) "host")) (should (string-equal (file-remote-p "/user@host:" 'localname) "")) + (should (string-equal (file-remote-p "/user@host:" 'hop) nil)) ;; Expand `tramp-default-user'. (should (string-equal @@ -250,6 +254,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method:host:" 'user) "default-user")) (should (string-equal (file-remote-p "/method:host:" 'host) "host")) (should (string-equal (file-remote-p "/method:host:" 'localname) "")) + (should (string-equal (file-remote-p "/method:host:" 'hop) nil)) ;; Expand `tramp-default-host'. (should (string-equal @@ -260,6 +265,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method:user@:" 'host) "default-host")) (should (string-equal (file-remote-p "/method:user@:" 'localname) "")) + (should (string-equal (file-remote-p "/method:user@:" 'hop) nil)) ;; No expansion. (should (string-equal @@ -270,6 +276,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method:user@host:" 'user) "user")) (should (string-equal (file-remote-p "/method:user@host:" 'host) "host")) (should (string-equal (file-remote-p "/method:user@host:" 'localname) "")) + (should (string-equal (file-remote-p "/method:user@host:" 'hop) nil)) ;; No expansion. (should (string-equal @@ -283,6 +290,8 @@ shall not contain a timeout." (file-remote-p "/method:user@email@host:" 'host) "host")) (should (string-equal (file-remote-p "/method:user@email@host:" 'localname) "")) + (should (string-equal + (file-remote-p "/method:user@email@host:" 'hop) nil)) ;; Expand `tramp-default-method' and `tramp-default-user'. (should (string-equal @@ -293,6 +302,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/host#1234:" 'user) "default-user")) (should (string-equal (file-remote-p "/host#1234:" 'host) "host#1234")) (should (string-equal (file-remote-p "/host#1234:" 'localname) "")) + (should (string-equal (file-remote-p "/host#1234:" 'hop) nil)) ;; Expand `tramp-default-method'. (should (string-equal @@ -303,6 +313,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/user@host#1234:" 'user) "user")) (should (string-equal (file-remote-p "/user@host#1234:" 'host) "host#1234")) (should (string-equal (file-remote-p "/user@host#1234:" 'localname) "")) + (should (string-equal (file-remote-p "/user@host#1234:" 'hop) nil)) ;; Expand `tramp-default-user'. (should (string-equal @@ -315,6 +326,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method:host#1234:" 'host) "host#1234")) (should (string-equal (file-remote-p "/method:host#1234:" 'localname) "")) + (should (string-equal (file-remote-p "/method:host#1234:" 'hop) nil)) ;; No expansion. (should (string-equal @@ -328,6 +340,8 @@ shall not contain a timeout." (file-remote-p "/method:user@host#1234:" 'host) "host#1234")) (should (string-equal (file-remote-p "/method:user@host#1234:" 'localname) "")) + (should (string-equal + (file-remote-p "/method:user@host#1234:" 'hop) nil)) ;; Expand `tramp-default-method' and `tramp-default-user'. (should (string-equal @@ -337,6 +351,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/1.2.3.4:" 'user) "default-user")) (should (string-equal (file-remote-p "/1.2.3.4:" 'host) "1.2.3.4")) (should (string-equal (file-remote-p "/1.2.3.4:" 'localname) "")) + (should (string-equal (file-remote-p "/1.2.3.4:" 'hop) nil)) ;; Expand `tramp-default-method'. (should (string-equal @@ -347,6 +362,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/user@1.2.3.4:" 'user) "user")) (should (string-equal (file-remote-p "/user@1.2.3.4:" 'host) "1.2.3.4")) (should (string-equal (file-remote-p "/user@1.2.3.4:" 'localname) "")) + (should (string-equal (file-remote-p "/user@1.2.3.4:" 'hop) nil)) ;; Expand `tramp-default-user'. (should (string-equal @@ -357,6 +373,7 @@ shall not contain a timeout." (file-remote-p "/method:1.2.3.4:" 'user) "default-user")) (should (string-equal (file-remote-p "/method:1.2.3.4:" 'host) "1.2.3.4")) (should (string-equal (file-remote-p "/method:1.2.3.4:" 'localname) "")) + (should (string-equal (file-remote-p "/method:1.2.3.4:" 'hop) nil)) ;; No expansion. (should (string-equal @@ -369,6 +386,8 @@ shall not contain a timeout." (file-remote-p "/method:user@1.2.3.4:" 'host) "1.2.3.4")) (should (string-equal (file-remote-p "/method:user@1.2.3.4:" 'localname) "")) + (should (string-equal + (file-remote-p "/method:user@1.2.3.4:" 'hop) nil)) ;; Expand `tramp-default-method', `tramp-default-user' and ;; `tramp-default-host'. @@ -380,6 +399,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/[]:" 'user) "default-user")) (should (string-equal (file-remote-p "/[]:" 'host) "default-host")) (should (string-equal (file-remote-p "/[]:" 'localname) "")) + (should (string-equal (file-remote-p "/[]:" 'hop) nil)) ;; Expand `tramp-default-method' and `tramp-default-user'. (let ((tramp-default-host "::1")) @@ -389,7 +409,8 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/[]:" 'method) "default-method")) (should (string-equal (file-remote-p "/[]:" 'user) "default-user")) (should (string-equal (file-remote-p "/[]:" 'host) "::1")) - (should (string-equal (file-remote-p "/[]:" 'localname) ""))) + (should (string-equal (file-remote-p "/[]:" 'localname) "")) + (should (string-equal (file-remote-p "/[]:" 'hop) nil))) ;; Expand `tramp-default-method' and `tramp-default-user'. (should (string-equal @@ -399,6 +420,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/[::1]:" 'user) "default-user")) (should (string-equal (file-remote-p "/[::1]:" 'host) "::1")) (should (string-equal (file-remote-p "/[::1]:" 'localname) "")) + (should (string-equal (file-remote-p "/[::1]:" 'hop) nil)) ;; Expand `tramp-default-method'. (should (string-equal @@ -409,6 +431,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/user@[::1]:" 'user) "user")) (should (string-equal (file-remote-p "/user@[::1]:" 'host) "::1")) (should (string-equal (file-remote-p "/user@[::1]:" 'localname) "")) + (should (string-equal (file-remote-p "/user@[::1]:" 'hop) nil)) ;; Expand `tramp-default-user'. (should (string-equal @@ -419,6 +442,7 @@ shall not contain a timeout." (file-remote-p "/method:[::1]:" 'user) "default-user")) (should (string-equal (file-remote-p "/method:[::1]:" 'host) "::1")) (should (string-equal (file-remote-p "/method:[::1]:" 'localname) "")) + (should (string-equal (file-remote-p "/method:[::1]:" 'hop) nil)) ;; No expansion. (should (string-equal @@ -430,6 +454,7 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method:user@[::1]:" 'host) "::1")) (should (string-equal (file-remote-p "/method:user@[::1]:" 'localname) "")) + (should (string-equal (file-remote-p "/method:user@[::1]:" 'hop) nil)) ;; Local file name part. (should (string-equal (file-remote-p "/host:/:" 'localname) "/:")) @@ -444,7 +469,8 @@ shall not contain a timeout." (should (string-equal (file-remote-p "/method1:user1@host1|method2:user2@host2:/path/to/file") - (format "/%s:%s@%s:" "method2" "user2" "host2"))) + (format "/%s:%s@%s|%s:%s@%s:" + "method1" "user1" "host1" "method2" "user2" "host2"))) (should (string-equal (file-remote-p @@ -465,12 +491,21 @@ shall not contain a timeout." (file-remote-p "/method1:user1@host1|method2:user2@host2:/path/to/file" 'localname) "/path/to/file")) + (should + (string-equal + (file-remote-p + "/method1:user1@host1|method2:user2@host2:/path/to/file" 'hop) + (format "%s:%s@%s|" + "method1" "user1" "host1"))) (should (string-equal (file-remote-p "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file") - (format "/%s:%s@%s:" "method3" "user3" "host3"))) + (format "/%s:%s@%s|%s:%s@%s|%s:%s@%s:" + "method1" "user1" "host1" + "method2" "user2" "host2" + "method3" "user3" "host3"))) (should (string-equal (file-remote-p @@ -494,7 +529,14 @@ shall not contain a timeout." (file-remote-p "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file" 'localname) - "/path/to/file")))) + "/path/to/file")) + (should + (string-equal + (file-remote-p + "/method1:user1@host1|method2:user2@host2|method3:user3@host3:/path/to/file" + 'hop) + (format "%s:%s@%s|%s:%s@%s|" + "method1" "user1" "host1" "method2" "user2" "host2"))))) (ert-deftest tramp-test03-file-name-defaults () "Check default values for some methods." @@ -2168,11 +2210,7 @@ Since it unloads Tramp, it shall be the last test to run." ;; * Work on skipped tests. Make a comment, when it is impossible. ;; * Fix `tramp-test15-copy-directory' for `smb'. Using tar in a pipe ;; doesn't work well when an interactive password must be provided. -;; * Fix `tramp-test27-start-file-process' for `nc' and on MS -;; Windows (`process-send-eof'?). -;; * Fix `tramp-test31-special-characters' for `nc'. -;; * Fix `tramp-test32-utf8' for `nc'/`telnet' (when target is a dumb -;; busybox). Seems to be in `directory-files'. +;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). ;; * Fix Bug#16928. Set expected error of `tramp-test33-asynchronous-requests'. ;; * Fix `tramp-test35-unload' (Not all symbols are unbound). Set ;; expected error. commit 33b779a11fb6785944383aeeae44f77cb580ee37 Author: Eli Zaretskii Date: Wed Jul 29 20:52:23 2015 +0300 Resurrect highlighting of repeated words by Flyspell Mode * lisp/textmodes/flyspell.el (flyspell-word): Leave some non-word characters between point and the doublon candidate, so that flyspell-word-search-backward finds it. (Bug#21157) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 2329f29..e074918 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1119,7 +1119,8 @@ misspelling and skips redundant spell-checking step." (let* ((bound (- start (- end start) - (- (skip-chars-backward " \t\n\f")))) + (- (save-excursion + (skip-chars-backward " \t\n\f"))))) (p (when (>= bound (point-min)) (flyspell-word-search-backward word bound t)))) (and p (/= p start))))) commit cafa012c8f745ef4dada889813f8b7f982c1ea9f Author: Eli Zaretskii Date: Wed Jul 29 20:02:56 2015 +0300 Fix redisplay of large images on expose events * src/xdisp.c (expose_window, expose_area): Avoid comparisons between signed negative values and unsigned values. This prevented redisplay on expose events when the window showed a very large image. diff --git a/src/xdisp.c b/src/xdisp.c index 2be057f..5a89f4c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -30061,8 +30061,11 @@ expose_area (struct window *w, struct glyph_row *row, XRectangle *r, /* Find the last one. */ last = first; first_x = x; - while (last < end - && x < r->x + r->width) + /* Use a signed int intermediate value to avoid catastrophic + failures due to comparison between signed and unsigned, when + x is negative (can happen for wide images that are hscrolled). */ + int r_end = r->x + r->width; + while (last < end && x < r_end) { x += last->pixel_width; ++last; @@ -30336,6 +30339,11 @@ expose_window (struct window *w, XRectangle *fr) check later if it is changed. */ bool phys_cursor_on_p = w->phys_cursor_on_p; + /* Use a signed int intermediate value to avoid catastrophic + failures due to comparison between signed and unsigned, when + y0 or y1 is negative (can happen for tall images). */ + int r_bottom = r.y + r.height; + /* Update lines intersecting rectangle R. */ first_overlapping_row = last_overlapping_row = NULL; for (row = w->current_matrix->rows; @@ -30345,10 +30353,10 @@ expose_window (struct window *w, XRectangle *fr) int y0 = row->y; int y1 = MATRIX_ROW_BOTTOM_Y (row); - if ((y0 >= r.y && y0 < r.y + r.height) - || (y1 > r.y && y1 < r.y + r.height) + if ((y0 >= r.y && y0 < r_bottom) + || (y1 > r.y && y1 < r_bottom) || (r.y >= y0 && r.y < y1) - || (r.y + r.height > y0 && r.y + r.height < y1)) + || (r_bottom > y0 && r_bottom < y1)) { /* A header line may be overlapping, but there is no need to fix overlapping areas for them. KFS 2005-02-12 */ @@ -30385,7 +30393,7 @@ expose_window (struct window *w, XRectangle *fr) if (WINDOW_WANTS_MODELINE_P (w) && (row = MATRIX_MODE_LINE_ROW (w->current_matrix), row->enabled_p) - && row->y < r.y + r.height) + && row->y < r_bottom) { if (expose_line (w, row, &r)) mouse_face_overwritten_p = true;