[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idris-mode dcabbc4 1/3: [ feature ] Make sending words of
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idris-mode dcabbc4 1/3: [ feature ] Make sending words of encouragement customisable. |
Date: |
Wed, 3 Nov 2021 11:57:57 -0400 (EDT) |
branch: elpa/idris-mode
commit dcabbc442165dd0ecbeb32b7064cc90b4393bce3
Author: Jan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk>
Commit: Jan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk>
[ feature ] Make sending words of encouragement customisable.
---
idris-settings.el | 5 +++++
inferior-idris.el | 16 +++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/idris-settings.el b/idris-settings.el
index 5033404..cb82ed5 100644
--- a/idris-settings.el
+++ b/idris-settings.el
@@ -84,6 +84,11 @@ The log is placed in `idris-event-buffer-name'."
:type 'boolean
:group 'idris)
+(defcustom idris-words-of-encouragement t
+ "Send words of encouragement."
+ :type 'boolean
+ :group 'idris)
+
;;; Faces
(defface idris-active-term-face
'((((background light))
diff --git a/inferior-idris.el b/inferior-idris.el
index 200a485..ff74c6d 100644
--- a/inferior-idris.el
+++ b/inferior-idris.el
@@ -142,7 +142,9 @@ directory variables.")
(set-process-query-on-exit-flag idris-connection t)
(setq idris-process-current-working-directory "")
(run-hooks 'idris-run-hook)
- (message "Connected. %s" (idris-random-words-of-encouragement))))
+ (when idris-words-of-encouragement
+ (message "Connected. %s" (idris-random-words-of-encouragement)))
+ ))
(defun idris-sentinel (_process msg)
(message "Idris disconnected: %s" (substring msg 0 -1))
@@ -183,14 +185,14 @@ directory variables.")
(cl-flet ((idris-warn (msg)
(unless (or (null msg) (string-blank-p msg))
(message "Warning from Idris: %s" msg))))
- (if (string-match idris-process-exact-port-output-regexp string)
- (idris-connect (string-to-number (match-string
idris-exact-port-matcher string)))
- (if (not (string-match idris-process-port-with-warning-output-regexp
string))
- (idris-warn string)
+ (if (string-match idris-process-exact-port-output-regexp string)
+ (idris-connect (string-to-number (match-string
idris-exact-port-matcher string)))
+ (if (not (string-match idris-process-port-with-warning-output-regexp
string))
+ (idris-warn string)
(idris-warn (match-string idris-warning-matcher string))
(idris-connect (string-to-number (match-string
idris-warning-port-matcher string))))
- ""))))
-
+ ""))))
+
(defun idris-show-process-buffer (string)
"Show the Idris process buffer if STRING is non-empty."
(when (> (length string) 0)