unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* add-menu-button: Xemacs to emacs
@ 2005-03-16  4:38 Tim Johnson
  2005-03-16  9:42 ` David Kastrup
  2005-03-16 12:46 ` Thien-Thi Nguyen
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Johnson @ 2005-03-16  4:38 UTC (permalink / raw)


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

Thanks
tim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16  4:38 add-menu-button: Xemacs to emacs Tim Johnson
@ 2005-03-16  9:42 ` David Kastrup
  2005-03-16 17:03   ` Tim Johnson
  2005-03-16 12:46 ` Thien-Thi Nguyen
  1 sibling, 1 reply; 8+ messages in thread
From: David Kastrup @ 2005-03-16  9:42 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16  4:38 add-menu-button: Xemacs to emacs Tim Johnson
  2005-03-16  9:42 ` David Kastrup
@ 2005-03-16 12:46 ` Thien-Thi Nguyen
  2005-03-16 14:47   ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Thien-Thi Nguyen @ 2005-03-16 12:46 UTC (permalink / raw)


Tim Johnson <tim@johnsons-web.com> writes:

> 2)The larger question is:
>     Is there a "checklist" of emacs/xemacs discrepancies?

surely if you write one there will be one to refer to.
IMHO, however, it's not worth the trouble unless you are
writing a program to automatically (transparently) adapt
one codebase to another.

thi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16 12:46 ` Thien-Thi Nguyen
@ 2005-03-16 14:47   ` Stefan Monnier
  2005-03-16 17:09     ` Tim Johnson
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2005-03-16 14:47 UTC (permalink / raw)


>> 2)The larger question is:
>> Is there a "checklist" of emacs/xemacs discrepancies?

> surely if you write one there will be one to refer to.
> IMHO, however, it's not worth the trouble unless you are
> writing a program to automatically (transparently) adapt
> one codebase to another.

It would be useful, to have a few guidelines, tho.
I've created a new entry in the wiki for that:

   http://www.emacswiki.org/cgi-bin/wiki/ElispCompatibility

Feel free to add your own ideas,


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16  9:42 ` David Kastrup
@ 2005-03-16 17:03   ` Tim Johnson
  2005-03-16 17:14     ` David Kastrup
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Johnson @ 2005-03-16 17:03 UTC (permalink / raw)


David Kastrup wrote:
> Tim Johnson <tim@johnsons-web.com> writes:

>>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.
<snip...>
>>1)The simple question is:
>>    What is the corresponding emacs function to add a menu
   Hello David:
    Thanks for the example. This is very valuable and is what
I needed for that issue.

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

To make a long story short. It looks like I should re-install emacs
allright.

Cheers
Tim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16 14:47   ` Stefan Monnier
@ 2005-03-16 17:09     ` Tim Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Tim Johnson @ 2005-03-16 17:09 UTC (permalink / raw)


Stefan Monnier wrote:

>>>2)The larger question is:
>>>Is there a "checklist" of emacs/xemacs discrepancies?
> 
> 
>>surely if you write one there will be one to refer to.
>>IMHO, however, it's not worth the trouble unless you are
>>writing a program to automatically (transparently) adapt
>>one codebase to another.

  I'm in the processing of providing a major mode that
may be used by both xemacs and emacs so it does cause
an issue to arise.

> 
> It would be useful, to have a few guidelines, tho.
> I've created a new entry in the wiki for that:
> 
>    http://www.emacswiki.org/cgi-bin/wiki/ElispCompatibility
> 
> Feel free to add your own ideas,

Thanks Stefan. Good work! I will look at that closely.
On a related note:
I had written a wrapper for 'isearch-.... and found that the
'interactive argument differs between the forks
  so I will check to see if that is covered.

regards
tim

> 
> 
>         Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16 17:03   ` Tim Johnson
@ 2005-03-16 17:14     ` David Kastrup
  2005-03-16 17:47       ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: David Kastrup @ 2005-03-16 17:14 UTC (permalink / raw)


Tim Johnson <tim@johnsons-web.com> writes:

> David Kastrup wrote:
>> Tim Johnson <tim@johnsons-web.com> writes:
>
>>>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.
> <snip...>
>>>1)The simple question is:
>>>    What is the corresponding emacs function to add a menu
>    Hello David:
>     Thanks for the example. This is very valuable and is what
> I needed for that issue.

I should have mentioned that LaTeX-mode-map in that example is a
keymap in the relevant mode: menus in XEmacs are bound to "locales"
(which is why you need the easy-menu-add to activate them in some
buffer), whereas menus in Emacs are bound to keymaps.

So the easy-menu-* functions require a keymap as one argument, even
though the implementation for XEmacs will most likely ignore it.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: add-menu-button: Xemacs to emacs
  2005-03-16 17:14     ` David Kastrup
@ 2005-03-16 17:47       ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2005-03-16 17:47 UTC (permalink / raw)


> So the easy-menu-* functions require a keymap as one argument, even
> though the implementation for XEmacs will most likely ignore it.

Actually, if memory servs the trick is that the LaTeX-mode-map (or other)
keymap is passed as an argument twice: once in easy-menu-define and one in
easy-menu-add.  Emacs ignores the one in easy-menu-add, and XEmacs ignores
the one in easy-menu-define.


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-03-16 17:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-16  4:38 add-menu-button: Xemacs to emacs Tim Johnson
2005-03-16  9:42 ` David Kastrup
2005-03-16 17:03   ` Tim Johnson
2005-03-16 17:14     ` David Kastrup
2005-03-16 17:47       ` Stefan Monnier
2005-03-16 12:46 ` Thien-Thi Nguyen
2005-03-16 14:47   ` Stefan Monnier
2005-03-16 17:09     ` Tim Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).