commit | author | age
|
76bbd0
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file uses dynamic docstrings, first added in Emacs 19.29. |
|
7 |
|
|
8 |
;;; This file does not contain utf-8 non-ASCII characters, |
|
9 |
;;; and so can be loaded in Emacs versions earlier than 23. |
|
10 |
|
|
11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
12 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
13 |
|
|
14 |
|
|
15 |
(byte-code "\300\301!\210\302\303\304\305\306\307\310\311\310\301& \207" [require org custom-declare-group org-protocol nil "Intercept calls from emacsclient to trigger custom actions.\n\nThis is done by advising `server-visit-files' to scan the list of filenames\nfor `org-protocol-the-protocol' and sub-protocols defined in\n`org-protocol-protocol-alist' and `org-protocol-protocol-alist-default'." :version "22.1" :group convenience] 10) |
|
16 |
#@97 Default protocols to use. |
|
17 |
See `org-protocol-protocol-alist' for a description of this variable. |
|
18 |
(defconst org-protocol-protocol-alist-default '(("org-capture" :protocol "capture" :function org-protocol-capture :kill-client t) ("org-store-link" :protocol "store-link" :function org-protocol-store-link) ("org-open-source" :protocol "open-source" :function org-protocol-open-source)) (#$ . 849)) |
|
19 |
#@338 This is the protocol to detect if org-protocol.el is loaded. |
|
20 |
`org-protocol-protocol-alist-default' and `org-protocol-protocol-alist' hold |
|
21 |
the sub-protocols that trigger the required action. You will have to define |
|
22 |
just one protocol handler OS-wide (MS-Windows) or per application (Linux). |
|
23 |
That protocol handler should call emacsclient. |
|
24 |
(defconst org-protocol-the-protocol "org-protocol" (#$ . 1250)) |
|
25 |
(byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\307\310\315&\210\300\316\302\303\317DD\320\306\307\310\321&\210\300\322\302\303\323DD\324\306\307\310\325&\210\300\326\302\303\327DD\330\306\307\331\332\333\334\310\335&\207" [custom-declare-variable org-protocol-reverse-list-of-files funcall function #[0 "\300\207" [t] 1] "Non-nil means re-reverse the list of filenames passed on the command line.\nThe filenames passed on the command line are passed to the emacs-server in\nreverse order. Set to t (default) to re-reverse the list, i.e. use the\nsequence on the command line. If nil, the sequence of the filenames is\nunchanged." :group org-protocol :type boolean org-protocol-project-alist #[0 "\300\207" [nil] 1] "Map URLs to local filenames for `org-protocol-open-source' (open-source).\n\nEach element of this list must be of the form:\n\n (module-name :property value property: value ...)\n\nwhere module-name is an arbitrary name. All the values are strings.\n\nPossible properties are:\n\n :online-suffix - the suffix to strip from the published URLs\n :working-suffix - the replacement for online-suffix\n :base-url - the base URL, e.g. http://www.example.com/project/\n Last slash required.\n :working-directory - the local working directory. This is, what base-url will\n be replaced with.\n :redirects - A list of cons cells, each of which maps a regular\n expression to match to a path relative to :working-directory.\n\nExample:\n\n (setq org-protocol-project-alist\n \\='((\"https://orgmode.org/worg/\"\n :online-suffix \".php\"\n :working-suffix \".org\"\n :base-url \"https://orgmode.org/worg/\"\n :working-directory \"/home/user/org/Worg/\")\n (\"http://localhost/org-notes/\"\n :online-suffix \".html\"\n :working-suffix \".org\"\n :base-url \"http://localhost/org/\"\n :working-directory \"/home/user/org/\"\n :rewrites ((\"org/?$\" . \"index.php\")))\n (\"Hugo based blog\"\n :base-url \"https://www.site.com/\"\n :working-directory \"~/site/content/post/\"\n :online-suffix \".html\"\n :working-suffix \".md\"\n :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\" . \".md\")))))\n\n\n The last line tells `org-protocol-open-source' to open\n /home/user/org/index.php, if the URL cannot be mapped to an existing\n file, and ends with either \"org\" or \"org/\".\n\nConsider using the interactive functions `org-protocol-create' and\n`org-protocol-create-for-org' to help you filling this variable with valid contents." alist org-protocol-protocol-alist #[0 "\300\207" [nil] 1] "Register custom handlers for org-protocol.\n\nEach element of this list must be of the form:\n\n (module-name :protocol protocol :function func :kill-client nil)\n\nprotocol - protocol to detect in a filename without trailing\n colon and slashes. See rfc1738 section 2.1 for more\n on this. If you define a protocol \"my-protocol\",\n `org-protocol-check-filename-for-protocol' will search\n filenames for \"org-protocol:/my-protocol\" and\n trigger your action for every match. `org-protocol'\n is defined in `org-protocol-the-protocol'. Double and\n triple slashes are compressed to one by emacsclient.\n\nfunction - function that handles requests with protocol and takes\n one argument. If a new-style link (key=val&key2=val2)\n is given, the argument will be a property list with\n the values from the link. If an old-style link is\n given (val1/val2), the argument will be the filename\n with all protocols stripped.\n\n If the function returns nil, emacsclient and -server\n do nothing. Any non-nil return value is considered a\n valid filename and thus passed to the server.\n\n `org-protocol.el' provides some support for handling\n old-style filenames, if you follow the conventions\n used for the standard handlers in\n `org-protocol-protocol-alist-default'. See\n `org-protocol-parse-parameters'.\n\nkill-client - If t, kill the client immediately, once the sub-protocol is\n detected. This is necessary for actions that can be interrupted by\n `C-g' to avoid dangling emacsclients. Note that all other command\n line arguments but the this one will be discarded. Greedy handlers\n still receive the whole list of arguments though.\n\nHere is an example:\n\n (setq org-protocol-protocol-alist\n \\='((\"my-protocol\"\n :protocol \"my-protocol\"\n :function my-protocol-handler-function)\n (\"your-protocol\"\n :protocol \"your-protocol\"\n :function your-protocol-handler-function)))" (alist) org-protocol-default-template-key #[0 "\300\207" [nil] 1] "The default template key to use.\nThis is usually a single character string but can also be a\nstring with two characters." (choice (const nil) (string)) org-protocol-data-separator #[0 "\300\207" [#1="/+\\|\\?"] 1 #1#] "The default data separator to use.\nThis should be a single regexp string." :version "24.4" :package-version (Org . "8.0") string] 12) |
|
26 |
#@104 Sanitize slashes to double-slashes in URI. |
|
27 |
Emacsclient compresses double and triple slashes. |
|
28 |
|
|
29 |
(fn URI) |
|
30 |
(defalias 'org-protocol-sanitize-uri #[257 "\300\301\"\203 \302\303\"\211@\304\305\306A\307#Q\266\202\207" [string-match "^\\([a-z]+\\):/" split-string "/+" "//" mapconcat identity "/"] 8 (#$ . 7085)]) |
|
31 |
#@410 Split the DATA argument for an org-protocol handler function. |
|
32 |
If UNHEXIFY is non-nil, hex-decode each split part. If UNHEXIFY |
|
33 |
is a function, use that function to decode each split part. The |
|
34 |
string is split at each occurrence of SEPARATOR (regexp). If no |
|
35 |
SEPARATOR is specified or SEPARATOR is nil, assume "/+". The |
|
36 |
results of that splitting are returned as a list. |
|
37 |
|
|
38 |
(fn DATA &optional UNHEXIFY SEPARATOR) |
|
39 |
(defalias 'org-protocol-split-data #[769 "\211\206 \300\301\"\203! \302!\203 \303\"\202\" |