[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
respect active region in browse-url.el
From: |
Yoichi NAKAYAMA |
Subject: |
respect active region in browse-url.el |
Date: |
Sat, 22 May 2004 15:55:12 +0900 |
User-agent: |
Wanderlust/2.11.28 (Wonderwall) EMIKO/1.14.1 (Choanoflagellata) LIMIT/1.14.8 (土師の里) APEL/10.6 Emacs/21.3.50 (i686-pc-linux-gnu) MULE/5.0 (賢木) |
Hi,
Url in text sometimes splits into lines and
`browse-url-url-at-point' detects only a part.
Following change enables a user to explicitly
specify url string part in text.
emacs-w3m (http://emacs-w3m.namazu.org/index-en.html)
has such feature and I'm using it conveniently.
Index: browse-url.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/browse-url.el,v
retrieving revision 1.36
diff -u -r1.36 browse-url.el
--- browse-url.el 27 Apr 2004 14:03:10 -0000 1.36
+++ browse-url.el 22 May 2004 06:33:58 -0000
@@ -583,7 +583,13 @@
negation if a prefix argument was given."
(let ((event (elt (this-command-keys) 0)))
(and (listp event) (mouse-set-point event)))
- (list (read-string prompt (browse-url-url-at-point))
+ (list (read-string prompt (or (and transient-mark-mode mark-active
+ ;; rfc2396 Appendix E.
+ (replace-regexp-in-string
+ "[\t\r\f\n ]+" ""
+ (buffer-substring-no-properties
+ (region-beginning) (region-end))))
+ (browse-url-url-at-point)))
(not (eq (null browse-url-new-window-flag)
(null current-prefix-arg)))))
Reference: http://www.faqs.org/rfcs/rfc2396.html
Regards,
--
Yoichi NAKAYAMA
- respect active region in browse-url.el,
Yoichi NAKAYAMA <=