/[emacs]/emacs/lisp/net/quickurl.el
ViewVC logotype

Diff of /emacs/lisp/net/quickurl.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pj, Mon Jul 16 12:22:59 2001 UTC revision 1.5.8.1 by miles, Fri Apr 4 06:20:30 2003 UTC
# Line 264  It also restores point after the `read'. Line 264  It also restores point after the `read'.
264    (save-excursion    (save-excursion
265      (setf (point) (point-min))      (setf (point) (point-min))
266      (setq quickurl-urls (funcall quickurl-sort-function (read buffer)))))      (setq quickurl-urls (funcall quickurl-sort-function (read buffer)))))
267                          
268  (defun quickurl-load-urls ()  (defun quickurl-load-urls ()
269    "Load the contents of `quickurl-url-file' into `quickurl-urls'."    "Load the contents of `quickurl-url-file' into `quickurl-urls'."
270    (when (file-exists-p quickurl-url-file)    (when (file-exists-p quickurl-url-file)
# Line 280  It also restores point after the `read'. Line 280  It also restores point after the `read'.
280        (pp quickurl-urls)        (pp quickurl-urls)
281        (princ quickurl-postfix)        (princ quickurl-postfix)
282        (write-region (point-min) (point-max) quickurl-url-file nil 0))))        (write-region (point-min) (point-max) quickurl-url-file nil 0))))
283      
284  (defun quickurl-find-url (lookup)  (defun quickurl-find-url (lookup)
285    "Return URL associated with key LOOKUP.    "Return URL associated with key LOOKUP.
286    
# Line 327  buffer, this default action can be modif Line 327  buffer, this default action can be modif
327    (let ((url (quickurl-find-url lookup)))    (let ((url (quickurl-find-url lookup)))
328      (when url      (when url
329        (quickurl-insert url))))        (quickurl-insert url))))
330      
331  (defun quickurl-grab-url ()  (defun quickurl-grab-url ()
332    "Attempt to grab a word/url pair from point in the current buffer.    "Attempt to grab a word/url pair from point in the current buffer.
333    
# Line 370  is decided." Line 370  is decided."
370                         (read-string "URL: "     (quickurl-url-url word-url))                         (read-string "URL: "     (quickurl-url-url word-url))
371                         (read-string "Comment: " (quickurl-url-comment word-url)))))                         (read-string "Comment: " (quickurl-url-comment word-url)))))
372    (if (zerop (length word))    (if (zerop (length word))
373        (error "You must specify a WORD for lookup")          (error "You must specify a WORD for lookup")
374      (quickurl-load-urls)      (quickurl-load-urls)
375      (let* ((current-url (quickurl-find-url word))      (let* ((current-url (quickurl-find-url word))
376             (add-it      (if current-url             (add-it      (if current-url
# Line 546  TYPE dictates what will be inserted, opt Line 546  TYPE dictates what will be inserted, opt
546  (quickurl-list-make-inserter with-lookup)  (quickurl-list-make-inserter with-lookup)
547  (quickurl-list-make-inserter with-desc)  (quickurl-list-make-inserter with-desc)
548  (quickurl-list-make-inserter lookup)  (quickurl-list-make-inserter lookup)
549      
550  (provide 'quickurl)  (provide 'quickurl)
551    
552  ;;; quickurl.el ends here  ;;; quickurl.el ends here

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.5.8.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26