[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: add-menu-button: Xemacs to emacs
From: |
David Kastrup |
Subject: |
Re: add-menu-button: Xemacs to emacs |
Date: |
Wed, 16 Mar 2005 10:42:57 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Tim Johnson <tim@johnsons-web.com> writes:
> Hello:
>
> I am in the process of transitioning from Xemacs to emacs.
> I have code that uses the xemacs 'add-menu-button function.
> Emacs does not recognize this function.
>
> 1)The simple question is:
> What is the corresponding emacs function to add a menu
> (and items) to the menubar
Example:
(easy-menu-define preview-menu LaTeX-mode-map
"This is the menu for preview-latex."
'("Preview"
"Generate previews"
["(or toggle) at point" preview-at-point]
["for environment" preview-environment]
["for section" preview-section]
["for region" preview-region (preview-mark-active)]
["for buffer" preview-buffer]
["for document" preview-document]
"---"
"Remove previews"
["at point" preview-clearout-at-point]
["from section" preview-clearout-section]
["from region" preview-clearout (preview-mark-active)]
["from buffer" preview-clearout-buffer]
["from document" preview-clearout-document]
"---"
"Turn preamble cache"
["on" preview-cache-preamble]
["off" preview-cache-preamble-off]
"---"
("Customize"
["Browse options"
(customize-group 'preview)]
["Extend this menu"
(easy-menu-add-item
nil '("Preview")
(customize-menu-create 'preview))])
["Read documentation" preview-goto-info-page]
["Report Bug" preview-report-bug]))
And then use
(easy-menu-add preview-menu LaTeX-mode-map)
when you are initializing the mode. While this does nothing in Emacs,
it will add the menu to the menubar when you are using XEmacs. The
easy-menu interface works for both Emacsen.
> 2)The larger question is:
> Is there a "checklist" of emacs/xemacs discrepancies?
> 3)When evaluating a call to 'add-menu-button is emacs/*scratch*
> I'm getting the following error message:
> "Autoloading failed to define function debug"
> It appears that a 'debug function needs to be defined in the
> emacs startup process. (debug on error is enabled)
> How may I enable this 'debug function?
This sounds like your Emacs installation is terribly broken. If you
are lucky, you just have something very bad in your .emacs (like
(setq load-path '("my-personal-directory"))
which would replace the system load-path).
If this error message persists even if you start Emacs with
emacs -q
M-x debug RET
then you might need to reinstall Emacs. If it goes away in that case,
you have to find what causes the problem in your .emacs.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum