diff options
| author | Michael Albinus | 2012-06-17 20:54:39 +0200 |
|---|---|---|
| committer | Michael Albinus | 2012-06-17 20:54:39 +0200 |
| commit | 298551496fd9011dc68f8a463a69820573a3abd2 (patch) | |
| tree | fcebb8d4c5785af2eaf4ceb0304c59a66c4b504a | |
| parent | ddfbf826bcd838b46e1e0ac577b76853267c060a (diff) | |
| download | emacs-298551496fd9011dc68f8a463a69820573a3abd2.tar.gz emacs-298551496fd9011dc68f8a463a69820573a3abd2.zip | |
* minibuffer.el (read-file-name-default): Bind `non-essential' to `t'.
* net/tramp.el (tramp-file-name-handler): Catch 'non-essential.
* net/ange-ftp.el (ange-ftp-gwp-start, ange-ftp-start-process):
* net/tramp-sh.el (tramp-maybe-open-connection):
Throw if `non-essential' is non-nil.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 3 | ||||
| -rw-r--r-- | lisp/net/ange-ftp.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 32 |
5 files changed, 46 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 560f1212b71..fbcff3e97c0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2012-06-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * minibuffer.el (read-file-name-default): Bind `non-essential' to `t'. | ||
| 4 | |||
| 5 | * net/tramp.el (tramp-file-name-handler): Catch 'non-essential. | ||
| 6 | |||
| 7 | * net/ange-ftp.el (ange-ftp-gwp-start, ange-ftp-start-process): | ||
| 8 | * net/tramp-sh.el (tramp-maybe-open-connection): | ||
| 9 | Throw if `non-essential' is non-nil. | ||
| 10 | |||
| 1 | 2012-06-17 Martin Rudalics <rudalics@gmx.at> | 11 | 2012-06-17 Martin Rudalics <rudalics@gmx.at> |
| 2 | 12 | ||
| 3 | * window.el (special-display-p): Signal an error if BUFFER-NAME | 13 | * window.el (special-display-p): Signal an error if BUFFER-NAME |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6cd7af7fd01..e4453afe046 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -2335,7 +2335,8 @@ See `read-file-name' for the meaning of the arguments." | |||
| 2335 | (if (consp default-filename) | 2335 | (if (consp default-filename) |
| 2336 | (mapcar 'abbreviate-file-name default-filename) | 2336 | (mapcar 'abbreviate-file-name default-filename) |
| 2337 | (abbreviate-file-name default-filename)))) | 2337 | (abbreviate-file-name default-filename)))) |
| 2338 | (let ((insdef (cond | 2338 | (let ((non-essential t) |
| 2339 | (insdef (cond | ||
| 2339 | ((and insert-default-directory (stringp dir)) | 2340 | ((and insert-default-directory (stringp dir)) |
| 2340 | (if initial | 2341 | (if initial |
| 2341 | (cons (minibuffer--double-dollars (concat dir initial)) | 2342 | (cons (minibuffer--double-dollars (concat dir initial)) |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 447549f58cd..4ca40fdabef 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -1774,6 +1774,10 @@ good, skip, fatal, or unknown." | |||
| 1774 | 1774 | ||
| 1775 | (defun ange-ftp-gwp-start (host user name args) | 1775 | (defun ange-ftp-gwp-start (host user name args) |
| 1776 | "Login to the gateway machine and fire up an FTP process." | 1776 | "Login to the gateway machine and fire up an FTP process." |
| 1777 | ;; If `non-essential' is non-nil, don't reopen a new connection. It | ||
| 1778 | ;; will be catched in Tramp. | ||
| 1779 | (when non-essential | ||
| 1780 | (throw 'non-essential 'non-essential)) | ||
| 1777 | (let (;; It would be nice to make process-connection-type nil, | 1781 | (let (;; It would be nice to make process-connection-type nil, |
| 1778 | ;; but that doesn't work: ftp never responds. | 1782 | ;; but that doesn't work: ftp never responds. |
| 1779 | ;; Can anyone find a fix for that? | 1783 | ;; Can anyone find a fix for that? |
| @@ -1905,6 +1909,10 @@ been queued with no result. CONT will still be called, however." | |||
| 1905 | "Spawn a new FTP process ready to connect to machine HOST and give it NAME. | 1909 | "Spawn a new FTP process ready to connect to machine HOST and give it NAME. |
| 1906 | If HOST is only FTP-able through a gateway machine then spawn a shell | 1910 | If HOST is only FTP-able through a gateway machine then spawn a shell |
| 1907 | on the gateway machine to do the FTP instead." | 1911 | on the gateway machine to do the FTP instead." |
| 1912 | ;; If `non-essential' is non-nil, don't reopen a new connection. It | ||
| 1913 | ;; will be catched in Tramp. | ||
| 1914 | (when non-essential | ||
| 1915 | (throw 'non-essential 'non-essential)) | ||
| 1908 | (let* ((use-gateway (ange-ftp-use-gateway-p host)) | 1916 | (let* ((use-gateway (ange-ftp-use-gateway-p host)) |
| 1909 | (use-smart-ftp (and (not ange-ftp-gateway-host) | 1917 | (use-smart-ftp (and (not ange-ftp-gateway-host) |
| 1910 | (ange-ftp-use-smart-gateway-p host))) | 1918 | (ange-ftp-use-smart-gateway-p host))) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 47aaa4a8e57..1ef602cf6da 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4292,6 +4292,11 @@ connection if a previous connection has died for some reason." | |||
| 4292 | ;; We call `tramp-get-buffer' in order to get a debug | 4292 | ;; We call `tramp-get-buffer' in order to get a debug |
| 4293 | ;; buffer for messages from the beginning. | 4293 | ;; buffer for messages from the beginning. |
| 4294 | (tramp-get-buffer vec) | 4294 | (tramp-get-buffer vec) |
| 4295 | |||
| 4296 | ;; If `non-essential' is non-nil, don't reopen a new connection. | ||
| 4297 | (when non-essential | ||
| 4298 | (throw 'non-essential 'non-essential)) | ||
| 4299 | |||
| 4295 | (tramp-with-progress-reporter | 4300 | (tramp-with-progress-reporter |
| 4296 | vec 3 | 4301 | vec 3 |
| 4297 | (if (zerop (length (tramp-file-name-user vec))) | 4302 | (if (zerop (length (tramp-file-name-user vec))) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e9621c5d44e..d0e8b35d6ca 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1928,22 +1928,32 @@ Falls back to normal file name handler if no Tramp file name handler exists." | |||
| 1928 | (let ((default-directory | 1928 | (let ((default-directory |
| 1929 | (tramp-compat-temporary-file-directory))) | 1929 | (tramp-compat-temporary-file-directory))) |
| 1930 | (load (cadr sf) 'noerror 'nomessage))) | 1930 | (load (cadr sf) 'noerror 'nomessage))) |
| 1931 | ;; If `non-essential' is non-nil, Tramp shall | ||
| 1932 | ;; not open a new connection. | ||
| 1931 | ;; If Tramp detects that it shouldn't continue | 1933 | ;; If Tramp detects that it shouldn't continue |
| 1932 | ;; to work, it throws the `suppress' event. We | 1934 | ;; to work, it throws the `suppress' event. |
| 1933 | ;; try the default handler then. | ||
| 1934 | ;; This could happen for example, when Tramp | 1935 | ;; This could happen for example, when Tramp |
| 1935 | ;; tries to open the same connection twice in a | 1936 | ;; tries to open the same connection twice in a |
| 1936 | ;; short time frame. | 1937 | ;; short time frame. |
| 1938 | ;; In both cases, we try the default handler then. | ||
| 1937 | (setq result | 1939 | (setq result |
| 1938 | (catch 'suppress (apply foreign operation args))) | 1940 | (catch 'non-essential |
| 1939 | (if (eq result 'suppress) | 1941 | (catch 'suppress |
| 1940 | (let (tramp-message-show-message) | 1942 | (apply foreign operation args)))) |
| 1941 | (tramp-message | 1943 | (cond |
| 1942 | v 1 "Suppress received in operation %s" | 1944 | ((eq result 'non-essential) |
| 1943 | (append (list operation) args)) | 1945 | (tramp-message |
| 1944 | (tramp-cleanup v) | 1946 | v 5 "Non-essential received in operation %s" |
| 1945 | (tramp-run-real-handler operation args)) | 1947 | (append (list operation) args)) |
| 1946 | result)) | 1948 | (tramp-run-real-handler operation args)) |
| 1949 | ((eq result 'suppress) | ||
| 1950 | (let (tramp-message-show-message) | ||
| 1951 | (tramp-message | ||
| 1952 | v 1 "Suppress received in operation %s" | ||
| 1953 | (append (list operation) args)) | ||
| 1954 | (tramp-cleanup v) | ||
| 1955 | (tramp-run-real-handler operation args))) | ||
| 1956 | (t result))) | ||
| 1947 | 1957 | ||
| 1948 | ;; Trace that somebody has interrupted the operation. | 1958 | ;; Trace that somebody has interrupted the operation. |
| 1949 | ((debug quit) | 1959 | ((debug quit) |