Package: emacs;
Reported by: David Reitter <david.reitter <at> gmail.com>
Date: Mon, 28 Jun 2010 14:42:02 UTC
Severity: normal
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6527 in the body.
You can then email your comments to 6527 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
owner <at> debbugs.gnu.org, larry <at> denenberg.com, bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Mon, 28 Jun 2010 14:42:02 GMT) Full text and rfc822 format available.David Reitter <david.reitter <at> gmail.com>
:larry <at> denenberg.com, bug-gnu-emacs <at> gnu.org
.
(Mon, 28 Jun 2010 14:42:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: David Reitter <david.reitter <at> gmail.com> To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org> Subject: C-h b alters key-translation-map (in a bad way) Date: Mon, 28 Jun 2010 10:41:36 -0400
X-debbugs-cc: larry <at> denenberg.com C-h b alters the key translation map. Emacs (setq ns-command-modifier 'alt) ;; On NS, we need to assign the modifier key Press Command-C -> A-c is undefined (correct) C-h b Press Command-C -> ¢ is inserted The value of `key-translation-map' is indeed changed by C-h b, and resetting it fixes the problem. Some debugging suggests that something odd is happening in describe_map(). Commenting out map = call1 (Qkeymap_canonicalize, map); makes the error go away. A direct call to `keymap-canonicalize' does not, however, reproduce it, so there is something else going on. Full credit for the original report of a reproducible bug goes to Larry Denenberg - his report is quoted below. In GNU Emacs 23.2.50.1 (x86_64-apple-darwin10.3.1, NS apple-appkit-1038.29) of 2010-05-10 on elin.psy.cmu.edu Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: which-function-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: <help-echo> C-x k <return> ) s e <backspace> <backspace> <backspace> ( s e t q SPC n s - a <backspace> c o m m a n d - m o d i f i e r SPC ' a l t ) C-x C-e <return> A-c A-c <down> <down> C-h b <help-echo> <down-mouse-1> <mouse-1> A-c A-c <help-echo> <menu-bar> <help-menu> <send-emacs-bug-report> Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Unable to load color "darkblue" alt Type C-x 1 to delete the help window, C-M-v to scroll help. Load-path shadows: None found. Features: (shadow sort mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug kmacro two-column iso-transl help-mode view ghostedit ghostedit-stopwords-en easy-mmode which-func imenu tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) === Begin forwarded message: > From: Larry Denenberg <larry <at> denenberg.com> > Date: June 25, 2010 7:02:32 AM EDT > To: aquamacs-bugs <at> aquamacs.org > Cc: larry <at> denenberg.com > Subject: [Aquamacs-bugs] 23.2; ^H B doesn't just describe bindings, it changes them > Reply-To: Bug reports for Aquamacs Emacs <aquamacs-bugs <at> aquamacs.org> > > > Starting from scratch, type ^H C ⌘. [that's C-h A-.) to get > ⌘. runs the command keyboard-quit > > Then type ^H B to see a help buffer describing key bindings, after > which ^H C ⌘. again (in any buffer) yields > · (translated from ⌘.) runs the command self-insert-command > > Note that the first character here is not a period but a centered dot, #xb7. > > BTW, after you've done this, you get "Options have changed - save them?" > upon exit. > > I get this behavior in Aquamacs as described below, whether starting > "-q" or "-Q", and also in 24.0.50.1. I do not get it in 22.3.1, nor in > plain GNU Emacs 24.0.50.2. > > /Larry Denenberg > larry <at> denenberg.com > http://larry.denenberg.com/ > > > In GNU Emacs 23.2.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) > of 2010-05-09 on braeburn.aquamacs.org - Aquamacs Distribution 2.0 > Windowing system distributor `Apple', version 10.3.1038 > configured using `configure '--with-ns' '--without-x' 'CFLAGS=-arch i386 -arch ppc' 'LDFLAGS=-arch i386 -arch ppc'' > > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: en_US.UTF-8 > value of $XMODIFIERS: nil > locale-coding-system: utf-8-unix > default enable-multibyte-characters: t > > Major mode: Text > > Minor modes in effect: > savehist-mode: t > smart-frame-positioning-mode: t > aquamacs-autoface-mode: t > recentf-mode: t > osx-key-mode: t > tabbar-mwheel-mode: t > tabbar-mode: t > show-paren-mode: t > delete-selection-mode: t > pc-selection-mode: t > cua-mode: t > tooltip-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-encryption-mode: t > auto-compression-mode: t > smart-spacing-mode: t > column-number-mode: t > line-number-mode: t > visual-line-mode: t > transient-mark-mode: t > > Recent input: > <ns-application-activated> ^H C ⌘. ^H B ^H C ⌘. ^X > O ^H O <help-echo> <help-echo> <help-echo> <help-echo> > <help-echo> <switch-frame> ^H C ⌘. <menu-bar> <help-menu> > <bug-diagnosis> <start-vanilla-aquamacs> <menu-bar> > <help-menu> <bug-diagnosis> <send-emacs-bug-report >> > > Recent messages: > Cleaning up the recentf list...done (0 removed) > 29 environment variables imported from login shell (/bin/bash). > Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex.el (source)...done > Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/haskell-mode/haskell-site-file.el (source)...done > one-buffer-one-frame-mode disabled. > Mark set [32 times] > Aquamacs is based on GNU Emacs, a part of the GNU/Linux system. It is Free Software: you can improve and redistribute it under the GNU General Public License, version 3 or later. Copyright (C) 2010 Free Software Foundation, Inc. (C) 2010 D. Reitter. No Warranty. > ⌘. runs the command keyboard-quit > Type "q" to quit, M-x scroll-up to scroll help. > · (translated from ⌘.) runs the command self-insert-command [2 times] > start-vanilla-aquamacs: Searching for program: no such file or directory, Aquamacs.app/Contents/MacOS/Aquamacs > > Load-path shadows: > None found. > > Features: > (shadow sort mail-extr message ecomplete rfc822 mml mml-sec > password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 > rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc > mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash > mail-utils emacsbug kmacro two-column iso-transl aquamacs-mode-defaults > auctex-config server tex-site smart-dnd aquamacs-aux savehist mouse-sel > one-buffer-one-frame smart-frame-positioning drews_init > color-theme-autoloads saveplace visual-line aquamacs-bug > aquamacs-autoface-mode aquamacs-editing sendmail recentf tree-widget > cus-edit osxkeys emulate-mac-keyboard-mode frame-cmds strings misc-fns > thingatpt+ thingatpt frame-fns avoid aquamacs-mac-fontsets fit-frame > aquamacs-frame-setup aquamacs-tabbar tabbar-window cl cl-19 tabbar > easy-mmode cus-start cus-load aquamacs-site-start cocoa-compatibility > filladapt aquamacs-redo check-for-updates aquamacs-menu osx_defaults > aquamacs-tool-bar aquamacs mac-extra-functions aquamacs-tools > aquamacs-macros parse-time timezone time-date paren delsel pc-select > cua-base wid-edit regexp-opt advice advice-preload byte-opt bytecomp > byte-compile debug help-fns help-mode view image-file disp-table tooltip > ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd > fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer > select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu > font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan > thai tai-viet lao korean japanese hebrew greek romanian slovak czech > european ethiopic indian cyrillic chinese case-table epa-hook > jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces > cus-face files text-properties overlay md5 base64 format env code-pages > mule custom widget hashtable-print-readable backquote > make-network-process ns multi-tty emacs) > > Command line: (Aquamacs.app/Contents/MacOS/Aquamacs) > > PATH: /Users/larry/Bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/nmh/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/texbin:/opt/subversion/bin:/usr/lib:/Users/larry/Bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/nmh/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/texbin:/opt/subversion/bin:/usr/lib:/usr/texbin:/usr/local/texlive/2008/bin > > exec-path: (/Users/larry/Bin /bin /sbin /usr/bin /usr/sbin /usr/local/nmh/bin /usr/local/bin /usr/local/mysql/bin /usr/texbin /opt/subversion/bin /usr/lib /Users/larry/Bin /bin /sbin /usr/bin /usr/sbin /usr/local/nmh/bin /usr/local/bin /usr/local/mysql/bin /usr/texbin /opt/subversion/bin /usr/lib /Applications/Aquamacs.app/Contents/MacOS/bin /usr/local/texlive/2008/bin) > _______________________________________________ > Aquamacs-bugs mailing list > Aquamacs-bugs <at> aquamacs.org > http://lists.aquamacs.org/mailman/listinfo.cgi/aquamacs-bugs
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Mon, 28 Jun 2010 19:49:02 GMT) Full text and rfc822 format available.Message #8 received at 6527 <at> debbugs.gnu.org (full text, mbox):
From: David Reitter <david.reitter <at> gmail.com> To: 6527 <at> debbugs.gnu.org Subject: Re: C-h b alters key-translation-map (in a bad way) Date: Mon, 28 Jun 2010 15:48:28 -0400
I have reduced bug 6527 to this: (map-keymap-internal 'ignore 'iso-transl-ctl-x-8-map) (as called via `keymap_canonicalize') or also (keymap-parent 'iso-transl-ctl-x-8-map) because it seems to be the call to get_keymap with autoloading that is causing it. Indeed we have the following autoload: ;;;*** ;;;### (autoloads nil "iso-transl" "international/iso-transl.el" ;;;;;; (19423 17168)) ;;; Generated autoloads from international/iso-transl.el (or key-translation-map (setq key-translation-map (make-sparse-keymap))) (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map) (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 'keymap) And, merely loading iso-trans.el is documented to create keybindings with Alt.
Message #9 received at 6527-quiet <at> debbugs.gnu.org (full text, mbox):
From: David Reitter <david.reitter <at> gmail.com> To: 6527-quiet <at> debbugs.gnu.org Subject: iso-transl pach (bug#6527: C-h b alters key-translation-map (in a bad way)) Date: Sun, 18 Jul 2010 12:06:03 +0100
[ Resent from http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00967.html Otherwise how will someone reading this bug report find it? ] I reported bug 6527 a while ago. > 6527: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6527 The problem was that iso-trans.el is autoloaded (e.g., when doing C-h b) and unconditionally binds Alt key combinations, overriding any user/package defined A- keys. Once loaded, there is no obvious way to undo those bindings. Here's a fix for this. It defines a new minor mode, `iso-transl-mode', which controls those A-... key bindings. I chose to automatically define the C-x 8 prefix key combinations when the package is loaded, so that the C-x 8 autoloading mechanism remains in place for the comfort of the occasional user. I don't know how much iso-transl is used by people, so I can't gauge the impact of this. Please advise. diff --combined lisp/international/iso-transl.el index 8a88b50,b11a7a2..0000000 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@@ -25,21 -25,16 +25,21 @@@ ;;; Commentary: ;; Loading this package defines three ways of entering the non-ASCII -;; printable characters with codes above 127: the prefix C-x 8, or the -;; Alt key, or a dead accent key. For example, you can enter uppercase -;; A-umlaut as `C-x 8 " A' or `Alt-" A' (if you have an Alt key) or -;; `umlaut A' (if you have an umlaut/diaeresis key). +;; printable characters with codes above 127: the prefix C-x 8, and, +;; with `iso-transl-mode' enabled, also the Alt key, and a dead accent +;; key. For example, you can enter uppercase A-umlaut as `C-x 8 " A' +;; or, `iso-transl-mode' is enabled, `Alt-" A' (if you have an Alt +;; key) or `umlaut A' (if you have an umlaut/diaeresis key). -;; C-x 8 is set up to autoload this package, -;; but Alt keys and dead accent keys are only defined -;; once you have loaded the package. It is nontrivial -;; to make all of the Alt keys autoload, and it is not clear -;; that the dead accent keys SHOULD autoload this package. +;; C-x 8 is set up to autoload this package, but Alt keys and dead +;; accent keys are only defined once you have loaded the package and +;; enabled `iso-transl-mode'. It is nontrivial to make all of the Alt +;; keys autoload, and it is not clear that the dead accent keys SHOULD +;; autoload this package. + +;; Note that C-h b will autoload this package, which is one reason +;; why the more destructive key sequences (without C-x 8 prefix) are +;; only defined in `iso-transl-mode', and are thus reversible. ;;; Code: @@@ -252,41 -247,29 +252,41 @@@ sequence VECTOR. (VECTOR is normally o (setq key-translation-map (make-sparse-keymap))) (define-key key-translation-map "\C-x8" iso-transl-ctl-x-8-map) +(defmacro iso-transl-define-key (keymap key def) + "Back up definition of KEY in KEYMAP, then `define-key'." + `(progn + (push (cons ,key (or (lookup-key ,keymap ,key) 'none)) + (get ',keymap 'iso-transl-backup)) + (define-key ,keymap ,key ,def))) + ;; For each entry in the alist, we'll make up to three ways to generate ;; the character in question: the prefix `C-x 8'; the ALT modifier on ;; the first key of the sequence; and (if applicable) replacing the first ;; key of the sequence with the corresponding dead key. For example, a ;; character associated with the string "~n" can be input with `C-x 8 ~ n' ;; or `Alt-~ n' or `mute-asciitilde n'. +(defun iso-transl-define-prefix-keys (alist) + (while alist + (let ((translated-vec (cdr (car alist)))) + (iso-transl-define-key iso-transl-ctl-x-8-map (car (car alist)) translated-vec)) + (setq alist (cdr alist)))) (defun iso-transl-define-keys (alist) (while alist (let ((translated-vec (cdr (car alist)))) - (define-key iso-transl-ctl-x-8-map (car (car alist)) translated-vec) + ;(iso-transl-define-key iso-transl-ctl-x-8-map (car (car alist)) translated-vec) (let ((inchar (aref (car (car alist)) 0)) (vec (vconcat (car (car alist)))) (tail iso-transl-dead-key-alist)) (aset vec 0 (logior (aref vec 0) ?\A-\^@)) - (define-key key-translation-map vec translated-vec) - (define-key isearch-mode-map (vector (aref vec 0)) nil) + (iso-transl-define-key key-translation-map vec translated-vec) + (iso-transl-define-key isearch-mode-map (vector (aref vec 0)) nil) (while tail (if (eq (car (car tail)) inchar) (let ((deadvec (copy-sequence vec)) (deadkey (cdr (car tail)))) (aset deadvec 0 deadkey) - (define-key isearch-mode-map (vector deadkey) nil) - (define-key key-translation-map deadvec translated-vec))) + (iso-transl-define-key isearch-mode-map (vector deadkey) nil) + (iso-transl-define-key key-translation-map deadvec translated-vec))) (setq tail (cdr tail))))) (setq alist (cdr alist)))) @@@ -297,45 -280,14 +297,45 @@@ (iso-transl-define-keys (cdr (assoc lang iso-transl-language-alist)))) -;; The standard mapping comes automatically. You can partially overlay it -;; with a language-specific mapping by using `M-x iso-transl-set-language'. -(iso-transl-define-keys iso-transl-char-map) - +;; unconditional definitions +(iso-transl-define-prefix-keys iso-transl-char-map) (define-key isearch-mode-map "\C-x" nil) (define-key isearch-mode-map [?\C-x t] 'isearch-other-control-char) (define-key isearch-mode-map "\C-x8" nil) +(define-minor-mode iso-transl-mode + "ISO Key translation mode. +This mode defines two ways of entering the non-ASCII printable +characters with codes above 127: the Alt key and +a dead accent key. For example, you can enter uppercase A-umlaut as +`Alt-\" A' (if you have an Alt key) or `umlaut A' (if +you have an umlaut/diaeresis key). + +This character can always be entered as `C-x 8 \" A' regardless of +this mode." + :group 'i18n + :lighter " ISO" + + (if iso-transl-mode + ;; The standard mapping comes automatically. You can partially overlay it + ;; with a language-specific mapping by using `M-x iso-transl-set-language'. + (iso-transl-define-keys iso-transl-char-map) + (mapc + (lambda (key-def) + (define-key key-translation-map (car key-def) + (and (not (eq (cdr key-def) 'none)) (cdr key-def)))) + (nreverse (get 'key-translation-map 'iso-transl-backup))) + (put 'key-translation-map 'iso-transl-backup nil) + (mapc + (lambda (key-def) + (condition-case nil + (define-key isearch-mode-map (car key-def) + (and (not (eq (cdr key-def) 'none)) (cdr key-def))) + ;; if some of the unconditional definitions above are instead made conditional + ;; restoring the default keys fails. + (error nil))) + (nreverse (get 'isearch-mode-map 'iso-transl-backup))) + (put 'isearch-mode-map 'iso-transl-backup nil))) (provide 'iso-transl)
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to control <at> debbugs.gnu.org
.
(Wed, 21 Sep 2011 21:10:02 GMT) Full text and rfc822 format available.Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to control <at> debbugs.gnu.org
.
(Tue, 10 Apr 2012 10:32:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Fri, 13 Apr 2012 12:40:02 GMT) Full text and rfc822 format available.Message #16 received at 6527 <at> debbugs.gnu.org (full text, mbox):
From: Stefan Monnier <monnier <at> iro.umontreal.ca> To: David Reitter <david.reitter <at> gmail.com> Cc: 6527 <at> debbugs.gnu.org Subject: Re: C-h b autoloads iso-transl and alters key-translation-map Date: Fri, 13 Apr 2012 08:37:58 -0400
IIRC the reason why we've accepted the "change upon load" behavior of iso-transl.el for so long is that it only affects Alt bindings, and most Emacs users probably don't have both Meta and Alt keys, so they can't get to the Alt bindings anyway. This said, I think your patch is doing the right thing: move those extra bindings to a minor mode. I'd just like to see the implementation changed to make use of the new multiple inheritance in keymaps: - define the added bindings statically in a separate keymap (call it iso-transl-mode-translation-map). - when enabling/disabling the mode, just add/remove that map from the parents of key-translation-map. That will save you from the iso-transl-define-key dance of saving previous bindings. Stefan
bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Wed, 18 Jul 2012 11:29:02 GMT) Full text and rfc822 format available.Message #19 received at 6527 <at> debbugs.gnu.org (full text, mbox):
From: Chong Yidong <cyd <at> gnu.org> To: Stefan Monnier <monnier <at> iro.umontreal.ca> Cc: David Reitter <david.reitter <at> gmail.com>, 6527 <at> debbugs.gnu.org Subject: Re: bug#6527: C-h b autoloads iso-transl and alters key-translation-map Date: Wed, 18 Jul 2012 19:22:09 +0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes: > I'd just like to see the implementation changed to make use of the new > multiple inheritance in keymaps: > - define the added bindings statically in a separate keymap (call it > iso-transl-mode-translation-map). > - when enabling/disabling the mode, just add/remove that map from the > parents of key-translation-map. How about something like the following (modulo comment changes and fixing the isearch integration)? There's still no facility for cleanly adding/removing a keymap parent. So this patch makes iso-transl-map the parent to key-translation-map at top-level, and leaves it as the parent. To enable the key translations, it calls define-key on iso-transl-map; to disable the key translations, it does (setcdr iso-transl-map nil), which turns iso-transl-map back into a sparse keymap. (Hence this relies on knowledge of the internal representation of keymaps, but I don't see how to avoid that.) === modified file 'lisp/international/iso-transl.el' *** lisp/international/iso-transl.el 2012-07-18 09:27:23 +0000 --- lisp/international/iso-transl.el 2012-07-18 11:20:36 +0000 *************** *** 236,249 **** ("N" . [?Ñ]) ("n" . [?ñ])))) ! (defvar iso-transl-ctl-x-8-map nil "Keymap for C-x 8 prefix.") ! (or iso-transl-ctl-x-8-map ! (fset 'iso-transl-ctl-x-8-map ! (setq iso-transl-ctl-x-8-map (make-sparse-keymap)))) ! (or key-translation-map ! (setq key-translation-map (make-sparse-keymap))) ! (define-key key-translation-map "\C-x8" iso-transl-ctl-x-8-map) ;; For each entry in the alist, we'll make up to three ways to generate ;; the character in question: the prefix `C-x 8'; the ALT modifier on --- 236,247 ---- ("N" . [?Ñ]) ("n" . [?ñ])))) ! (defvar iso-transl-map (make-sparse-keymap)) ! (set-keymap-parent key-translation-map iso-transl-map) ! ! (defvar iso-transl-ctl-x-8-map (make-sparse-keymap) "Keymap for C-x 8 prefix.") ! (fset 'iso-transl-ctl-x-8-map iso-transl-ctl-x-8-map) ;; For each entry in the alist, we'll make up to three ways to generate ;; the character in question: the prefix `C-x 8'; the ALT modifier on *************** *** 259,265 **** (vec (vconcat (car (car alist)))) (tail iso-transl-dead-key-alist)) (aset vec 0 (logior (aref vec 0) ?\A-\^@)) ! (define-key key-translation-map vec translated-vec) (define-key isearch-mode-map (vector (aref vec 0)) nil) (while tail (if (eq (car (car tail)) inchar) --- 257,263 ---- (vec (vconcat (car (car alist)))) (tail iso-transl-dead-key-alist)) (aset vec 0 (logior (aref vec 0) ?\A-\^@)) ! (define-key iso-transl-map vec translated-vec) (define-key isearch-mode-map (vector (aref vec 0)) nil) (while tail (if (eq (car (car tail)) inchar) *************** *** 267,273 **** (deadkey (cdr (car tail)))) (aset deadvec 0 deadkey) (define-key isearch-mode-map (vector deadkey) nil) ! (define-key key-translation-map deadvec translated-vec))) (setq tail (cdr tail))))) (setq alist (cdr alist)))) --- 265,271 ---- (deadkey (cdr (car tail)))) (aset deadvec 0 deadkey) (define-key isearch-mode-map (vector deadkey) nil) ! (define-key iso-transl-map deadvec translated-vec))) (setq tail (cdr tail))))) (setq alist (cdr alist)))) *************** *** 280,286 **** ;; The standard mapping comes automatically. You can partially overlay it ;; with a language-specific mapping by using `M-x iso-transl-set-language'. ! (iso-transl-define-keys iso-transl-char-map) (provide 'iso-transl) --- 278,295 ---- ;; The standard mapping comes automatically. You can partially overlay it ;; with a language-specific mapping by using `M-x iso-transl-set-language'. ! ! (define-minor-mode iso-transl-mode ! "Toggle ISO-8859 Key Translation mode." ! :group 'i18n ! :global t ! (setcdr iso-transl-map nil) ! (setcdr iso-transl-ctl-x-8-map nil) ! (when iso-transl-mode ! (iso-transl-define-keys iso-transl-char-map) ! (define-key iso-transl-map "\C-x8" iso-transl-ctl-x-8-map))) ! ! (iso-transl-mode) (provide 'iso-transl)
bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Thu, 19 Jul 2012 12:13:02 GMT) Full text and rfc822 format available.Message #22 received at 6527 <at> debbugs.gnu.org (full text, mbox):
From: Stefan Monnier <monnier <at> IRO.UMontreal.CA> To: Chong Yidong <cyd <at> gnu.org> Cc: David Reitter <david.reitter <at> gmail.com>, 6527 <at> debbugs.gnu.org Subject: Re: bug#6527: C-h b autoloads iso-transl and alters key-translation-map Date: Thu, 19 Jul 2012 08:06:32 -0400
> How about something like the following (modulo comment changes and > fixing the isearch integration)? I don't much like the idea of hard-coding key-translation-map's parent like this. > There's still no facility for cleanly adding/removing a keymap parent. Then, let's try to fix this problem. How 'bout: (defun add-parent (map new-parent) (let ((cur (keymap-parent map))) (cond ((null cur) (set-keymap-parent map new-parent)) ((eq cur new-parent)) ((and (consp cur) (memq new-parent cur))) ((implicit-parents-holder-p cur) (push new-parent (cdr cur))) (t (set-keymap-parent map (make-composed-keymap (list new-parent cur))))))) (defun remove-parent (map parent) (let ((cur (keymap-parent map))) (cond ((eq cur parent) (set-keymap-parent map nil)) ((and (consp cur) (memq parent cur)) (delq parent cur) (unless (cdr cur) (set-keymap-parent map nil)))))) The only remaining problem is to define implicit-parents-holder-p which magically determines if the keymap is one of those that where implicitly created by add-parent (by calling make-composed-keymap) or if it's a *real* keymap that belongs to someone else and that we shouldn't modify. Stefan
bug-gnu-emacs <at> gnu.org
:bug#6527
; Package emacs
.
(Tue, 02 Nov 2021 15:39:01 GMT) Full text and rfc822 format available.Message #25 received at 6527 <at> debbugs.gnu.org (full text, mbox):
From: Lars Ingebrigtsen <larsi <at> gnus.org> To: David Reitter <david.reitter <at> gmail.com> Cc: larry <at> denenberg.com, 6527 <at> debbugs.gnu.org Subject: Re: bug#6527: C-h b alters key-translation-map (in a bad way) Date: Tue, 02 Nov 2021 16:37:52 +0100
David Reitter <david.reitter <at> gmail.com> writes: > C-h b alters the key translation map. In Emacs 28, Emacs is preloaded with iso-transl, so this no longer happens. I'm therefore closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
Lars Ingebrigtsen <larsi <at> gnus.org>
to control <at> debbugs.gnu.org
.
(Tue, 02 Nov 2021 15:39:02 GMT) Full text and rfc822 format available.Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Wed, 01 Dec 2021 12:24:05 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.