aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2005-09-07 21:23:36 +0000
committerMichael Albinus2005-09-07 21:23:36 +0000
commit553f03bcd2591933df371d8926be18072ea37041 (patch)
treed9fcea5e596d9a41b8f03ac290bc61e041690c35
parentdcc6da3a1cf566b4ba8792814ebf93eed7581344 (diff)
downloademacs-553f03bcd2591933df371d8926be18072ea37041.tar.gz
emacs-553f03bcd2591933df371d8926be18072ea37041.zip
* woman.el (top): Remap `man' command by `woman' in
`woman-mode-map'. (Man-getpage-in-background-advice): Remove defadvice; it isn't necessary any longer with the remapped command. (Man-bgproc-sentinel-advice): Remove defadvice which counts formatting time only. * net/tramp.el (tramp-action-password) (tramp-multi-action-password): Compile the password prompt from `method', `user' and `host'. Sometimes it isn't obvious which password to enter, for example with remote files offered by recentf.el, or with multiple steps. Suggested by Robert Marshall <robert@chezmarshall.freeserve.co.uk>.
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/net/tramp.el13
-rw-r--r--lisp/woman.el51
3 files changed, 57 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c899dad69a8..3bda07a0d32 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12005-09-07 Michael Albinus <michael.albinus@gmx.de>
2
3 * woman.el (top): Remap `man' command by `woman' in
4 `woman-mode-map'.
5 (Man-getpage-in-background-advice): Remove defadvice; it isn't
6 necessary any longer with the remapped command.
7 (Man-bgproc-sentinel-advice): Remove defadvice which counts
8 formatting time only.
9
10 * net/tramp.el (tramp-action-password)
11 (tramp-multi-action-password): Compile the password prompt from
12 `method', `user' and `host'. Sometimes it isn't obvious which
13 password to enter, for example with remote files offered by
14 recentf.el, or with multiple steps. Suggested by Robert Marshall
15 <robert@chezmarshall.freeserve.co.uk>.
16
12005-09-07 Stefan Monnier <monnier@iro.umontreal.ca> 172005-09-07 Stefan Monnier <monnier@iro.umontreal.ca>
2 18
3 * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): 19 * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords):
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e721f3fb016..b8b3fb9068a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5213,7 +5213,10 @@ Returns nil if none was found, else the command is returned."
5213 5213
5214(defun tramp-action-password (p multi-method method user host) 5214(defun tramp-action-password (p multi-method method user host)
5215 "Query the user for a password." 5215 "Query the user for a password."
5216 (let ((pw-prompt (match-string 0))) 5216 (let ((pw-prompt
5217 (format "Password for %s "
5218 (tramp-make-tramp-file-name
5219 nil method user host ""))))
5217 (tramp-message 9 "Sending password") 5220 (tramp-message 9 "Sending password")
5218 (tramp-enter-password p pw-prompt user host))) 5221 (tramp-enter-password p pw-prompt user host)))
5219 5222
@@ -5300,8 +5303,12 @@ The terminal type can be configured with `tramp-terminal-type'."
5300 5303
5301(defun tramp-multi-action-password (p method user host) 5304(defun tramp-multi-action-password (p method user host)
5302 "Query the user for a password." 5305 "Query the user for a password."
5303 (tramp-message 9 "Sending password") 5306 (let ((pw-prompt
5304 (tramp-enter-password p (match-string 0) user host)) 5307 (format "Password for %s "
5308 (tramp-make-tramp-file-name
5309 nil method user host ""))))
5310 (tramp-message 9 "Sending password")
5311 (tramp-enter-password p pw-prompt user host)))
5305 5312
5306(defun tramp-multi-action-succeed (p method user host) 5313(defun tramp-multi-action-succeed (p method user host)
5307 "Signal success in finding shell prompt." 5314 "Signal success in finding shell prompt."
diff --git a/lisp/woman.el b/lisp/woman.el
index 5ecc4744305..cfc6da83e8e 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1741,7 +1741,10 @@ Leave point at end of new text. Return length of inserted text."
1741 (define-key woman-mode-map "w" 'woman) 1741 (define-key woman-mode-map "w" 'woman)
1742 (define-key woman-mode-map "\en" 'WoMan-next-manpage) 1742 (define-key woman-mode-map "\en" 'WoMan-next-manpage)
1743 (define-key woman-mode-map "\ep" 'WoMan-previous-manpage) 1743 (define-key woman-mode-map "\ep" 'WoMan-previous-manpage)
1744 (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)) 1744 (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)
1745
1746 ;; We don't need to call `man' when we are in `woman-mode'.
1747 (define-key woman-mode-map [remap man] 'woman))
1745 1748
1746(defun woman-follow-word (event) 1749(defun woman-follow-word (event)
1747 "Run WoMan with word under mouse as topic. 1750 "Run WoMan with word under mouse as topic.
@@ -1942,25 +1945,33 @@ Optional argument REDRAW, if non-nil, forces mode line to be updated."
1942(defvar WoMan-Man-start-time nil 1945(defvar WoMan-Man-start-time nil
1943 "Used to record formatting time used by the `man' command.") 1946 "Used to record formatting time used by the `man' command.")
1944 1947
1945(defadvice Man-getpage-in-background 1948;; Both advices are disabled because "a file in Emacs should not put
1946 (around Man-getpage-in-background-advice (topic) activate) 1949;; advice on a function in Emacs" (see Info node "(elisp)Advising
1947 "Use WoMan unless invoked outside a WoMan buffer or invoked explicitly. 1950;; Functions"). Counting the formatting time is useful for
1948Otherwise use Man and record start of formatting time." 1951;; developping, but less applicable for daily use. The advice for
1949 (if (and (eq major-mode 'woman-mode) 1952;; `Man-getpage-in-background' can be discarded, because the
1950 (not (eq (caar command-history) 'man))) 1953;; key-binding in `woman-mode-map' has been remapped to call `woman'
1951 (WoMan-getpage-in-background topic) 1954;; but `man'. Michael Albinus <michael.albinus@gmx.de>
1952 ;; Initiates man processing 1955
1953 (setq WoMan-Man-start-time (current-time)) 1956;; (defadvice Man-getpage-in-background
1954 ad-do-it)) 1957;; (around Man-getpage-in-background-advice (topic) activate)
1955 1958;; "Use WoMan unless invoked outside a WoMan buffer or invoked explicitly.
1956(defadvice Man-bgproc-sentinel 1959;; Otherwise use Man and record start of formatting time."
1957 (after Man-bgproc-sentinel-advice activate) 1960;; (if (and (eq major-mode 'woman-mode)
1958 ;; Terminates man processing 1961;; (not (eq (caar command-history) 'man)))
1959 "Report formatting time." 1962;; (WoMan-getpage-in-background topic)
1960 (let* ((time (current-time)) 1963;; ;; Initiates man processing
1961 (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536) 1964;; (setq WoMan-Man-start-time (current-time))
1962 (- (cadr time) (cadr WoMan-Man-start-time))))) 1965;; ad-do-it))
1963 (message "Man formatting done in %d seconds" time))) 1966
1967;; (defadvice Man-bgproc-sentinel
1968;; (after Man-bgproc-sentinel-advice activate)
1969;; ;; Terminates man processing
1970;; "Report formatting time."
1971;; (let* ((time (current-time))
1972;; (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536)
1973;; (- (cadr time) (cadr WoMan-Man-start-time)))))
1974;; (message "Man formatting done in %d seconds" time)))
1964 1975
1965 1976
1966;;; Buffer handling: 1977;;; Buffer handling: