aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2004-05-23 22:38:30 +0000
committerJuanma Barranquero2004-05-23 22:38:30 +0000
commit4c4939993a74ca113cf52872d749f13482bd8251 (patch)
tree3df11853d1874f8933abcade592b353d854bca63
parent675254bc4b3ccb7931dda00969a08277d3967e3d (diff)
downloademacs-4c4939993a74ca113cf52872d749f13482bd8251.tar.gz
emacs-4c4939993a74ca113cf52872d749f13482bd8251.zip
(browse-url-interactive-arg): Enable user to explicitly select the text to
be taken as URL.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/browse-url.el16
2 files changed, 18 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1533d3aae18..6035f696952 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12004-05-24 Yoichi NAKAYAMA <yoichi@geiin.org> (tiny change)
2
3 * net/browse-url.el (browse-url-interactive-arg): Enable user to
4 explicitly select the text to be taken as URL.
5
12004-05-23 Juri Linkov <juri@jurta.org> 62004-05-23 Juri Linkov <juri@jurta.org>
2 7
3 * info.el (Info-index-nodes): New var and fun. 8 * info.el (Info-index-nodes): New var and fun.
@@ -69,7 +74,7 @@
69 * progmodes/gud.el (gud-menu-map, gud-speedbar-menu-items) 74 * progmodes/gud.el (gud-menu-map, gud-speedbar-menu-items)
70 (gud-speedbar-buttons, gud-sentinel, gud-display-line) 75 (gud-speedbar-buttons, gud-sentinel, gud-display-line)
71 (gud-basic-call): Handle new value for gud-minor-mode (gdbmi) for 76 (gud-basic-call): Handle new value for gud-minor-mode (gdbmi) for
72 a new mode. The file (gdb-mi.el) for this mode will be included 77 a new mode. The file (gdb-mi.el) for this mode will be included
73 with the GDB distribution (6.2 onwards) and will use GDB/MI as its 78 with the GDB distribution (6.2 onwards) and will use GDB/MI as its
74 primary interface. 79 primary interface.
75 80
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 8000e49c6d8..e98b3d815ab 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -577,13 +577,21 @@ down (this *won't* always work)."
577 577
578(defun browse-url-interactive-arg (prompt) 578(defun browse-url-interactive-arg (prompt)
579 "Read a URL from the minibuffer, prompting with PROMPT. 579 "Read a URL from the minibuffer, prompting with PROMPT.
580Default to the URL at or before point. If invoked with a mouse button, 580If `transient-mark-mode' is non-nil and the mark is active,
581set point to the position clicked first. Return a list for use in 581defaults to the current region, else to the URL at or before
582`interactive' containing the URL and `browse-url-new-window-flag' or its 582point. If invoked with a mouse button, set point to the
583position clicked first. Return a list for use in `interactive'
584containing the URL and `browse-url-new-window-flag' or its
583negation if a prefix argument was given." 585negation if a prefix argument was given."
584 (let ((event (elt (this-command-keys) 0))) 586 (let ((event (elt (this-command-keys) 0)))
585 (and (listp event) (mouse-set-point event))) 587 (and (listp event) (mouse-set-point event)))
586 (list (read-string prompt (browse-url-url-at-point)) 588 (list (read-string prompt (or (and transient-mark-mode mark-active
589 ;; rfc2396 Appendix E.
590 (replace-regexp-in-string
591 "[\t\r\f\n ]+" ""
592 (buffer-substring-no-properties
593 (region-beginning) (region-end))))
594 (browse-url-url-at-point)))
587 (not (eq (null browse-url-new-window-flag) 595 (not (eq (null browse-url-new-window-flag)
588 (null current-prefix-arg))))) 596 (null current-prefix-arg)))))
589 597