Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b9b1c3a9
Commit
b9b1c3a9
authored
Sep 19, 2000
by
Dave Love
Browse files
(map-y-or-n-p): Check use-dialog-box. Don't lose
with null `help'. Use modern backquote syntax.
parent
afd3c8cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
31 deletions
+37
-31
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/map-ynp.el
lisp/map-ynp.el
+32
-31
No files found.
lisp/ChangeLog
View file @
b9b1c3a9
2000-09-19 Dave Love <fx@gnu.org>
* map-ynp.el (map-y-or-n-p): Check use-dialog-box. Don't lose
with null `help'. Use modern backquote syntax.
2000-09-19 Gerd Moellmann <gerd@gnu.org>
* font-lock.el (font-lock-mode): Change message telling the user
...
...
lisp/map-ynp.el
View file @
b9b1c3a9
;;; map-ynp.el --- General-purpose boolean question-asker.
;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
;; Copyright (C) 1991, 1992, 1993, 1994, 1995
, 2000
Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.org>
;; Maintainer: FSF
...
...
@@ -96,20 +96,21 @@ Returns the number of actions taken."
list
(
cdr
list
))
t
)
nil
))))))
(
if
(
listp
last-nonmenu-event
)
(
if
(
and
(
listp
last-nonmenu-event
)
use-dialog-box
)
;; Make a list describing a dialog box.
(
let
((
object
(
capitalize
(
nth
0
help
)))
(
objects
(
capitalize
(
nth
1
help
)))
(
action
(
capitalize
(
nth
2
help
))))
(
setq
map
(
`
((
"Yes"
.
act
)
(
"No"
.
skip
)
(
"Quit"
.
exit
)
(
(
,
(
if
help
(
concat
action
" "
object
" And Quit"
)
"Do it and Quit"
)
)
.
act-and-exit
)
(
(
,
(
if
help
(
concat
action
" All "
objects
)
"Do All"
)
)
.
automatic
)
(
,@
(
mapcar
(
lambda
(
elt
)
(
cons
(
capitalize
(
nth
2
elt
))
(
vector
(
nth
1
elt
))))
action-alist
))
))
(
let
((
object
(
if
help
(
capitalize
(
nth
0
help
)))
)
(
objects
(
if
help
(
capitalize
(
nth
1
help
)))
)
(
action
(
if
help
(
capitalize
(
nth
2
help
))))
)
(
setq
map
`
((
"Yes"
.
act
)
(
"No"
.
skip
)
(
"Quit"
.
exit
)
(
,
(
if
help
(
concat
action
" "
object
" And Quit"
)
"Do it and Quit"
)
.
act-and-exit
)
(
,
(
if
help
(
concat
action
" All "
objects
)
"Do All"
)
.
automatic
)
,@
(
mapcar
(
lambda
(
elt
)
(
cons
(
capitalize
(
nth
2
elt
))
(
vector
(
nth
1
elt
))))
action-alist
))
use-menus
t
mouse-event
last-nonmenu-event
))
(
setq
user-keys
(
if
action-alist
...
...
@@ -130,8 +131,8 @@ Returns the number of actions taken."
(
unwind-protect
(
progn
(
if
(
stringp
prompter
)
(
setq
prompter
(
`
(
lambda
(
object
)
(
format
(
,
prompter
)
object
))))
)
(
setq
prompter
`
(
lambda
(
object
)
(
format
,
prompter
object
))))
(
while
(
funcall
next
)
(
setq
prompt
(
funcall
prompter
elt
))
(
cond
((
stringp
prompt
)
...
...
@@ -176,9 +177,9 @@ Returns the number of actions taken."
next
(
function
(
lambda
()
nil
))))
((
or
(
eq
def
'quit
)
(
eq
def
'exit-prefix
))
(
setq
quit-flag
t
)
(
setq
next
(
`
(
lambda
()
(
setq
next
'
(
,
next
)
)
'
(
,
elt
)))
))
(
setq
next
`
(
lambda
()
(
setq
next
'
,
next
)
',
elt
)))
((
eq
def
'automatic
)
;; Act on this and all following objects.
(
if
(
funcall
prompter
elt
)
...
...
@@ -219,34 +220,34 @@ the current %s and exit."
(set-buffer standard-output)
(help-mode)))
(setq next
(`
(lambda ()
(setq next '
(,
next)
)
'(,
elt)))
))
(setq next (lambda ()
(setq next '
,
next)
',
elt)))
((vectorp def)
;; A user-defined key.
(if (funcall (aref def 0) elt) ;Call its function.
;; The function has eaten this object.
(setq actions (1+ actions))
;; Regurgitated; try again.
(setq next
(`
(lambda ()
(setq next '
(,
next)
)
'(,
elt))))
))
(setq next (lambda ()
(setq next '
,
next)
',
elt))))
((and (consp char)
(eq (car char) 'switch-frame))
;; switch-frame event. Put it off until we're done.
(setq delayed-switch-frame char)
(setq next
(`
(lambda ()
(setq next '
(,
next)
)
'(,
elt)))
))
(setq next (lambda ()
(setq next '
,
next)
',
elt)))
(t
;; Random char.
(message "
Type
%s
for
help.
"
(key-description (vector help-char)))
(beep)
(sit-for 1)
(setq next
(`
(lambda ()
(setq next '
(,
next)
)
'(,
elt)))))
))
(setq next (lambda ()
(setq next '
,
next)
',
elt)))))
(prompt
(funcall actor elt)
(setq actions (1+ actions))))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment