[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure e12db12 091/313: Fix prompt being included in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure e12db12 091/313: Fix prompt being included in input history |
Date: |
Wed, 11 Aug 2021 09:59:53 -0400 (EDT) |
branch: elpa/inf-clojure
commit e12db12b1c5b2bf6c35352fd9fb99c52eaa3b728
Author: Øyvind Stegard <oyvind@stegard.net>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Fix prompt being included in input history
When navigating to previous input history and *current input is empty*,
the `backward-sexp' call in function `inf-clojure-get-old-input' would
not respect comint prompt boundary and jump to beginning of line. This
caused the prompt text to be stored in `comint-stored-incomplete-input',
which is annoying and causes even more problems if prompt text is set to
read-only.
This change makes sure that the extracted buffer substring for current
input does not include the prompt, even when input is empty or just
white space.
Also, introduce a regexp to use for `comint-prompt-regexp' which matches
both main prompt and sub prompts, so that boundary is respected when
`comint-use-prompt-regexp' is set to t.
Fixes #35
---
inf-clojure.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index 07a57c4..9c7ea58 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -167,6 +167,13 @@ to load that file."
:type 'regexp
:group 'inf-clojure)
+(defcustom inf-clojure-comint-prompt-regexp "^\\( *#_\\|[^=> \n]+\\)=> *"
+ "Regexp to recognize both main prompt and subprompt for comint.
+This should usually be a combination of `inf-clojure-prompt' and
+`inf-clojure-subprompt'."
+ :type 'regexp
+ :group 'inf-clojure)
+
(defvar inf-clojure-buffer nil
"The current inf-clojure process buffer.
@@ -253,7 +260,7 @@ If `comint-use-prompt-regexp' is nil (the default),
\\[comint-insert-input] on o
Paragraphs are separated only by blank lines. Semicolons start comments.
If you accidentally suspend your process, use \\[comint-continue-subjob]
to continue it."
- (setq comint-prompt-regexp inf-clojure-prompt)
+ (setq comint-prompt-regexp inf-clojure-comint-prompt-regexp)
(setq mode-line-process '(":%s"))
(clojure-mode-variables)
(inf-clojure-eldoc-setup)
@@ -268,7 +275,7 @@ to continue it."
(save-excursion
(let ((end (point)))
(backward-sexp)
- (buffer-substring (point) end))))
+ (buffer-substring (max (point) (comint-line-beginning-position)) end))))
(defun inf-clojure-input-filter (str)
"Return t if STR does not match `inf-clojure-filter-regexp'."
- [nongnu] elpa/inf-clojure d2bedf9 048/313: Fix the installation instructions in the Elisp snippet, (continued)
- [nongnu] elpa/inf-clojure d2bedf9 048/313: Fix the installation instructions in the Elisp snippet, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7aa0299 062/313: Refactoring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 64263f7 045/313: Fix a typo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 8247c43 067/313: Add ElDoc info to README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6758a31 069/313: Fix for older Emacs, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0a7c61b 079/313: Fix a docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0259801 080/313: Kill a trailing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 63c2f9e 082/313: Add possibility to customize more vars, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d9e4400 087/313: Tweak the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 117d8cb 090/313: Bump the clojure-mode and Emacs deps, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e12db12 091/313: Fix prompt being included in input history,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure e6a4ef3 093/313: Add some handy GitHub templates to improve the contribution process, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-prompt-on-set-ns` (#46), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6e55048 099/313: [Fix #42] Add a defcustom controlling the window in which the REPL buffer is displayed, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 872c143 101/313: Handle properly ANSI color escape sequences in the REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2e1dd6c 108/313: Update the "Usage" section of the README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 916ec97 106/313: Infer the customization group from defcustom names, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a36d2a0 111/313: Remove unwanted ansi chars from the REPL output, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3929054 113/313: Modify CHANGELOG and README for REPL types, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d265232 115/313: Fix a problem with pcase on inf-clojure-repl-type, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ac74e20 117/313: Kill inf-clojure-var-at-point, ELPA Syncer, 2021/08/11