comparison lisp/startup.el @ 19927:962303f5f565

(normal-top-level-add-to-load-path): Try looking for the unmodified default-directory in load-path. (initial-scratch-message): New variable. (command-line-1): Use initial-scratch-message.
author Richard M. Stallman <rms@gnu.org>
date Sun, 14 Sep 1997 17:27:48 +0000
parents 48114d461ac4
children d21ea4b5978e
comparison
equal deleted inserted replaced
19926:09d355f9877e 19927:962303f5f565
332 332
333 (defvar init-file-had-error nil) 333 (defvar init-file-had-error nil)
334 334
335 ;; This function is called from the subdirs.el file. 335 ;; This function is called from the subdirs.el file.
336 (defun normal-top-level-add-to-load-path (dirs) 336 (defun normal-top-level-add-to-load-path (dirs)
337 (let ((tail (member (directory-file-name default-directory) load-path))) 337 (let ((tail (or (member (directory-file-name default-directory) load-path)
338 (member default-directory load-path))))
338 (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail))))) 339 (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail)))))
339 340
340 (defun normal-top-level () 341 (defun normal-top-level ()
341 (if command-line-processed 342 (if command-line-processed
342 (message "Back to top level.") 343 (message "Back to top level.")
669 (command-line-1 (cdr command-line-args)) 670 (command-line-1 (cdr command-line-args))
670 671
671 ;; If -batch, terminate after processing the command options. 672 ;; If -batch, terminate after processing the command options.
672 (if noninteractive (kill-emacs t))) 673 (if noninteractive (kill-emacs t)))
673 674
675 (defcustom initial-scratch-message "\
676 This buffer is for notes you don't want to save, and for Lisp evaluation.
677 If you want to create a file, visit that file with C-x C-f,
678 then enter the text in that file's own buffer.
679
680 "
681 "Initial message displayed in *scratch* buffer at startup.
682 If this is nil, no message will be displayed."
683 :type 'string)
684
674 (defun command-line-1 (command-line-args-left) 685 (defun command-line-1 (command-line-args-left)
675 (or noninteractive (input-pending-p) init-file-had-error 686 (or noninteractive (input-pending-p) init-file-had-error
676 (and inhibit-startup-echo-area-message 687 (and inhibit-startup-echo-area-message
677 (or (and (get 'inhibit-startup-echo-area-message 'saved-value) 688 (or (and (get 'inhibit-startup-echo-area-message 'saved-value)
678 (equal inhibit-startup-echo-area-message 689 (equal inhibit-startup-echo-area-message
818 829
819 (set-buffer-modified-p nil) 830 (set-buffer-modified-p nil)
820 (sit-for 120)) 831 (sit-for 120))
821 (with-current-buffer (get-buffer "*scratch*") 832 (with-current-buffer (get-buffer "*scratch*")
822 (erase-buffer) 833 (erase-buffer)
823 (insert "\ 834 (and initial-scratch-message
824 If you want to create a file, don't type the text in this buffer. 835 (insert initial-scratch-message))
825 This buffer is for notes you don't want to save, and for Lisp evaluation.
826 If you want to create a file, first visit that file with C-x C-f,
827 then enter the text in that file's own buffer.
828
829 ")
830 (set-buffer-modified-p nil))))))) 836 (set-buffer-modified-p nil)))))))
831 ;; Delay 2 seconds after the init file error message 837 ;; Delay 2 seconds after the init file error message
832 ;; was displayed, so user can read it. 838 ;; was displayed, so user can read it.
833 (if init-file-had-error 839 (if init-file-had-error
834 (sit-for 2)) 840 (sit-for 2))