;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313\314\315& \210\316\317\320\321\310\322\323\324\312\305& \210\316\325\326\327\323\330\312\305&\210\316\331\332\333\323\330\312\305&\210\316\334\335\336\323\330\312\305&\207" [require thingatpt pp browse-url custom-declare-group quickurl nil "Insert a URL based on text at point in buffer." :version "21.1" :group abbrev :prefix "quickurl-" custom-declare-variable quickurl-url-file (locate-user-emacs-file "quickurls" ".quickurls") "File that contains the URL list." "24.4" :type file quickurl-format-function #'quickurl-format-url "Function to format the URL before insertion into the current buffer." function quickurl-sort-function #'quickurl-sort-urls "Function to sort the URL list." quickurl-grab-lookup-function #'current-word "Function to grab the thing to lookup."] 10) #@49 Default function for `quickurl-assoc-function'. (defalias 'quickurl--assoc-function #[(key alist) "\302 \303#\207" [key alist assoc-string t] 4 (#$ . 1272)]) (byte-code "\300\301\302\303\304\305\306\307\310\311& \210\300\312\313\314\306\315\310\311&\210\300\316\317\320\306\321\310\311&\210\300\322\323\324\306\321\310\311&\210\300\325\326\327\306\330\310\311&\207" [custom-declare-variable quickurl-assoc-function #'quickurl--assoc-function "Function to use for alist lookup into `quickurl-urls'." :version "26.1" :type function :group quickurl quickurl-completion-ignore-case t "Should `quickurl-ask' ignore case when doing the input lookup?" boolean quickurl-prefix ";; -*- lisp -*-\n\n" "Text to write to `quickurl-url-file' before writing the URL list." string quickurl-postfix "" "Text to write to `quickurl-url-file' after writing the URL list.\n\nSee the constant `quickurl-reread-hook-postfix' for some example text that\ncould be used here." quickurl-list-mode-hook nil "Hooks for `quickurl-list-mode'." hook] 10) #@339 Example `quickurl-postfix' text that adds a local variable to the `quickurl-url-file' so that if you edit it by hand it will ensure that `quickurl-urls' is updated with the new URL list. To make use of this do something like: (setq quickurl-postfix quickurl-reread-hook-postfix) in your init file (after loading/requiring quickurl). (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'write-file-functions (lambda () (quickurl-read) nil) nil t))\n;; End:\n" (#$ . 2308)) #@55 URL alist for use with `quickurl' and `quickurl-ask'. (defvar quickurl-urls nil (#$ . 2848)) #@49 Local keymap for a `quickurl-list-mode' buffer. (defvar quickurl-list-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210\302\315\316#\210\302\317\320#\210\302\321\320#\210\302\322\323#\210)\207" [map make-sparse-keymap define-key "a" quickurl-list-add-url [(control m)] quickurl-list-insert-url "u" quickurl-list-insert-naked-url " " quickurl-list-insert-with-lookup "l" quickurl-list-insert-lookup "d" quickurl-list-insert-with-desc [(control g)] quickurl-list-quit "q" [mouse-2] quickurl-list-mouse-select] 4) (#$ . 2947)) #@34 Name for the URL listing buffer. (defvar quickurl-list-buffer-name "*quickurl-list*" (#$ . 3550)) #@51 `current-buffer' when `quickurl-list' was called. (defvar quickurl-list-last-buffer nil (#$ . 3654)) #@30 Does the URL have a comment? (defalias 'quickurl-url-commented-p #[(url) "A<\207" [url] 1 (#$ . 3761)]) #@58 Create a URL from KEYWORD, URL and (optionally) COMMENT. (defalias 'quickurl-make-url #[(keyword url &optional comment) "\203G\303U\204 \nE\207 \nB\207" [comment keyword url 0] 3 (#$ . 3872)]) (defalias 'quickurl-url-keyword 'car "Return the keyword for the URL.\n\n(fn URL)") #@81 Return the actual URL of the URL. Note that this function is a setfable place. (defalias 'quickurl-url-url #[(url) "\301!\203\nA@\207A\207" [url quickurl-url-commented-p] 2 (#$ . 4162)]) (byte-code "\300\301\302\303#\300\207" [function-put quickurl-url-url gv-expander #[(do &rest args) "\302\303\304 $\207" [do args gv--defsetter quickurl-url-url #[(store url) "\302\303\304D\305D\306DF E\207" [url store setf if quickurl-url-commented-p cadr cdr] 6]] 5]] 4) #@135 Get the comment from a URL. If the URL has no comment an empty string is returned. Also note that this function is a setfable place. (defalias 'quickurl-url-comment #[(url) "\301!\203\n\3028\207\303\207" [url quickurl-url-commented-p 2 ""] 2 (#$ . 4638)]) (byte-code "\300\301\302\303#\300\207" [function-put quickurl-url-comment gv-expander #[(do &rest args) "\302\303\304 $\207" [do args gv--defsetter quickurl-url-comment #[(store url) "\302\303D\302\304\305 DD\306\307D\310DE\306\311\312E EF\313\304\305 DD\306\307D\314\307D EEEF\207" [url store if quickurl-url-commented-p zerop length setf cdr cadr nth 2 unless list] 10]] 5]] 4) #@119 Return a description for the URL. If the URL has a comment then this is returned, otherwise the keyword is returned. (defalias 'quickurl-url-description #[(url) "\302!\211G\303U\203\304!\202 )\207" [url desc quickurl-url-comment 0 quickurl-url-keyword] 3 (#$ . 5292)]) (defalias 'quickurl-format-url #[(url) "\301\302\303!\"\207" [url format "" quickurl-url-url] 4]) #@66 Sort URLs in LIST according to their `quickurl-url-description'. (defalias 'quickurl-sort-urls #[(list) "\301\302\"\207" [list sort #[(x y) "\302!\227\302 !\227\231\207" [x y quickurl-url-description] 3]] 3 (#$ . 5682)]) #@216 `read' the URL list from BUFFER into `quickurl-urls'. BUFFER, if nil, defaults to current buffer. Note that this function moves point to `point-min' before doing the `read' It also restores point after the `read'. (defalias 'quickurl-read #[(&optional buffer) "\212eb\210\303 \206 p!!\211)\207" [quickurl-sort-function buffer quickurl-urls read] 3 (#$ . 5912)]) #@64 Load the contents of `quickurl-url-file' into `quickurl-urls'. (defalias 'quickurl-load-urls #[nil "\302!\205\303\304!r q\210\305\216\306!\210\307 +\207" [quickurl-url-file #1=#:temp-buffer file-exists-p generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents quickurl-read] 2 (#$ . 6284)]) #@62 Save the contents of `quickurl-urls' to `quickurl-url-file'. (defalias 'quickurl-save-urls #[nil "\306\307!rq\210\310\216p\311\312 !\210\313\f!\210\312 !\210\314ed\311\315%-\207" [#1=#:temp-buffer print-length standard-output quickurl-prefix quickurl-urls quickurl-postfix generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] nil princ pp write-region 0 quickurl-url-file] 6 (#$ . 6645)]) #@252 Return URL associated with key LOOKUP. The lookup is done by looking in the alist `quickurl-urls' and the `cons' for the URL is returned. The actual method used to look into the alist depends on the setting of the variable `quickurl-assoc-function'. (defalias 'quickurl-find-url #[(lookup) " \n\"\207" [quickurl-assoc-function lookup quickurl-urls] 3 (#$ . 7088)]) #@133 Insert URL, formatted using `quickurl-format-function'. Also display a `message' saying what the URL was unless SILENT is non-nil. (defalias 'quickurl-insert #[(url &optional silent) " !c\210\n?\205\303\304\305 !\"\207" [quickurl-format-function url silent message "Found %s" quickurl-url-url] 4 (#$ . 7462)]) #@184 Insert a URL based on LOOKUP. If not supplied LOOKUP is taken to be the word at point in the current buffer, this default action can be modified via `quickurl-grab-lookup-function'. (defalias 'quickurl #[(&optional lookup) "\204 \211\205.\303 \210\304!\211\204\305\306\"\202-\307\310!\203'\311\310!\210\312c\210\313\n!)\207" [lookup quickurl-grab-lookup-function url quickurl-load-urls quickurl-find-url error "No URL associated with \"%s\"" looking-at "\\w" skip-syntax-forward " " quickurl-insert] 4 (#$ . 7783) nil]) #@63 Insert a URL, with `completing-read' prompt, based on LOOKUP. (defalias 'quickurl-ask #[(lookup) "\302!\211\205 \303 !)\207" [lookup url quickurl-find-url quickurl-insert] 3 (#$ . 8323) (list (progn (quickurl-load-urls) (let ((completion-ignore-case quickurl-completion-ignore-case)) (completing-read "Lookup: " quickurl-urls nil t))))]) #@362 Attempt to grab a word/URL pair from point in the current buffer. Point should be somewhere on the URL and the word is taken to be the thing that is returned from calling `quickurl-grab-lookup-function' once a `backward-word' has been issued at the start of the URL. It is assumed that the URL is either "unguarded" or is wrapped inside an wrapper. (defalias 'quickurl-grab-url #[nil "\305\300!\211\2058\212\306\300!\210\307 !\203\310\311!\210\312\313!\210\n \211\2057\314\315\316!r\fq\210\317\216 c\210\320ed\"+\"*)\207" [url thing-at-point-markedup-url-regexp quickurl-grab-lookup-function word #1=#:temp-buffer thing-at-point beginning-of-thing thing-at-point-looking-at search-backward " `naked-url' - Insert the URL with no formatting `with-lookup' - Insert "lookup " `with-desc' - Insert "description " `lookup' - Insert the lookup for that URL (defalias 'quickurl-list-insert #[(type) "\305e\306 \"8\211\203Gr\nq\210 \307\267\202@\f !\202A\310 !\202A\311\312\313 !\310 !#\202A\311\314\315 !\310 !#\202A\313 !\202A\316c\210)\202K\317\320!\210 )\207" [quickurl-urls url quickurl-list-last-buffer type quickurl-format-function count-lines line-beginning-position #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (url 22 naked-url 28 with-lookup 34 with-desc 46 lookup 58)) quickurl-url-url format "%s " quickurl-url-keyword "%S " quickurl-url-description nil error "No URL details on that line"] 6 (#$ . 15733)]) #@76 Macro to make a key-response function for use in `quickurl-list-mode-map'. (defalias 'quickurl-list-make-inserter '(macro . #[(type) "\301\302\303\304\"!\305\303\306\"\307\310\311\312DD\313BB\257\207" [type defun intern format "quickurl-list-insert-%S" nil "Insert the result of calling `quickurl-list-insert' with `%s'." (interactive) when quickurl-list-insert quote ((quickurl-list-quit))] 9 (#$ . 16719)])) #@65 Insert the result of calling `quickurl-list-insert' with `url'. (defalias 'quickurl-list-insert-url #[nil "\300\301!\205\302 \207" [quickurl-list-insert url quickurl-list-quit] 2 (#$ . 17139) nil]) #@71 Insert the result of calling `quickurl-list-insert' with `naked-url'. (defalias 'quickurl-list-insert-naked-url #[nil "\300\301!\205\302 \207" [quickurl-list-insert naked-url quickurl-list-quit] 2 (#$ . 17345) nil]) #@73 Insert the result of calling `quickurl-list-insert' with `with-lookup'. (defalias 'quickurl-list-insert-with-lookup #[nil "\300\301!\205\302 \207" [quickurl-list-insert with-lookup quickurl-list-quit] 2 (#$ . 17569) nil]) #@71 Insert the result of calling `quickurl-list-insert' with `with-desc'. (defalias 'quickurl-list-insert-with-desc #[nil "\300\301!\205\302 \207" [quickurl-list-insert with-desc quickurl-list-quit] 2 (#$ . 17799) nil]) #@68 Insert the result of calling `quickurl-list-insert' with `lookup'. (defalias 'quickurl-list-insert-lookup #[nil "\300\301!\205\302 \207" [quickurl-list-insert lookup quickurl-list-quit] 2 (#$ . 18023) nil]) (provide 'quickurl)