Skip to content
Snippets Groups Projects
Commit 8080abe8 authored by ram's avatar ram
Browse files

Changed hemlock init file loading to accept .hemlock-init as well as

hemlock-init.  Fixed ED doc string.
parent 27f30447
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/main.lisp,v 1.8 1991/10/04 17:18:47 chiles Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/main.lisp,v 1.9 1991/10/17 16:12:27 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -255,15 +255,15 @@ ...@@ -255,15 +255,15 @@
&key (init t) &key (init t)
(display (cdr (assoc :display ext:*environment-list*)))) (display (cdr (assoc :display ext:*environment-list*))))
"Invokes the editor, Hemlock. If X is supplied and is a symbol, the "Invokes the editor, Hemlock. If X is supplied and is a symbol, the
definition of X is put into a buffer, and that buffer is selected. If X definition of X is put into a buffer, and that buffer is selected. If X is
is a pathname, the file specified by X is visited in a new buffer. If X a pathname, the file specified by X is visited in a new buffer. If X is not
is not supplied or Nil, the editor is entered in the same state as when supplied or Nil, the editor is entered in the same state as when last
last exited. When :init is supplied as t (the default), the file exited. When :init is supplied as t (the default), the file
\"hemlock-init.fasl\" or \"hemlock-init.lisp\" is loaded from the home or \"hemlock-init.lisp\", or \".hemlock-init.lisp\" is loaded from the home
default directory, but the Lisp command line switch -hinit can be used to directory, but the Lisp command line switch -hinit can be used to specify a
specify a different name. If the argument is non-nil and not t, then it different name. Any compiled version of the source is preferred when
should be a pathname that will be merged with the home or default directory. choosing the file to load. If the argument is non-nil and not t, then it
The display argument is not currently supported." should be a pathname that will be merged with the home directory."
(when *in-the-editor* (error "You are already in the editor, you bogon!")) (when *in-the-editor* (error "You are already in the editor, you bogon!"))
(let ((*in-the-editor* t) (let ((*in-the-editor* t)
(display (unless *editor-has-been-entered* (display (unless *editor-has-been-entered*
...@@ -313,19 +313,20 @@ ...@@ -313,19 +313,20 @@
(defun maybe-load-hemlock-init (init) (defun maybe-load-hemlock-init (init)
(when init (when init
(let* ((name (case init (let* ((switch (find "hinit" *command-line-switches*
((t) (let ((switch (find "hinit" *command-line-switches* :test #'string-equal
:test #'string-equal :key #'cmd-switch-name))
:key #'cmd-switch-name))) (spec-name
(if switch (if (not (eq init t))
(or (cmd-switch-value switch) init
(car (cmd-switch-words switch)) (and switch
"hemlock-init") (or (cmd-switch-value switch)
"hemlock-init"))) (car (cmd-switch-words switch)))))))
(t (pathname init))))) (if spec-name
(load (merge-pathnames name (user-homedir-pathname)) (load (merge-pathnames spec-name (user-homedir-pathname))
:if-does-not-exist nil)))) :if-does-not-exist nil)
(or (load "home:hemlock-init" :if-does-not-exist nil)
(load "home:.hemlock-init" :if-does-not-exist nil))))))
;;;; SAVE-ALL-BUFFERS. ;;;; SAVE-ALL-BUFFERS.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment