]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
properly load ess-r-mode; fix directory typo
[lib.git] / emacs_el / configuration / don-configuration.org
index e9b962c70cd52f580753485b5174653864aae21f..f18b5ceac76ec0564c74a153561aa84e6b5101f4 100644 (file)
@@ -914,13 +914,13 @@ This can be used to link things pretty quickly if necessary
   (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"))
@@ -2206,8 +2206,32 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 
   (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.
@@ -2356,10 +2380,16 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   (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