unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: initial-scratch-message vs. initial-major-mode comment syntax
Date: Tue, 22 Jun 2004 10:22:13 -0600	[thread overview]
Message-ID: <40D85CB5.4040505@yahoo.com> (raw)

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

                 reply	other threads:[~2004-06-22 16:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=40D85CB5.4040505@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /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).