my-setup-windows: balance windows horizontally
Stefan Bund [Wed, 11 Oct 2017 16:08:22 +0000 (18:08 +0200)]
.gitmodules
pjb-emacs [new submodule]
setup/mywin.el
setup/pjb-emacs.el [new file with mode: 0644]

index b1f65c9..d365e1d 100644 (file)
@@ -39,3 +39,6 @@ url = git://g0dil.de/emacsstuff.git
 [submodule "solarized-emacs"]
        path = solarized-emacs
        url = https://github.com/bbatsov/solarized-emacs.git
+[submodule "pjb-emacs"]
+       path = pjb-emacs
+       url = https://github.com/informatimago/emacs.git
diff --git a/pjb-emacs b/pjb-emacs
new file mode 160000 (submodule)
index 0000000..0de906e
--- /dev/null
+++ b/pjb-emacs
@@ -0,0 +1 @@
+Subproject commit 0de906e8f5f8297252c4b784dff2daf8df50c87f
index 7d961c1..b33e6a5 100644 (file)
@@ -145,8 +145,7 @@ window smaller than MIN-HEIGHT lines."
                             (not (member name setup-my-windows-precious-buffers))) return w)
               firstwindow))
     (when (and distribute (> (length newtopwindows) 1))
-      ;;(balance-windows)
-      )
+      (pjb-balance-windows t))
     (select-window newwindow)
     (if (not (member (buffer-name currentbuffer) setup-my-windows-junk-buffers))
         (switch-to-buffer currentbuffer))))
diff --git a/setup/pjb-emacs.el b/setup/pjb-emacs.el
new file mode 100644 (file)
index 0000000..39a07ab
--- /dev/null
@@ -0,0 +1,11 @@
+(let ((pjb-libdir (concat (file-name-directory
+                                 (directory-file-name
+                                  (file-name-directory
+                                   (or load-file-name
+                                       (when (boundp 'bytecomp-filename) bytecomp-filename)
+                                       buffer-file-name))))
+                                "pjb-emacs")))
+  (add-to-list 'load-path pjb-libdir)
+  (loop for feature in '(pjb-cl-magic pjb-sources pjb-strings pjb-list pjb-cl pjb-utilities)
+        do (require feature))
+  (load-file (concat (file-name-as-directory pjb-libdir) "pjb-emacs-balance-windows.el")))