Subject: Re: bug#55940: macOS: <ns-show-prefs> displayed as keybinding for \\[customize]

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 18 Jun 2022 14:06:09 +0200

Stefan Kangas <[email-masked]> writes:

>> `where-is-internal' should never return these "synthetic" events (that
>> are only created to have a way to have Emacs process them in the normal
>> event loop).  So perhaps we should just mark these symbols with a
>> special property to make `where-is-internal' ignore them?
>
> Sounds good to me.

These "keys" are added in places like:

      (when (featurep 'ns)
	(setq system-key-alist
	      (list
	       ;; These are special "keys" used to pass events from C to lisp.
	       (cons  1 'ns-power-off)
	       (cons  2 'ns-open-file)
	       (cons  3 'ns-open-temp-file)
	       (cons  4 'ns-drag-file)
	       (cons  5 'ns-drag-color)
	       (cons  6 'ns-drag-text)
	       (cons  8 'ns-open-file-line)
;;;	       (cons  9 'ns-insert-working-text)
;;;	       (cons 10 'ns-delete-working-text)
	       (cons 11 'ns-spi-service-call)
	       (cons 12 'ns-new-frame)
	       (cons 13 'ns-toggle-toolbar)
	       (cons 14 'ns-show-prefs)
	       ))))

Adding a symbol property like `non-key-event' to these symbols would be
easy enough, but perhaps we should have a bit of infrastructure to make
this easier to do.  Uhm...  Just adding a little helper function here
does the trick, I think.

Now pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no