From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22066: 24.5; documentation for "values" is not accurate Date: Mon, 08 Feb 2021 08:16:03 +0100 Message-ID: <87blcvm3m4.fsf@gnus.org> References: <87zhksiyyl.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15472"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 22066@debbugs.gnu.org To: Shiyao Ma Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 08 15:32:56 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l97ay-0003sb-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 15:32:56 +0100 Original-Received: from localhost ([::1]:35960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l97ax-0002ew-Dy for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 09:32:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l90nF-00072i-9v for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 02:17:19 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l90n8-0007jS-Kk for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 02:17:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l90n8-0003xo-GS for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 02:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Feb 2021 07:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22066 X-GNU-PR-Package: emacs Original-Received: via spool by 22066-submit@debbugs.gnu.org id=B22066.161276857915163 (code B ref 22066); Mon, 08 Feb 2021 07:17:02 +0000 Original-Received: (at 22066) by debbugs.gnu.org; 8 Feb 2021 07:16:19 +0000 Original-Received: from localhost ([127.0.0.1]:49682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l90mR-0003wV-H4 for submit@debbugs.gnu.org; Mon, 08 Feb 2021 02:16:19 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:44428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l90mP-0003w8-DU for 22066@debbugs.gnu.org; Mon, 08 Feb 2021 02:16:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UeU/MvbPodwxm9sS0HsBm2sa2QVqIOeBomGYEsknRNI=; b=kifPDsIGCVwwr+BPzgI/zS9CLv ZgCsDYn+E/9Qg+d45BK0T8fxFzGn78ZcFfml22a8DEjKKr2blaV/5z5AK4Zenqz7g/Q1pCTxt3Ieg L33ahofucofp4S8o2k5IucXvkEXSGAhAEMJNBfXALx8Oqs+cNKi35kEKzvrDOXn+ebpI=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l90mC-0002PD-Lt; Mon, 08 Feb 2021 08:16:11 +0100 X-Now-Playing: Aretha Franklin's _I Never Loved a Man the Way I Love You_: "I Never Loved a Man (The Way I Love You)" In-Reply-To: <87zhksiyyl.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 19:21:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199595 Archived-At: Lars Ingebrigtsen 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