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
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
73a644b4
Commit
73a644b4
authored
Apr 08, 1994
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(popup-dialog-box): New function.
parent
26c5bf8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
lisp/emacs-lisp/lmenu.el
lisp/emacs-lisp/lmenu.el
+50
-0
No files found.
lisp/emacs-lisp/lmenu.el
View file @
73a644b4
...
...
@@ -146,6 +146,56 @@ The syntax, more precisely:
(
if
(
keymapp
cmd
)
(
setq
menu
cmd
)
(
call-interactively
cmd
))))))
(
defun
popup-dialog-box
(
data
)
"Pop up a dialog box.
A dialog box description is a list.
- The first element of the list is a string to display in the dialog box.
- The rest of the elements are descriptions of the dialog box's buttons.
Each one is a vector of three elements:
- The first element is the text of the button.
- The second element is the `callback'.
- The third element is t or nil, whether this button is selectable.
If the `callback' of a button is a symbol, then it must name a command.
It will be invoked with `call-interactively'. If it is a list, then it is
evaluated with `eval'.
One (and only one) of the buttons may be `nil'. This marker means that all
following buttons should be flushright instead of flushleft.
The syntax, more precisely:
form := <something to pass to `eval'>
command := <a symbol or string, to pass to `call-interactively'>
callback := command | form
active-p := <t, nil, or a form to evaluate to decide whether this
button should be selectable>
name := <string>
partition := 'nil'
button := '[' name callback active-p ']'
dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')'"
(
let
((
name
(
car
data
))
(
tail
(
cdr
data
))
converted
choice
)
(
while
tail
(
if
(
null
(
car
tail
))
(
setq
converted
(
cons
nil
converted
))
(
let
((
item
(
aref
(
car
tail
)
0
))
(
callback
(
aref
(
car
tail
)
1
))
(
enable
(
aref
(
car
tail
)
2
)))
(
setq
converted
(
cons
(
if
enable
(
cons
item
callback
)
item
)
converted
))))
(
setq
tail
(
cdr
tail
)))
(
setq
choice
(
x-popup-dialog
t
(
cons
name
(
nreverse
converted
))))
(
setq
meaning
(
assq
choice
converted
))
(
if
meaning
(
if
(
symbolp
(
cdr
meaning
))
(
call-interactively
(
cdr
meaning
))
(
eval
(
cdr
meaning
))))))
;; This is empty because the usual elements of the menu bar
;; are provided by menu-bar.el instead.
...
...
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