Mercurial > emacs
comparison lisp/net/quickurl.el @ 38086:50acec1e0d30
(quickurl-url-file): Run through convert-standard-filename.
(quickurl-list-populate-buffer): Add help-echo to mouse-highlighted text.
(top level): Update Dave's URL.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sun, 17 Jun 2001 11:46:20 +0000 |
parents | 5131c8bca419 |
children | b174db545cfd |
comparison
equal
deleted
inserted
replaced
38085:4adf8e4eebfe | 38086:50acec1e0d30 |
---|---|
1 ;;; quickurl.el --- Insert an URL based on text at point in buffer. | 1 ;;; quickurl.el --- Insert an URL based on text at point in buffer. |
2 | 2 |
3 ;; Copyright (C) 1999,2000 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1999,2000,2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Dave Pearson <davep@davep.org> | 5 ;; Author: Dave Pearson <davep@davep.org> |
6 ;; Maintainer: Dave Pearson <davep@davep.org> | 6 ;; Maintainer: Dave Pearson <davep@davep.org> |
7 ;; Created: 1999-05-28 | 7 ;; Created: 1999-05-28 |
8 ;; Keywords: hypermedia | 8 ;; Keywords: hypermedia |
57 ;; Given the above, your quickurl file might look like: | 57 ;; Given the above, your quickurl file might look like: |
58 ;; | 58 ;; |
59 ;; (("GNU" . "http://www.gnu.org/") | 59 ;; (("GNU" . "http://www.gnu.org/") |
60 ;; ("FSF" "http://www.fsf.org/" "The Free Software Foundation") | 60 ;; ("FSF" "http://www.fsf.org/" "The Free Software Foundation") |
61 ;; ("emacs" . "http://www.emacs.org/") | 61 ;; ("emacs" . "http://www.emacs.org/") |
62 ;; ("hagbard" "http://www.hagbard.demon.co.uk" "Hagbard's World")) | 62 ;; ("davep" "http://www.davep.org/" "Dave's homepage")) |
63 ;; | 63 ;; |
64 ;; In case you're wondering about the mixture of cons cells and lists, | 64 ;; In case you're wondering about the mixture of cons cells and lists, |
65 ;; quickurl started life using just the cons cells, there were no comments. | 65 ;; quickurl started life using just the cons cells, there were no comments. |
66 ;; URL comments are a later addition and so there is a mixture to keep | 66 ;; URL comments are a later addition and so there is a mixture to keep |
67 ;; backward compatibility with existing URL lists. | 67 ;; backward compatibility with existing URL lists. |
103 "Insert an URL based on text at point in buffer." | 103 "Insert an URL based on text at point in buffer." |
104 :version "21.1" | 104 :version "21.1" |
105 :group 'abbrev | 105 :group 'abbrev |
106 :prefix "quickurl-") | 106 :prefix "quickurl-") |
107 | 107 |
108 (defcustom quickurl-url-file "~/.quickurls" | 108 (defcustom quickurl-url-file (convert-standard-filename "~/.quickurls") |
109 "*File that contains the URL list." | 109 "*File that contains the URL list." |
110 :type 'file | 110 :type 'file |
111 :group 'quickurl) | 111 :group 'quickurl) |
112 | 112 |
113 (defcustom quickurl-format-function (lambda (url) (format "<URL:%s>" (quickurl-url-url url))) | 113 (defcustom quickurl-format-function (lambda (url) (format "<URL:%s>" (quickurl-url-url url))) |
480 (setf (buffer-string) "") | 480 (setf (buffer-string) "") |
481 (loop for url in quickurl-urls | 481 (loop for url in quickurl-urls |
482 do (let ((start (point))) | 482 do (let ((start (point))) |
483 (insert (format fmt (quickurl-url-description url) | 483 (insert (format fmt (quickurl-url-description url) |
484 (quickurl-url-url url))) | 484 (quickurl-url-url url))) |
485 (put-text-property start (1- (point)) | 485 (add-text-properties start (1- (point)) |
486 'mouse-face 'highlight))) | 486 '(mouse-face highlight |
487 help-echo "mouse-2: insert this URL")))) | |
487 (setf (point) (point-min))))) | 488 (setf (point) (point-min))))) |
488 | 489 |
489 (defun quickurl-list-add-url (word url comment) | 490 (defun quickurl-list-add-url (word url comment) |
490 "Wrapper for `quickurl-add-url' that doesn't guess the parameters." | 491 "Wrapper for `quickurl-add-url' that doesn't guess the parameters." |
491 (interactive "sWord: \nsURL: \nsComment: ") | 492 (interactive "sWord: \nsURL: \nsComment: ") |