emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8e36ddf 2/2: Don't hard-code the RSS structure so m


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8e36ddf 2/2: Don't hard-code the RSS structure so much in nnrss
Date: Thu, 26 Sep 2019 18:33:53 -0400 (EDT)

branch: master
commit 8e36ddfd44488e5194d26b34ad7405f92f838767
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Don't hard-code the RSS structure so much in nnrss
    
    * lisp/gnus/nnrss.el (nnrss-get-namespace-prefix): Find the URL in
    any section in the RSS (bug#34685).
---
 lisp/gnus/nnrss.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 9554327..1eca462 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -39,6 +39,7 @@
 (require 'iso8601)
 (require 'mml)
 (require 'xml)
+(require 'dom)
 
 (defgroup nnrss nil
   "RSS access for Gnus."
@@ -1008,7 +1009,11 @@ Simply ensures that the first element is rss or rdf."
   "Given EL (containing a parsed element) and URI (containing a string
 that gives the URI for which you want to retrieve the namespace
 prefix), return the prefix."
-  (let* ((prefix (car (rassoc uri (cadar el))))
+  (let* ((prefix (car (rassoc uri (dom-attributes
+                                  (dom-search
+                                   el
+                                   (lambda (node)
+                                     (rassoc uri (dom-attributes node))))))))
         (nslist (if prefix
                     (split-string (symbol-name prefix) ":")))
         (ns (cond ((eq (length nslist) 1) ; no prefix given



reply via email to

[Prev in Thread] Current Thread [Next in Thread]