unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Shiyao Ma <i@introo.me>
Cc: 22066@debbugs.gnu.org
Subject: bug#22066: 24.5; documentation for "values" is not accurate
Date: Mon, 08 Feb 2021 08:16:03 +0100	[thread overview]
Message-ID: <87blcvm3m4.fsf@gnus.org> (raw)
In-Reply-To: <87zhksiyyl.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 19:21:06 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But I'm not quite sure what the actual semantics are.  `eval-expression'
> definitely sets it, but are there other functions that do?
>
> `eval-last-sexp' doesn't, even when given a prefix (when it does read,
> evaluate and print something).

I've looked a bit closed at what the semantics are, and they seem to be
pretty obscure.  Here's the only place where we put things on `values':

      if (printflag)
	{
	  Vvalues = Fcons (val, Vvalues);
	  if (EQ (Vstandard_output, Qt))
	    Fprin1 (val, Qnil);
	  else
	    Fprint (val, Qnil);
	}

printflag is an option in many functions, so if you say

(eval-region 2 13 t)

then the value will be stored in `values' -- otherwise not.  And this
has been this way since at least 1991 (which is the initial revision of
lread.c).

`eval-expression' has this:

  (if (null eval-expression-debug-on-error)
      (push (eval (let ((lexical-binding t)) (macroexpand-all exp)) t)
            values)

etc.  So it's being set a few places, and it's used in one single place:
`elisp--eval-defun'.

Anyway, I guess this means that `eval-last-sexp' is just missing a push?
So I've now added that to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-02-08  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  5:48 bug#22066: 24.5; documentation for "values" is not accurate Shiyao Ma
2019-08-01 17:21 ` Lars Ingebrigtsen
2021-02-08  7:16   ` Lars Ingebrigtsen [this message]
2021-02-08 16:00     ` Stefan Monnier
2021-02-08 16:15       ` Lars Ingebrigtsen
2021-02-08 17:07         ` Stefan Monnier
2021-02-09  7:37           ` Lars Ingebrigtsen
2021-02-09  7:57             ` Lars Ingebrigtsen
2021-02-09 15:24               ` Stefan Monnier
2021-02-09 15:26                 ` Lars Ingebrigtsen
2021-02-09 18:29                   ` Stefan Monnier
2021-02-09 18:32                     ` Lars Ingebrigtsen
2021-02-09 18:33                       ` Lars Ingebrigtsen
2021-02-09 20:29                         ` Stefan Monnier
2021-02-09 18:35                       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blcvm3m4.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=22066@debbugs.gnu.org \
    --cc=i@introo.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).