unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>,
	rms@gnu.org, emacs-devel@gnu.org
Subject: Re: The *Warnings* buffer and undo
Date: Wed, 28 Mar 2007 16:52:57 -0400	[thread overview]
Message-ID: <r5r6r9nl92.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <85abxxw46j.fsf@lola.goethe.zz> (David Kastrup's message of "Wed,  28 Mar 2007 21:36:52 +0200")

David Kastrup wrote:

> I don't think it is a good idea to let-bind buffer-undo-list here:
> instead it should generally be set to t in the buffer.

Maybe the following is better then. It would seem odd to me if
display-warning permanently disabled undo in pre-existing buffers.


*** warnings.el	21 Jan 2007 02:44:23 -0000	1.11
--- warnings.el	28 Mar 2007 20:49:50 -0000
***************
*** 218,225 ****
  	      but raise suspicion of a possible problem.
  :debug     -- info for debugging only.
  
! BUFFER-NAME, if specified, is the name of the buffer for logging the
! warning.  By default, it is `*Warnings*'.
  
  See the `warnings' custom group for user customization features.
  
--- 218,226 ----
  	      but raise suspicion of a possible problem.
  :debug     -- info for debugging only.
  
! BUFFER-NAME, if specified, is the name of the buffer for logging
! the warning.  By default, it is `*Warnings*'.  If this function
! has to create the buffer, it disables undo in the buffer.
  
  See the `warnings' custom group for user customization features.
  
***************
*** 227,242 ****
  `warning-fill-prefix' for additional programming features."
    (unless level
      (setq level :warning))
    (if (assq level warning-level-aliases)
        (setq level (cdr (assq level warning-level-aliases))))
    (or (< (warning-numeric-level level)
           (warning-numeric-level warning-minimum-log-level))
        (warning-suppress-p type warning-suppress-log-types)
        (let* ((typename (if (consp type) (car type) type))
! 	     (buffer (get-buffer-create (or buffer-name "*Warnings*")))
  	     (level-info (assq level warning-levels))
  	     start end)
  	(with-current-buffer buffer
  	  (goto-char (point-max))
  	  (when (and warning-series (symbolp warning-series))
  	    (setq warning-series
--- 228,249 ----
  `warning-fill-prefix' for additional programming features."
    (unless level
      (setq level :warning))
+   (unless buffer-name
+     (setq buffer-name "*Warnings*"))
    (if (assq level warning-level-aliases)
        (setq level (cdr (assq level warning-level-aliases))))
    (or (< (warning-numeric-level level)
           (warning-numeric-level warning-minimum-log-level))
        (warning-suppress-p type warning-suppress-log-types)
        (let* ((typename (if (consp type) (car type) type))
!              (old (get-buffer buffer-name))
! 	     (buffer (get-buffer-create buffer-name))
  	     (level-info (assq level warning-levels))
  	     start end)
  	(with-current-buffer buffer
+           ;; If we created the buffer, disable undo.
+           (unless old
+             (setq buffer-undo-list t))
  	  (goto-char (point-max))
  	  (when (and warning-series (symbolp warning-series))
  	    (setq warning-series

  reply	other threads:[~2007-03-28 20:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 20:01 The *Warnings* buffer and undo Lennart Borgman (gmail)
2007-03-25 17:27 ` Richard Stallman
2007-03-28  0:47   ` Glenn Morris
2007-03-28 19:36     ` David Kastrup
2007-03-28 20:52       ` Glenn Morris [this message]
2007-03-29 17:59       ` Richard Stallman
2007-03-29 18:35         ` David Kastrup
2007-03-30 12:42           ` Richard Stallman
2007-03-30 19:18             ` Glenn Morris
2007-03-30 19:53               ` Lennart Borgman (gmail)
2007-03-31  7:20                 ` Richard Stallman
2007-03-31 19:41                   ` Glenn Morris
2007-03-31 23:21                     ` Richard Stallman
2007-03-29 22:07         ` Miles Bader
2007-03-30 21:23           ` Richard Stallman
2007-03-30 21:45             ` Glenn Morris
2007-03-30 22:50             ` Miles Bader
2007-03-31 20:43               ` Richard Stallman
2007-04-01  0:22                 ` Miles Bader
2007-04-01  0:44                   ` Miles Bader
2007-03-29 15:32     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=r5r6r9nl92.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).