Subject: 28.0.50; iso-transl overwrites alt key bindings

From: "Mark Bestley" <[email-masked]>
Date: Wed, 27 Oct 2021 21:42:19 +0100

In emacs -Q just need something to get the Alt key bound
e.g.
(setq  mac-command-modifier 'alt)

The when you Type A-c you get ¢ and you cannot bind it yourself.

On a mac I want the key by space to be Alt as that is what is printed on
my PC keyboard. I suspect this is true with PCs

The issue is that (require 'iso-transl) is called before the user can alter its behaviour and that iso-transl.el then binds to various A-c and other keys.

This makes it impossible to use Alt as a modifier key

load-history shows

("/Applications/MacPorts/Emacs.app/Contents/Resources/lisp/subdirs.el <http://emacs.app/Contents/Resources/lisp/subdirs.el>")
("/Applications/MacPorts/Emacs.app/Contents/Resources/site-lisp/subdirs.el <http://emacs.app/Contents/Resources/site-lisp/subdirs.el>")
("/Applications/MacPorts/Emacs.app/Contents/Resources/lisp/leim/leim-list.el <http://emacs.app/Contents/Resources/lisp/leim/leim-list.el>")
("/Applications/MacPorts/Emacs.app/Contents/Resources/lisp/international/iso-transl.elc <http://emacs.app/Contents/Resources/lisp/international/iso-transl.elc>" iso-transl-dead-key-alist iso-transl-char-map iso-transl-language-alist iso-transl-ctl-x-8-map
  (defun . iso-transl-define-keys)
  (defun . iso-transl-set-language)
  (provide . iso-transl))
("/Applications/MacPorts/Emacs.app/Contents/Resources/lisp/tooltip.elc <http://emacs.app/Contents/Resources/lisp/tooltip.elc>"
  (require . syntax)
 
In emacs 27 iso-transl was not called that early and only seem to be
called by describe-bindings and so could be overridden as shown in Aquamacs

Ideally iso-transl should only bind the A- keys if explicitly asked to
do so. At least the user shoulkd be able to configure the behaviour - as
exising emacs uses this wrong behaviour the default can be this setting
of A- keys but the user should be able to set something to stop this.

See
https://emacs.stackexchange.com/questions/17508/how-can-i-prevent-override-key-translation-behavior-such-as-%C2%B5-translated-from
for other users finding this (and they are not Mac based)

In GNU Emacs 28.0.50 (build 1, aarch64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6 (Build 20G165))
of 2021-10-17 built on mini20.local
Repository revision: ccb35fb8fb9de5f069fd0103f24e3048d716febc
Repository branch: HEAD
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.6

Configured using:
'configure --prefix=/opt/local --disable-silent-rules --without-dbus
--without-gconf --without-libotf --without-m17n-flt --with-libgmp
--with-gnutls --with-json --with-xml2 --with-modules --infodir
/opt/local/share/info/emacs --with-ns --with-lcms2 --without-harfbuzz
--without-imagemagick --without-xaw3d --with-native-compilation
--with-rsvg 'CFLAGS=-pipe -Os
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch
arm64' 'CPPFLAGS=-I/opt/local/include
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk'
'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-no_pie
-Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
-arch arm64''

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM
ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra time-date
subr-x shortdoc text-property-search seq byte-opt gv bytecomp
byte-compile cconv help-fns radix-tree help-mode cl-loaddefs cl-lib
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 80691 8984)
(symbols 48 6822 0)
(strings 32 21275 2068)
(string-bytes 1 715988)
(vectors 16 15733)
(vector-slots 8 322442 18788)
(floats 8 72 30)
(intervals 56 355 0)
(buffers 992 12))

-- 
Mark Bestley