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

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

[emacs-wiki-discuss] Re: menus again


From: Michael Olson
Subject: [emacs-wiki-discuss] Re: menus again
Date: Mon, 13 Sep 2004 19:33:11 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

Marc Tommasi <address@hidden> writes:

> (defun mt-write-menu (menu)
>   (when emacs-wiki-publishing-p
>     (let (str)
>       (while menu
>         (setq str (concat str
>                        "$menu[] = array(\"texte\"=>\"" (car(car menu))
>                        "\",\"url\"=>\"" (cadr(car menu))
>                        "\",\"bulle\"=>\"" (caddr(car menu))
>                        "\");\n"
>                        ))     
>         (setq menu (cdr menu))
>         )
>       (concat "<?\n" str "\n  display_menu($menu);\n?>")
>     )
>   )
> )

Try the following:

(defun mt-write-menu (menu)
  (when emacs-wiki-publishing-p
    (let (str)
      (while menu
        (setq str (concat str
                         "$menu[] = array(\"texte\"=>\"" (car(car menu))
                         "\",\"url\"=>\"" (cadr(car menu))
                         "\",\"bulle\"=>\"" (caddr(car menu))
                         "\");\n"
                         ))     
        (setq menu (cdr menu))
        )
      (concat "<example><?\n" str "\n  display_menu($menu);\n?></example>")
    )
  )
)

This puts the <example> tag around your output, which keeps Emacs Wiki
from interpreting it any further and preserves whitespace.  The
<example> tag will go away when you view the published page.





reply via email to

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