all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
@ 2021-08-22  2:32 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-08-22 20:09 ` Alan Third
  0 siblings, 1 reply; 6+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-08-22  2:32 UTC (permalink / raw)
  To: 50160

Emacs version: 28.0.50
window system: ns

EmacsToolbar now uses [img hash] as NSToolbarItem’s identifier
(see addDisplayItemWithImage in src/nsmenu.m).

This is not good because this causes conflict.
For example, “close” icon is used as `kill-this-buffer' by default but
isearch-tool-bar-map uses “close” icon as `isearch-cancel’.
addDisplayItemWithImage reuses NSToolbarItem which has same 
identifier so when in isearch “close” icon on toolbar doesn’t work.

I’m not a Objective-C expert so I don’t know what value should be set
as correct identifier... 🙇

--
tsuucat






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

* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
  2021-08-22  2:32 bug#50160: 28.0.50; Wrong NSToolbarItem identifier tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-08-22 20:09 ` Alan Third
  2021-09-09 17:33   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Third @ 2021-08-22 20:09 UTC (permalink / raw)
  To: tsuucat; +Cc: 50160

On Sun, Aug 22, 2021 at 11:32:05AM +0900, tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
> Emacs version: 28.0.50
> window system: ns
> 
> EmacsToolbar now uses [img hash] as NSToolbarItem’s identifier
> (see addDisplayItemWithImage in src/nsmenu.m).
> 
> This is not good because this causes conflict.
> For example, “close” icon is used as `kill-this-buffer' by default but
> isearch-tool-bar-map uses “close” icon as `isearch-cancel’.
> addDisplayItemWithImage reuses NSToolbarItem which has same 
> identifier so when in isearch “close” icon on toolbar doesn’t work.

Ah, hmm... Perhaps we should append the label text to the hash or
something?

-- 
Alan Third





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

* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
  2021-08-22 20:09 ` Alan Third
@ 2021-09-09 17:33   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-09-09 20:59     ` Alan Third
  0 siblings, 1 reply; 6+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-09 17:33 UTC (permalink / raw)
  To: Alan Third; +Cc: 50160


> Ah, hmm... Perhaps we should append the label text to the hash or
> something?

I tried to append the label text to the hash. Most items fixed. But 
isearch.el uses “undo” icon and “Undo” label for isearch-delete-char item
so the tool-tip is wrong…
It is hard to set correct identifier because anyone can create toolbar items 
dynamically in Emacs lisp.

I noticed the current toolbaritem problem only matters label and tool-tip.
Executed commands are not wrong.

--
tsuucat




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

* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
  2021-09-09 17:33   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-09-09 20:59     ` Alan Third
  2021-12-22 20:50       ` Alan Third
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Third @ 2021-09-09 20:59 UTC (permalink / raw)
  To: tsuucat; +Cc: 50160

On Fri, Sep 10, 2021 at 02:33:40AM +0900, tsuucat wrote:
> 
> > Ah, hmm... Perhaps we should append the label text to the hash or
> > something?
> 
> I tried to append the label text to the hash. Most items fixed. But 
> isearch.el uses “undo” icon and “Undo” label for isearch-delete-char item
> so the tool-tip is wrong…
> It is hard to set correct identifier because anyone can create toolbar items 
> dynamically in Emacs lisp.
> 
> I noticed the current toolbaritem problem only matters label and tool-tip.
> Executed commands are not wrong.

I suppose we could concatenate the hashes of all the values that might
matter.

Alternatively maybe we just don't cache the toolbar items? I don't
know if that's worth investigating. My experience with some other
areas of the NS port is that there's a lot of caching and things going
on that doesn't seem to actually save us anything, but the toolbar can
be refreshed very often in the right circumstances, so it may be best
to keep the cache.
-- 
Alan Third





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

* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
  2021-09-09 20:59     ` Alan Third
@ 2021-12-22 20:50       ` Alan Third
  2022-08-22 13:54         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Third @ 2021-12-22 20:50 UTC (permalink / raw)
  To: tsuucat, 50160

On Thu, Sep 09, 2021 at 09:59:28PM +0100, Alan Third wrote:
> On Fri, Sep 10, 2021 at 02:33:40AM +0900, tsuucat wrote:
> > 
> > > Ah, hmm... Perhaps we should append the label text to the hash or
> > > something?
> > 
> > I tried to append the label text to the hash. Most items fixed. But 
> > isearch.el uses “undo” icon and “Undo” label for isearch-delete-char item
> > so the tool-tip is wrong…
> > It is hard to set correct identifier because anyone can create toolbar items 
> > dynamically in Emacs lisp.
> > 
> > I noticed the current toolbaritem problem only matters label and tool-tip.
> > Executed commands are not wrong.
> 
> I suppose we could concatenate the hashes of all the values that might
> matter.

I've pushed a change to master that (I hope) does this.
-- 
Alan Third





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

* bug#50160: 28.0.50; Wrong NSToolbarItem identifier
  2021-12-22 20:50       ` Alan Third
@ 2022-08-22 13:54         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-22 13:54 UTC (permalink / raw)
  To: Alan Third; +Cc: 50160, tsuucat

Alan Third <alan@idiocy.org> writes:

> I've pushed a change to master that (I hope) does this.

This was half a year ago, but the bug report was left open, so I'm
closing it now.

If Alan's change didn't fix the problem, please respond to the debbugs
address and we'll reopen.





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

end of thread, other threads:[~2022-08-22 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-22  2:32 bug#50160: 28.0.50; Wrong NSToolbarItem identifier tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-22 20:09 ` Alan Third
2021-09-09 17:33   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 20:59     ` Alan Third
2021-12-22 20:50       ` Alan Third
2022-08-22 13:54         ` Lars Ingebrigtsen

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.