mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2018-11-18 76bbd07de7add0f9d13c6914f158d19630fe2f62
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;ELC
;;; Compiled
;;; in Emacs version 26.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\303\304\305\306\307\310\311\301&\210\312\313\314\315\316DD\317\311\304\320\321&\210\312\322\314\315\323DD\324\311\304\320\325&\210\312\326\314\315\327DD\330\311\304\320\331&\210\312\332\314\315\333DD\334\311\304\320\335&\210\312\336\314\315\337DD\340\311\304\320\341&\210\312\342\314\315\343DD\344\311\304\320\345&\210\312\346\314\315\347DD\350\311\304\320\345&\207" [require org sha1 custom-declare-group org-feed nil "Options concerning RSS feeds as inputs for Org files." :tag "Org Feed" :group custom-declare-variable org-feed-alist funcall function #[0 "\300\207" [nil] 1] "Alist specifying RSS feeds that should create inputs for Org.\nEach entry in this list specified an RSS feed tat should be queried\nto create inbox items in Org.  Each entry is a list with the following items:\n\nname         a custom name for this feed\nURL          the Feed URL\nfile         the target Org file where entries should be listed, when\n             nil the target becomes the current buffer (may be an\n             indirect buffer) each time the feed update is invoked\nheadline     the headline under which entries should be listed\n\nAdditional arguments can be given using keyword-value pairs.  Many of these\nspecify functions that receive one or a list of \"entries\" as their single\nargument.  An entry is a property list that describes a feed item.  The\nproperty list has properties for each field in the item, for example `:title'\nfor the `<title>' field and `:pubDate' for the publication date.  In addition,\nit contains the following properties:\n\n`:item-full-text'   the full text in the <item> tag\n`:guid-permalink'   t when the guid property is a permalink\n\nHere are the keyword-value pair allows in `org-feed-alist'.\n\n:drawer drawer-name\n     The name of the drawer for storing feed information.  The default is\n     \"FEEDSTATUS\".  Using different drawers for different feeds allows\n     several feeds to target the same inbox heading.\n\n:filter filter-function\n     A function to select interesting entries in the feed.  It gets a single\n     entry as parameter.  It should return the entry if it is relevant, or\n     nil if it is not.\n\n:template template-string\n     The default action on new items in the feed is to add them as children\n     under the headline for the feed.  The template describes how the entry\n     should be formatted.  If not given, it defaults to\n     `org-feed-default-template'.\n\n:formatter formatter-function\n     Instead of relying on a template, you may specify a function to format\n     the outline node to be inserted as a child.  This function gets passed\n     a property list describing a single feed item, and it should return a\n     string that is a properly formatted Org outline node of level 1.\n\n:new-handler function\n     If adding new items as children to the outline is not what you want\n     to do with new items, define a handler function that is called with\n     a list of all new items in the feed, each one represented as a property\n     list.  The handler should do what needs to be done, and org-feed will\n     mark all items given to this handler as \"handled\", i.e. they will not\n     be passed to this handler again in future readings of the feed.\n     When the handler is called, point will be at the feed headline.\n\n:changed-handler function\n     This function gets passed a list of all entries that have been\n     handled before, but are now still in the feed and have *changed*\n     since last handled (as evidenced by a different sha1 hash).\n     When the handler is called, point will be at the feed headline.\n\n:parse-feed function\n     This function gets passed a buffer, and should return a list\n     of entries, each being a property list containing the\n     `:guid' and `:item-full-text' keys.  The default is\n     `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' is an\n     alternative.\n\n:parse-entry function\n     This function gets passed an entry as returned by the parse-feed\n     function, and should return the entry with interesting properties added.\n     The default is `org-feed-parse-rss-entry'; `org-feed-parse-atom-entry'\n     is an alternative." :type (repeat (list :value (#1="" "http://" #1# #1#) (string :tag "Name") (string :tag "Feed URL") (file :tag "File for inbox") (string :tag "Headline for inbox") (repeat :inline t (choice (list :inline t :tag "Filter" (const :filter) (symbol :tag "Filter Function")) (list :inline t :tag "Template" (const :template) (string :tag "Template")) (list :inline t :tag "Formatter" (const :formatter) (symbol :tag "Formatter Function")) (list :inline t :tag "New items handler" (const :new-handler) (symbol :tag "Handler Function")) (list :inline t :tag "Changed items" (const :changed-handler) (symbol :tag "Handler Function")) (list :inline t :tag "Parse Feed" (const :parse-feed) (symbol :tag "Parse Feed Function")) (list :inline t :tag "Parse Entry" (const :parse-entry) (symbol :tag "Parse Entry Function")))))) org-feed-drawer #[0 "\300\207" [#2="FEEDSTATUS"] 1 #2#] "The name of the drawer for feed status information.\nEach feed may also specify its own drawer name using the `:drawer'\nparameter in `org-feed-alist'." (string :tag "Drawer Name") org-feed-default-template #[0 "\300\207" [#3="\n* %h\n  %U\n  %description\n  %a\n"] 1 #3#] "Template for the Org node created from RSS feed items.\nThis is just the default, each feed can specify its own.\nAny fields from the feed item can be interpolated into the template with\n%name, for example %title, %description, %pubDate etc.  In addition, the\nfollowing special escapes are valid as well:\n\n%h      The title, or the first line of the description\n%t      The date as a stamp, either from <pubDate> (if present), or\n        the current date\n%T      Date and time\n%u,%U   Like %t,%T, but inactive time stamps\n%a      A link, from <guid> if that is a permalink, else from <link>\n%(sexp) Evaluate elisp `(sexp)' and replace with the result, the simple\n        %-escapes above can be used as arguments, e.g. %(capitalize \\\"%h\\\")" (string :tag "Template") org-feed-save-after-adding #[0 "\300\207" [t] 1] "Non-nil means save buffer after adding new feed items." boolean org-feed-retrieve-method #[0 "\300\207" [url-retrieve-synchronously] 1] "The method to be used to retrieve a feed URL.\nThis can be `curl' or `wget' to call these external programs, or it can be\nan Emacs Lisp function that will return a buffer containing the content\nof the file pointed to by the URL." (choice (const :tag "Internally with url.el" url-retrieve-synchronously) (const :tag "Externally with curl" curl) (const :tag "Externally with wget" wget) (function :tag "Function")) org-feed-before-adding-hook #[0 "\300\207" [nil] 1] "Hook that is run before adding new feed items to a file.\nYou might want to commit the file in its current state to version control,\nfor example." hook org-feed-after-adding-hook #[0 "\300\207" [nil] 1] "Hook that is run after new items have been added to a file.\nDepending on `org-feed-save-after-adding', the buffer will already\nhave been saved."] 8)
#@37 The buffer used to retrieve a feed.
(defvar org-feed-buffer "*Org feed*" (#$ . 7588))
#@53 Get inbox items from all feeds in `org-feed-alist'.
(defalias 'org-feed-update-all #[0 "\301\211G\211\2030\211@\3021\303!0\202\210\304\211\203$\\\262\202(T\262\210A\266\202\202\210\305\306\307\267\202A\310\202F\311\202F\312\313\"\211\314U\203Q\315\202R\316\301U\203]\317\202b\312\320\"%\207" [org-feed-alist 0 (error) org-feed-update nil message "%s from %d %s%s" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (0 57 1 61)) "No new entries" "1 new entry" format "%d new entries" 1 "feed" "feeds" "" " (unavailable feeds: %d)"] 11 (#$ . 7680) nil])
#@191 Get inbox items from FEED.
FEED can be a string with an association in `org-feed-alist', or
it can be a list structured like an entry in `org-feed-alist'.
 
(fn FEED &optional RETRIEVE-ONLY)
(defalias 'org-feed-update #[513 ";\203 \304\"\262\204\305\306!\210\30724@A@\3108\206*\311\312 \206)p!\3138\314>A@\315>A@\316>A@\317    >A@\320\n>A@\206O    \321 >A@\206Y\n\322\f>A@\206c\323\324 >A@\206m\325\326\211\211\211\211C\326\211\211\211C\326C\326\327!\262 \n\203\217\330\331\f!!\204\225\305\332\"\210\203\240\333\307\f\"\210\f !\262\3341\263\335 !0\202\267\210\202\270\210\212\336 \337\340\341\342\343!\344\"\310$\216\345\"\262 \346\f\"\240\210\347\337\350\351\342\343 !\352\"\353\354%\n\"\262    \211\203-\211@\355\356\"\204\211B\262\202&\310\304\355\357\"\f\242\"8\262\203&\360\355\361\"!\230\204&\211B\262A\266\202\202\356\210\347 \"\262\347 \"\262\203Y\362\326\347    \"\"\262\362\326\347    \"\"\262\204l\204l\363\364\"\210\333\307\340\"\210\365\347\366    \"\347\367    \"\"\240\210\347\337\350\370\342\343        \"\371\"\372\354%\n\"\262\203\302\203\246\nb\210!\210\202\273\347\337\350\373\342\343\"\374\"\375\354%\"\262\n\376  \"\210\203\324\203\324\nb\210!\210\377     #\210\nb\210\201@ \210\201A \210\201B\201C!\210 \203\374\201D \210\363\201EGG\201FV\203\201G\202\201H\201I!&\210\201J\201K!\210G)\262)\266\2270\207" [org-feed-alist org-feed-default-template org-feed-drawer org-feed-save-after-adding assoc error "No such feed in `org-feed-alist" exit 2 buffer-file-name buffer-base-buffer 3 :filter :formatter :new-handler :changed-handler :template :drawer :parse-feed org-feed-parse-rss-feed :parse-entry org-feed-parse-rss-entry nil org-feed-get-feed bufferp get-buffer "Cannot get feed %s" throw (error) kill-buffer current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] org-feed-goto-inbox-internal org-feed-read-previous-status mapcar 257 "\301\302\303\304\305\"\300\242\"A@#\211\262\207" [plist-put :handled assoc plist-get :guid] 8 "\n\n(fn E)" plist-get :handled :guid sha1 :item-full-text delq message "No new items in feed %s" append #[257 "\300\301\"D\207" [plist-get :guid] 4 "\n\n(fn E)"] #[257 "\300\301\"D\207" [plist-get :guid] 4 "\n\n(fn E)"] "\301\302\303\"\240\210\301\242\304\301\242\300\242\"\203\305\202\302\306\"\307\302\310\"!E\207" [plist-get :guid assoc t :handled sha1 :item-full-text] 7 "\302\301\300#\207" [org-feed-format-entry] 5 org-feed-add-items org-feed-write-status outline-hide-subtree org-show-children org-cycle-hide-drawers children save-buffer "Added %d new item%s from feed %s to file %s, heading %s" 1 "s" "" file-name-nondirectory run-hooks org-feed-after-adding-hook] 34 (#$ . 8306) (byte-code "\301\302\"C\207" [org-feed-alist org-completing-read "Feed name: "] 3)])
#@63 Go to the inbox that captures the feed named FEED.
 
(fn FEED)
(defalias 'org-feed-goto-inbox #[257 "\211;\203 \301\"\262\211\204\302\303!\210\304\3058\3068\"\207" [org-feed-alist assoc error "No such feed in `org-feed-alist" org-feed-goto-inbox-internal 2 3] 5 (#$ . 11251) (byte-code "G\301U\203\f@\202\302\303\"C\207" [org-feed-alist 1 org-completing-read "Feed name: "] 3)])
#@48 Show the raw feed buffer of a feed.
 
(fn FEED)
(defalias 'org-feed-show-raw-feed #[257 "\211;\203 \301\"\262\211\204\302\303!\210\304\305\306\"!\210eb\207" [org-feed-alist assoc error "No such feed in `org-feed-alist" pop-to-buffer-same-window org-feed-update retrieve-only] 5 (#$ . 11649) (byte-code "G\301U\203\f@\202\302\303\"C\207" [org-feed-alist 1 org-completing-read "Feed name: "] 3)])
#@117 Find or create HEADING in FILE.
Switch to that buffer, and return the position of that headline.
 
(fn FILE HEADING)
(defalias 'org-feed-goto-inbox-internal #[514 "\300!\210~\210eb\210\301\302\303Q\304\305#\203\306\224b\210\202(db\210\307\310\261\210\311\305!\210`\207" [find-file re-search-forward "^\\*+[     ]+" "[     ]*\\(:.*?:[     ]*\\)?$" nil t 0 "\n\n* " "\n\n" org-back-to-heading] 6 (#$ . 12063)])
#@113 Get the alist of old GUIDs from the entry at POS.
This will find DRAWER and extract the alist.
 
(fn POS DRAWER)
(defalias 'org-feed-read-previous-status #[514 "\212b\210\212\300\301\211\")\302\303\304Q\301#\205\305\306\307!!\262)\207" [org-end-of-subtree t re-search-forward "^[     ]*:" ":[     ]*\n\\([^]*?\\)\n[     ]*:END:" read match-string 1] 7 (#$ . 12476)])
#@74 Write the feed STATUS to DRAWER in entry at POS.
 
(fn POS DRAWER STATUS)
(defalias 'org-feed-write-status #[771 "\212b\210\212\300\301\211\")\302\303\304Q\301#\203+\305\225b\210`\212\302\306\307\301#\205%\305\224)|\210\2028\310 \210\311\312\261\210\313\305!\210\314!c\262)\207" [org-end-of-subtree t re-search-forward "^[     ]*:" ":[     ]*\n" 0 "^[     ]*:END:" nil outline-next-heading "  :" ":\n  :END:\n" beginning-of-line pp-to-string] 9 (#$ . 12846)])
#@67 Add the formatted items to the headline as POS.
 
(fn POS ENTRIES)
(defalias 'org-feed-add-items #[514 "\301\211\212b\210\302!\204\303\304!\210\305\306\307!G\307\"\262\310\311\211\"\210\312\301x\210\313\314!\210`\262\211A\262\242\211\262\203>\315\316#\210\202)\317!)\207" [org-complex-heading-regexp nil looking-at error "Wrong position" org-get-valid-level match-string 1 org-end-of-subtree t "     \n" beginning-of-line 2 org-paste-subtree yank org-mark-ring-push] 8 (#$ . 13312)])
#@258 Format ENTRY so that it can be inserted into an Org file.
ENTRY is a property list.  This function adds a `:formatted-for-org' property
and returns the full property list.
If that property is already present, nothing changes.
 
(fn ENTRY TEMPLATE FORMATTER)
(defalias 'org-feed-format-entry #[771 "\300\301!\210\211\203\f\211!\207\302\303\304\"\206\305\306\"\303\307\"\203*\310\311\211\303\307\"#\206,\312 \303\313\"\2069@\2069\305\314\315\316\211\"\"\314\315\311\316\"\"\314\315\316\311\"\"\314\315\311\211\"\"\303\n\317\"\203f\303\n\320\"\206k\303\n\321\"\211\203v\322\323\"\202w\324\262\325\326!r\211q\210\327\330\331\332\333!\334\"\335$\216\nc\210eb\210\336\337!\210\340\341\316\311#\203/\342\343!\344\330\224!\344\330\225!\345 \204*|\210\316\211\223\210\211\316\211\223\210\346\267\202\337    \202\202\202\202\202\202\303\347\350P!\"\212\351 \327\330\352\332\333!\353\"\354$\216\355 \210\356\357\360Q!\203\f\361\362 \"\202 )\262)\262\262\211\203)\363 \203&\364\365\366#\202'\211c\210\210\266\202\227\336 \210\367\370 \371ed\311#\"*\262\207" [require org-capture org-split-string plist-get :description "???" "\n" :pubDate org-read-date t current-time :title format-time-string org-time-stamp-format nil :guid-permalink :guid :link format "[[%s]]\n" "" generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 org-capture-expand-embedded-elisp mark re-search-forward "%\\([a-zA-Z]+\\)" match-string 1 copy-marker org-capture-escaped-% #s(hash-table size 6 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("h" 195 "t" 200 "T" 205 "u" 210 "U" 215 "a" 219)) intern ":" match-data "\301\300\302\"\207" [set-match-data evaporate] 3 beginning-of-line looking-at "^\\([     ]*\\)%" "[     ]*$" org-feed-make-indented-block org-get-indentation org-capture-inside-embedded-elisp-p replace-regexp-in-string "\"" "\\\\\"" decode-coding-string buffer-string detect-coding-region] 24 (#$ . 13813)])
#@64 Add indentation of N spaces to a multiline string S.
 
(fn S N)
(defalias 'org-feed-make-indented-block #[514 "\300\301\"\204    \207\302\303\304\301\"\301\305\306\"P#\207" [string-match "\n" mapconcat identity org-split-string make-string 32] 9 (#$ . 15860)])
#@98 Remove HTTP headers from BUFFER, and return it.
Assumes headers are indeed present!
 
(fn BUFFER)
(defalias 'org-feed-skip-http-headers #[257 "r\211q\210~\210eb\210\300\301!\210e`|\210)\207" [search-forward "\n\n"] 3 (#$ . 16128)])
#@63 Get the RSS feed file at URL and return the buffer.
 
(fn URL)
(defalias 'org-feed-get-feed #[257 "\302=\203\f\303\302!!\207\304=\203/\3051\306    !0\202!\210\202\"\210\307\310\311    \311\312&\210    \207\313=\203T\3141@\306    !0\202D\210\202E\210\307\315\311    \311\316\317\320&\210    \207\321!\205]!\207" [org-feed-retrieve-method org-feed-buffer url-retrieve-synchronously org-feed-skip-http-headers curl (error) kill-buffer call-process "curl" nil "--silent" wget (error) "wget" "-q" "-O" "-" functionp] 10 (#$ . 16365)])
#@166 Parse BUFFER for RSS feed entries.
Returns a list of entries, with each entry a property list,
containing the properties `:guid' and `:item-full-text'.
 
(fn BUFFER)
(defalias 'org-feed-parse-rss-feed #[257 "\301\302!\210\303\304\211\211\211\211\211rq\210~\210eb\210\305\306\304\303#\203X`\262\305\307\304\303#\205-\310\224\262{\262\311\312\"\205A\313\314\315\"!\262\316\317F\262\211B\262~\210b\210\202\237*\207" [case-fold-search require xml t nil re-search-forward "<item\\>.*?>" "</item>" 0 string-match "<guid\\>.*?>\\([^]*?\\)</guid>" xml-substitute-special match-string-no-properties 1 :guid :item-full-text] 12 (#$ . 16907)])
#@87 Parse the `:item-full-text' field for xml tags and create new properties.
 
(fn ENTRY)
(defalias 'org-feed-parse-rss-entry #[257 "\300\301!\210\302\303!r\211q\210\304\305\306\307\310!\311\"\312$\216\313\314\"c\210eb\210\315\316\317\320#\203<\321\322\323\324\325!P!\326\324\312!!#\262\202 eb\210\315\327\317\320#\204N\321\330\320#\262*\210\207" [require xml generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 plist-get :item-full-text re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^]*?\\)</\\1>" nil t plist-put intern ":" match-string 1 xml-substitute-special "isPermaLink[     ]*=[     ]*\"false\"" :guid-permalink] 8 (#$ . 17572)])
#@276 Parse BUFFER for Atom feed entries.
Returns a list of entries, with each entry a property list,
containing the properties `:guid' and `:item-full-text'.
 
The `:item-full-text' property actually contains the sexp
formatted as a string, not the original XML data.
 
(fn BUFFER)
(defalias 'org-feed-parse-atom-feed #[257 "\300\301!\210r\211q\210~\210\302ed\"@\303\304\305\306\"\"\262)\207" [require xml xml-parse-region mapcar #[257 "\300\301\302\303\"@!@\304\305!F\207" [:guid xml-node-children xml-get-children id :item-full-text prin1-to-string] 6 "\n\n(fn ENTRY)"] xml-get-children entry] 7 (#$ . 18286)])
#@78 Parse the `:item-full-text' as a sexp and create new properties.
 
(fn ENTRY)
(defalias 'org-feed-parse-atom-entry #[257 "\300\301\302\"!@\303\304\305\306\307\"@\310\"#\262\303\311\312\313\306\314\"@!@!#\262\306\315\"@\316\317\"\203~\211\320\230\203I\303\321\312\313!@!#\262\202~\211\322\230\203_\303\321\312\313!@!#\262\202~\211\323\230\203t\303\321\324\313!!#\262\202~\303\321\325\326\"#\262\266\207" [read-from-string plist-get :item-full-text plist-put :link xml-get-attribute xml-get-children link href :title xml-substitute-special xml-node-children title content xml-get-attribute-or-nil type "text" :description "html" "xhtml" prin1-to-string format-message "Unknown `%s' content."] 10 (#$ . 18902)])
(provide 'org-feed)