aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorSam Steingold2013-05-08 11:13:25 -0400
committerSam Steingold2013-05-08 11:13:25 -0400
commit72d3cfca0a6a0dafaaa0fa271ac1934c9f836134 (patch)
tree726d4b5d5f00263c95e97dbd1bb65ea3d8bc6ef8 /lisp/net
parent5cb15713d8575fae940c9f177874ea98e5e7c7e0 (diff)
downloademacs-72d3cfca0a6a0dafaaa0fa271ac1934c9f836134.tar.gz
emacs-72d3cfca0a6a0dafaaa0fa271ac1934c9f836134.zip
* lisp/thingatpt.el (thing-at-point): Accept optional second argument
NO-PROPERTIES to strip the text properties from the return value. * lisp/net/browse-url.el (browse-url-url-at-point): Pass NO-PROPERTIES to `thing-at-point' instead of stripping the properties ourselves. Also, when `thing-at-point' fails to find a url, prepend "http://" to the filename at point on the assumption that the user is pointing at something like gnu.org/gnu.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/browse-url.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 19e513a3354..695b7a11424 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -658,9 +658,10 @@ regarding its parameter treatment."
658;; URL input 658;; URL input
659 659
660(defun browse-url-url-at-point () 660(defun browse-url-url-at-point ()
661 (let ((url (thing-at-point 'url))) 661 (or (thing-at-point 'url t)
662 (set-text-properties 0 (length url) nil url) 662 ;; assume that the user is pointing at something like gnu.org/gnu
663 url)) 663 (let ((f (thing-at-point 'filename t)))
664 (and f (concat "http://" f)))))
664 665
665;; Having this as a separate function called by the browser-specific 666;; Having this as a separate function called by the browser-specific
666;; functions allows them to be stand-alone commands, making it easier 667;; functions allows them to be stand-alone commands, making it easier