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

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

Clear desktop-delay-hook after use.  Simplify.
parent 71bccd7f
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
;; f89-kam@nada.kth.se (Klas Mellbourn) for a mh-e tip. ;; f89-kam@nada.kth.se (Klas Mellbourn) for a mh-e tip.
;; kifer@sbkifer.cs.sunysb.edu (M. Kifer) for a bug hunt. ;; kifer@sbkifer.cs.sunysb.edu (M. Kifer) for a bug hunt.
;; treese@lcs.mit.edu (Win Treese) for ange-ftp tips. ;; treese@lcs.mit.edu (Win Treese) for ange-ftp tips.
;; pot@cnuce.cnr.it (Francesco Potorti`) for misc. tips.
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------
;; TODO: ;; TODO:
;; ;;
...@@ -438,20 +439,26 @@ MODE is the major mode." ...@@ -438,20 +439,26 @@ MODE is the major mode."
(delete-file filename))))) (delete-file filename)))))
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
(defun desktop-read () (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."
(interactive) (interactive)
(let ((filename)) (if noninteractive
(if (file-exists-p (concat "./" desktop-basefilename)) nil
(setq desktop-dirname (expand-file-name "./")) (let ((dirs '("./" "~/")))
(if (file-exists-p (concat "~/" desktop-basefilename)) (while (and dirs
(setq desktop-dirname (expand-file-name "~/")) (not (file-exists-p (expand-file-name
(setq desktop-dirname nil))) desktop-basefilename
(if desktop-dirname (car dirs)))))
(progn (setq dirs (cdr dirs)))
(load (concat desktop-dirname desktop-basefilename) t t t) (setq desktop-dirname (and dirs (expand-file-name (car dirs))))
(run-hooks 'desktop-delay-hook) (if desktop-dirname
(message "Desktop loaded.")) (progn
(desktop-clear)))) (load (expand-file-name desktop-basefilename desktop-dirname)
t t t)
(run-hooks 'desktop-delay-hook)
(setq desktop-delay-hook nil)
(message "Desktop loaded."))
(desktop-clear)))))
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
(defun desktop-load-default () (defun desktop-load-default ()
"Load the `default' start-up library manually. "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