annotate lisp/packages/session.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Synched up with: Not in FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; #### Chuck -- I think we should remove this. It's dumb and stupid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; and there are at least two other packages we provide that do the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; same thing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 (setq kill-emacs-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 '(save-session))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Record in `/.emacs-session' a command to re-visit the last file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; that was being looked at.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 (defun save-session ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 (and buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 (write-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 (concat "(" (if (eq major-mode 'rmail-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 "rmail"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 "find-file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 " " (if (string= (concat (getenv "HOME") "/RMAIL")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; Omit the file name if it is the primary rmail file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; to cause the default inboxes to be used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (prin1-to-string buffer-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ")\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 "(goto-char " (prin1-to-string (window-start)) ")\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 "(beginning-of-line)\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 "(set-window-start (selected-window) (point))\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 "(goto-line "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (prin1-to-string (1+ (count-lines 1 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ")\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 nil (expand-file-name "~/.emacs-session")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Don't print a message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 nil 'lambda)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Restore previous saved session, if there is one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (load "~/.emacs-session" t t)