(use-package ess
:ensure t
:commands R
- :mode "\\.R\\'"
+ :mode ("\\.R\\'" . ess-r-mode)
:bind (:map ess-mode-map
("C-c C-R" . dla/ess-region-remote-eval))
:config
(defun ess-change-directory (path)
"Set the current working directory to PATH for both *R* and Emacs."
- (interactive "DDirectory to change to: ")
+ (interactive "Directory to change to: ")
(when (file-exists-p path)
(ess-command (concat "setwd(\"" path "\")\n"))
(column-number-mode t)
- (desktop-save-mode)
- (desktop-read)
+#+END_SRC
+** Desktop-save-mode
+If the envvar EMACS_SERVER_NAME is set, consider this a separate
+emacs, and use a different desktop file to restore history
+#+BEGIN_SRC emacs-lisp
+ (use-package desktop-save
+ :defer f
+ :config
+ (setq desktop-base-file-name
+ (convert-standard-filename
+ (concat ".emacs"
+ (or (getenv "EMACS_SERVER_NAME")
+ "")
+ ".desktop")
+ ))
+ (setq desktop-base-lock-name
+ (convert-standard-filename
+ (concat desktop-base-file-name
+ ".lock")))
+ (desktop-save-mode 1)
+ (setq desktop-auto-save-timeout 60)
+ (desktop-read)
+ )
+#+END_SRC
+** Misc (Uncharacterized)
+#+BEGIN_SRC emacs-lisp
'(icomplete-mode on)
(custom-set-faces
;; custom-set-faces was added by Custom.
(ad-activate 'ask-user-about-supersession-threat)
#+END_SRC
-* Server
+* Start Server
#+BEGIN_SRC emacs-lisp
- (unless (server-running-p)
- (server-start))
+ (use-package server
+ :config
+ (setq server-name
+ (or (getenv "EMACS_SERVER_NAME")
+ "emacs"))
+ (unless (server-running-p)
+ (global-set-key "\C-xp" 'server-edit)
+ (server-start)))
#+END_SRC