emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] Relative paths in annotations, and planner sub-dire


From: emacs-wiki
Subject: [emacs-wiki-discuss] Relative paths in annotations, and planner sub-directories
Date: Mon, 14 Nov 2005 12:37:33 +0200 (IST)


Hello,

First, as a new comer to the list, and to using planner, muse and friends, I'd like to thank Sacha Chua, Michael Olson, and all the rest who contribute code: GREAT JOB!. Also my thanks to the creator, John Wiegley.

I am using planner and friends for few weeks. The root directory for the planner files is in
        ~/var/plans
and it is divided into few sub directories, such as
        ~/var/plans/comp
        ~/var/plans/lab
etc.

I have two difficulties using 'remember'.

1. The path that is offered in the "*Remember*" buffer is relative to ~/var/plans, and not to the would-be project page(s). I expand on this below.

2. When I type 'C-c C-c' followed by 'comp/pim' as the target project page, I get an error
        "Symbol's function definition is void:
                match-string-no-properties"
the note is not saved, and the buffer is not exited.


This is how my planner project is defined in muse-config.el:
(setq muse-project-alist
       '(("planner"                   ; project name
         ("~/var/plans"                       ; project root directory
          ;;                              project sub directories
          "~/var/plans/comp"          ; + home system
          "~/var/plans/home"          ; + home and family issues
          "~/var/plans/lab"           ; + researach
          "~/var/plans/priv"          ; + personal projects
          "~/var/plans/sys"           ; + Pilepl-lab sys admin
          "~/var/plans/teach"         ; + Teaching
          :default "master-plan"
           :major-mode planner-mode
           :visit-link planner-visit-link)
         (:base "pdf"
                :path "~/var/pub/plans"))))

I don't understand the purpose of the ':visit-link' tag, just copied this it from Michael's example.

Regarding to item 1, I use the example from Sacha's configuration to generate relative paths only if the file is under my home directory:

(setq planner-annotation-use-relative-file
       (lambda (filename)
         "Return non-nil if FILENAME is under my home directory."
        (save-match-data
          (or (string-match "^/home/itayf" filename)))))

And I get something like:
[[pos://../../adm/cv/cv.tex#1][/home/itayf/adm/cv/cv.tex]]

This is ok for the Daily pages which reside directly under ~/var/plans, but is no good for most of my project pages which are located in sub-directories.

One solution is to put the daily pages in, say, ~/var/plans/daily, and force all the links to be with another relative level
   [[pos://../../../what/ever]] instead of
   [[pos://../../what/ever]].

Another (more robust?) solution, would be to use the home directory alias "~"
   [[pos://~/what/ever][~/what/ever]]
provided that muse and (X)emacs support this.  This will
solve the problem of saving a note into multiple pages that do not reside at the same depth within the directory tree, or copying it later into a different page that is on a different directory level.

Unfortunately I can code neither as I know very little lisp.
Is it difficult to do?  Could someone show me an example, please?

Regardless, I enjoy using planner and friends.

Thanks in advance, and once again: thanks to Sacha, Michal, John, and the rest of the contributors.

        Itay

--
address@hidden




reply via email to

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