%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/org/ |
Current File : //usr/local/share/emacs/27.2/lisp/org/org-protocol.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; 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\303\304\305\306\307\310\311\312\311\301& \207" [require org ol 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) #@97 Default protocols to use. See `org-protocol-protocol-alist' for a description of this variable. (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)) (#$ . 865)) #@338 This is the protocol to detect if org-protocol.el is loaded. `org-protocol-protocol-alist-default' and `org-protocol-protocol-alist' hold the sub-protocols that trigger the required action. You will have to define just one protocol handler OS-wide (MS-Windows) or per application (Linux). That protocol handler should call emacsclient. (defconst org-protocol-the-protocol "org-protocol" (#$ . 1266)) (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 (\"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 (\"GNU emacs OpenGrok\"\n :base-url \"https://opengrok.housegordon.com/source/xref/emacs/\"\n :working-directory \"~/dev/gnu-emacs/\")))\n\n The :rewrites line of \"localhost org-notes\" entry tells\n `org-protocol-open-source' to open /home/user/org/index.php,\n if the URL cannot be mapped to an existing file, and ends with\n either \"org\" or \"org/\". The \"GNU emacs OpenGrok\" entry\n does not include any suffix properties, allowing local source\n file to be opened as found by OpenGrok.\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") regexp] 12) #@104 Sanitize slashes to double-slashes in URI. Emacsclient compresses double and triple slashes. (fn URI) (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 (#$ . 7441)]) #@410 Split the DATA argument for an org-protocol handler function. If UNHEXIFY is non-nil, hex-decode each split part. If UNHEXIFY is a function, use that function to decode each split part. The string is split at each occurrence of SEPARATOR (regexp). If no SEPARATOR is specified or SEPARATOR is nil, assume "/+". The results of that splitting are returned as a list. (fn DATA &optional UNHEXIFY SEPARATOR) (defalias 'org-protocol-split-data #[769 "\211\206 \300\301\"\204 \211\202\"