From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Barzilay Newsgroups: gmane.emacs.bugs Subject: bug#4118: 23.1; eval-last-sexp-print-value is inconvenient Date: Thu, 13 Aug 2009 21:25:17 -0400 Message-ID: <19076.48381.916404.208797@winooski.ccs.neu.edu> References: <19073.20002.692770.552510@winooski.ccs.neu.edu> <87ocqkfxa5.fsf@mail.jurta.org> <19075.27103.685992.984191@winooski.ccs.neu.edu> <87fxbvp9e5.fsf@mail.jurta.org> Reply-To: Eli Barzilay , 4118@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250214434 28084 80.91.229.12 (14 Aug 2009 01:47:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Aug 2009 01:47:14 +0000 (UTC) Cc: 4118@emacsbugs.donarmstrong.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 14 03:47:06 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mblso-0003E5-EJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Aug 2009 03:47:06 +0200 Original-Received: from localhost ([127.0.0.1]:50308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mblsn-0005h7-Dk for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2009 21:47:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mblsg-0005eN-Fm for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 21:46:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mblsb-0005WE-6c for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 21:46:57 -0400 Original-Received: from [199.232.76.173] (port=57848 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mblsb-0005Vs-0K for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 21:46:53 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52677) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MblsZ-0002r3-Rp for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 21:46:52 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7E1knZO025772; Thu, 13 Aug 2009 18:46:49 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7E1U3NO023066; Thu, 13 Aug 2009 18:30:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Eli Barzilay Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Aug 2009 01:30:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4118 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4118-submit@emacsbugs.donarmstrong.com id=B4118.125021312022566 (code B ref 4118); Fri, 14 Aug 2009 01:30:03 +0000 Original-Received: (at 4118) by emacsbugs.donarmstrong.com; 14 Aug 2009 01:25:20 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7E1PIZq022563 for <4118@emacsbugs.donarmstrong.com>; Thu, 13 Aug 2009 18:25:19 -0700 Original-Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1MblXh-00004u-Tt; Thu, 13 Aug 2009 21:25:17 -0400 In-Reply-To: <87fxbvp9e5.fsf@mail.jurta.org> X-Mailer: VM 7.19 under Emacs 22.1.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 13 Aug 2009 21:46:57 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30170 Archived-At: On Aug 14, Juri Linkov wrote: > >> But it inserts other representations only when you type `C-x C-e' twice. > >> Do you mean you don't want this after the second `C-x C-e' key press? > > > > Hmm, I see that the reason for what I've seen is that I'm using it > > indirectly through my own function, and for some reason > > `eval-expression-print-format' decides whether to do its thing based > > on the current command. This looks like an odd interface... A better > > and more consistent interface seems to me to always print the extra > > information unless it goes into a buffer -- something like: > > > > (defun eval-expression-print-format (value) > > ... > > (if (and (integerp value) (not (bufferp standard-output))) > > ...)) > > The reason not to print the extra information on the first > invocation of `eval-last-sexp' is the following. Most often users > want to see the integer result of the evaluated expression, but the > extra information also contains a character representation of this > integer that might print some unrelated character that might load > some weird fonts the user doesn't want to load. In that case the obvious way to do this is to not print the character form if it requires such a font. If this is not easy to do, then making it work only for ASCII seems better than the current weird behavior. (The reason I consider it weird is that I managed to use Emacs for more than 15 years without noticing it.) > > But you seem to suggest that there are practical uses to get that > > extra stuff into the buffer? I don't see any occasion that would > > make it desirable... > > When the current buffer contains an integer, typing `C-x C-e' twice > inserts it to the same buffer as a character. However, this is not > too convenient, so I'd like to improve this interface. The main point (IMO) of making it consistent is keyboard macros, and in that case, if you want the character, then it's easy to just wrap an (insert ...) around the expression. Using it to insert the character and then removing all the preceding text is much more difficult for that. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!