3

The rigidity to which emacs adheres to its layout is annoying at times. How can i get a layout like this when I shift to the particular modes?

+------------------+-----------+
|                  |           |
|                  | *compiler*|
|      .cpp file   +-----------+
|                  | *eshell*  |
|                  |           |
|                  +-----------+
|                  |           |
+------------------+ *dired*   |
|      shell       |           |
|                  |           |
+------------------+-----------+
      C++ Mode


+---------------+--------------+           +------+---------------------------+
|               |              |           |      |                           |
|               |              |           |      |                           |
|               | Slime REPL   |           |*dire |    .py file               |
|               |              |           |  -d* |                           |
|    .lisp file +--------------+           |      |                           |
|               | Slime Events |           |      |                           |
|               |              |           |------+---------------------------+
|---------------+--------------+           |*buff |                           |
|          Shell               |           | -er  | Python Shell              |
|                              |           |-list*|                           |
|------------------------------|           +------+---------------------------+
      Common Lisp Mode                              Python Mode 

I've tried using purpose-mode (package "window-purpose") without adding hooks, I manually saved my layout and reloaded with purpose-load-window-layout and gave it my myLayout.window-config. But that don't bring back a shell or compiler or SLIME or nothing except the Dired window and the main file in the major mode. So I reload all over again. Any suggestions on how to do this better.

how can I get window purpose to give me this window layout consistently for common lisp programming. enter image description here

It should also give me this config in c++ mode

enter image description here my basic mode - purposes configuration:

(defun aviik-add-purposes ()
  (add-to-list 'purpose-user-mode-purposes '(c++-mode . cpp))
  (add-to-list 'purpose-user-mode-purposes '(python-mode . python))
  (add-to-list 'purpose-user-mode-purposes '(lisp-mode . lisp))
  (add-to-list 'purpose-user-mode-purposes '(shell-mode . shells))
  (add-to-list 'purpose-user-mode-purposes '(slime-repl-mode . slime))
  (add-to-list 'purpose-user-mode-purposes '(help-mode . help))
  (add-to-list 'purpose-user-mode-purposes '(info-mode . help))
  (add-to-list 'purpose-user-mode-purposes '(emacs-lisp-mode . elisp)))

And then I have window-purpose settings :

(use-package window-purpose
  :ensure t
  :commands (purpose-mode)
  :config
  (progn
    (purpose-x-golden-ratio-setup)
    (purpose-x-kill-setup)
    (aviik-add-purposes)
    (add-to-list 'global-mode-string '(:eval (purpose--modeline-string)))
    (purpose-compile-user-configuration))
  :bind
   (("s-x p" . purpose-mode)
          ("s-x a" . purpose-switch-buffer-with-p)
          ("s-x d" . purpose-toggle-window-purpose-dedicated)
          ("s-x w" . purpose-toggle-window-buffer-dedicated)
          ("s-x s" . purpose-save-window-layout)
          ("s-x l" . purpose-load-window-layout)
          ("s-x z" . purpose-reset-window-layout))
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.