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

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

[emacs-wiki-discuss] Re: transitioning to muse


From: Jim Ottaway
Subject: [emacs-wiki-discuss] Re: transitioning to muse
Date: Mon, 17 Oct 2005 22:23:55 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>>>> Yvonne Thomson <address@hidden> writes:

> The problem is, I've got at least one other thing that uses
> emacs-wiki. I wrote myself a replacement for w3m's bookmark manager, so
> that it uses wiki pages in a dedicated bookmarks project. There were a
> few reasons for that which I won't go into. I'm not quite sure how to
> translate the code for muse, though. I've got a bunch of functions that
> look something like this.

> (defun w3m-wiki-bookmark-view (section)
>   "View a section of the bookmark list"
>   (interactive
>        (with-emacs-wiki-project "bookmarks"
>             (list (emacs-wiki-read-name (emacs-wiki-file-alist)))))
>               (with-emacs-wiki-project "bookmarks"
>                   (emacs-wiki-find-file section)))

> Now, I'm not sure if this was the best way to do this, and I'm guessing
> probably not, but the question is, what's the muse equivalent of
> something like this? I've got code to add b bookmarks as well.

I have just started using muse too, so I am doing similar
translations. 

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")
  ...
  ...)

In the general case, a macro such as this

(defmacro with-muse-project (project &rest body)
  `(progn
     (unless (muse-project ,project)
       (error "Can't find project %s" ,project))
     (with-temp-buffer
       (muse-mode)
       (setq muse-current-project (muse-project ,project))
       (muse-project-set-variables)
       ,@body)))

might be useful.  But I have only tested it very casually.

That's a great idea to use muse pages for w3m bookmarks. I suppose it
is possible to add annotations to them?  I would find something like
that very useful: have you or will you be posting the code?

> The other problem I'm having is even more obscure, and I might have to
> go to another list for the answer, but here goes. I'm blind, and I'm an
> emacspeak user. Emacspeak basically uses advice to speak things in
> different modes. The functions I'm having trouble with and
> muse-next-reference and muse-previous-reference. I need it to speak the
> link title as I tab across them, but I'm having trouble actually
> *extracting* the link title so emacspeak can speak it. My original
> emacs-wiki code looked something like this.

> (defadvice emacs-wiki-next-reference (after emacspeak pre act)
>   "Speak the next reference "
>   (dtk-stop)
>   (emacspeak-auditory-icon 'scroll)
>   (dtk-speak (match-string 0)))


> anyone know a simple way to get the link title of a link?

> If anyone can help me with any of this weird stuff, let me know.

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))))


Regards

-- 
Jim Ottaway




reply via email to

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