comparison lisp/international/quail.el @ 19391:763bc03e7797

(quail-guidance-buf): Now a permanent local. (quail-update-guidance, quail-show-guidance-buf): Test input-method-verbose-flag. (quail-setup-overlays): Underline quail-conv-overlay only if input-method-highlight-flag is non-nil.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Aug 1997 21:16:27 +0000
parents 70e5d1211d98
children 8901359ae445
comparison
equal deleted inserted replaced
19390:4d72985edb2d 19391:763bc03e7797
46 (require 'faces) 46 (require 'faces)
47 47
48 ;; Buffer local variables 48 ;; Buffer local variables
49 49
50 (defvar quail-current-package nil 50 (defvar quail-current-package nil
51 "The current Quail package to input multilingual text in Quail minor mode. 51 "The current Quail package, which depends on the current input method.
52 See the documentation of `quail-package-alist' for the format.") 52 See the documentation of `quail-package-alist' for the format.")
53 (make-variable-buffer-local 'quail-current-package) 53 (make-variable-buffer-local 'quail-current-package)
54 (put 'quail-current-package 'permanent-local t) 54 (put 'quail-current-package 'permanent-local t)
55 55
56 ;; Quail uses the following two buffers to assist users. 56 ;; Quail uses the following two buffers to assist users.
60 (defvar quail-completion-buf nil) 60 (defvar quail-completion-buf nil)
61 61
62 ;; Each buffer in which Quail is activated should use different 62 ;; Each buffer in which Quail is activated should use different
63 ;; guidance buffers. 63 ;; guidance buffers.
64 (make-variable-buffer-local 'quail-guidance-buf) 64 (make-variable-buffer-local 'quail-guidance-buf)
65 (put 'quail-guidance-buf 'permanent-local t)
65 66
66 ;; A main window showing Quail guidance buffer. 67 ;; A main window showing Quail guidance buffer.
67 (defvar quail-guidance-win nil) 68 (defvar quail-guidance-win nil)
68 (make-variable-buffer-local 'quail-guidance-win) 69 (make-variable-buffer-local 'quail-guidance-win)
69 70
438 (overlay-put quail-overlay (car l) (car (cdr l))) 439 (overlay-put quail-overlay (car l) (car (cdr l)))
439 (setq l (cdr (cdr l)))))) 440 (setq l (cdr (cdr l))))))
440 (if (overlayp quail-conv-overlay) 441 (if (overlayp quail-conv-overlay)
441 (move-overlay quail-conv-overlay pos pos) 442 (move-overlay quail-conv-overlay pos pos)
442 (setq quail-conv-overlay (make-overlay pos pos nil nil t)) 443 (setq quail-conv-overlay (make-overlay pos pos nil nil t))
443 (overlay-put quail-conv-overlay 'face 'underline) 444 (if input-method-highlight-flag
445 (overlay-put quail-conv-overlay 'face 'underline))
444 ;;(overlay-put quail-conv-overlay 'modification-hooks 446 ;;(overlay-put quail-conv-overlay 'modification-hooks
445 ;;'(quail-conv-overlay-modification-hook)) 447 ;;'(quail-conv-overlay-modification-hook))
446 ))) 448 )))
447 449
448 ;; Delete overlays used in Quail mode. 450 ;; Delete overlays used in Quail mode.
608 the first column of the fourth row is left of key `a', 610 the first column of the fourth row is left of key `a',
609 the first column of the fifth row is left of key `z', 611 the first column of the fifth row is left of key `z',
610 the sixth row is below the `z' - `/' row. 612 the sixth row is below the `z' - `/' row.
611 Nth (N is even) and (N+1)th characters in the string are non-shifted 613 Nth (N is even) and (N+1)th characters in the string are non-shifted
612 and shifted characters respectively at the same location. 614 and shifted characters respectively at the same location.
613 The location of Nth character is row (N / 30) and column ((N mod 30) / 2).") 615 The location of Nth character is row (N / 30) and column ((N mod 30) / 2).
616 The command `quail-set-keyboard-layout' usually sets this variable.")
614 617
615 (defconst quail-keyboard-layout-len 180) 618 (defconst quail-keyboard-layout-len 180)
616 619
617 ;; Here we provide several examples of famous keyboard layouts. 620 ;; Here we provide several examples of famous keyboard layouts.
618 621
1352 Create the buffer if it does not exist yet. 1355 Create the buffer if it does not exist yet.
1353 The buffer is normally displayed at the echo area, 1356 The buffer is normally displayed at the echo area,
1354 but if the current buffer is a minibuffer, it is shown in 1357 but if the current buffer is a minibuffer, it is shown in
1355 the bottom-most ordinary window of the same frame, 1358 the bottom-most ordinary window of the same frame,
1356 or in a newly created frame (if the selected frame has no other windows)." 1359 or in a newly created frame (if the selected frame has no other windows)."
1357 (if (and input-method-tersely-flag 1360 (if (and (not input-method-verbose-flag)
1358 (eq (selected-window) (minibuffer-window))) 1361 (eq (selected-window) (minibuffer-window)))
1359 ;; We don't need the guidance buffer. 1362 ;; We don't need the guidance buffer.
1360 nil 1363 nil
1361 ;; At first, setup a guidance buffer. 1364 ;; At first, setup a guidance buffer.
1362 (or (buffer-live-p quail-guidance-buf) 1365 (or (buffer-live-p quail-guidance-buf)
1431 (delete-window win))))))) 1434 (delete-window win)))))))
1432 1435
1433 (defun quail-update-guidance () 1436 (defun quail-update-guidance ()
1434 "Update the Quail guidance buffer and completion buffer (if displayed now)." 1437 "Update the Quail guidance buffer and completion buffer (if displayed now)."
1435 ;; Update guidance buffer. 1438 ;; Update guidance buffer.
1436 (if (or (null input-method-tersely-flag) 1439 (if (or input-method-verbose-flag
1437 (not (eq (selected-window) (minibuffer-window)))) 1440 (not (eq (selected-window) (minibuffer-window))))
1438 (let ((guidance (quail-guidance))) 1441 (let ((guidance (quail-guidance)))
1439 (cond ((eq guidance t) 1442 (cond ((eq guidance t)
1440 ;; Show the current possible translations. 1443 ;; Show the current possible translations.
1441 (quail-show-translations)) 1444 (quail-show-translations))