emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Substitute a guid XML element in org-feed
@ 2015-09-27 18:24 Hiroshi Saito
  2015-09-30 11:57 ` Nicolas Goaziou
  2015-10-18 17:54 ` Michael Brand
  0 siblings, 2 replies; 6+ messages in thread
From: Hiroshi Saito @ 2015-09-27 18:24 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 112 bytes --]

Hi,

A guid XML element is not substituted in org-feed. Here is a patch to fix it.

--
Sincerely,
Hiroshi Saito

[-- Attachment #2: 0001-org-feed.el-Substitute-a-guid-XML-element.patch --]
[-- Type: application/octet-stream, Size: 977 bytes --]

From 1e0bb33bf929b77ae45694137c56b84587a8626c Mon Sep 17 00:00:00 2001
From: Hiroshi Saito <saidie@saidie.info>
Date: Mon, 28 Sep 2015 03:04:10 +0900
Subject: [PATCH] org-feed.el: Substitute a guid XML element

* lisp/org-feed.el (org-feed-parse-rss-feed): Substitute a guid XML
element with `xml-substitute-special'.

TINYCHANGE
---
 lisp/org-feed.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-feed.el b/lisp/org-feed.el
index e511be0..d0da368 100644
--- a/lisp/org-feed.el
+++ b/lisp/org-feed.el
@@ -615,7 +615,7 @@ containing the properties `:guid' and `:item-full-text'."
 		       (match-beginning 0)))
 	(setq item (buffer-substring beg end)
 	      guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
-		       (org-match-string-no-properties 1 item)))
+		       (xml-substitute-special (org-match-string-no-properties 1 item))))
 	(setq entry (list :guid guid :item-full-text item))
 	(push entry entries)
 	(widen)
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Substitute a guid XML element in org-feed
  2015-09-27 18:24 [PATCH] Substitute a guid XML element in org-feed Hiroshi Saito
@ 2015-09-30 11:57 ` Nicolas Goaziou
  2015-10-18 17:54 ` Michael Brand
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2015-09-30 11:57 UTC (permalink / raw)
  To: Hiroshi Saito; +Cc: emacs-orgmode

Hello,

Hiroshi Saito <monodie@gmail.com> writes:

> A guid XML element is not substituted in org-feed. Here is a patch to
> fix it.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Substitute a guid XML element in org-feed
  2015-09-27 18:24 [PATCH] Substitute a guid XML element in org-feed Hiroshi Saito
  2015-09-30 11:57 ` Nicolas Goaziou
@ 2015-10-18 17:54 ` Michael Brand
  2015-10-18 23:49   ` Hiroshi Saito
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Brand @ 2015-10-18 17:54 UTC (permalink / raw)
  To: Hiroshi Saito; +Cc: Org Mode

Hi Hiroshi

On Sun, Sep 27, 2015 at 8:24 PM, Hiroshi Saito <monodie@gmail.com> wrote:
> A guid XML element is not substituted in org-feed. Here is a patch
> to fix it.

It causes the error

    if: Symbol's function definition is void: xml-substitute-special

because xml is not loaded yet.

Michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Substitute a guid XML element in org-feed
  2015-10-18 17:54 ` Michael Brand
@ 2015-10-18 23:49   ` Hiroshi Saito
  2015-11-14  4:15     ` Hiroshi Saito
  0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi Saito @ 2015-10-18 23:49 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

Hi Michael,

So sorry for that error. I did not notice.

I wrote an additional patch to fix it. The patch makes sure that the xml
library is loaded before calling `xml-substitute-special` as with
`org-feed-parse-rss-entry` and `org-feed-parse-atom-feed`.

--
Sincerely,
Hiroshi Saito

2015-10-19 2:54 GMT+09:00 Michael Brand <michael.ch.brand@gmail.com>:
> Hi Hiroshi
>
> On Sun, Sep 27, 2015 at 8:24 PM, Hiroshi Saito <monodie@gmail.com> wrote:
>> A guid XML element is not substituted in org-feed. Here is a patch
>> to fix it.
>
> It causes the error
>
>     if: Symbol's function definition is void: xml-substitute-special
>
> because xml is not loaded yet.
>
> Michael

[-- Attachment #2: 0001-org-feed.el-Load-the-xml-library-before-substituting.patch --]
[-- Type: application/octet-stream, Size: 891 bytes --]

From ca262ffe4376897523e641c0c51a6d26258883db Mon Sep 17 00:00:00 2001
From: Hiroshi Saito <saidie@saidie.info>
Date: Mon, 19 Oct 2015 08:07:01 +0900
Subject: [PATCH] org-feed.el: Load the xml library before substituting a guid
 XML element

* lisp/org-feed.el (org-feed-parse-rss-feed): Load the xml library
before calling `xml-substitute-special`.

TINYCHANGE
---
 lisp/org-feed.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-feed.el b/lisp/org-feed.el
index c881c18..fbd6108 100644
--- a/lisp/org-feed.el
+++ b/lisp/org-feed.el
@@ -604,6 +604,7 @@ Assumes headers are indeed present!"
   "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'."
+  (require 'xml)
   (let ((case-fold-search t)
 	entries beg end item guid entry)
     (with-current-buffer buffer
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Substitute a guid XML element in org-feed
  2015-10-18 23:49   ` Hiroshi Saito
@ 2015-11-14  4:15     ` Hiroshi Saito
  2015-11-14  8:32       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi Saito @ 2015-11-14  4:15 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode

Hi Nicolas,

Thank you for applying my patch.

I'm sorry to say the patch causes an error unless xml package is luckily
loaded. I attached another patch to fix it in my last post:
http://lists.gnu.org/archive/html/emacs-orgmode/2015-10/msg00417.html

Could you please review new patch or revert my first patch?

--
Sincerely,
Hiroshi Saito

2015-10-19 8:49 GMT+09:00 Hiroshi Saito <monodie@gmail.com>:
> Hi Michael,
>
> So sorry for that error. I did not notice.
>
> I wrote an additional patch to fix it. The patch makes sure that the xml
> library is loaded before calling `xml-substitute-special` as with
> `org-feed-parse-rss-entry` and `org-feed-parse-atom-feed`.
>
> --
> Sincerely,
> Hiroshi Saito
>
> 2015-10-19 2:54 GMT+09:00 Michael Brand <michael.ch.brand@gmail.com>:
>> Hi Hiroshi
>>
>> On Sun, Sep 27, 2015 at 8:24 PM, Hiroshi Saito <monodie@gmail.com> wrote:
>>> A guid XML element is not substituted in org-feed. Here is a patch
>>> to fix it.
>>
>> It causes the error
>>
>>     if: Symbol's function definition is void: xml-substitute-special
>>
>> because xml is not loaded yet.
>>
>> Michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Substitute a guid XML element in org-feed
  2015-11-14  4:15     ` Hiroshi Saito
@ 2015-11-14  8:32       ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2015-11-14  8:32 UTC (permalink / raw)
  To: Hiroshi Saito; +Cc: Org Mode

Hello,

Hiroshi Saito <monodie@gmail.com> writes:

> I'm sorry to say the patch causes an error unless xml package is luckily
> loaded. I attached another patch to fix it in my last post:
> http://lists.gnu.org/archive/html/emacs-orgmode/2015-10/msg00417.html

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-14  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-27 18:24 [PATCH] Substitute a guid XML element in org-feed Hiroshi Saito
2015-09-30 11:57 ` Nicolas Goaziou
2015-10-18 17:54 ` Michael Brand
2015-10-18 23:49   ` Hiroshi Saito
2015-11-14  4:15     ` Hiroshi Saito
2015-11-14  8:32       ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).