[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure 54ac59a 295/313: Modeline with connected info
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure 54ac59a 295/313: Modeline with connected info |
Date: |
Wed, 11 Aug 2021 10:00:36 -0400 (EDT) |
branch: elpa/inf-clojure
commit 54ac59a6af9a9b548c62aaa07edcf7e240d90aa3
Author: dan sutton <dan@dpsutton.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Modeline with connected info
note this changes the `inf-clojure-buffer` to always be a _buffer_ and
not the name of a buffer. Seems like renaming can be quite risky since
it was just a name of the buffer rather than the buffer.
---
inf-clojure.el | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index 1ec3db8..ac7951e 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -274,6 +274,14 @@ mode. Default is whitespace followed by 0 or 1
single-letter colon-keyword
\(as in :a, :c, etc.)"
:type 'regexp)
+(defun inf-clojure--modeline-info ()
+ "Return modeline info.
+Either \"not connected\" or \"repl-type: buffer-name\""
+ (if (bufferp inf-clojure-buffer)
+ (with-current-buffer inf-clojure-buffer
+ (format "%s: %s" inf-clojure-repl-type (buffer-name (current-buffer))))
+ "not connected"))
+
(defvar inf-clojure-mode-map
(let ((map (copy-keymap comint-mode-map)))
(define-key map (kbd "C-x C-e") #'inf-clojure-eval-last-sexp)
@@ -359,13 +367,30 @@ mode. Default is whitespace followed by 0 or 1
single-letter colon-keyword
map))
;;;###autoload
+(defcustom inf-clojure-mode-line
+ '(:eval (format " inf-clojure[%s]" (inf-clojure--modeline-info)))
+ "Mode line lighter for cider mode.
+
+The value of this variable is a mode line template as in
+`mode-line-format'. See Info Node `(elisp)Mode Line Format' for details
+about mode line templates.
+
+Customize this variable to change how inf-clojure-minor-mode
+displays its status in the mode line. The default value displays
+the current connection. Set this variable to nil to disable the
+mode line entirely."
+ :type 'sexp
+ :risky t)
+
+;;;###autoload
(define-minor-mode inf-clojure-minor-mode
"Minor mode for interacting with the inferior Clojure process buffer.
The following commands are available:
\\{inf-clojure-minor-mode-map}"
- :lighter "" :keymap inf-clojure-minor-mode-map
+ :lighter inf-clojure-mode-line
+ :keymap inf-clojure-minor-mode-map
(setq-local comint-input-sender 'inf-clojure--send-string)
(inf-clojure-eldoc-setup)
(make-local-variable 'completion-at-point-functions)
@@ -703,7 +728,7 @@ process buffer for a list of commands.)"
(inf-clojure-mode)
(setq-local inf-clojure-repl-type repl-type)
(hack-dir-local-variables-non-file-buffer))))
- (setq inf-clojure-buffer "*inf-clojure*")
+ (setq inf-clojure-buffer (get-buffer "*inf-clojure*"))
(if inf-clojure-repl-use-same-window
(pop-to-buffer-same-window "*inf-clojure*")
(pop-to-buffer "*inf-clojure*")))
- [nongnu] elpa/inf-clojure 2cfc38f 239/313: Move repl features into single datastructure for clarity, (continued)
- [nongnu] elpa/inf-clojure 2cfc38f 239/313: Move repl features into single datastructure for clarity, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure fe22ce2 253/313: Add a couple of disclaimers and a basic TOC, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e33a546 243/313: Bugfixes and readme updates, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure c9681d0 257/313: Tweak some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2c8e46b 273/313: Release 3.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1ba6416 255/313: Tweak the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d7eb9ce 267/313: Update the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 53025bf 270/313: Correct misspelled function. Fixes #181, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure aaca773 288/313: Tweak a changelog entry, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3e712d9 292/313: Add a couple of changelog entries, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 54ac59a 295/313: Modeline with connected info,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure f7b6a8e 296/313: Don't try to select a dead buffer, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a2cebf5 311/313: Add a separator between a couple of paragraphs, ELPA Syncer, 2021/08/11