emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

input-method completion is annoying.


From: Michaël Cadilhac
Subject: input-method completion is annoying.
Date: Wed, 07 Mar 2007 15:35:32 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Hi!

Input method completion is sometimes like a PITA because it just
happens when you need it least.

For example, I use BBDB with Gnus, and a postfix input-method. Let's
say I want to search for Akim's mail contact.

I just type Aki and have a <TAB> (BBDB completion expected). Heck!
quail (quite unreadable) completion:
| Possible completion and corresponding characters are:
|  i: -
|    i^:(1/1) 1.î
|      i^^:(1/1) 1.i^
|    i":(1/1) 1.ï
|      i"":(1/1) 1.i"
`------------------------

Apart from the fact that this completion infos are kind of useless
(the echo area already prints the useful infos), the binding is
annoying.

I just propose to change this key to M-# (don't ask me why this key,
it's only a free key that can't be used by mistake):
Index: lisp/international/quail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/international/quail.el,v
retrieving revision 1.154
diff -B -w -c -r1.154 quail.el
*** lisp/international/quail.el 2 Feb 2007 11:43:31 -0000       1.154
--- lisp/international/quail.el 7 Mar 2007 13:18:31 -0000
***************
*** 266,273 ****
  (defvar quail-translation-keymap
    (let ((map (make-keymap))
        (i 0))
!     (while (< i ?\ )
!       (define-key map (char-to-string i) 'quail-other-command)
        (setq i (1+ i)))
      (while (< i 127)
        (define-key map (char-to-string i) 'quail-self-insert-command)
--- 266,274 ----
  (defvar quail-translation-keymap
    (let ((map (make-keymap))
        (i 0))
!     (while (< i ?\s)
!       (unless (= i meta-prefix-char)
!       (define-key map (char-to-string i) 'quail-other-command))
        (setq i (1+ i)))
      (while (< i 127)
        (define-key map (char-to-string i) 'quail-self-insert-command)
***************
*** 285,291 ****
      (define-key map [left] 'quail-prev-translation)
      (define-key map [down] 'quail-next-translation-block)
      (define-key map [up] 'quail-prev-translation-block)
!     (define-key map "\C-i" 'quail-completion)
      (define-key map "\C-@" 'quail-select-current)
      ;; Following simple.el, Enter key on numeric keypad selects the
      ;; current translation just like `C-SPC', and `mouse-2' chooses
