[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] Re: transitioning to muse
From: |
Jim Ottaway |
Subject: |
Re: [emacs-wiki-discuss] Re: transitioning to muse |
Date: |
Tue, 18 Oct 2005 01:01:00 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>>>>> Yvonne Thomson <address@hidden> writes:
> At Mon, 17 Oct 2005 22:23:55 +0100,
> Jim Ottaway wrote:
>> It looks as though the muse equivalents take a project name in their
>> arguments, so the above would look something like:
>>
>> (defun w3m-wiki-bookmark-view (section)
>> "View a section of the bookmark list"
>> (interactive
>> (list (muse-read-project-file "bookmarks" "Section: ")))
>> (muse-project-find-file section "bookmarks")
>> ...
> This is the thing. That's what *I* thought, too. What you in fact get if
> you try this and, say, enter a section name of emacs is:
> muse-project-find-file: Wrong type argument: stringp, ("emacs")
> I can't for the life of me work out what it's looking for.
Ahh yes, of course, that's because muse-read-project-file returns a cons:
ELISP> (muse-read-project-file "notes" "file: ")
("charity" . "/home/jeho/Notes/charity")
So you have to take the car of that to get the file/page. I didn't
try the two parts together so I didn't notice that.
>> muse-explicit-link-regexp's match group 2 has the description, so
>> something like this, perhaps?
>>
>> (defadvice emacs-wiki-next-reference (after emacspeak pre act)
>> "Speak the next reference "
>> (dtk-stop)
>> (emacspeak-auditory-icon 'scroll)
>> (when (looking-at muse-explicit-link-regexp)
>> (dtk-speak (match-string-no-properties 2))))
> Ah, wouldn't it be nice if it was that easy? <grin>. For your
> interest, and for anyone else who does a search and wants to know how
> to do this, what I actually ended up with looked more like
> this. Please try to ignore the atrocious formatting.
> (defadvice muse-next-reference (after emacspeak pre act)
> "Speak the next reference "
> (dtk-stop)
> (emacspeak-auditory-icon 'scroll)
> (cond ((looking-at muse-explicit-link-regexp)
> (if (match-string-no-properties 2)
> (dtk-speak (match-string-no-properties 2))
> (dtk-speak (match-string-no-properties 1))
> )
> )
> ((looking-at muse-implicit-link-regexp)
> (dtk-speak(match-string-no-properties 1)))))
Oh, I see. I suppose you could separate out the conditional thing
into a separate function you could re-use. You would have to deal
with going backwards too; but I suspect that there are more problems
than I appreciate: I don't know anything about emacspeak.
--
Jim Ottaway