all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Shall menu_bar_items and tool_bar_items look at text property keymaps?
@ 2002-02-13  0:01 Kim F. Storm
  2002-02-13 16:52 ` Stefan Monnier
  2002-02-14  3:12 ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Kim F. Storm @ 2002-02-13  0:01 UTC (permalink / raw)



I was looking at the above functions and wondered whether it really
makes sense for those functions to look for menu-bar and tool-bar
bindings in the keymap and local-map properties of PT in the current
buffer?

I guess it makes sense in some specific cases that the menu bar or
tool bar changes dynamically depending on what kind of text is below
the cursor, but I was wondering whether it will actually work - as it
requires that the menu-bar and tool-bar are updated (or at least
checked for updates) every time the cursor moves...

It this is not done, the contents of the menu and tool bar will
include or exclude some options seemingly at random - depending on
where the cursor is the last time the menu or tool bar was updated...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-13  0:01 Shall menu_bar_items and tool_bar_items look at text property keymaps? Kim F. Storm
@ 2002-02-13 16:52 ` Stefan Monnier
  2002-02-13 21:26   ` Kim F. Storm
  2002-02-14  3:12 ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2002-02-13 16:52 UTC (permalink / raw)
  Cc: emacs-devel

> I was looking at the above functions and wondered whether it really
> makes sense for those functions to look for menu-bar and tool-bar
> bindings in the keymap and local-map properties of PT in the current
> buffer?
> 
> I guess it makes sense in some specific cases that the menu bar or
> tool bar changes dynamically depending on what kind of text is below
> the cursor, but I was wondering whether it will actually work - as it
> requires that the menu-bar and tool-bar are updated (or at least
> checked for updates) every time the cursor moves...

They are updated when they are activated (f.ex. when you click on
the menubar to brinf down a menu), so it should work fine.


	Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-13 16:52 ` Stefan Monnier
@ 2002-02-13 21:26   ` Kim F. Storm
  0 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2002-02-13 21:26 UTC (permalink / raw)


"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> > I was looking at the above functions and wondered whether it really
> > makes sense for those functions to look for menu-bar and tool-bar
> > bindings in the keymap and local-map properties of PT in the current
> > buffer?
> > 
> > I guess it makes sense in some specific cases that the menu bar or
> > tool bar changes dynamically depending on what kind of text is below
> > the cursor, but I was wondering whether it will actually work - as it
> > requires that the menu-bar and tool-bar are updated (or at least
> > checked for updates) every time the cursor moves...
> 
> They are updated when they are activated (f.ex. when you click on
> the menubar to brinf down a menu), so it should work fine.

I cannot see how this can work reliable.

What if the keymap contain a new main menu item which is not currently
on the menu-bar ... then when you click on the menu-bar, it suddenly
changes ... and it wont change back if you move the cursor (until you
click on the menu-bar again).

This might be a minor problem for the menu-bar, but for the tool-bar,
it really doesn't make sense ...  you say it is updated when you click
on the tool-bar, but how can you click on something which isn't shown
yet (and afterwards you may be able to click on something which isn't
valid anymore.)

Are you aware of any packages which actually relies on this?

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-13  0:01 Shall menu_bar_items and tool_bar_items look at text property keymaps? Kim F. Storm
  2002-02-13 16:52 ` Stefan Monnier
@ 2002-02-14  3:12 ` Richard Stallman
  2002-02-14  8:57   ` Kim F. Storm
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-02-14  3:12 UTC (permalink / raw)
  Cc: emacs-devel

    I was looking at the above functions and wondered whether it really
    makes sense for those functions to look for menu-bar and tool-bar
    bindings in the keymap and local-map properties of PT in the current
    buffer?

This could cause a substantial slowdown if it means that Emacs
has to recompute the menus based on the current value of point.
The usefulness of the feature seems marginal, which suggests it 
is better not to pay that price, better not to add that feature.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-14  3:12 ` Richard Stallman
@ 2002-02-14  8:57   ` Kim F. Storm
  2002-02-15 10:36     ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2002-02-14  8:57 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     I was looking at the above functions and wondered whether it really
>     makes sense for those functions to look for menu-bar and tool-bar
>     bindings in the keymap and local-map properties of PT in the current
>     buffer?
> 
> This could cause a substantial slowdown if it means that Emacs
> has to recompute the menus based on the current value of point.
> The usefulness of the feature seems marginal, which suggests it 
> is better not to pay that price, better not to add that feature.

I asked the question because those functions already DO LOOK for
those bindings - but the rest of emacs doesn't call those functions
often enough for the functionality to work anyway.

Since it doesn't really work, I doubt anyone is actually using it.

So my proposal is to remove the "look for keymaps at PT" from those
functions.

