From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: pp-eval-expression enhancements Date: Sun, 22 Jul 2007 16:42:58 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185147907 6622 80.91.229.12 (22 Jul 2007 23:45:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2007 23:45:07 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 23 01:45:06 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ICl6o-00017l-0t for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2007 01:45:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICl6n-0001Dz-GJ for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2007 19:45:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ICl6k-0001Du-DG for emacs-devel@gnu.org; Sun, 22 Jul 2007 19:45:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ICl6j-0001Di-0p for emacs-devel@gnu.org; Sun, 22 Jul 2007 19:45:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICl6i-0001Df-OP for emacs-devel@gnu.org; Sun, 22 Jul 2007 19:45:00 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ICl6i-0005ds-AQ for emacs-devel@gnu.org; Sun, 22 Jul 2007 19:45:00 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6MNivY3010097 for ; Sun, 22 Jul 2007 18:44:58 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l6MN0Qt9008848 for ; Sun, 22 Jul 2007 17:44:57 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-112.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3059430941185147786; Sun, 22 Jul 2007 16:43:06 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75340 Archived-At: Any news on this? > From: Drew Adams Sent: Tuesday, July 10, 2007 3:55 PM > This patch improves `pp-eval-expression' in these ways: > > * Provides a progress message. > * Does not make buffer *Pp Eval Output* read-only. > * Inhibits emacs-lisp-mode-hook and change-major-mode-hook > when entering emacs-lisp-mode. > * Fontifies buffer *Pp Eval Output*. > > I often want to use *Pp Eval Output* as more or less a normal Emacs-Lisp > buffer: killing, yanking, evaluating. I see no reason to make it > read-only. It should probably also have undo, but I'll leave that to > someone else's patch. > > I also propose that we use `M-:', the binding of `eval-expression', for > `pp-eval-expression' instead. Why would we not want to do that? > To try that out, do this: > > (substitute-key-definition 'eval-expression 'pp-eval-expression > global-map) > > --------------8<--------------------- > > *** pp-CVS-2007-07-10.el Tue Jul 10 15:37:26 2007 > --- pp-CVS-patched-2007-07-10.el Tue Jul 10 15:40:38 2007 > *************** > *** 103,108 **** > --- 103,109 ---- > (interactive > (list (read-from-minibuffer "Eval: " nil read-expression-map t > 'read-expression-history))) > + (message "Evaluating...") > (setq values (cons (eval expression) values)) > (let* ((old-show-function temp-buffer-show-function) > ;; Use this function to display the buffer. > *************** > *** 126,139 **** > (progn > (select-window window) > (run-hooks 'temp-buffer-show-hook)) > ! (select-window old-selected))) > ! (message "%s" (buffer-substring (point-min) (point))) > ! )))))) > ! (with-output-to-temp-buffer "*Pp Eval Output*" > ! (pp (car values)) > ! (with-current-buffer standard-output > ! (emacs-lisp-mode) > ! (set (make-local-variable 'font-lock-verbose) nil))))) > > ;;;###autoload > (defun pp-eval-last-sexp (arg) > --- 127,144 ---- > (progn > (select-window window) > (run-hooks 'temp-buffer-show-hook)) > ! (select-window old-selected) > ! (message "Evaluating...done. See buffer *Pp Eval > Output*."))) > ! (message "%s" (buffer-substring (point-min) > (point))))))))) > ! (with-output-to-temp-buffer "*Pp Eval Output*" (pp (car values))) > ! (save-excursion > ! (set-buffer "*Pp Eval Output*") > ! (setq buffer-read-only nil) > ! (let ((emacs-lisp-mode-hook nil) > ! (change-major-mode-hook nil)) > ! (emacs-lisp-mode)) > ! (set (make-local-variable 'font-lock-verbose) nil) > ! (font-lock-fontify-buffer)))) > > ;;;###autoload > (defun pp-eval-last-sexp (arg)