emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/crux b07b31a 005/112: Move a function around


From: ELPA Syncer
Subject: [nongnu] elpa/crux b07b31a 005/112: Move a function around
Date: Wed, 11 Aug 2021 09:57:43 -0400 (EDT)

branch: elpa/crux
commit b07b31ae6f8731534b490f706c2dc2f5feb27a7a
Author: Bozhidar Batsov <bozhidar@batsov.com>
Commit: Bozhidar Batsov <bozhidar@batsov.com>

    Move a function around
---
 crux.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/crux.el b/crux.el
index 019a373..7ee47b2 100644
--- a/crux.el
+++ b/crux.el
@@ -64,6 +64,17 @@ With a prefix ARG always prompt for command to use."
   "The default `ansi-term' name used by `crux-visit-term-buffer'.
 This variable can be set via .dir-locals.el to provide multi-term support.")
 
+(defun crux-start-or-switch-to (function buffer-name)
+  "Invoke FUNCTION if there is no buffer with BUFFER-NAME.
+Otherwise switch to the buffer named BUFFER-NAME.  Don't clobber
+the current buffer."
+  (if (not (get-buffer buffer-name))
+      (progn
+        (split-window-sensibly (selected-window))
+        (other-window 1)
+        (funcall function))
+    (switch-to-buffer-other-window buffer-name)))
+
 (defun crux-visit-term-buffer ()
   "Create or visit a terminal buffer."
   (interactive)
@@ -258,17 +269,6 @@ buffer is not visiting a file."
 
 (add-hook 'find-file-hook #'crux-reopen-as-root)
 
-(defun crux-start-or-switch-to (function buffer-name)
-  "Invoke FUNCTION if there is no buffer with BUFFER-NAME.
-Otherwise switch to the buffer named BUFFER-NAME.  Don't clobber
-the current buffer."
-  (if (not (get-buffer buffer-name))
-      (progn
-        (split-window-sensibly (selected-window))
-        (other-window 1)
-        (funcall function))
-    (switch-to-buffer-other-window buffer-name)))
-
 (defun crux-insert-date ()
   "Insert a timestamp according to locale's date and time format."
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]