From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: initial-scratch-message vs. initial-major-mode comment syntax Date: Tue, 22 Jun 2004 10:22:13 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <40D85CB5.4040505@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1087921364 1966 80.91.224.253 (22 Jun 2004 16:22:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Jun 2004 16:22:44 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 22 18:22:36 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 1Bco2e-0003kv-00 for ; Tue, 22 Jun 2004 18:22:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bco3x-0000Ux-Jk for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Jun 2004 12:23:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bco3v-0000Ui-Rx for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2004 12:23:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bco3s-0000UU-OO for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2004 12:23:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bco3s-0000UR-Ja for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2004 12:23:52 -0400 Original-Received: from [193.4.58.12] (helo=horus.isnic.is) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Bco2P-0004g3-F4 for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2004 12:22:21 -0400 Original-Received: from Mail.FU-Berlin.DE (mail.fu-berlin.de [130.133.1.2]) by horus.isnic.is (8.12.9p2/8.12.9/isnic) with ESMTP id i5MGMGh9082084 for ; Tue, 22 Jun 2004 16:22:16 GMT (envelope-from mod-submit@uni-berlin.de) Original-Received: by Mail.FU-Berlin.DE (Exim 4.34) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1Bco2F-000512-Bo>; Tue, 22 Jun 2004 18:22:11 +0200 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Tue, 22 Jun 2004 18:22:11 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 62 X-Orig-X-Trace: news.uni-berlin.de 73faVUYQYCpj60WLRvbGtAckMETh0U3k3i9R6iHQIOhOSNVBc= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8261 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8261 When initial-major-mode is not a Lisp programming language mode, initial-scratch-message is not appropriate because each line has a leading ";; " comment string. That in turn could have undesirable results when syntax-driven fontification is on. Since initial-scratch-message is inserted by command-line-1, which is called by command-line after initial-major-mode has been funcall'ed, it should be possible to use comment-region (which is sensitive to the major mode's syntax) in command-line-1. It's hard to test, though, since "startup" is dumped into the emacs executable; and perhaps calling comment-region in startup.el would also require "newcomment" to be dumped via loadup.el. Here's a patch to illustrate the main idea: *** emacs-21.3/lisp/startup.el~ Sun Mar 16 15:05:59 2003 --- emacs-21.3/lisp/startup.el Tue Jun 22 10:12:52 2004 *************** *** 1009,1017 **** (if noninteractive (kill-emacs t))) (defcustom initial-scratch-message (purecopy "\ ! ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ! ;; If you want to create a file, visit that file with C-x C-f, ! ;; then enter the text in that file's own buffer. ") "Initial message displayed in *scratch* buffer at startup. --- 1009,1017 ---- (if noninteractive (kill-emacs t))) (defcustom initial-scratch-message (purecopy "\ ! This buffer is for notes you don't want to save, and for Lisp evaluation. ! If you want to create a file, visit that file with C-x C-f, ! then enter the text in that file's own buffer. ") "Initial message displayed in *scratch* buffer at startup. *************** *** 1435,1441 **** (with-current-buffer (get-buffer "*scratch*") (erase-buffer) (when initial-scratch-message ! (insert initial-scratch-message)) (set-buffer-modified-p nil))))))) ;; Delay 2 seconds after the init file error message --- 1435,1443 ---- (with-current-buffer (get-buffer "*scratch*") (erase-buffer) (when initial-scratch-message ! (insert initial-scratch-message) ! (when comment-start ! (comment-region (point-min) (point-max)))) (set-buffer-modified-p nil))))))) ;; Delay 2 seconds after the init file error message -- Kevin Rodgers