MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.131.85.46
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/net/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/net/quickurl.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:10:34 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/net/quickurl.el
;;; in Emacs version 24.3.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\322\323\312\305&\210\316\324\325\326\322\327\312\305&\210\316\330\331\332\322\327\312\305&\210\316\333\334\335\322\327\312\305&\210\316\336\337\340\322\327\312\305&\210\316\341\342\343\322\344\312\305&\210\316\345\346\347\322\350\312\305&\210\316\351\352\353\322\350\312\305&\210\316\354\306\355\322\356\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 (convert-standard-filename "~/.quickurls") "File that contains the URL list." :type file quickurl-format-function (lambda (url) (format "<URL:%s>" (quickurl-url-url url))) "Function to format the URL before insertion into the current buffer." function quickurl-sort-function (lambda (list) (sort list (lambda (x y) (string< (downcase (quickurl-url-description x)) (downcase (quickurl-url-description y)))))) "Function to sort the URL list." quickurl-grab-lookup-function #'current-word "Function to grab the thing to lookup." quickurl-assoc-function #'assoc-ignore-case "Function to use for alist lookup into `quickurl-urls'." 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 "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 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" (#$ . 2306))
#@55 URL alist for use with `quickurl' and `quickurl-ask'.
(defvar quickurl-urls nil (#$ . 2842))
#@49 Local keymap for a `quickurl-list-mode' buffer.
(defvar quickurl-list-mode-map (byte-code "\301 \302\303\"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\304\315\316#\210\304\317\320#\210\304\321\322#\210\304\323\322#\210\304\324\325#\210\304\326\327#\210)\207" [map make-sparse-keymap suppress-keymap t 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 "?" describe-mode] 4) (#$ . 2941))
#@34 Name for the URL listing buffer.
(defvar quickurl-list-buffer-name "*quickurl-list*" (#$ . 3613))
#@51 `current-buffer' when `quickurl-list' was called.
(defvar quickurl-list-last-buffer nil (#$ . 3717))
#@30 Does the URL have a comment?
(defalias 'quickurl-url-commented-p #[(url) "A<\207" [url] 1 (#$ . 3824)])
#@58 Create a URL from KEYWORD, URL and (optionally) COMMENT.
(defalias 'quickurl-make-url #[(keyword url &optional comment) "\203\303G!\204	\nE\207	\nB\207" [comment keyword url zerop] 3 (#$ . 3935)])
(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) "\302!\203
\211A@)\207A\207" [url x quickurl-url-commented-p] 3 (#$ . 4229)])
(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])
#@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 (#$ . 4663)])
(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])
#@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!\303	G!\203\304!\202	)\207" [url desc quickurl-url-comment zerop quickurl-url-keyword] 2 (#$ . 5268)])
#@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	\206p!!\211)\207" [quickurl-sort-function buffer quickurl-urls read] 3 (#$ . 5553)])
#@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*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents quickurl-read] 2 (#$ . 5925)])
#@62 Save the contents of `quickurl-urls' to `quickurl-url-file'.
(defalias 'quickurl-save-urls #[nil "\306\307!rq\210\310\216p\311\n!\210\312!\210\311\f!\210\313ed
\314\315%,\207" [#1=#:temp-buffer standard-output quickurl-prefix quickurl-urls quickurl-postfix quickurl-url-file generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) princ pp write-region nil 0] 6 (#$ . 6302)])
#@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 (#$ . 6743)])
#@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 (#$ . 7117)])
#@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 (#$ . 7438) 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 (#$ . 7978) (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
<URL:...> wrapper.
(defalias 'quickurl-grab-url #[nil "\305\300!\211\2057\212\306\300!\210\307	!\203\310\311!\210\312v\210\n \211\2056\313\314\315!r\fq\210\316\216c\210\317ed\"+\"*)\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 "<URL:" -1 quickurl-make-url generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) buffer-substring-no-properties] 5 (#$ . 8326)])
#@158 Allow the user to interactively add a new URL associated with WORD.

See `quickurl-grab-url' for details on how the default word/URL combination
is decided.
(defalias 'quickurl-add-url #[(word url comment) "\306G!\203\307\310!\207\311 \210\312!\211\203)\313\314!\203%\315\316\317\"!\202*\320\202*\320\211\205\306	\203\235	\321!\203F\211A
\240\210)\202N\211
\241\210))	\321!\203\203\306G!\203t\211\211A@)\241\210)\202\231AA\211\240\210)\202\231\306G!\204\231\211AD\241\210))\202\250\322
#B !\323 \210\324!!\203\274\325 \210\313\314!\205\306\326\327
\"*\207" [word current-url add-it #1=#:v #2=#:v url zerop error "You must specify a WORD for lookup" quickurl-load-urls quickurl-find-url called-interactively-p interactive y-or-n-p format "\"%s\" exists, replace URL? " t quickurl-url-commented-p quickurl-make-url quickurl-save-urls get-buffer quickurl-list-populate-buffer message "Added %s" #3=#:v #4=#:v comment #5=#:v x #6=#:c #7=#:v quickurl-urls quickurl-sort-function quickurl-list-buffer-name] 5 (#$ . 9226) (let ((word-url (quickurl-grab-url))) (list (read-string "Word: " (quickurl-url-keyword word-url)) (read-string "URL: " (quickurl-url-url word-url)) (read-string "Comment: " (quickurl-url-comment word-url))))])
#@193 Browse the URL associated with 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-browse-url #[(&optional lookup) "\204	 \211\205#\303 \210\304!\211\203\305\306\n!!\202\"\307\310\")\207" [lookup quickurl-grab-lookup-function url quickurl-load-urls quickurl-find-url browse-url quickurl-url-url error "No URL associated with \"%s\""] 4 (#$ . 10532) nil])
#@72 Browse the URL, with `completing-read' prompt, associated with LOOKUP.
(defalias 'quickurl-browse-url-ask #[(lookup) "\302!\211\205
\303\304	!!)\207" [lookup url quickurl-find-url browse-url quickurl-url-url] 4 (#$ . 11033) (list (progn (quickurl-load-urls) (completing-read "Browse: " quickurl-urls nil t)))])
#@58 Pull `quickurl-url-file' into a buffer for hand editing.
(defalias 'quickurl-edit-urls #[nil "\301!\207" [quickurl-url-file find-file] 2 (#$ . 11353) nil])
(put 'quickurl-list-mode 'mode-class 'special)
#@119 A mode for browsing the quickurl URL list.

The key bindings for `quickurl-list-mode' are:

\{quickurl-list-mode-map}
(defalias 'quickurl-list-mode #[nil "\305 \210\306!\210\307\310\311\312!\210\313\211\211\207" [quickurl-list-mode-map major-mode mode-name buffer-read-only truncate-lines kill-all-local-variables use-local-map quickurl-list-mode "quickurl list" run-mode-hooks quickurl-list-mode-hook t] 3 (#$ . 11564) nil])
#@73 Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
(defalias 'quickurl-list #[nil "\302 \210\303 \230\204\fp\304!\210\305 \210\306 \207" [quickurl-list-buffer-name quickurl-list-last-buffer quickurl-load-urls buffer-name pop-to-buffer quickurl-list-populate-buffer quickurl-list-mode] 2 (#$ . 12001) nil])
#@38 Populate the `quickurl-list' buffer.
(defalias 'quickurl-list-populate-buffer #[nil "r\306!q\210	\307\211\n:\203\"\n@\310!G\fB\nA\211\202
\f\237+\206*\311C\312\313\314\315
\"\"\316\317 \210	\307:\203j@`\312\310!\320!#c\210\321`S\322#\210)A\211\202A*eb,\207" [quickurl-list-buffer-name quickurl-urls #1=#:--cl-var-- url #2=#:--cl-var-- sizes get-buffer nil quickurl-url-description 20 format "%%-%ds %%s\n" apply max t erase-buffer quickurl-url-url add-text-properties (mouse-face highlight help-echo "mouse-2: insert this URL") fmt inhibit-read-only #3=#:--cl-var-- start] 6 (#$ . 12338)])
#@67 Wrapper for `quickurl-add-url' that doesn't guess the parameters.
(defalias 'quickurl-list-add-url #[(word url comment) "\303	\n#\207" [word url comment quickurl-add-url] 4 (#$ . 12972) "sWord: \nsURL: \nsComment: "])
#@52 Kill the buffer named `quickurl-list-buffer-name'.
(defalias 'quickurl-list-quit #[nil "\302!\210\303	!\210\304 \207" [quickurl-list-buffer-name quickurl-list-last-buffer kill-buffer switch-to-buffer delete-other-windows] 2 (#$ . 13197) nil])
#@39 Select the URL under the mouse click.
(defalias 'quickurl-list-mouse-select #[(event) "\302!\303	8\206	A@:\203	A@@\202	A@)b\210\304 \207" [event position event-end 5 quickurl-list-insert-url] 2 (#$ . 13447) "e"])
#@353 Insert the URL under cursor into `quickurl-list-last-buffer'.
TYPE dictates what will be inserted, options are:
  `url'         - Insert the URL as <URL:url>
  `naked-url'   - Insert the URL with no formatting
  `with-lookup' - Insert "lookup <URL:url>"
  `with-desc'   - Insert "description <URL:url>"
  `lookup'      - Insert the lookup for that URL
(defalias 'quickurl-list-insert #[(type) "\305e\306 \"8\211\203_r\nq\210\301=\203\f	!\202Y\307=\203(\310	!\202Y\311=\203:\312\313\314	!\310	!#\202Y\315=\203L\312\316\317	!\310	!#\202Y\320=\203X\314	!\202Y\321c\210)\202c\322\323!\210	)\207" [quickurl-urls url quickurl-list-last-buffer type quickurl-format-function count-lines line-beginning-position naked-url quickurl-url-url with-lookup format "%s <URL:%s>" quickurl-url-keyword with-desc "%S <URL:%s>" quickurl-url-description lookup nil error "No URL details on that line"] 6 (#$ . 13675)])
#@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 (#$ . 14599)]))
#@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 (#$ . 15019) 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 (#$ . 15225) 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 (#$ . 15449) 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 (#$ . 15679) 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 (#$ . 15903) nil])
(provide 'quickurl)

MMCT - 2023