summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/ange-ftp.el3
-rw-r--r--lisp/net/browse-url.el10
-rw-r--r--lisp/net/goto-addr.el5
-rw-r--r--lisp/net/rcirc.el12
-rw-r--r--lisp/net/tramp-cache.el11
-rw-r--r--lisp/net/tramp-sh.el24
-rw-r--r--lisp/net/tramp.el28
7 files changed, 65 insertions, 28 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 93954588fa9..4338cdff3cd 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3098,7 +3098,8 @@ logged in as user USER and cd'd to directory DIR."
(if (not (eq system-type 'windows-nt))
(setq name (ange-ftp-real-expand-file-name name))
;; Windows UNC default dirs do not make sense for ftp.
- (setq name (if (string-match "\\`//" default-directory)
+ (setq name (if (and default-directory
+ (string-match "\\`//" default-directory))
(ange-ftp-real-expand-file-name name "c:/")
(ange-ftp-real-expand-file-name name)))
;; Strip off possible drive specifier.
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index f378277d5f0..50423208e34 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -944,7 +944,9 @@ used instead of `browse-url-new-window-flag'."
url args))
(defun browse-url-can-use-xdg-open ()
- "Check if xdg-open can be used, i.e. we are on Gnome, KDE, Xfce4 or LXDE."
+ "Return non-nil if the \"xdg-open\" program can be used.
+xdg-open is a desktop utility that calls your preferred web browser.
+This requires you to be running either Gnome, KDE, Xfce4 or LXDE."
(and (getenv "DISPLAY")
(executable-find "xdg-open")
;; xdg-open may call gnome-open and that does not wait for its child
@@ -967,6 +969,7 @@ used instead of `browse-url-new-window-flag'."
(eq 0 (call-process
"/bin/sh" nil nil nil
"-c"
+ ;; FIXME use string-match rather than grep.
"xprop -root _DT_SAVE_MODE|grep xfce4"))
(error nil))
(member (getenv "DESKTOP_SESSION") '("LXDE" "Lubuntu"))
@@ -974,7 +977,10 @@ used instead of `browse-url-new-window-flag'."
;;;###autoload
-(defun browse-url-xdg-open (url &optional new-window)
+(defun browse-url-xdg-open (url &optional ignored)
+ "Pass the specified URL to the \"xdg-open\" command.
+xdg-open is a desktop utility that calls your preferred web browser.
+The optional argument IGNORED is not used."
(interactive (browse-url-interactive-arg "URL: "))
(call-process "xdg-open" nil 0 nil url))
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index f95381fa808..e5fe45b5bf0 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -275,7 +275,10 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and
;;;###autoload
(define-minor-mode goto-address-mode
- "Minor mode to buttonize URLs and e-mail addresses in the current buffer."
+ "Minor mode to buttonize URLs and e-mail addresses in the current buffer.
+With a prefix argument ARG, enable the mode if ARG is positive,
+and disable it otherwise. If called from Lisp, enable the mode
+if ARG is omitted or nil."
nil
""
nil
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 771c9839cc0..b8bf270d87c 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1,6 +1,6 @@
;;; rcirc.el --- default, simple IRC client.
-;; Copyright (C) 2005-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2012 Free Software Foundation, Inc.
;; Author: Ryan Yeske <rcyeske@gmail.com>
;; Maintainers: Ryan Yeske <rcyeske@gmail.com>,
@@ -1261,7 +1261,10 @@ Create the buffer if it doesn't exist."
"Keymap for multiline mode in rcirc.")
(define-minor-mode rcirc-multiline-minor-mode
- "Minor mode for editing multiple lines in rcirc."
+ "Minor mode for editing multiple lines in rcirc.
+With a prefix argument ARG, enable the mode if ARG is positive,
+and disable it otherwise. If called from Lisp, enable the mode
+if ARG is omitted or nil."
:init-value nil
:lighter " rcirc-mline"
:keymap rcirc-multiline-minor-mode-map
@@ -1779,7 +1782,10 @@ This function does not alter the INPUT string."
;;;###autoload
(define-minor-mode rcirc-track-minor-mode
- "Global minor mode for tracking activity in rcirc buffers."
+ "Global minor mode for tracking activity in rcirc buffers.
+With a prefix argument ARG, enable the mode if ARG is positive,
+and disable it otherwise. If called from Lisp, enable the mode
+if ARG is omitted or nil."
:init-value nil
:lighter ""
:keymap rcirc-track-minor-mode-map
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 03a5fe5b88e..d222dd1011d 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -243,7 +243,7 @@ PROPERTY is set persistent when KEY is a vector."
(aset key 3 nil))
(let ((hash (or (gethash key tramp-cache-data)
(puthash key (make-hash-table :test 'equal)
- tramp-cache-data))))
+ tramp-cache-data))))
(puthash property value hash)
(setq tramp-cache-data-changed t)
(tramp-message key 7 "%s %s" property value)
@@ -329,10 +329,15 @@ KEY identifies the connection, it is either a process or a vector."
tramp-cache-data-changed
(stringp tramp-persistency-file-name))
(let ((cache (copy-hash-table tramp-cache-data)))
- ;; Remove temporary data.
+ ;; Remove temporary data. If there is the key "login-as", we
+ ;; don't save either, because all other properties might
+ ;; depend on the login name, and we want to give the
+ ;; possibility to use another login name later on.
(maphash
(lambda (key value)
- (if (and (vectorp key) (not (tramp-file-name-localname key)))
+ (if (and (vectorp key)
+ (not (tramp-file-name-localname key))
+ (not (gethash "login-as" value)))
(progn
(remhash "process-name" value)
(remhash "process-buffer" value)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2478253841f..38e19730a6d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -380,7 +380,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "pscp")
- (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k")
+ (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") ("-p" "%k")
("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
@@ -394,7 +394,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "pscp")
- (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k")
+ (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") ("-p" "%k")
("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
@@ -419,13 +419,12 @@ detected as prompt when being sent on echoing hosts, therefore.")
`(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'")
nil "root"))
;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored.
+;; Do not add "plink" based methods, they ask interactively for the user.
;;;###tramp-autoload
(add-to-list 'tramp-default-user-alist
`(,(concat
"\\`"
- (regexp-opt
- '("rcp" "remcp" "rsh" "telnet" "krlogin"
- "plink" "plink1" "pscp" "psftp" "fcp"))
+ (regexp-opt '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp"))
"\\'")
nil ,(user-login-name)))
@@ -2281,8 +2280,10 @@ The method used must be an out-of-band method."
;; Set variables for computing the prompt for reading
;; password.
(setq tramp-current-method (tramp-file-name-method v)
- tramp-current-user (tramp-file-name-user v)
- tramp-current-host (tramp-file-name-real-host v))
+ tramp-current-user (or (tramp-file-name-user v)
+ (tramp-get-connection-property
+ v "login-as" nil))
+ tramp-current-host (tramp-file-name-real-host v))
;; Expand hops. Might be necessary for gateway methods.
(setq v (car (tramp-compute-multi-hops v)))
@@ -2309,8 +2310,15 @@ The method used must be an out-of-band method."
(setq port (string-to-number (match-string 2 host))
host (string-to-number (match-string 1 host))))
+ ;; Check for user. There might be an interactive setting.
+ (setq user (or (tramp-file-name-user v)
+ (tramp-get-connection-property v "login-as" nil)))
+
;; Compose copy command.
- (setq spec (format-spec-make
+ (setq host (or host "")
+ user (or user "")
+ port (or port "")
+ spec (format-spec-make
?h host ?u user ?p port
?t (tramp-get-connection-property
(tramp-get-connection-process v) "temp-file" "")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index afb7ab4312b..f13315bc662 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -460,6 +460,12 @@ usually suffice.")
"Regexp which matches `tramp-echo-mark' as it gets echoed by
the remote shell.")
+(defcustom tramp-local-end-of-line
+ (if (memq system-type '(windows-nt)) "\r\n" "\n")
+ "*String used for end of line in local processes."
+ :group 'tramp
+ :type 'string)
+
(defcustom tramp-rsh-end-of-line "\n"
"*String used for end of line in rsh connections.
I don't think this ever needs to be changed, so please tell me about it
@@ -1902,7 +1908,7 @@ Falls back to normal file name handler if no Tramp file name handler exists."
;; operations shall return at least a default value
;; in order to give the user a chance to correct the
;; file name in the minibuffer.
- ;; We cannot use 'debug as error handler. In order
+ ;; We cannot use `debug' as error handler. In order
;; to get a full backtrace, one could apply
;; (setq debug-on-error t debug-on-signal t)
(error
@@ -3109,14 +3115,16 @@ beginning of local filename are not substituted."
(defun tramp-action-login (proc vec)
"Send the login name."
(when (not (stringp tramp-current-user))
- (save-window-excursion
- (let ((enable-recursive-minibuffers t))
- (pop-to-buffer (tramp-get-connection-buffer vec))
- (setq tramp-current-user (read-string (match-string 0))))))
- (tramp-message vec 3 "Sending login name `%s'" tramp-current-user)
+ (setq tramp-current-user
+ (with-connection-property vec "login-as"
+ (save-window-excursion
+ (let ((enable-recursive-minibuffers t))
+ (pop-to-buffer (tramp-get-connection-buffer vec))
+ (read-string (match-string 0)))))))
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
- (tramp-send-string vec tramp-current-user))
+ (tramp-message vec 3 "Sending login name `%s'" tramp-current-user)
+ (tramp-send-string vec (concat tramp-current-user tramp-local-end-of-line)))
(defun tramp-action-password (proc vec)
"Query the user for a password."
@@ -3148,7 +3156,7 @@ See also `tramp-action-yn'."
(throw 'tramp-action 'permission-denied))
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
- (tramp-send-string vec "yes"))))
+ (tramp-send-string vec (concat "yes" tramp-local-end-of-line)))))
(defun tramp-action-yn (proc vec)
"Ask the user for confirmation using `y-or-n-p'.
@@ -3162,7 +3170,7 @@ See also `tramp-action-yesno'."
(throw 'tramp-action 'permission-denied))
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
- (tramp-send-string vec "y"))))
+ (tramp-send-string vec (concat "y" tramp-local-end-of-line)))))
(defun tramp-action-terminal (proc vec)
"Tell the remote host which terminal type to use.
@@ -3170,7 +3178,7 @@ The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type)
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
- (tramp-send-string vec tramp-terminal-type))
+ (tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line)))
(defun tramp-action-process-alive (proc vec)
"Check, whether a process has finished."