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
e6b75e30
Commit
e6b75e30
authored
Aug 14, 1995
by
Richard M. Stallman
Browse files
(command-line-1): Add option --eval to evalute an
expression on the command line and print the result.
parent
c3c6202c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
lisp/startup.el
lisp/startup.el
+10
-1
No files found.
lisp/startup.el
View file @
e6b75e30
...
...
@@ -101,6 +101,9 @@
;; --funcall FUNC and should not be used. (It's a typo
;; -e FUNC promoted to a feature.)
;;
;; -eval FORM Execute Emacs lisp form FORM, and print
;; --eval FORM the value it returns.
;;
;; -insert FILE Insert the contents of FILE into buffer.
;; --insert FILE
;; -------------------------
...
...
@@ -674,7 +677,7 @@ Type \\[describe-distribution] for information on getting the latest version."))
;; and long versions of what's on command-switch-alist.
(
longopts
(
append
'
((
"--funcall"
)
(
"--load"
)
(
"--insert"
)
(
"--kill"
)
(
"--directory"
))
(
"--directory"
)
(
"--eval"
)
)
(
mapcar
'
(
lambda
(
elt
)
(
list
(
concat
"-"
(
car
elt
))))
command-switch-alist
)))
...
...
@@ -717,6 +720,12 @@ Type \\[describe-distribution] for information on getting the latest version."))
(
if
(
arrayp
(
symbol-function
tem
))
(
command-execute
tem
)
(
funcall
tem
)))
((
string-equal
argi
"-eval"
)
(
if
argval
(
setq
tem
argval
)
(
setq
tem
(
car
command-line-args-left
))
(
setq
command-line-args-left
(
cdr
command-line-args-left
)))
(
print
(
eval
(
read
tem
))))
;; Set the default directory as specified in -L.
((
or
(
string-equal
argi
"-L"
)
(
string-equal
argi
"-directory"
))
...
...
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