++kfs


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-14  8:57   ` Kim F. Storm
@ 2002-02-15 10:36     ` Richard Stallman
  2002-02-15 11:39       ` Kim F. Storm
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-02-15 10:36 UTC (permalink / raw)
  Cc: emacs-devel

    Since it doesn't really work, I doubt anyone is actually using it.

    So my proposal is to remove the "look for keymaps at PT" from those
    functions.

Why change this at all?  Is there a bug that needs fixing here?
If so, what is it?

I'm concerned because Emacs developers are putting a large fraction of
their time into areas that are attractive for programmers to work on,
but not a large fraction into areas that really help users.  We need
to shift the effort to places where it will make Emacs more
powerful or more convenient or easier to learn and use.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-15 10:36     ` Richard Stallman
@ 2002-02-15 11:39       ` Kim F. Storm
  2002-02-16 21:56         ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2002-02-15 11:39 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     Since it doesn't really work, I doubt anyone is actually using it.
> 
>     So my proposal is to remove the "look for keymaps at PT" from those
>     functions.
> 
> Why change this at all?  Is there a bug that needs fixing here?
> If so, what is it?

It is a bug: If a programmer puts a menu-bar or tool-bar binding into
a keymap or local-map text property, that will not work realiable.

Instead of trying to make it work (which will involve a severe performance
penalty), I suggest to remove the code and document in the Elisp manual
that those text property maps don't support menu-bar and tool-bar bindings.

In the specific situation, I was investigating how to add a new type
of keymap (details may follow later :-) when I stumbled across the
(seemingly) bogus code in keyboard.c.  So I decided to ask my fellow
developers whether that code was really needed -- or it could be
removed -- to simplify the task of adding the new type of keymap - in
which case I could just remove the bogus code instead of adding more
(bogus) code.


> 
> I'm concerned because Emacs developers are putting a large fraction of
> their time into areas that are attractive for programmers to work on,
> but not a large fraction into areas that really help users.  We need
> to shift the effort to places where it will make Emacs more
> powerful or more convenient or easier to learn and use.

I know you regularly express this concern, and I fully agree with you!
There is no need to spend time on features which are not visible to
the user.  

However, I feel that this concern sometimes is used to reject changes
to the "core" emacs that would subsequently make it *significantly*
easier (for the programmer) to write packages which *does* make emacs
better (for the user) in the ways you express above.

And with emacs, a lisp package programmer (like me) is also a user!

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-15 11:39       ` Kim F. Storm
@ 2002-02-16 21:56         ` Richard Stallman
  2002-02-20 15:28           ` Kim F. Storm
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-02-16 21:56 UTC (permalink / raw)
  Cc: emacs-devel

    Instead of trying to make it work (which will involve a severe performance
    penalty), I suggest to remove the code and document in the Elisp manual
    that those text property maps don't support menu-bar and tool-bar bindings.

Documenting that seems like a good idea.  Is there special code
that attempts to make it work but fails?  If so, put it in #if 0
and with a comment explaining why it doesn't work and why
working correctly is hard.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Shall menu_bar_items and tool_bar_items look at text property keymaps?
  2002-02-16 21:56         ` Richard Stallman
@ 2002-02-20 15:28           ` Kim F. Storm
  0 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2002-02-20 15:28 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     Instead of trying to make it work (which will involve a severe performance
>     penalty), I suggest to remove the code and document in the Elisp manual
>     that those text property maps don't support menu-bar and tool-bar bindings.
> 
> Documenting that seems like a good idea.  Is there special code
> that attempts to make it work but fails?  If so, put it in #if 0
> and with a comment explaining why it doesn't work and why
> working correctly is hard.

I have changed menu_bar_items and tool_bar_items in keyboard.c to not
look for keymap and local-map properties, and I have added comments to
the code explaining why we don't look at those maps.

I'll discuss with Eli how to fix the documentation in the lisp ref.

However, the old code wasn't really correct (it looked at the keymaps
in the wrong order), so instead of keeping the (messy/buggy) old code,
I have replaced it with simpler and cleaner code which handles just
the "normal" keymaps.  I hope that is ok.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-02-20 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-13  0:01 Shall menu_bar_items and tool_bar_items look at text property keymaps? Kim F. Storm
2002-02-13 16:52 ` Stefan Monnier
2002-02-13 21:26   ` Kim F. Storm
2002-02-14  3:12 ` Richard Stallman
2002-02-14  8:57   ` Kim F. Storm
2002-02-15 10:36     ` Richard Stallman
2002-02-15 11:39       ` Kim F. Storm
2002-02-16 21:56         ` Richard Stallman
2002-02-20 15:28           ` Kim F. Storm

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.