Skip to content

Commit

Permalink
updated full-ide emacs-purpose layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyglazyrindev committed Jan 9, 2018
1 parent acb1404 commit a13d6cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
10 changes: 5 additions & 5 deletions layouts/full-ide.window-layout
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(nil (0 0 225 50) (nil (0 0 157 50) (t (0 0 28 50) (:purpose dired :purpose-dedicated t :width 0.12444444444444444 :height 0.5098039215686274 :edges (0.0 0.0 0.12444444444444444 0.5098039215686274)) (:purpose
buffers :purpose-dedicated t :width 0.12444444444444444 :height 0.47058823529411764 :edges (0.0 0.5098039215686274 0.12444444444444444 0.9803921568627451))) (t (28 0 157 50) (:purpose edit :purpose-dedicated t :width
0.702 :height 0.8823529411764706 :edges (0.12444444444444444 0.0 0.82666666666666667 0.8823529411764706)) (:purpose misc :purpose-dedicated t :width 0.702 :height 0.09803921568627451 :edges
(0.12444444444444444 0.8823529411764706 0.82666666666666667 0.9803921568627451)))) (t (157 0 225 50) (:purpose ilist :purpose-dedicated nil :width 0.15333333333333332 :height 0.7058823529411765 :edges
(0.82666666666666667 0.0 1.0 0.7058823529411765)) (:purpose todo :purpose-dedicated nil :width 0.15333333333333332 :height 0.27450980392156865 :edges (0.82666666666666667 0.7058823529411765 1.0 0.9803921568627451))))
(nil (0 0 225 50) (nil (0 0 157 50) (t (0 0 28 50) (:purpose dired :purpose-dedicated t :width 0.2 :height 0.5098039215686274 :edges (0.0 0.0 0.2 0.5098039215686274)) (:purpose
buffers :purpose-dedicated t :width 0.2 :height 0.47058823529411764 :edges (0.0 0.5098039215686274 0.2 0.9803921568627451))) (t (28 0 157 50) (:purpose edit :purpose-dedicated t :width
0.63 :height 0.8823529411764706 :edges (0.20 0.0 0.83 0.8823529411764706)) (:purpose misc :purpose-dedicated t :width 0.63 :height 0.09803921568627451 :edges
(0.2 0.8823529411764706 0.83 0.9803921568627451)))) (t (157 0 225 50) (:purpose ilist :purpose-dedicated nil :width 0.17 :height 0.9803921568627451 :edges
(0.83 0.0 1 0.9803921568627451)) ))
24 changes: 18 additions & 6 deletions window-purpose-x.el
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,27 @@ All windows are purpose-dedicated.")
(setq ibuffer-display-summary t)
(setq ibuffer-use-header-line t))

(defun purpose-x-code1-update-dired ()
(defun purpose-update-dired ()
"Update free dired window with current buffer's directory.
If a non-buffer-dedicated window with purpose 'dired exists, display
the directory of the current buffer in that window, using `dired'.
If there is no window available, do nothing.
If current buffer doesn't have a filename, do nothing."
(unless (eq major-mode 'org-mode)
(when (and (buffer-file-name)
(when (and (buffer-file-name)
(cl-delete-if #'window-dedicated-p
(purpose-windows-with-purpose 'dired)))
(save-selected-window
(dired (file-name-directory (buffer-file-name)))
(when (fboundp 'dired-hide-details-mode)
(dired-hide-details-mode))
(bury-buffer (current-buffer))))))
(bury-buffer (current-buffer)))))

(defun purpose-x-code1-update-changed ()
"Update auxiliary buffers if frame/buffer had changed.
Uses `frame-or-buffer-changed-p' to determine whether the frame or
buffer had changed."
(when (frame-or-buffer-changed-p 'purpose-x-code1-buffers-changed)
(purpose-x-code1-update-dired)
(purpose-update-dired)
(imenu-list-update-safe)))

;;;###autoload
Expand All @@ -158,7 +157,7 @@ imenu."
(interactive)
(purpose-set-extension-configuration :purpose-x-code1 purpose-x-code1-purpose-config)
(purpose-x-code1--setup-ibuffer)
(purpose-x-code1-update-dired)
(purpose-update-dired)
(imenu-list-minor-mode)
(frame-or-buffer-changed-p 'purpose-x-code1-buffers-changed)
(add-hook 'post-command-hook #'purpose-x-code1-update-changed)
Expand Down Expand Up @@ -712,5 +711,18 @@ This is implemented by overriding `replace-buffer-in-windows' with

;;; --- purpose-x-kill ends here ---

;;; purpose-full-ide

(defvar purpose-full-ide-buffers-changed nil
"Internal variable for use with `frame-or-buffer-changed-p'.")

(defun purpose-full-ide-update-changed ()
"Update auxiliary buffers if frame/buffer had changed.
Uses `frame-or-buffer-changed-p' to determine whether the frame or
buffer had changed."
(when (frame-or-buffer-changed-p 'purpose-full-ide-buffers-changed)
(imenu-list-update-safe)))


(provide 'window-purpose-x)
;;; window-purpose-x.el ends here

0 comments on commit a13d6cb

Please sign in to comment.