[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: deskheight.el v0.3
From: |
Kevin Rodgers |
Subject: |
Re: deskheight.el v0.3 |
Date: |
Fri, 31 Jan 2003 11:54:41 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Bruce Ingalls wrote:
Kevin Rodgers wrote:
Bruce Ingalls wrote:
;;Not sure why interactive mode does not return a value, while
compiled mode does.
Do you mean batch mode?
er, yes. I took this notation from another author (of which.el?), and
assumed that
the standard Emacs parlance was "interactive mode" for M-x, and
"compiled mode"
for C-x e
That author and now yourself are very confused.
Batch mode refers to emacs started with the -batch command line argument,
which sets the `noninteractive' variable.
There is no compiled mode. An Emacs Lisp function may be compiled (as may
forms aka symbolic expressions in general), which is what happens when you byte-
compile a .el file into a .elc file.
A function whose definition contains an interactive spec is called a command,
which can be invoked interactively via `M-x' (execute-extended-command) whether
it has been compiled or not.
Any form can be evaluated via `C-x e'.
I just fooled around and find that `M-x' does return the result of the
interactively executed command:
(setq foo (execute-extended-command nil)) C-x e C-x C-f /tmp/foo RET
; returns:
#<buffer foo>
Perhaps you mean that `M-x desktop-height-approx' doesn't report anything to
the user. I think what you want is something like:
(let ((deskheight ...))
(if (interactive-p) ; called via M-x
(message "%d" deskheight)
deskheight))
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>