[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master be1afa047f 01/10: * lisp/play/zone.el (zone): Allow selecting a p
From: |
Philip Kaludercic |
Subject: |
master be1afa047f 01/10: * lisp/play/zone.el (zone): Allow selecting a program |
Date: |
Fri, 14 Oct 2022 12:30:37 -0400 (EDT) |
branch: master
commit be1afa047f74f3197e530b28971249593b12d177
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
* lisp/play/zone.el (zone): Allow selecting a program
---
lisp/play/zone.el | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/lisp/play/zone.el b/lisp/play/zone.el
index b0ce0194cf..5ea5bbc926 100644
--- a/lisp/play/zone.el
+++ b/lisp/play/zone.el
@@ -103,9 +103,24 @@ If the element is a function or a list of a function and a
number,
program))))
;;;###autoload
-(defun zone ()
- "Zone out, completely."
- (interactive)
+(defun zone (&optional pgm)
+ "Zone out, completely.
+With a prefix argument the user is prompted for a program to run.
+When called from Lisp the optional argument PGM can be used to
+run a specific program. The program must be a member of
+`zone-programs'."
+ (interactive
+ (and current-prefix-arg
+ (let ((choice (completing-read
+ "Program: "
+ (mapcar
+ (lambda (prog)
+ (substring (symbol-name prog) 9))
+ zone-programs)
+ nil t)))
+ (list (intern (concat "zone-pgm-" choice))))))
+ (unless pgm
+ (setq pgm (aref zone-programs (random (length zone-programs)))))
(save-window-excursion
(let ((f (selected-frame))
(outbuf (get-buffer-create "*zone*"))
@@ -125,8 +140,7 @@ If the element is a function or a list of a function and a
number,
(set-window-start (selected-window) (point-min))
(set-window-point (selected-window) wp)
(sit-for 0 500)
- (let ((pgm (elt zone-programs (random (length zone-programs))))
- (ct (and f (frame-parameter f 'cursor-type)))
+ (let ((ct (and f (frame-parameter f 'cursor-type)))
(show-trailing-whitespace nil)
restore)
(when ct
- master updated (b175a9fb7e -> 51fc195d39), Philip Kaludercic, 2022/10/14
- master db69681759 06/10: * lisp/net/rcirc.el (rcirc-generate-log-filename): Append ".log", Philip Kaludercic, 2022/10/14
- master cae0056769 08/10: Allow filtering what items are added to Ecomplete, Philip Kaludercic, 2022/10/14
- master ff0fe62002 02/10: Mention that vc-prepare-patch can interact with a log-view, Philip Kaludercic, 2022/10/14
- master 8fc5148429 09/10: * lisp/net/rcirc.el (rcirc-bridged-nick): Inherit from highlight, Philip Kaludercic, 2022/10/14
- master be1afa047f 01/10: * lisp/play/zone.el (zone): Allow selecting a program,
Philip Kaludercic <=
- master 000cd5f9f6 05/10: ; * lisp/vc/vc.el (vc-default-prepare-patch): Add missing argument, Philip Kaludercic, 2022/10/14
- master 60f46b45d9 04/10: Prepare all inline patches at once, Philip Kaludercic, 2022/10/14
- master 6539eb0588 07/10: Prevent .dir-locals.el from being byte-compiled, Philip Kaludercic, 2022/10/14
- master 51fc195d39 10/10: Add a quick-help menu, Philip Kaludercic, 2022/10/14
- master 5426b4d7bf 03/10: Allow reordering commits in 'vc-prepare-patch' prompt, Philip Kaludercic, 2022/10/14