emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: "Евгений Курбатов" <EvgenyKurbatov@yandex.ru>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-feed-update doesn't understand the file name of a target Org-file when it is not a constant
Date: Sat, 18 Jun 2011 23:12:12 +0200	[thread overview]
Message-ID: <87pqmac09f.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <1301421308331851@web3.yandex.ru>

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

At Fri, 17 Jun 2011 21:30:51 +0400,
Евгений Курбатов wrote:
> 
> Hello!
> 
> I do some elisp code to download the latest RSS feeds from some resource:
> 
> (setq debug-on-error t)
> (org-mode)
> (org-feed-update
>  '("arxiv"
>    "http://export.arxiv.org/rss/astro-ph"
>    (concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org"))
>    "arXiv.org"
>    )
>  )
> 
> The goal is to get an unique Org file for feeds per day. However, the error is rising:
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp (concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org")))
>   expand-file-name((concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org")))
>   find-file-noselect((concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org")) nil nil nil)
>   find-file((concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org")))
>   org-feed-goto-inbox-internal((concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org")) "arXiv.org")
>   byte-code("\306   \"\307\n\"\310\311
> \"\211\312+\211,\203]
> 
> When I hardcode a string instead of (concat ...) everything is
> ok. The subject is also not in format-time-string, it is exactly in
> concat. The type returned by concat is the stringp, so the situation
> is very strange. I also tried to use org-feed-alist, and local
> variable instead of calling concat, nothing helps.

The quote in front of ("arxiv"

>  '("arxiv"

"quotes" the following list, i.e. Emacs does not evaluate the Lisp
expressions inside the list but processes it as pure data. 

To calculate the file name each time you call `org-feed-update' either
leave out the quotes like:

(org-feed-update (list "arxiv" "http://export.arxiv.org/rss/astro-ph" (concat … )))

-or-

Use backquotes:

http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html

(org-feed-update
 `("arxiv"
   "http://export.arxiv.org/rss/astro-ph"
   ,(concat "~/org/arxiv-" (format-time-string "%Y-%m-%d.org"))
   "arXiv.org"
  )
)

The ` means: The following structure is data except the parts with the
backquote ,.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

      reply	other threads:[~2011-06-18 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17 17:30 org-feed-update doesn't understand the file name of a target Org-file when it is not a constant Евгений Курбатов
2011-06-18 21:12 ` David Maus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqmac09f.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=EvgenyKurbatov@yandex.ru \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).