* Does the command loop even look at the return values of commands executed?
@ 2021-08-26 5:32 Marcin Borkowski
2021-08-26 12:51 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Marcin Borkowski @ 2021-08-26 5:32 UTC (permalink / raw)
To: Help Gnu Emacs mailing list
Hi all,
I am pretty sure that the command loop discards anything returned by
a command invoked via a keybinding or M-x, but I couldn't find anything
about it in the Elisp reference. Is that true? Is it documented
anywhere? (I don't necessarily think it /needs/ to, but I'm quite
curious; also, I don't want to lie in my book;-).)
TIA,
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Does the command loop even look at the return values of commands executed?
2021-08-26 5:32 Does the command loop even look at the return values of commands executed? Marcin Borkowski
@ 2021-08-26 12:51 ` Eli Zaretskii
2021-08-26 16:52 ` [External] : " Drew Adams
2021-08-26 20:00 ` Marcin Borkowski
0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-08-26 12:51 UTC (permalink / raw)
To: help-gnu-emacs
> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Thu, 26 Aug 2021 07:32:36 +0200
>
> I am pretty sure that the command loop discards anything returned by
> a command invoked via a keybinding or M-x, but I couldn't find anything
> about it in the Elisp reference. Is that true? Is it documented
> anywhere?
Yes, we ignore the value returned by commands. No, it isn't
documented, AFAICT.
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-26 12:51 ` Eli Zaretskii
@ 2021-08-26 16:52 ` Drew Adams
2021-08-27 7:59 ` Stephen Berman
2021-08-26 20:00 ` Marcin Borkowski
1 sibling, 1 reply; 10+ messages in thread
From: Drew Adams @ 2021-08-26 16:52 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
> > I am pretty sure that the command loop discards anything returned by
> > a command invoked via a keybinding or M-x, but I couldn't find anything
> > about it in the Elisp reference. Is that true? Is it documented
> > anywhere?
>
> Yes, we ignore the value returned by commands. No, it isn't
> documented, AFAICT.
Just for info, in case it's somehow relevant to
Marcin: There is global variable `values'.
(elisp) node `Eval' tells us:
___
Variable: values
The value of this variable is a list of the values returned by all
the expressions that were read, evaluated, and printed from buffers
(including the minibuffer) by the standard Emacs commands which do
this. (Note that this does _not_ include evaluation in ‘*ielm*’
buffers, nor evaluation using ‘C-j’, ‘C-x C-e’, and similar
evaluation commands in ‘lisp-interaction-mode’.) The elements are
ordered most recent first.
(setq x 1)
⇒ 1
(list 'A (1+ 2) auto-save-default)
⇒ (A 3 t)
values
⇒ ((A 3 t) 1 ...)
This variable is useful for referring back to values of forms
recently evaluated. It is generally a bad idea to print the value
of ‘values’ itself, since this may be very long. Instead, examine
particular elements, like this:
;; Refer to the most recent evaluation result.
(nth 0 values)
⇒ (A 3 t)
;; That put a new element on,
;; so all elements move back one.
(nth 1 values)
⇒ (A 3 t)
;; This gets the element that was next-to-most-recent
;; before this example.
(nth 3 values)
⇒ 1
___
Although it doesn't apply to `C-x C-e', it does apply
to `M-:'.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-26 16:52 ` [External] : " Drew Adams
@ 2021-08-27 7:59 ` Stephen Berman
2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 16:12 ` Drew Adams
0 siblings, 2 replies; 10+ messages in thread
From: Stephen Berman @ 2021-08-27 7:59 UTC (permalink / raw)
To: Drew Adams; +Cc: help-gnu-emacs@gnu.org
On Thu, 26 Aug 2021 16:52:02 +0000 Drew Adams <drew.adams@oracle.com> wrote:
>> > I am pretty sure that the command loop discards anything returned by
>> > a command invoked via a keybinding or M-x, but I couldn't find anything
>> > about it in the Elisp reference. Is that true? Is it documented
>> > anywhere?
>>
>> Yes, we ignore the value returned by commands. No, it isn't
>> documented, AFAICT.
>
> Just for info, in case it's somehow relevant to
> Marcin: There is global variable `values'.
> (elisp) node `Eval' tells us:
>
> ___
> Variable: values
> The value of this variable is a list of the values returned by all
> the expressions that were read, evaluated, and printed from buffers
> (including the minibuffer) by the standard Emacs commands which do
> this.
[...]
In Emacs 28 the doc string of `values' says "This variable is obsolete
as of Emacs 28.1 and should not be used." It's also mentioned in Emacs
28 NEWS, but the Emacs 28 Elisp manual hasn't been updated on this yet.
Steve Berman
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-27 7:59 ` Stephen Berman
@ 2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 9:40 ` Stephen Berman
2021-08-27 11:38 ` Eli Zaretskii
2021-08-27 16:12 ` Drew Adams
1 sibling, 2 replies; 10+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-08-27 8:12 UTC (permalink / raw)
To: help-gnu-emacs
Stephen Berman wrote:
> In Emacs 28 the doc string of `values' says "This variable
> is obsolete as of Emacs 28.1 and should not be used." It's
> also mentioned in Emacs 28 NEWS, but the Emacs 28 Elisp
> manual hasn't been updated on this yet.
Here, which is
GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo
version 1.16.0) of 2021-08-02
the docstring for `values' say
values is a variable defined in ‘src/lread.c’.
Its value is nil
Probably introduced at or before Emacs version 1.1.
Documentation:
List of values of all expressions which were read, evaluated and printed.
Order is reverse chronological.
Maybe an Emacs 28.1 thing ...
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-08-27 9:40 ` Stephen Berman
2021-08-27 9:47 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 11:38 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2021-08-27 9:40 UTC (permalink / raw)
To: help-gnu-emacs
On Fri, 27 Aug 2021 10:12:02 +0200 Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Stephen Berman wrote:
>
>> In Emacs 28 the doc string of `values' says "This variable
>> is obsolete as of Emacs 28.1 and should not be used." It's
>> also mentioned in Emacs 28 NEWS, but the Emacs 28 Elisp
>> manual hasn't been updated on this yet.
>
> Here, which is
>
> GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo
> version 1.16.0) of 2021-08-02
>
> the docstring for `values' say
>
> values is a variable defined in ‘src/lread.c’.
> Its value is nil
>
> Probably introduced at or before Emacs version 1.1.
>
> Documentation:
> List of values of all expressions which were read, evaluated and printed.
> Order is reverse chronological.
>
> Maybe an Emacs 28.1 thing ...
It was changed in this commit:
commit 627a02467508140d213a68c9eed6cb78a5e94860
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
CommitDate: Tue Feb 9 16:28:38 2021 +0100
Note that the `values' variable is now obsolete
* src/lread.c (syms_of_lread): Note that it's obsolete in the doc
string (because we can't mark it as obsolete "properly" yet,
because that leads to compilation warnings when somebody
(let (values) ... values).
On Fri, 27 Aug 2021 10:13:24 +0200 Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Stephen Berman wrote:
>
>> This is true of Emacs 27 but in Emacs 28 `=' and `+' are
>> buttonized in *Help*.
>
> Not here which is
>
> GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo
> version 1.16.0) of 2021-08-02
It was changed in this commit:
commit 25dadca0d175aa7f9f1654314f90af64cdcb68fd
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
CommitDate: Sun Jan 10 13:37:38 2021 +0000
Hyperlink symbol names without word syntax in Help
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Allow single-character symbol names.
* lisp/help-mode.el (help-xref-symbol-regexp): Also match symbol
names starting with symbol syntax (bug#6601, bug#24309).
* test/lisp/help-mode-tests.el (help-mode-tests-xref-button): Test
hyperlink creation for function names without symbol syntax.
> Please use
>
> C-u M-x emacs-version RET
>
> GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo
> version 1.16.0) of 2021-08-02
GNU Emacs 28.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-08-26
I think more relevant is the value of `emacs-repository-version':
"ee2ffd9c9eb33a17307f36ff58caec1ba79878d2"
On Fri, 27 Aug 2021 10:51:22 +0200 Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Yeah ... where/how did you get 28.1?
>
> I did what I usually do and got same old 28.0.50.
>
> From https://git.savannah.gnu.org/git/emacs.git
>
> #! /bin/zsh
> #
> # this file:
> # http://user.it.uu.se/~embe8573/conf/.zsh/install-emacs
> # https://dataswamp.org/~incal/conf/.zsh/install-emacs
>
> local EMACS_SRC=https://git.savannah.gnu.org/git/emacs.git
> local EMACS_DIR=~/src
>
> emacs-install-prepare () {
> sudo apt-get -qq update
> sudo apt-get install build-essential
> sudo apt-get build-dep emacs
> }
>
> emacs-src-reset () {
> cd $EMACS_DIR
> git reset --hard
> git clean -xdf
> git pull $EMACS_SRC
> }
> alias emacs-reset-src=emacs-src-reset
>
> emacs-src-get () {
> cd $EMACS_DIR
> git clone $EMACS_SRC
> }
> alias emacs-get-src=emacs-src-get
>
> # autogen.sh
> # configure --with-x-toolkit=no
> # make
> # sudo make install
I don't know why you're failing to get the current sources. I also use
`git pull'. I have an account so the URL I use
srb@git.sv.gnu.org:/srv/git/emacs.git but I don't think that should make
a difference. Maybe your emacs-install-prepare function is interfering.
Steve Berman
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 9:40 ` Stephen Berman
@ 2021-08-27 11:38 ` Eli Zaretskii
1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-08-27 11:38 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Fri, 27 Aug 2021 10:12:02 +0200
> From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
>
> Stephen Berman wrote:
>
> > In Emacs 28 the doc string of `values' says "This variable
> > is obsolete as of Emacs 28.1 and should not be used." It's
> > also mentioned in Emacs 28 NEWS, but the Emacs 28 Elisp
> > manual hasn't been updated on this yet.
>
> Here, which is
>
> GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo
> version 1.16.0) of 2021-08-02
>
> the docstring for `values' say
>
> values is a variable defined in ‘src/lread.c’.
> Its value is nil
>
> Probably introduced at or before Emacs version 1.1.
>
> Documentation:
> List of values of all expressions which were read, evaluated and printed.
> Order is reverse chronological.
Your build is old; update from Git soon is recommended.
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [External] : Re: Does the command loop even look at the return values of commands executed?
2021-08-27 7:59 ` Stephen Berman
2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-08-27 16:12 ` Drew Adams
1 sibling, 0 replies; 10+ messages in thread
From: Drew Adams @ 2021-08-27 16:12 UTC (permalink / raw)
To: Stephen Berman; +Cc: help-gnu-emacs@gnu.org
> > Just for info, in case it's somehow relevant to
> > Marcin: There is global variable `values'.
> > (elisp) node `Eval' tells us: ...
>
> In Emacs 28 the doc string of `values' says "This variable is obsolete
> as of Emacs 28.1 and should not be used." It's also mentioned in Emacs
> 28 NEWS, but the Emacs 28 Elisp manual hasn't been updated on this yet.
Yes, I know - but it's good to spread the word.
[Oh, and there is no Emacs 28 release (yet).]
Variable `values' has existed since ~Day One.
It's in Emacs 20, and I believe I recall it
from The Beginning. R.I.P.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Does the command loop even look at the return values of commands executed?
2021-08-26 12:51 ` Eli Zaretskii
2021-08-26 16:52 ` [External] : " Drew Adams
@ 2021-08-26 20:00 ` Marcin Borkowski
1 sibling, 0 replies; 10+ messages in thread
From: Marcin Borkowski @ 2021-08-26 20:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On 2021-08-26, at 14:51, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Marcin Borkowski <mbork@mbork.pl>
>> Date: Thu, 26 Aug 2021 07:32:36 +0200
>>
>> I am pretty sure that the command loop discards anything returned by
>> a command invoked via a keybinding or M-x, but I couldn't find anything
>> about it in the Elisp reference. Is that true? Is it documented
>> anywhere?
>
> Yes, we ignore the value returned by commands. No, it isn't
> documented, AFAICT.
Thanks!
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-08-27 16:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-26 5:32 Does the command loop even look at the return values of commands executed? Marcin Borkowski
2021-08-26 12:51 ` Eli Zaretskii
2021-08-26 16:52 ` [External] : " Drew Adams
2021-08-27 7:59 ` Stephen Berman
2021-08-27 8:12 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 9:40 ` Stephen Berman
2021-08-27 9:47 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-27 11:38 ` Eli Zaretskii
2021-08-27 16:12 ` Drew Adams
2021-08-26 20:00 ` Marcin Borkowski
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.