From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: The *Warnings* buffer and undo Date: Wed, 28 Mar 2007 16:52:57 -0400 Message-ID: References: <460583AD.7010002@gmail.com> <85abxxw46j.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175115324 5283 80.91.229.12 (28 Mar 2007 20:55:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2007 20:55:24 +0000 (UTC) Cc: "Lennart Borgman \(gmail\)" , rms@gnu.org, emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 28 22:55:15 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 1HWfAo-00048b-1n for ged-emacs-devel@m.gmane.org; Wed, 28 Mar 2007 22:55:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWfDI-0000jF-56 for ged-emacs-devel@m.gmane.org; Wed, 28 Mar 2007 15:57:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HWfDE-0000g4-Ct for emacs-devel@gnu.org; Wed, 28 Mar 2007 16:57:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HWfDD-0000fN-Uh for emacs-devel@gnu.org; Wed, 28 Mar 2007 16:57:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWfDD-0000ey-OR for emacs-devel@gnu.org; Wed, 28 Mar 2007 15:57:43 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HWfAh-0003yi-Tk for emacs-devel@gnu.org; Wed, 28 Mar 2007 16:55:08 -0400 Original-Received: from [127.0.0.1] (helo=localhost) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HWf8b-0006UG-Lh; Wed, 28 Mar 2007 16:52:57 -0400 X-Spook: USDOJ threat nitrate JUWTF red noise broadside X-Ran: 2%l3H:&"c`AdWkdO$N867?{,Nh%/$IK^N@mF&B'c:EyzNe>HQR=E^E5:Tm3K.ZU8iHcIT) X-Hue: magenta X-Attribution: GM In-Reply-To: <85abxxw46j.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 28 Mar 2007 21:36:52 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:68728 Archived-At: 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