--- 286,292 ----
      (define-key map [left] 'quail-prev-translation)
      (define-key map [down] 'quail-next-translation-block)
      (define-key map [up] 'quail-prev-translation-block)
!     (define-key map "\M-#" 'quail-completion)
      (define-key map "\C-@" 'quail-select-current)
      ;; Following simple.el, Enter key on numeric keypad selects the
      ;; current translation just like `C-SPC', and `mouse-2' chooses
***************
*** 295,301 ****
      (define-key map [down-mouse-2] nil)
      (define-key map "\C-h" 'quail-translation-help)
      (define-key map [?\C- ] 'quail-select-current)
-     (define-key map [tab] 'quail-completion)
      (define-key map [delete] 'quail-delete-last-char)
      (define-key map [backspace] 'quail-delete-last-char)
      map)
--- 296,301 ----
***************
*** 338,344 ****
    (let ((map (make-keymap))
        (i 0))
      (while (< i ?\ )
!       (define-key map (char-to-string i) 'quail-other-command)
        (setq i (1+ i)))
      (while (< i 127)
        (define-key map (char-to-string i) 'quail-self-insert-command)
--- 338,345 ----
    (let ((map (make-keymap))
        (i 0))
      (while (< i ?\ )
!       (unless (= i meta-prefix-char)
!       (define-key map (char-to-string i) 'quail-other-command))
        (setq i (1+ i)))
      (while (< i 127)
        (define-key map (char-to-string i) 'quail-self-insert-command)
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10783
diff -C0 -r1.10783 ChangeLog
*** lisp/ChangeLog      7 Mar 2007 12:50:23 -0000       1.10783
--- lisp/ChangeLog      7 Mar 2007 13:21:40 -0000
***************
*** 0 ****
--- 1,7 ----
+ 2007-03-07  Micha,Ak(Bl Cadilhac  <address@hidden>
+ 
+       * international/quail.el (quail-translation-keymap): Don't bind
+       `meta-prefix-char' to `quail-othe-command', in order to bind
+       "\M-#" instead of <TAB> to quail-completion.
+       (quail-simple-translation-keymap): Ditto.
+ 
Index: leim/quail/latin-ltx.el
===================================================================
RCS file: /sources/emacs/emacs/leim/quail/latin-ltx.el,v
retrieving revision 1.27
diff -B -w -c -r1.27 latin-ltx.el
*** leim/quail/latin-ltx.el     16 Jan 2007 08:40:03 -0000      1.27
--- leim/quail/latin-ltx.el     7 Mar 2007 13:24:16 -0000
***************
*** 41,47 ****
   \\'a -> á  \\`{a} -> à
   \\pi -> π  \\int -> ∫  ^1 -> ¹"
  
!  '(("\t" . quail-completion))
   t t nil nil nil nil nil nil nil t)
  
  (quail-define-rules
--- 41,47 ----
   \\'a -> á  \\`{a} -> à
   \\pi -> π  \\int -> ∫  ^1 -> ¹"
  
!  '(("\M-#" . quail-completion))
   t t nil nil nil nil nil nil nil t)
  
  (quail-define-rules
Index: leim/quail/sgml-input.el
===================================================================
RCS file: /sources/emacs/emacs/leim/quail/sgml-input.el,v
retrieving revision 1.8
diff -B -w -c -r1.8 sgml-input.el
*** leim/quail/sgml-input.el    16 Jan 2007 08:40:03 -0000      1.8
--- leim/quail/sgml-input.el    7 Mar 2007 13:24:17 -0000
***************
*** 41,47 ****
  HTMLspecial and HTMLsymbol.
  
  E.g.: &aacute; -> á"
!  '(("\t" . quail-completion))
   t nil nil nil nil nil nil nil nil t)
  
  (quail-define-rules
--- 41,47 ----
  HTMLspecial and HTMLsymbol.
  
  E.g.: &aacute; -> á"
!  '(("\M-#" . quail-completion))
   t nil nil nil nil nil nil nil nil t)
  
  (quail-define-rules
Index: leim/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/leim/ChangeLog,v
retrieving revision 1.214
diff -C0 -r1.214 ChangeLog
*** leim/ChangeLog      11 Feb 2007 00:42:11 -0000      1.214
--- leim/ChangeLog      7 Mar 2007 13:25:10 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-03-07  Micha,Ak(Bl Cadilhac  <address@hidden>
+ 
+       * quail/latin-ltx.el ("TeX"): Use "\M-#" instead of <TAB> for
+       `quail-completion'.
+       * quail/sgml-input.el ("sgml"): Ditto.
+ 
Second little bug, the completion buffer isn't read-only. How about:
Index: lisp/international/quail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/international/quail.el,v
retrieving revision 1.154
diff -B -w -c -r1.154 quail.el
*** lisp/international/quail.el 2 Feb 2007 11:43:31 -0000       1.154
--- lisp/international/quail.el 7 Mar 2007 13:14:23 -0000
***************
*** 2161,2170 ****
                  ;; quail-completion-buf.
                  (minibuffer-scroll-window nil))
              (scroll-other-window)))
!       (setq quail-current-key key)
        (erase-buffer)
        (insert "Possible completion and corresponding characters are:\n")
        (quail-completion-1 key map 1)
        (goto-char (point-min))
        (display-buffer (current-buffer))
        (setq require-update t)))
--- 2161,2172 ----
                  ;; quail-completion-buf.
                  (minibuffer-scroll-window nil))
              (scroll-other-window)))
!       (setq quail-current-key key
!             buffer-read-only nil)
        (erase-buffer)
        (insert "Possible completion and corresponding characters are:\n")
        (quail-completion-1 key map 1)
+       (setq buffer-read-only t)
        (goto-char (point-min))
        (display-buffer (current-buffer))
        (setq require-update t)))
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10783
diff -C0 -r1.10783 ChangeLog
*** lisp/ChangeLog      7 Mar 2007 12:50:23 -0000       1.10783
--- lisp/ChangeLog      7 Mar 2007 13:14:55 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2007-03-07  Michaël Cadilhac  <address@hidden>
+ 
+       * international/quail.el (quail-completion): Set the buffer to be
+       read-only when needed.
+ 
TIA!

-- 
 |   Michaël `Micha' Cadilhac       |  La meilleure façon                    |
 |   http://michael.cadilhac.name   |     de ne pas avancer,                 |
 |   JID/MSN:                       |  c'est de suivre une idée fixe.        |
 `----  address@hidden  |          -- Jacques Prévert       -  --'

Attachment: pgpqxHPTKuCQz.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]