From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jul 2018 20:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 32064@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.153082174019367 (code B ref -1); Thu, 05 Jul 2018 20:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jul 2018 20:15:40 +0000 Received: from localhost ([127.0.0.1]:48011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbAfE-00052J-9Z for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbAfA-000525-UW for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbAf4-0007iu-Bh for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbAf4-0007if-35 for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbAf2-0007X6-Mz for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbAew-0007ek-QR for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:26 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbAew-0007ds-GE for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:22 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w65KESKN086558 for ; Thu, 5 Jul 2018 20:15:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=vwCAY7jPmojt6P7xxa+vDz758WEh7IKzCdgSyxgxByQ=; b=BQZ9cDUuB5U7i3UWHKVRSLup4MaGfYzzCortoNT3C5Ies8vf8H7bNtyGz8W0PP2WzKPT H1hVUljbpVlC8kcXbXEkhm9cbOLDfXbGELn95DCcurh2EEPsL39zqQYxKYVSmP8/d2P9 igP2bUiVvUOzMGdrSURbVGJp3Zj8mhAvXrKLoyhiFMtw8usp/W94HILHsw51xUcwOWpk G9JK3SPOJEL0X/wRar81DV9C9yS0YvDnU8lpaNIR1l3QDevzjMf3apKWazwtiX8A2KSp ghEJoeC5t/eBEZVYjBW+V2FTMHkYP46Omjvun1o/8zFZcjfVG7W9mSka24Ur7H5Cg5K5 gg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2k0dnjqa7x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 05 Jul 2018 20:15:19 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w65KFIUb017270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 5 Jul 2018 20:15:19 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w65KFHGM007008 for ; Thu, 5 Jul 2018 20:15:18 GMT MIME-Version: 1.0 Message-ID: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> Date: Thu, 5 Jul 2018 13:15:16 -0700 (PDT) From: Drew Adams X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807050224 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The doc string was messed up a bit in Emacs 26, apparently for the fix of bug #4118. >From this, which makes sense: Normally, this function truncates long output according to the value of the variables `eval-expression-print-length' and `eval-expression-print-level'. With a prefix argument of zero, however, there is no such truncation. Such a prefix argument also causes integers to be printed in several additional formats (octal, hexadecimal, and character). The text was changed to this, which does not make sense at all: Normally, this function truncates long output according to the value of the variables 'eval-expression-print-length' and 'eval-expression-print-level'. With a prefix argument of zero, however, there is no such truncation. Such a prefix argument also causes integers to be printed in several additional formats (octal, hexadecimal, and character when the prefix argument is -1 or the integer is 'eval-expression-print-maximum-character' or less). Both old and new say that with a prefix arg of ZERO ("such a prefix argument") the behavior is to do both of these things: 1. Do not truncate. 2. Print in additional formats. That's fine. But the Emacs 26+ version also says that with a ZERO prefix arg ("such a prefix argument"), if the prefix arg is ALSO -1 (impossible) or if "the integer" (what integer?) is less than or equal to the value of `eval-expression-print-maximum-character', the additional formats include "character". A character is not a format, so it's unclear what printing in format "character" means. But the main problem with this is that it makes us try to understand a prefix arg that is BOTH zero and -1, and it leaves us wondering what "the integer" is that is tested against `eval-expression-print-maximum-character' when the prefix arg is zero. If "the integer" is just the numeric prefix arg then the <=3D `eval-expression-print-maximum-character' could be clear - but there should be no connection with the value being zero ("such a prefix arg"). Just say: If zero then no truncation. If <=3D `eval...' then ___ (whatever is meant by "character format" printing). In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30 Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3'' From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jul 2018 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 32064@debbugs.gnu.org Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.15308278213397 (code B ref 32064); Thu, 05 Jul 2018 21:57:02 +0000 Received: (at 32064) by debbugs.gnu.org; 5 Jul 2018 21:57:01 +0000 Received: from localhost ([127.0.0.1]:48045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbCFJ-0000sj-2l for submit@debbugs.gnu.org; Thu, 05 Jul 2018 17:57:01 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:46872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbCFF-0000sU-E1 for 32064@debbugs.gnu.org; Thu, 05 Jul 2018 17:56:58 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w65LrnJW152526 for <32064@debbugs.gnu.org>; Thu, 5 Jul 2018 21:56:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=2uM1RbOU5CbX6mG2R60Vdx85za/MhvGKyjIIipgahXY=; b=AiEvKZgx2tjCBYFRNHEi0Vq/dqewdV5VOMziNEF45NGNW2yicVXFBmuJ0aeP6bVd8T0E +gO8MSy9gUrwxF96DmPue7za0ZyYWwPyzGdgzTgDWG45bmQrUp1yXDajcTACisHdCmWI 7bfQ/lAANg2Ndh5BYYpZ7Z5ivWFjPAkM9AONlyR+UyffSVGurb6ddDZq1iIPzWXFn9Jo wXFuPvo5rxm8vs5Lr8F2cv1M6+ATozN8tQSuXqYgxeu7z0ThcoMXxB4kMopGuohuGqg9 jnALKUEoKbZT69ayA4zjvceNJQPBvxr0OEFAC0CLbkf04tA3Ap9NJf6QMSyXGrZCnjVF 0A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2k0dnjqh2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <32064@debbugs.gnu.org>; Thu, 05 Jul 2018 21:56:51 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w65Luo6m015166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <32064@debbugs.gnu.org>; Thu, 5 Jul 2018 21:56:50 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w65Lunj2001855 for <32064@debbugs.gnu.org>; Thu, 5 Jul 2018 21:56:50 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 5 Jul 2018 14:56:48 -0700 (PDT) From: Drew Adams References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> In-Reply-To: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807050241 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Looking at `eval-expression-get-print-arguments' and the doc string for `ev= al-expression', things are a bit clearer. At least please incorporate some= thing like what is said for `eval-expression' in the doc of `eval-last-sexp= '.=20 But even the `eval-expression' doc is not very good for the description of = CHAR-PRINT-LIMIT. It's not true that "unless given a positive prefix argum= ent" a number value is printed in several... Try a prefix arg of -9, for in= stance. The doc of `eval-expression-get-print-arguments' says that it determines th= e prefix-arg behavior for `eval-last-sexp'. Is that true? The doc of `eval-expression-get-print-arguments' needs to specify the logic= of what it does, and that info needs to be included in the doc of `eval-ex= pression' and (if appropriate) the doc of `eval-last-sexp'. Or at least th= eir doc needs to point to such info. The doc string for `eval-expression-print-format' is not great either. It = says only what the result will "typically" look like. It needs to specify = what formats it outputs, under what conditions. It seems that this is the situation for `eval-expression-get-print-argument= s': No prefix arg : no insert, truncate, 127 - : no insert, truncate, 127 0 : insert, no truncate, 127 -1 : insert, truncate, biggest fixnum else : insert, truncate, nil Is that right? If so, the doc should spell that out. There's no way a user will guess this or get it easily from the current doc. And the various doc strings seem to suggest that the handling of the last a= rg, CHAR-PRINT-LIMIT by `eval-exprresion' is different from its handling by= `eval-last-sexp'. But is that true? This is all a confusing mess, I'm afraid. And the code (e.g. of `eval-last= -sexp' and its helper `elisp--eval-last-sexp') is not very clear either. From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 00:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Drew Adams Cc: 32064@debbugs.gnu.org Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.153083659831872 (code B ref 32064); Fri, 06 Jul 2018 00:24:02 +0000 Received: (at 32064) by debbugs.gnu.org; 6 Jul 2018 00:23:18 +0000 Received: from localhost ([127.0.0.1]:48086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbEWr-0008I0-Tu for submit@debbugs.gnu.org; Thu, 05 Jul 2018 20:23:18 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:55421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbEWp-0008Hm-PG for 32064@debbugs.gnu.org; Thu, 05 Jul 2018 20:23:16 -0400 Received: by mail-it0-f44.google.com with SMTP id 16-v6so14338530itl.5 for <32064@debbugs.gnu.org>; Thu, 05 Jul 2018 17:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2J6pzdTQSElrz5KE2lN9AUnx9kUjHgcbsNxuqlNUoqY=; b=UY4+l/Np2b6cVfYN8t51sz87Z20yxoFygDK0J+WjfMcHaI3oi2KnOPL4Ukl53W6mWo UZa7+NS6N7wB3SVvKAGBMrzqBOpyjt/8L6eNz4pvTNtGxIkQNVPXPipOiL438c72rPGZ zPWHifzIu57cIUsb9fp1UCHOGFyWpRNRAME/KWuNyYx2HJZCo4juUEWhObiwWHc1A2qi VKTwZXxD1mjfaR1SWuyDPt9Y6uYARfeFcKA98Ys7A89FvSHIzDhpsWMQzSiOEdFpH64b GYmdf9at5rugTtJg8513WUywku25FVexFMbyGIeGZ2z/OBz5cyFVkhHooaX7bdCBcBmX TJDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2J6pzdTQSElrz5KE2lN9AUnx9kUjHgcbsNxuqlNUoqY=; b=PtjixhIw+S7tvvbIVVMCCN8/RVA/AjC7R1bCunKzmvIMx5bcrOvehtJJgCUsrQ5x17 dQJ1VHC4WUk06WozX3IB/9QYvE37nIlNpgeeI71Rwu+7G6qDxcl13bztY3RkwmH8koYA NMZdA5f7+s7pLlal2BcUtYa1IsLt4650dAL2oc98sd70RflEoi/f2Zt5oqZ47SoChcpm wtdO/xe9qrLaqczEd+7MqxMPfrTW913pobAvnkl28tOnUJTLrpr6RlrJoBtiuF6AJgbM dU0SFNks85B7jWSxZKVS15ttMgKAPCnyPMa4NWZWPDkdXeoVTfYHDf0ZOHYEAGSvvjP3 0djQ== X-Gm-Message-State: APt69E1d99lgmi3WIW1KeuHqZdk/qToau+o+Xqf1s+W7OcBVXlfB2UFB HbwL/N1Y0MKqq3RV4F2wZ5WAzw== X-Google-Smtp-Source: AAOMgpfnFym/w0pZ6f89hu00HBI/Tl83sBW3iUZA6uAP3RII4TMw2mGc1GEytJIOSxvJamXkYcbHXQ== X-Received: by 2002:a24:e1c5:: with SMTP id n188-v6mr4531910ith.89.1530836590265; Thu, 05 Jul 2018 17:23:10 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 128-v6sm3907156ioo.78.2018.07.05.17.23.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Jul 2018 17:23:09 -0700 (PDT) From: Noam Postavsky References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> Date: Thu, 05 Jul 2018 20:23:08 -0400 In-Reply-To: (Drew Adams's message of "Thu, 5 Jul 2018 14:56:48 -0700 (PDT)") Message-ID: <87bmbldxg3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Drew Adams writes: > This is all a confusing mess, I'm afraid. And the code (e.g. of > `eval-last-sexp' and its helper `elisp--eval-last-sexp') is not very > clear either. I agree. I think the solution is to simplify the interface somewhat. As it stands, we're trying to cram a lot of functionality into the prefix argument, and the encoding is too difficult to remember (both in terms of implementing & documenting, as well as for using). Instead, we should have something like this: No prefix: echo with default formatting (like now) C-u: insert result into buffer, no alternate integer formatting (like now) C-u C-u: query user for detailed formatting options individually And that's it, no clever handling of 0 vs negative number vs `-', etc From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 09:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Drew Adams Cc: 32064@debbugs.gnu.org Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.153086966032646 (code B ref 32064); Fri, 06 Jul 2018 09:35:01 +0000 Received: (at 32064) by debbugs.gnu.org; 6 Jul 2018 09:34:20 +0000 Received: from localhost ([127.0.0.1]:48227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbN88-0008UU-2C for submit@debbugs.gnu.org; Fri, 06 Jul 2018 05:34:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbN86-0008UH-1V for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 05:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbN7x-0008B5-NG for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 05:34:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbN7x-0008AN-Jg; Fri, 06 Jul 2018 05:34:09 -0400 Received: from [176.228.60.248] (port=4675 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fbN7w-00085o-NX; Fri, 06 Jul 2018 05:34:09 -0400 Date: Fri, 06 Jul 2018 12:34:11 +0300 Message-Id: <83y3eolncc.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> (message from Drew Adams on Thu, 5 Jul 2018 13:15:16 -0700 (PDT)) References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Thu, 5 Jul 2018 13:15:16 -0700 (PDT) > From: Drew Adams > > The doc string was messed up a bit in Emacs 26, apparently for the fix > of bug #4118. It was also somewhat messed up in Emacs 25. > 1. Do not truncate. > 2. Print in additional formats. > > That's fine. But the Emacs 26+ version also says that with a ZERO prefix > arg ("such a prefix argument"), if the prefix arg is ALSO -1 > (impossible) or if "the integer" (what integer?) is less than or equal > to the value of `eval-expression-print-maximum-character', the > additional formats include "character". > > A character is not a format, so it's unclear what printing in format > "character" means. > > But the main problem with this is that it makes us try to understand a > prefix arg that is BOTH zero and -1, and it leaves us wondering what > "the integer" is that is tested against > `eval-expression-print-maximum-character' when the prefix arg is zero. > > If "the integer" is just the numeric prefix arg then the <= > `eval-expression-print-maximum-character' could be clear - but there > should be no connection with the value being zero ("such a prefix arg"). > Just say: If zero then no truncation. If <= `eval...' then ___ > (whatever is meant by "character format" printing). Thanks, I fixed the doc string on the emacs-26 branch to be both clear and correct. From unknown Sun Jun 22 04:00:01 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Drew Adams Subject: bug#32064: closed (Re: bug#32064: 26; doc string of `eval-last-sexp') Message-ID: References: <83wou8ln6q.fsf@gnu.org> <0d7bb132-057e-431e-a5fa-86e15b99879a@default> X-Gnu-PR-Message: they-closed 32064 X-Gnu-PR-Package: emacs Reply-To: 32064@debbugs.gnu.org Date: Fri, 06 Jul 2018 09:38:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1530869882-504-1" This is a multi-part message in MIME format... ------------=_1530869882-504-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #32064: 26; doc string of `eval-last-sexp' which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 32064@debbugs.gnu.org. --=20 32064: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D32064 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1530869882-504-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 32064-done) by debbugs.gnu.org; 6 Jul 2018 09:37:43 +0000 Received: from localhost ([127.0.0.1]:48231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbNBO-00007e-Io for submit@debbugs.gnu.org; Fri, 06 Jul 2018 05:37:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbNBM-00007O-Ff for 32064-done@debbugs.gnu.org; Fri, 06 Jul 2018 05:37:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbNBE-0008Id-3V for 32064-done@debbugs.gnu.org; Fri, 06 Jul 2018 05:37:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbNBD-0008I2-Uv; Fri, 06 Jul 2018 05:37:32 -0400 Received: from [176.228.60.248] (port=4878 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fbNBD-0003zU-9p; Fri, 06 Jul 2018 05:37:31 -0400 Date: Fri, 06 Jul 2018 12:37:33 +0300 Message-Id: <83wou8ln6q.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Thu, 5 Jul 2018 14:56:48 -0700 (PDT)) Subject: Re: bug#32064: 26; doc string of `eval-last-sexp' References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32064-done Cc: 32064-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Thu, 5 Jul 2018 14:56:48 -0700 (PDT) > From: Drew Adams > > Looking at `eval-expression-get-print-arguments' and the doc string for `eval-expression', things are a bit clearer. At least please incorporate something like what is said for `eval-expression' in the doc of `eval-last-sexp'. I preferred to fix eval-last-sexp in a somewhat different way. > But even the `eval-expression' doc is not very good for the description of CHAR-PRINT-LIMIT. It's not true that "unless given a positive prefix argument" a number value is printed in several... Try a prefix arg of -9, for instance. Right, fixed. > The doc of `eval-expression-get-print-arguments' says that it determines the prefix-arg behavior for `eval-last-sexp'. Is that true? Yes, AFAICT. > The doc of `eval-expression-get-print-arguments' needs to specify the logic of what it does, and that info needs to be included in the doc of `eval-expression' and (if appropriate) the doc of `eval-last-sexp'. Or at least their doc needs to point to such info. I see no reason to point to eval-expression-get-print-arguments in the doc string of eval-last-sexp. If someone reads the code of eval-last-sexp, they will see the call, and will look up the function. > The doc string for `eval-expression-print-format' is not great either. It says only what the result will "typically" look like. It needs to specify what formats it outputs, under what conditions. I don't see the need, as the code is quite self-describing. > And the various doc strings seem to suggest that the handling of the last arg, CHAR-PRINT-LIMIT by `eval-exprresion' is different from its handling by `eval-last-sexp'. But is that true? No, it is not true. Fixed. I'm closing the bug, thanks for pointing out these blunders. ------------=_1530869882-504-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Jul 2018 20:15:40 +0000 Received: from localhost ([127.0.0.1]:48011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbAfE-00052J-9Z for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbAfA-000525-UW for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbAf4-0007iu-Bh for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbAf4-0007if-35 for submit@debbugs.gnu.org; Thu, 05 Jul 2018 16:15:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbAf2-0007X6-Mz for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbAew-0007ek-QR for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:26 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbAew-0007ds-GE for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2018 16:15:22 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w65KESKN086558 for ; Thu, 5 Jul 2018 20:15:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=vwCAY7jPmojt6P7xxa+vDz758WEh7IKzCdgSyxgxByQ=; b=BQZ9cDUuB5U7i3UWHKVRSLup4MaGfYzzCortoNT3C5Ies8vf8H7bNtyGz8W0PP2WzKPT H1hVUljbpVlC8kcXbXEkhm9cbOLDfXbGELn95DCcurh2EEPsL39zqQYxKYVSmP8/d2P9 igP2bUiVvUOzMGdrSURbVGJp3Zj8mhAvXrKLoyhiFMtw8usp/W94HILHsw51xUcwOWpk G9JK3SPOJEL0X/wRar81DV9C9yS0YvDnU8lpaNIR1l3QDevzjMf3apKWazwtiX8A2KSp ghEJoeC5t/eBEZVYjBW+V2FTMHkYP46Omjvun1o/8zFZcjfVG7W9mSka24Ur7H5Cg5K5 gg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2k0dnjqa7x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 05 Jul 2018 20:15:19 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w65KFIUb017270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 5 Jul 2018 20:15:19 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w65KFHGM007008 for ; Thu, 5 Jul 2018 20:15:18 GMT MIME-Version: 1.0 Message-ID: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> Date: Thu, 5 Jul 2018 13:15:16 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 26; doc string of `eval-last-sexp' X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807050224 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The doc string was messed up a bit in Emacs 26, apparently for the fix of bug #4118. >From this, which makes sense: Normally, this function truncates long output according to the value of the variables `eval-expression-print-length' and `eval-expression-print-level'. With a prefix argument of zero, however, there is no such truncation. Such a prefix argument also causes integers to be printed in several additional formats (octal, hexadecimal, and character). The text was changed to this, which does not make sense at all: Normally, this function truncates long output according to the value of the variables 'eval-expression-print-length' and 'eval-expression-print-level'. With a prefix argument of zero, however, there is no such truncation. Such a prefix argument also causes integers to be printed in several additional formats (octal, hexadecimal, and character when the prefix argument is -1 or the integer is 'eval-expression-print-maximum-character' or less). Both old and new say that with a prefix arg of ZERO ("such a prefix argument") the behavior is to do both of these things: 1. Do not truncate. 2. Print in additional formats. That's fine. But the Emacs 26+ version also says that with a ZERO prefix arg ("such a prefix argument"), if the prefix arg is ALSO -1 (impossible) or if "the integer" (what integer?) is less than or equal to the value of `eval-expression-print-maximum-character', the additional formats include "character". A character is not a format, so it's unclear what printing in format "character" means. But the main problem with this is that it makes us try to understand a prefix arg that is BOTH zero and -1, and it leaves us wondering what "the integer" is that is tested against `eval-expression-print-maximum-character' when the prefix arg is zero. If "the integer" is just the numeric prefix arg then the <=3D `eval-expression-print-maximum-character' could be clear - but there should be no connection with the value being zero ("such a prefix arg"). Just say: If zero then no truncation. If <=3D `eval...' then ___ (whatever is meant by "character format" printing). In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30 Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3'' ------------=_1530869882-504-1-- From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 09:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 32064@debbugs.gnu.org, drew.adams@oracle.com Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.1530869967662 (code B ref 32064); Fri, 06 Jul 2018 09:40:01 +0000 Received: (at 32064) by debbugs.gnu.org; 6 Jul 2018 09:39:27 +0000 Received: from localhost ([127.0.0.1]:48237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbND5-0000Ab-2n for submit@debbugs.gnu.org; Fri, 06 Jul 2018 05:39:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbND3-0000AP-ET for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 05:39:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbNCv-0007HM-4Q for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 05:39:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbNCv-0007Gc-0T; Fri, 06 Jul 2018 05:39:17 -0400 Received: from [176.228.60.248] (port=4986 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fbNCu-0004AH-Dr; Fri, 06 Jul 2018 05:39:16 -0400 Date: Fri, 06 Jul 2018 12:39:18 +0300 Message-Id: <83va9sln3t.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87bmbldxg3.fsf@gmail.com> (message from Noam Postavsky on Thu, 05 Jul 2018 20:23:08 -0400) References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> <87bmbldxg3.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Noam Postavsky > Date: Thu, 05 Jul 2018 20:23:08 -0400 > Cc: 32064@debbugs.gnu.org > > Drew Adams writes: > > > This is all a confusing mess, I'm afraid. And the code (e.g. of > > `eval-last-sexp' and its helper `elisp--eval-last-sexp') is not very > > clear either. > > I agree. I think the solution is to simplify the interface somewhat. These additional features weer added just recently, so I see no reason why we should remove them now. Certainly not because the doc string needs to be fixed. > As it stands, we're trying to cram a lot of functionality into the > prefix argument, and the encoding is too difficult to remember (both in > terms of implementing & documenting, as well as for using). I had no difficulty bringing the doc string in line with the implementation, please take a look. From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 32064@debbugs.gnu.org, drew.adams@oracle.com Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.153087765919731 (code B ref 32064); Fri, 06 Jul 2018 11:48:01 +0000 Received: (at 32064) by debbugs.gnu.org; 6 Jul 2018 11:47:39 +0000 Received: from localhost ([127.0.0.1]:48265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbPD9-00058A-CA for submit@debbugs.gnu.org; Fri, 06 Jul 2018 07:47:39 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:38479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbPD8-00057y-F7 for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 07:47:38 -0400 Received: by mail-it0-f50.google.com with SMTP id v71-v6so6167832itb.3 for <32064@debbugs.gnu.org>; Fri, 06 Jul 2018 04:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/T1K32+l3o2dWpENMYfi0bXhixoU51jtJ4UuYh0uF9Y=; b=UzNQPtExqry0JUdJquapgb5GOjQdOVLKFlPEN8LavIixNccEBPkPcnYCyxZczEGP0W CvY+jFEnpc+o8DY3N6t+JUUoEzPRQa6Gul+7InizsgZeOk69nhESuQIfxvCQSi6EguLT 4sgPgbbMzRp/xSIvc9eK4PhUSto4Gu6RCZXe+87/LLJHD2GppR7Mm1yr9uJaJth5yQQB 5Uabobk2SNmWS2zpShaxtfJAAWviv8akRl6HI4ikwI003Yz5p9lgqeZTVGICSxuDw9lZ F0lE9DxmCrm7KGoY/TnOwmAmoaA4+tWRsgKCHRI5zBJ8TB0qd/fTFPykK6MkcHTArjNv p6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/T1K32+l3o2dWpENMYfi0bXhixoU51jtJ4UuYh0uF9Y=; b=PgzbNG7roffj/8/ghOzMDfjSutPbenP7RBN5fa2n1X0Un8IZzzs7PSaPmum9WgOhv5 l8rHBBU7G2PMRjrlSSOkBOxlAJMvg5FsGgbvhL2gHxaOsZlImesl30HOOFyWNy77BlI/ p5fodJDCxLeoIEE2mg+kWv8rtNHE8uwe+bt7Fp9ZRUi+fHBWsKBUJDhC6xAx0pQrlxVm A2yA9YXDMR688F6VVAVRWrTXZM6f/ObPL8v7HJS01vVyU8BEgl+q+yktdpHvqT4mbWIX HSjMS6R+PV3ed4rV5UsMDF7YrXcjMe76mkLG2yi+nYAdQcxMHEEjIOAfljvEbIb/npt6 QrWw== X-Gm-Message-State: APt69E3DpZ7P2HsFZB7FuIrVfZIWXseo/O8IGOcohVM1o8HjLEddWCd7 ZXxnE41bVa6vphoHB8Ea8tQ= X-Google-Smtp-Source: AAOMgpfcI90Eiwrg8araQwToXpyLDLl7VX91cb7gGYOaNJisZbPaRuzJL8PN1yYeFcTR8c8jngMrCQ== X-Received: by 2002:a24:7a84:: with SMTP id a126-v6mr7704800itc.111.1530877652638; Fri, 06 Jul 2018 04:47:32 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d11-v6sm1915872itb.6.2018.07.06.04.47.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jul 2018 04:47:31 -0700 (PDT) From: Noam Postavsky References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> <87bmbldxg3.fsf@gmail.com> <83va9sln3t.fsf@gnu.org> Date: Fri, 06 Jul 2018 07:47:29 -0400 In-Reply-To: <83va9sln3t.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Jul 2018 12:39:18 +0300") Message-ID: <877em8egby.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> I agree. I think the solution is to simplify the interface somewhat. > > These additional features weer added just recently, so I see no reason > why we should remove them now. Certainly not because the doc string > needs to be fixed. >> As it stands, we're trying to cram a lot of functionality into the >> prefix argument, and the encoding is too difficult to remember (both in >> terms of implementing & documenting, as well as for using). > > I had no difficulty bringing the doc string in line with the > implementation, please take a look. Thanks, I think that fixes all the typos and mistaken descriptions. I am still of the opinion that the prefix args apart from C-u are too complicated to be of much use. But we can wait a bit longer and maybe the next formatting feature will be the straw that breaks the proverbial camel's back. From unknown Sun Jun 22 04:00:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32064: 26; doc string of `eval-last-sexp' Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky , Eli Zaretskii Cc: 32064@debbugs.gnu.org Received: via spool by 32064-submit@debbugs.gnu.org id=B32064.153089973420897 (code B ref 32064); Fri, 06 Jul 2018 17:56:02 +0000 Received: (at 32064) by debbugs.gnu.org; 6 Jul 2018 17:55:34 +0000 Received: from localhost ([127.0.0.1]:48816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUxC-0005Qx-0J for submit@debbugs.gnu.org; Fri, 06 Jul 2018 13:55:34 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:46438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUxA-0005Ql-Lc for 32064@debbugs.gnu.org; Fri, 06 Jul 2018 13:55:33 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w66Hs5I4188631; Fri, 6 Jul 2018 17:55:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Us1Eu3cezwi2A9E5KFDtDG2tioqMi06Fkr+iytLsDL0=; b=Ltq8aO8AeXavVucr5+In4yBuQhrlnX/mqZdk2YM9u7h/GlOVAlJpqDYIP7ajnUL9CD7f FpQCWpocb/LVtvLUP27L+/BhhwsnCkgNN3D+JHXqTetGSyqWRJFwP7NIfXGKkAndB6Sl 52VUYIfczPhQOHmcTC/Y+YC4Qr3dwjTIvb8Q0BbyINF5lIYAAzL7nFuTVl+cbm/HAWev QR3PtAtNkLETbw4FKSoEi4Z+wdBqi0eybyRI8bokfcU0TDuFizL2FnBMxkb9JBhKOCG/ rp9juHHwW9HAOg1ul39wN8bQuxBIrM1aLYaLzQ1t3gPa1e6b7KW/j/7flj3vVztfowvN bg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2k0dnjtjgx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Jul 2018 17:55:26 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w66HtPiQ007726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jul 2018 17:55:25 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w66HtNd8007787; Fri, 6 Jul 2018 17:55:24 GMT MIME-Version: 1.0 Message-ID: <128a3332-b4cf-4e6b-b435-8215fee9928d@default> Date: Fri, 6 Jul 2018 10:55:19 -0700 (PDT) From: Drew Adams References: <0d7bb132-057e-431e-a5fa-86e15b99879a@default> <87bmbldxg3.fsf@gmail.com> <83va9sln3t.fsf@gnu.org> <877em8egby.fsf@gmail.com> In-Reply-To: <877em8egby.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060199 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > >> I agree. I think the solution is to simplify the interface somewhat. > > > > These additional features weer added just recently, so I see no reason > > why we should remove them now. Certainly not because the doc string > > needs to be fixed. >=20 > >> As it stands, we're trying to cram a lot of functionality into the > >> prefix argument, and the encoding is too difficult to remember (both > >> in terms of implementing & documenting, as well as for using). > > > > I had no difficulty bringing the doc string in line with the > > implementation, please take a look. >=20 > Thanks, I think that fixes all the typos and mistaken descriptions. I > am still of the opinion that the prefix args apart from C-u are too > complicated to be of much use. But we can wait a bit longer and maybe > the next formatting feature will be the straw that breaks the proverbial > camel's back. Thanks for the doc string corrections. I agree with Noam that the behavior is not great. It's not very user-friendly or very useful. It should be rethought, even at the cost of backward incompatibility. Perhaps a new, replacement command should be added and given the key binding, keeping the old command available for whoever wants to restore its binding. I started to write a mail to emacs-devel about this yesterday, but I dropped it, at least for now. FWIW, I think it would be good if the various Lisp evaluation commands acted more or less similarly - e.g., wrt a prefix arg. There are several, including: `eval-last-sexp', `eval-print-last-sexp', `pp-eval-last-sexp', `eval-expression', `pp-eval-expression', `eval-region', `eval-defun', `eval-buffer', and `lisp-eval-defun' Something I've been thinking about is the need I have to evaluate Lisp code with `lexical-binding' optionally non-nil. I know that the expectation of some (maybe all) is that Emacs will eventually make non-nil the default value of `lexical-binding', or even remove the variable altogether and make binding lexical by default (the same effect as having the variable default to non-nil everywhere, but with no ability to change the behavior to what nil gives). FWIW, I have no problem with that, as long as dynamic binding is still available - exactly the situation of Common Lisp, and _not_ the situation of Scheme. Still, it is now, and it can remain in the future, useful to be able to grab a bit of code from anywhere and evaluate it optionally with `lexical-binding' in effect. I sometimes copy Lisp code from files I'm working on to another Lisp buffer, to modify and experiment with. The buffer I copy it to might serve for code that comes from buffers with nil and non-nil `lexical-binding'. And it might not be a file buffer, or I might not have bothered to add a local-variable declaration for it. E.g. `C-x 4 f foo.el', for a non-existent file `foo.el', does not default to non-nil `lexical-binding' (yes, I could make it do that). When I want to evaluate bits of code in such a test buffer, it won't do to just use `eval-region' or `eval-expression' or `eval-last-sexp'. Depending on whether the code to be eval'd _depends on_ lexical binding, I need to first set `lexical-binding' as needed, perhaps temporarily, for the whole buffer. I'd prefer to have the evaluation commands take care of this. I can of course define separate commands for lexical binding, like so: (defun eval-region-lexical (start end &optional printflag read-function) "..." (interactive "r") (let ((lexical-binding t)) (eval-region start end printflag read-function))) But it would be handy if the regular commands would let me provide a prefix arg to get that behavior. E.g.: (defun eval-region (start end &optional printflag read-function lexicalp) "..." (interactive "r\ni\ni\nP") (let ((lexical-binding (if lexicalp t lexical-binding))) (eval-region start end printflag read-function))) That would work for `eval-region', because it currently defines no prefix-arg behavior. But for the other eval commands things are less simple. They already use prefix args to the max (too much). Like Noam, I'd argue that the prefix arg behavior for some of them is far too complex, if not tricky. The resulting doc is consequently pretty much a mess. Can we come up with something better? Maybe there needs to be more than one command for some of these things that are currently combined via prefix args (again, something that Noam too suggested)? Or maybe some better combinations can be found? You'll note that I included the `pp-eval-*' commands in the list above. I bind (a variant of) `pp-eval-expression' to `M-:', for instance. I'd like `pp-eval-*' commands to also share in a reflection about better and more consistent prefix-arg behavior. --- FWIW, my variant of `pp-eval-expression' does the following. I mention it for the info about prefix-arg behavior. IOW, I realize that different eval commands can have different uses for a prefix arg. Still, some more consistency, and less complexity, than now would help. - Read with completion, using `pp-read-expression-map', which is like `read-expression-map' but with some Emacs-Lisp key bindings. - Respect option `eval-expression-debug-on-error'. - With no prefix arg, respect option `pp-max-tooltip-size'. If a tooltip is not used then if the value fits on one line (frame width) show it in the echo area. Otherwise, show it in buffer *Pp Eval Output*'. - With a zero prefix arg, swap the use of a tooltip according to `pp-max-tooltip-size': if that option is `nil' then use a tooltip; if non-`nil' then do not use a tooltip. - With non-zero prefix arg, insert the value into the current buffer at point. With a negative prefix arg, if the value is a string then insert it without enclosing double-quotes (").