emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undo in loaddefs.el buffer


From: Luc Teirlinck
Subject: Re: undo in loaddefs.el buffer
Date: Tue, 21 Dec 2004 18:17:59 -0600 (CST)

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.")
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]