Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (35 sloc) 1.37 KB
(require 'dss-paths)
(defadvice desktop-owner (after pry-from-cold-dead-hands activate)
"Don't allow dead emacsen to own the desktop file.
This function comes from the anonymous code on"
(when (not (dss/emacs-process-p ad-return-value))
(setq ad-return-value nil)))
(defun dss/emacs-process-p (pid)
"If pid is the process ID of an emacs process, return t, else nil.
Also returns nil if pid is nil.
This function comes from the anonymous code on
(when pid
(let ((attributes (process-attributes pid)) (cmd))
(dolist (attr attributes)
(if (string= "comm" (car attr))
(setq cmd (cdr attr))))
(if (and cmd (or (string= "emacs" cmd) (string= "emacs.exe" cmd))) t))))
(require 'desktop-recover)
(defun dss/desktop-reset ()
(desktop-save-mode 1)
;;(setq history-length 250)
;;(add-to-list 'desktop-globals-to-save 'file-name-history)
;; (setq desktop-buffers-not-to-save
;; (concat "\\("
;; "^nn\\.a[0-9]+\\|\\.log\\|(ftp)\\|^tags\\|^TAGS"
;; "\\|\\.emacs.*\\|\\.diary\\|\\.newsrc-dribble\\|\\.bbdb"
;; "\\)$"))
;; (add-to-list 'desktop-modes-not-to-save 'dired-mode)
;; (add-to-list 'desktop-modes-not-to-save 'Info-mode)
(provide 'dss-desktop)
Jump to Line
Something went wrong with that request. Please try again.