Changeset - e5b484e9b6b8
[Not reviewed]
0 1 0
Sergey Pashinin - 11 years ago 2014-07-05 19:35:07
sergey@pashinin.com
Restore ensime-inf-mode
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/workgroups-specialbufs.el
Show inline comments
 
@@ -126,96 +126,104 @@ You can get these commands using `wg-get-org-agenda-view-commands'."
 
              (deserialize . ,(lambda (buffer vars)
 
                                (wg-dbind (pythoncmd pythonargs) vars
 
                                  (save-window-excursion
 
                                    (run-python (concat pythoncmd " " pythonargs)))
 
                                  (wg-awhen (get-buffer (process-buffer (python-shell-get-or-create-process)))
 
                                    (set-buffer it)
 
                                    (switch-to-buffer (process-buffer (python-shell-get-or-create-process)))
 
                                    (goto-char (point-max)))
 
                                  )))))
 

	
 
;; Sage shell
 
(wg-support 'inferior-sage-mode 'sage-mode
 
            `((deserialize . ,(lambda (buffer vars)
 
                                (save-window-excursion
 
                                  (if (boundp' sage-command)
 
                                      (run-sage t sage-command t)))
 
                                (if (boundp 'sage-buffer)
 
                                    (wg-awhen (and
 
                                               sage-buffer)
 
                                      (set-buffer it)
 
                                      (switch-to-buffer sage-buffer)
 
                                      (goto-char (point-max))))))))
 

	
 
;; inferior-ess-mode   (ess-inf.el)
 
;; R shell, M-x R
 
(wg-support 'inferior-ess-mode 'ess-inf
 
            `((save . (inferior-ess-program))
 
              (deserialize . ,(lambda (buffer vars)
 
                                (wg-dbind (cmd) vars
 
                                  (let ((ess-ask-about-transfile nil)
 
                                        (ess-ask-for-ess-directory nil)
 
                                        (ess-history-file nil))
 
                                    (R)))))))
 

	
 
;; inferior-octave-mode
 
(wg-support 'inferior-octave-mode 'octave
 
            `((deserialize . ,(lambda (buffer vars)
 
                                (prog1 (run-octave)
 
                                  (rename-buffer (wg-buf-name buffer) t))))))
 

	
 
;; Prolog shell
 
(wg-support 'prolog-inferior-mode 'prolog
 
            `((deserialize . ,(lambda (buffer vars)
 
                                (save-window-excursion
 
                                  (run-prolog nil))
 
                                (switch-to-buffer "*prolog*")
 
                                (goto-char (point-max))))))
 

	
 
;; ensime-inf
 
(wg-support 'ensime-inf-mode 'ensime
 
            `((deserialize . ,(lambda (buffer vars)
 
                                (save-window-excursion
 
                                  (ensime-inf-switch))
 
                                (switch-to-buffer ensime-inf-buffer-name)
 
                                (goto-char (point-max))))))
 

	
 
;; compilation-mode
 
;;
 
;; I think it's not a good idea to compile a program just to switch
 
;; workgroups. So just restoring a buffer name.
 
(wg-support 'compilation-mode 'compile
 
            `((serialize . ,(lambda (buffer)
 
                              (if (boundp' compilation-arguments) compilation-arguments)))
 
              (deserialize . ,(lambda (buffer vars)
 
                                (save-window-excursion
 
                                  (get-buffer-create (wg-buf-name buffer)))
 
                                (with-current-buffer (wg-buf-name buffer)
 
                                  (when (boundp' compilation-arguments)
 
                                    (make-local-variable 'compilation-arguments)
 
                                    (setq compilation-arguments vars)))
 
                                (switch-to-buffer (wg-buf-name buffer))
 
                                (goto-char (point-max))))))
 

	
 
;; grep-mode
 
;; see grep.el - `compilation-start' - it is just a compilation buffer
 
;; local variables:
 
;; `compilation-arguments' == (cmd mode nil nil)
 
(wg-support 'grep-mode 'grep
 
            `((serialize . ,(lambda (buffer)
 
                              (if (boundp' compilation-arguments) compilation-arguments)))
 
              (deserialize . ,(lambda (buffer vars)
 
                                (compilation-start (car vars) (nth 1 vars))
 
                                (switch-to-buffer "*grep*")))))
 

	
 

	
 
;; speedbar-mode
 
(defun wg-deserialize-speedbar-buffer (buf)
 
  "Deserialize speedbar-buffer BUF."
 
  (when (and (require 'speedbar nil 'noerror)
 
             (require 'dframe nil 'noerror))
 
    (wg-dbind (this-function args) (wg-buf-special-data buf)
 
      (let ((default-directory (car args))
 
            bufname)
 
        (if (boundp 'sr-speedbar-buffer-name)
 
            (setq bufname sr-speedbar-buffer-name)
 
          (setq bufname "*SPEEDBAR*"))
 
        (when (and (fboundp 'speedbar-mode)
 
                   (fboundp 'speedbar-reconfigure-keymaps)
 
                   (fboundp 'speedbar-update-contents)
 
                   (fboundp 'speedbar-set-timer))
 
          (with-no-warnings
 
            (setq speedbar-buffer (get-buffer-create bufname))
 
            (setq speedbar-frame (selected-frame)
 
                  dframe-attached-frame (selected-frame)
0 comments (0 inline, 0 general)