]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vt-control.el: Avoid `called-interactively-p`
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Apr 2021 16:49:36 +0000 (12:49 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Apr 2021 16:49:36 +0000 (12:49 -0400)
(vt-keypad-on, vt-keypad-off): Use the `tell` arg instead.
(vt-numlock): Add `tell` arg.

lisp/vt-control.el

index 0bd5132f7c38e46fb70fbf525b76ff8b88ced96e..bac0069b852ac234490dcc5e10090f828d36984c 100644 (file)
 
 (defun vt-keypad-on (&optional tell)
   "Turn on the VT applications keypad."
-  (interactive)
+  (interactive "p")
   (send-string-to-terminal "\e=")
   (setq vt-applications-keypad-p t)
-  (if (or tell (called-interactively-p 'interactive))
-      (message "Applications keypad enabled.")))
+  (if tell (message "Applications keypad enabled.")))
 
 (defun vt-keypad-off (&optional tell)
   "Turn off the VT applications keypad."
   (interactive "p")
   (send-string-to-terminal "\e>")
   (setq vt-applications-keypad-p nil)
-  (if (or tell (called-interactively-p 'interactive))
-      (message "Applications keypad disabled.")))
+  (if tell (message "Applications keypad disabled.")))
 
-(defun vt-numlock nil
+(defun vt-numlock (&optional tell)
   "Toggle VT application keypad on and off."
-  (interactive)
+  (interactive "p")
   (if vt-applications-keypad-p
-      (vt-keypad-off (called-interactively-p 'interactive))
-    (vt-keypad-on (called-interactively-p 'interactive))))
+      (vt-keypad-off tell)
+    (vt-keypad-on tell)))
 
 (provide 'vt-control)