From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: undo in loaddefs.el buffer Date: Tue, 21 Dec 2004 18:17:59 -0600 (CST) Message-ID: <200412220017.iBM0Hx108071@raven.dms.auburn.edu> References: <200412211414.iBLEEZ903426@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1103674999 22818 80.91.229.6 (22 Dec 2004 00:23:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Dec 2004 00:23:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 22 01:23:13 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CguHZ-000527-00 for ; Wed, 22 Dec 2004 01:23:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CguS5-0001D0-Gg for ged-emacs-devel@m.gmane.org; Tue, 21 Dec 2004 19:34:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CguRS-0001Cr-2s for emacs-devel@gnu.org; Tue, 21 Dec 2004 19:33:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CguRQ-0001Cf-VF for emacs-devel@gnu.org; Tue, 21 Dec 2004 19:33:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CguRQ-0001Cb-9n for emacs-devel@gnu.org; Tue, 21 Dec 2004 19:33:24 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CguEl-0005fd-TE for emacs-devel@gnu.org; Tue, 21 Dec 2004 19:20:20 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id iBM0KJFu024762; Tue, 21 Dec 2004 18:20:19 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id iBM0Hx108071; Tue, 21 Dec 2004 18:17:59 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: ihs_4664@yahoo.com In-reply-to: (message from Kevin Rodgers on Tue, 21 Dec 2004 14:57:35 -0700) 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: main.gmane.org gmane.emacs.devel:31316 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31316 Kevin Rodgers wrote: Is there any reason for emacs, when invoked non-interactively as by `make bootstrap`, to query the user? The new function `undo-outer-limit-truncate' does that. There definitely are situations where it might be appropriate to query the user when running in batch mode. That is why `(elisp)Batch Mode' says: Similarly, input that would normally come from the minibuffer is read from the standard input descriptor. That should however probably not happen during bootstrapping. I believe that the trivial mini-patch I sent earlier makes sense regardless of any problems with bootstrapping. Maybe there are actually two unrelated bugs (or misfeatures) here. It seems that enabling undo does not make much sense when invoked non-interactively. But the question is what undo-outer-limit-truncate should do if the person running `emacs --batch' (maybe accidentally) enabled it anyway. Maybe the following patch to simple.el makes sense in addition to the one for autoload.el. (It sets buffer-undo-list to nil without querying in the given situation.) The two compiler defvars seem needed regardless. I just point them out because the compiler complained about them while compiling the other change. ===File ~/simple.el-diff==================================== *** simple.el 21 Dec 2004 07:49:59 -0600 1.673 --- simple.el 21 Dec 2004 16:30:23 -0600 *************** *** 270,275 **** --- 270,276 ---- ;;; Internal variable for `next-error-follow-mode-post-command-hook'. (defvar next-error-follow-last-line nil) + (defvar compilation-current-error) (define-minor-mode next-error-follow-minor-mode "Minor mode for compilation, occur and diff modes. *************** *** 874,879 **** --- 875,882 ---- :type 'boolean :version "21.1") + (defvar edebug-active) + (defun eval-expression-print-format (value) "Format VALUE as a result of evaluated expression. Return a formatted string which is displayed in the echo area *************** *** 1491,1500 **** ;; so it had better not do a lot of consing. (setq undo-outer-limit-function 'undo-outer-limit-truncate) (defun undo-outer-limit-truncate (size) ! (if (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " ! (buffer-name) size)) ! (progn (setq buffer-undo-list nil) t) ! nil)) (defvar shell-command-history nil "History list for some commands that read shell commands.") --- 1494,1505 ---- ;; so it had better not do a lot of consing. (setq undo-outer-limit-function 'undo-outer-limit-truncate) (defun undo-outer-limit-truncate (size) ! (if (or noninteractive ! (yes-or-no-p ! (format "Buffer %s undo info is %d bytes long; discard it? " ! (buffer-name) size)) ! (progn (setq buffer-undo-list nil) t)) ! nil)) (defvar shell-command-history nil "History list for some commands that read shell commands.") ============================================================