From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/interactive-examples.html | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 devdocs/elisp/interactive-examples.html (limited to 'devdocs/elisp/interactive-examples.html') diff --git a/devdocs/elisp/interactive-examples.html b/devdocs/elisp/interactive-examples.html new file mode 100644 index 00000000..5aaa03cc --- /dev/null +++ b/devdocs/elisp/interactive-examples.html @@ -0,0 +1,44 @@ +

Examples of Using interactive

Here are some examples of interactive:

(defun foo1 ()              ; foo1 takes no arguments,
+    (interactive)           ;   just moves forward two words.
+    (forward-word 2))
+     ⇒ foo1
+
+ +
(defun foo2 (n)             ; foo2 takes one argument,
+    (interactive "^p")      ;   which is the numeric prefix.
+                            ; under shift-select-mode,
+                            ;   will activate or extend region.
+    (forward-word (* 2 n)))
+     ⇒ foo2
+
+ +
(defun foo3 (n)             ; foo3 takes one argument,
+    (interactive "nCount:") ;   which is read with the Minibuffer.
+    (forward-word (* 2 n)))
+     ⇒ foo3
+
+ +
(defun three-b (b1 b2 b3)
+  "Select three existing buffers.
+Put them into three windows, selecting the last one."
+
+
    (interactive "bBuffer1:\nbBuffer2:\nbBuffer3:")
+    (delete-other-windows)
+    (split-window (selected-window) 8)
+    (switch-to-buffer b1)
+    (other-window 1)
+    (split-window (selected-window) 8)
+    (switch-to-buffer b2)
+    (other-window 1)
+    (switch-to-buffer b3))
+     ⇒ three-b
+
+
(three-b "*scratch*" "declarations.texi" "*mail*")
+     ⇒ nil
+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Examples.html +

+
-- cgit v1.2.3