/[emacs]/emacs/lisp/international/encoded-kb.el
ViewVC logotype

Diff of /emacs/lisp/international/encoded-kb.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by rms, Wed Nov 21 10:41:45 2001 UTC revision 1.25 by monnier, Sat Dec 1 00:18:21 2001 UTC
# Line 24  Line 24 
24    
25  ;;; Code:  ;;; Code:
26    
 (defvar encoded-kbd-mode nil  
   "Non-nil if in Encoded-kbd minor mode.")  
 (put 'encoded-kbd-mode 'permanent-local t)  
   
 ;;; (let ((slot (assq 'encoded-kbd-mode minor-mode-alist))  
 ;;;       (name " Encoded-kbd"))  
 ;;;   (if slot  
 ;;;       (setcar (cdr slot) name)  
 ;;;     (setq minor-mode-alist  
 ;;;       (cons '(encoded-kbd-mode " Encoded-kbd") minor-mode-alist))))  
   
27  (defconst encoded-kbd-mode-map (make-sparse-keymap)  (defconst encoded-kbd-mode-map (make-sparse-keymap)
28    "Keymap for Encoded-kbd minor mode.")    "Keymap for Encoded-kbd minor mode.")
29    
 (let ((slot (assq 'encoded-kbd-mode minor-mode-map-alist)))  
   (if slot  
       (setcdr slot encoded-kbd-mode-map)  
     (setq minor-mode-map-alist  
           (cons (cons 'encoded-kbd-mode encoded-kbd-mode-map)  
                 minor-mode-map-alist))))  
   
30  ;; Subsidiary keymaps for handling ISO2022 escape sequences.  ;; Subsidiary keymaps for handling ISO2022 escape sequences.
31    
32  (defvar encoded-kbd-iso2022-esc-map  (defvar encoded-kbd-iso2022-esc-map
# Line 305  The following key sequence may cause mul Line 287  The following key sequence may cause mul
287  ;; Input mode at the time Encoded-kbd mode is turned on is saved here.  ;; Input mode at the time Encoded-kbd mode is turned on is saved here.
288  (defvar saved-input-mode nil)  (defvar saved-input-mode nil)
289    
290    (put 'encoded-kbd-mode 'permanent-local t)
291  ;;;###autoload  ;;;###autoload
292  (defun encoded-kbd-mode (&optional arg)  (define-minor-mode encoded-kbd-mode
293    "Toggle Encoded-kbd minor mode.    "Toggle Encoded-kbd minor mode.
294  With arg, turn Encoded-kbd mode on if and only if arg is positive.  With arg, turn Encoded-kbd mode on if and only if arg is positive.
295    
# Line 317  automatically. Line 300  automatically.
300  In Encoded-kbd mode, a text sent from keyboard is accepted  In Encoded-kbd mode, a text sent from keyboard is accepted
301  as a multilingual text encoded in a coding system set by  as a multilingual text encoded in a coding system set by
302  \\[set-keyboard-coding-system]."  \\[set-keyboard-coding-system]."
303    (if encoded-kbd-mode    :global t
304        ;; We must at first reset input-mode to the original.    ;; We must at first reset input-mode to the original.
305        (apply 'set-input-mode saved-input-mode))    (if saved-input-mode (apply 'set-input-mode saved-input-mode))
   (setq encoded-kbd-mode  
         (if (null arg) (null encoded-kbd-mode)  
           (> (prefix-numeric-value arg) 0)))  
306    (if encoded-kbd-mode    (if encoded-kbd-mode
307        (let ((coding (keyboard-coding-system)))        (let ((coding (keyboard-coding-system)))
308          (setq saved-input-mode  (current-input-mode))          (setq saved-input-mode  (current-input-mode))
# Line 374  as a multilingual text encoded in a codi Line 354  as a multilingual text encoded in a codi
354                 (setq encoded-kbd-mode nil)                 (setq encoded-kbd-mode nil)
355                 (error "Coding-system `%s' is not supported in Encoded-kbd mode"                 (error "Coding-system `%s' is not supported in Encoded-kbd mode"
356                        (keyboard-coding-system))))                        (keyboard-coding-system))))
357          (encoded-kbd-setup-keymap coding)          (encoded-kbd-setup-keymap coding))))
         (run-hooks 'encoded-kbd-mode-hook))))  
358    
359  ;;; encoded-kb.el ends here  ;;; encoded-kb.el ends here

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26