From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: How to show *Warnings* buffer at startup time? Date: Wed, 18 Mar 2009 22:22:21 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1237382559 4571 80.91.229.12 (18 Mar 2009 13:22:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Mar 2009 13:22:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 18 14:23:56 2009 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 1Ljvk8-0007IZ-47 for ged-emacs-devel@m.gmane.org; Wed, 18 Mar 2009 14:23:36 +0100 Original-Received: from localhost ([127.0.0.1]:34279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljvil-00048m-GP for ged-emacs-devel@m.gmane.org; Wed, 18 Mar 2009 09:22:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljvih-00048Z-Hs for emacs-devel@gnu.org; Wed, 18 Mar 2009 09:22:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljvic-000482-UM for emacs-devel@gnu.org; Wed, 18 Mar 2009 09:22:06 -0400 Original-Received: from [199.232.76.173] (port=51591 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljvic-00047z-P1 for emacs-devel@gnu.org; Wed, 18 Mar 2009 09:22:02 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:50936) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ljvic-0002gJ-3C for emacs-devel@gnu.org; Wed, 18 Mar 2009 09:22:02 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n2IDLwRp010370 for ; Wed, 18 Mar 2009 22:21:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n2IDLwcZ001660 for ; Wed, 18 Mar 2009 22:21:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id n2IDLwHa004130 for ; Wed, 18 Mar 2009 22:21:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Ljviv-0002mh-Jc for emacs-devel@gnu.org; Wed, 18 Mar 2009 22:22:21 +0900 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:109675 Archived-At: I'm going to change create-fontset-from-x-resource (fontset.el) as this: @@ -1049,8 +1058,11 @@ (while (setq fontset-spec (x-get-resource (format "fontset-%d" idx) (format "Fontset-%d" idx))) (condition-case nil - (create-fontset-from-fontset-spec fontset-spec t 'noerror) - (error (message "Fontset-%d: invalid specification in X resource" idx))) + (create-fontset-from-fontset-spec fontset-spec t) + (error (display-warning + 'initialization + (format "Fontset-%d: invalid specification in X resource" idx) + :warning))) (setq idx (1+ idx))))) ;; But the *Warnings* buffer doesn't show up at startup time even if create-fontset-from-fontset-spec causes an error. Could someone tell me what is wrong with the above change? If it is because the X frame is not yet created at that time, don't we need something like the attached patch? --- Kenichi Handa handa@m17n.org --- startup.el.~1.527.~ 2009-02-23 09:51:02.000000000 +0900 +++ startup.el 2009-03-18 22:16:35.000000000 +0900 @@ -1235,7 +1235,13 @@ (if (and (boundp 'x-session-previous-id) (stringp x-session-previous-id)) (with-no-warnings - (emacs-session-restore x-session-previous-id)))) + (emacs-session-restore x-session-previous-id))) + + (let ((warning-buf (get-buffer "*Warnings*"))) + (if (and warning-buf + (not (get-buffer-window warning-buf)) + (> (buffer-size warning-buf) 0)) + (display-buffer warning-buf)))) (defcustom initial-scratch-message (purecopy "\ ;; This buffer is for notes you don't want to save, and for Lisp evaluation.