aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2020-08-01 15:23:59 +0200
committerOmar Polo <op@omarpolo.com>2020-08-01 15:23:59 +0200
commit485349ffcaf0ea77b059f5fcac4d06c10aee119a (patch)
tree3369b577b1134b8c5e1546025fd4c6fcc9b29a05
parent9537b3871a2c19ce204f314c1bb8bbe2de045e1f (diff)
downloadsam.el-485349ffcaf0ea77b059f5fcac4d06c10aee119a.tar.gz
sam.el-485349ffcaf0ea77b059f5fcac4d06c10aee119a.tar.bz2
remove sam-display-prompt in favor of sam-prompt
Ditch a double config for a single one: if sam-prompt is not nil, it is printed, otherwise it doesn't.
-rw-r--r--sam.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/sam.el b/sam.el
index 3ef3bfc..2230d2a 100644
--- a/sam.el
+++ b/sam.el
@@ -44,11 +44,8 @@
(defvar sam-current-buffer nil
"The active buffer where command would operate on.'")
-(defvar sam-prompt ""
- "The sam prompt.")
-
-(defvar sam-display-prompt nil
- "Whether to display the prompt or not.")
+(defvar sam-prompt nil
+ "The sam prompt. If nil, no prompt will be printed")
(defvar sam-is-inserting nil
"t if sam is accepting text input instead of commands.")
@@ -122,8 +119,8 @@
"Returns the string on the current line."
(copy-region-as-kill
(+ (if (and (not sam-is-inserting)
- sam-display-prompt)
- (length sam-display-prompt)
+ sam-prompt)
+ (length sam-prompt)
0)
(point-at-bol))
(point-at-eol))
@@ -158,7 +155,7 @@
(interactive)
(sam-exec-line)
(message "foo")
- (if (and (not sam-is-inserting) sam-display-prompt)
+ (if (and (not sam-is-inserting) sam-prompt)
(insert sam-prompt)))
(defun sam-current-buffer-p (buf)