From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH 2/2] Change indentation to match coding style guideline. Date: Wed, 7 Jul 2010 08:22:24 +0200 Message-ID: <1278483744-8255-2-git-send-email-dmaus@ictsoc.de> References: Return-path: Received: from [140.186.70.92] (port=57676 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWO23-0007PS-Jm for emacs-orgmode@gnu.org; Wed, 07 Jul 2010 02:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWO22-00075c-2G for emacs-orgmode@gnu.org; Wed, 07 Jul 2010 02:22:55 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:56856) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWO21-00075S-LL for emacs-orgmode@gnu.org; Wed, 07 Jul 2010 02:22:54 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * org-feed.el: Change indentation to match coding style guideline. Cosmetic changes. --- lisp/org-feed.el | 88 ++++++++++++++++++++++++++++++------------------------ 1 files changed, 49 insertions(+), 39 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index e41ad97..2af97e5 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -166,10 +166,11 @@ Here are the keyword-value pair allows in `org-feed-alist'. When the handler is called, point will be at the feed headline. :parse-feed function - This function gets passed a buffer, and should return a list of entries, - each being a property list containing the `:guid' and `:item-full-text' - keys. The default is `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' - is an alternative. + This function gets passed a buffer, and should return a list + of entries, each being a property list containing the + `:guid' and `:item-full-text' keys. The default is + `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' is an + alternative. :parse-entry function This function gets passed an entry as returned by the parse-feed @@ -200,12 +201,12 @@ Here are the keyword-value pair allows in `org-feed-alist'. (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")) + (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")) ))))) (defcustom org-feed-drawer "FEEDSTATUS" @@ -314,10 +315,10 @@ it can be a list structured like an entry in `org-feed-alist'." org-feed-default-template)) (drawer (or (nth 1 (memq :drawer feed)) org-feed-drawer)) - (parse-feed (or (nth 1 (memq :parse-feed feed)) - 'org-feed-parse-rss-feed)) - (parse-entry (or (nth 1 (memq :parse-entry feed)) - 'org-feed-parse-rss-entry)) + (parse-feed (or (nth 1 (memq :parse-feed feed)) + 'org-feed-parse-rss-feed)) + (parse-entry (or (nth 1 (memq :parse-entry feed)) + 'org-feed-parse-rss-entry)) feed-buffer inbox-pos new-formatted entries old-status status new changed guid-alist e guid olds) (setq feed-buffer (org-feed-get-feed url)) @@ -333,10 +334,11 @@ it can be a list structured like an entry in `org-feed-alist'." (setq old-status (org-feed-read-previous-status inbox-pos drawer)) ;; Add the "handled" status to the appropriate entries (setq entries (mapcar (lambda (e) - (setq e (plist-put e :handled - (nth 1 (assoc - (plist-get e :guid) - old-status))))) + (setq e + (plist-put e :handled + (nth 1 (assoc + (plist-get e :guid) + old-status))))) entries)) ;; Find out which entries are new and which are changed (dolist (e entries) @@ -637,9 +639,9 @@ formatted as a string, not the original XML data." (let ((feed (car (xml-parse-region (point-min) (point-max))))) (mapcar (lambda (entry) - (list - :guid (car (xml-node-children (car (xml-get-children entry 'id)))) - :item-full-text (prin1-to-string entry))) + (list + :guid (car (xml-node-children (car (xml-get-children entry 'id)))) + :item-full-text (prin1-to-string entry))) (xml-get-children feed 'entry))))) (defun org-feed-parse-atom-entry (entry) @@ -647,28 +649,36 @@ formatted as a string, not the original XML data." (let ((xml (car (read-from-string (plist-get entry :item-full-text))))) ;; Get first . (setq entry (plist-put entry :link - (xml-get-attribute - (car (xml-get-children xml 'link)) - 'href))) + (xml-get-attribute + (car (xml-get-children xml 'link)) + 'href))) ;; Add as :title. (setq entry (plist-put entry :title - (org-feed-unescape (car (xml-node-children - (car (xml-get-children xml 'title))))))) + (org-feed-unescape + (car (xml-node-children + (car (xml-get-children xml 'title))))))) (let* ((content (car (xml-get-children xml 'content))) - (type (xml-get-attribute-or-nil content 'type))) + (type (xml-get-attribute-or-nil content 'type))) (when content - (cond - ((string= type "text") - ;; We like plain text. - (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)))))) - ((string= type "html") - ;; TODO: convert HTML to Org markup. - (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)))))) - ((string= type "xhtml") - ;; TODO: convert XHTML to Org markup. - (setq entry (plist-put entry :description (prin1-to-string (xml-node-children content))))) - (t - (setq entry (plist-put entry :description (format "Unknown '%s' content." type))))))) + (cond + ((string= type "text") + ;; We like plain text. + (setq entry (plist-put entry :description + (org-feed-unescape + (car (xml-node-children content)))))) + ((string= type "html") + ;; TODO: convert HTML to Org markup. + (setq entry (plist-put entry :description + (org-feed-unescape + (car (xml-node-children content)))))) + ((string= type "xhtml") + ;; TODO: convert XHTML to Org markup. + (setq entry (plist-put entry :description + (prin1-to-string + (xml-node-children content))))) + (t + (setq entry (plist-put entry :description + (format "Unknown '%s' content." type))))))) entry)) (provide 'org-feed) -- 1.7.1