GNU bug report logs - #34685
26.1; function nnrss-get-namespace-prefix always returns nil

Previous Next

Packages: emacs, gnus;

Reported by: wenbushi <wenbushi <at> gmail.com>

Date: Thu, 28 Feb 2019 15:37:02 UTC

Severity: minor

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: wenbushi <wenbushi <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; function nnrss-get-namespace-prefix always returns nil
Date: Thu, 28 Feb 2019 20:31:02 +0800
[Message part 1 (text/plain, inline)]
Package: nnrss

The function "nnrss-get-namespace-prefix" in gnus/nnrss.el always returns
nil,
which causes the contents in "<content:encoded>" tag of an RSS XML not
showing in the gnus article buffer.

Here is a fix:

--- nnrss.el    2019-02-28 20:02:29.224675750 +0800
+++ nnrss-fixed.el      2019-02-28 20:02:04.534267796 +0800
@@ -1031,7 +1031,7 @@
   "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 (cadar (nthcdr 2 (car el))))))
         (nslist (if prefix
                     (split-string (symbol-name prefix) ":")))
         (ns (cond ((eq (length nslist) 1) ; no prefix given


the argument "el" in the function is a list of the parsed XML, like(some
fields are ignored)

((rss ((version . "2.0") (xmlns:atom . "http://www.w3.org/2005/Atom"))
      (channel ((xmlns:content . "http://purl.org/rss/1.0/modules/content/
"))
               (title nil "RSS title")
               (item nil
                     (title nil "article title")
                     (content:encoded nil "article content")))))

The function "nnrss-get-namespace-prefix" should extract tag
"xmlns:content". But it only returns nil because "(cadar el)" matches
nothing.

Hope it helps.
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.