diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-05-04 23:45:21 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-05-04 23:45:21 -0400 |
commit | 80ac5d4d34b34947df9b0088d81ec02aa10a93b5 (patch) | |
tree | ad08364ee1613d99018bfd6cc42809ed3c1e08fa /lisp/term/tvi970.el | |
parent | f44379e7feb79dd734318706abe5a000cff34c9b (diff) | |
download | emacs-80ac5d4d34b34947df9b0088d81ec02aa10a93b5.tar.gz |
Use define-minor-mode in more cases.
* term/tvi970.el (tvi970-set-keypad-mode):
* simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
(normal-erase-is-backspace-mode):
* scroll-bar.el (scroll-bar-mode): Use it and define-minor-mode.
(set-scroll-bar-mode-1): (Re)move to its sole caller.
(get-scroll-bar-mode): New function.
* emacs-lisp/cl-macs.el (eq): Handle a non-variable first arg.
Diffstat (limited to 'lisp/term/tvi970.el')
-rw-r--r-- | lisp/term/tvi970.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index 389adcde6c4..4476165febc 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -28,6 +28,8 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (defvar tvi970-terminal-map (let ((map (make-sparse-keymap))) @@ -102,7 +104,7 @@ ;; Should keypad numbers send ordinary digits or distinct escape sequences? -(defun tvi970-set-keypad-mode (&optional arg) +(define-minor-mode tvi970-set-keypad-mode "Set the current mode of the TVI 970 numeric keypad. In ``numeric keypad mode'', the number keys on the keypad act as ordinary digits. In ``alternate keypad mode'', the keys send distinct @@ -111,12 +113,9 @@ independent of the normal number keys. With no argument, toggle between the two possible modes. With a positive argument, select alternate keypad mode. With a negative argument, select numeric keypad mode." - (interactive "P") - (let ((newval (if (null arg) - (not (terminal-parameter nil 'tvi970-keypad-numeric)) - (> (prefix-numeric-value arg) 0)))) - (set-terminal-parameter nil 'tvi970-keypad-numeric newval) - (send-string-to-terminal (if newval "\e=" "\e>")))) + :variable (terminal-parameter nil 'tvi970-keypad-numeric) + (send-string-to-terminal + (if (terminal-parameter nil 'tvi970-keypad-numeric) "\e=" "\e>"))) ;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0 ;;; tvi970.el ends here |