emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: andrea <andrea.crotti.0@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: org-agenda-files variable
Date: Fri, 22 Jan 2010 10:58:21 +0100	[thread overview]
Message-ID: <5AF2BB96-E765-44EB-9048-ED0AB7BDE37C@gmail.com> (raw)
In-Reply-To: <m18wbvwuzk.fsf@gmail.com>


On Jan 18, 2010, at 11:46 AM, andrea wrote:
> Anyway
>
> emacs-version: "23.1.50.1"
> org-version:   "6.33trans"
>
>
> The code for the hook is this
>
> --8<---------------cut here---------------start------------->8---
> (defun org-add-eventually()
>  "Adding a file to org-agenda when saved"
>  (interactive)
>  (if (string= major-mode "org-mode")
>      (org-agenda-file-to-front)))
>
> (add-hook 'before-save-hook 'org-add-eventually)
> --8<---------------cut here---------------end--------------->8---
>
> And finally I have different operating systems, linux on the other
> machine and osx 10.6 on this one.
>
> I'm not sure when the filename gets added in the "wrong format", but
> maybe it's my fault, I visit the absolute path.
> Anyway if I can force somehow to only use relative to home paths in
> emacs somehow it would be also fine.

I have looked in the code, and I have trouble to see how file
names would get into the list unabbreviated.  The code explicitly
abbreviates (i.e. inserts "~" for the HOME directory) for all new files.
Even if you have visited the file with an absolute path.

The only thing I can imagine is that you have, at some point,
filled the variable in a direct way, for example using wildcard
expansion like described in

http://orgmode.org/worg/org-faq.php#set-agenda-files-using-wildcards

This would insert absolute file names into the list, and once
they are in there, they will not be replaced with relative ones.

One way to clean up would be to remove all files from the list
and start over, only adding them with your hook function.

Another way would be to evaluate (i.e. put the cursor behind it
and press `C-x C-e') the following form in the scratch buffer

    (org-store-new-agenda-file-list
      (mapcar 'abbreviate-file-name org-agenda-files))

Hope this helps

- Carsten

      parent reply	other threads:[~2010-01-22  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 11:00 org-agenda-files variable andrea
2010-01-18  7:37 ` Carsten Dominik
2010-01-18 10:46   ` andrea
2010-01-18 11:45     ` Stephan Schmitt
2010-01-22  9:58     ` Carsten Dominik [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=5AF2BB96-E765-44EB-9048-ED0AB7BDE37C@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=andrea.crotti.0@gmail.com \
    --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).