GNU bug report logs - #22066
24.5; documentation for "values" is not accurate

Previous Next

Package: emacs;

Reported by: Shiyao Ma <i <at> introo.me>

Date: Tue, 1 Dec 2015 08:42:02 UTC

Severity: minor

Tags: fixed

Found in version 24.5

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Shiyao Ma <i <at> introo.me>
Cc: 22066 <at> debbugs.gnu.org
Subject: bug#22066: 24.5; documentation for "values" is not accurate
Date: Mon, 08 Feb 2021 08:16:03 +0100
Lars Ingebrigtsen <larsi <at> 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




This bug report was last modified 4 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.