Commit 253406b9 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(desktop-read): Do nothing in batch mode.

Clear desktop-delay-hook after use.  Simplify.
parent 71bccd7f
......@@ -85,6 +85,7 @@
;; (Klas Mellbourn) for a mh-e tip.
;; (M. Kifer) for a bug hunt.
;; (Win Treese) for ange-ftp tips.
;; (Francesco Potorti`) for misc. tips.
;; ---------------------------------------------------------------------------
;; TODO:
......@@ -438,20 +439,26 @@ MODE is the major mode."
(delete-file filename)))))
;; ----------------------------------------------------------------------------
(defun desktop-read ()
"Read the Desktop file and the files it specifies."
"Read the Desktop file and the files it specifies.
This is a no-op when Emacs is running in batch mode."
(let ((filename))
(if (file-exists-p (concat "./" desktop-basefilename))
(setq desktop-dirname (expand-file-name "./"))
(if (file-exists-p (concat "~/" desktop-basefilename))
(setq desktop-dirname (expand-file-name "~/"))
(setq desktop-dirname nil)))
(if desktop-dirname
(load (concat desktop-dirname desktop-basefilename) t t t)
(run-hooks 'desktop-delay-hook)
(message "Desktop loaded."))
(if noninteractive
(let ((dirs '("./" "~/")))
(while (and dirs
(not (file-exists-p (expand-file-name
(car dirs)))))
(setq dirs (cdr dirs)))
(setq desktop-dirname (and dirs (expand-file-name (car dirs))))
(if desktop-dirname
(load (expand-file-name desktop-basefilename desktop-dirname)
t t t)
(run-hooks 'desktop-delay-hook)
(setq desktop-delay-hook nil)
(message "Desktop loaded."))
;; ----------------------------------------------------------------------------
(defun desktop-load-default ()
"Load the `default' start-up library manually.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment