branch: elpa/idris-mode commit 4cbe1539056f51b6832b4a326d24a2d525aa07de Author: Marek L <nospam.ke...@gmail.com> Commit: Marek L <nospam.ke...@gmail.com>
Move definition of *-words-of-encouragement to idris-repl.el where they are also used. --- idris-repl.el | 25 +++++++++++++++++++++++++ inferior-idris.el | 27 --------------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/idris-repl.el b/idris-repl.el index a5511c5e34..09e322a673 100644 --- a/idris-repl.el +++ b/idris-repl.el @@ -38,6 +38,31 @@ (eval-when-compile (require 'cl-lib)) +;;; Words of encouragement - strongly inspired by Slime +(defun idris-user-first-name () + (let ((name (if (string= (user-full-name) "") + (user-login-name) + (user-full-name)))) + (string-match "^[^ ]*" name) + (capitalize (match-string 0 name)))) + +(defvar idris-words-of-encouragement + `("Let the hacking commence!" + "Hacks and glory await!" + "Hack and be merry!" + ,(format "%s, this could be the start of a beautiful program." + (idris-user-first-name)) + ,(format "%s, this could be the start of a beautiful proof." + (idris-user-first-name)) + "The terms have seized control of the means of computation - a glorious future awaits!" + "It typechecks! Ship it!" + "Do you know 'Land of My Fathers'?" + "Constructors are red / Types are blue / Your code always works / Because Idris loves you")) + +(defun idris-random-words-of-encouragement () + "Return a random string of encouragement" + (nth (random (length idris-words-of-encouragement)) + idris-words-of-encouragement)) (defvar idris-prompt-string "Idris" "The prompt shown in the REPL.") diff --git a/inferior-idris.el b/inferior-idris.el index a300c72722..b54f52de5e 100644 --- a/inferior-idris.el +++ b/inferior-idris.el @@ -32,33 +32,6 @@ (require 'idris-log) (require 'idris-warnings) -;;; Words of encouragement - strongly inspired by Slime -(defun idris-user-first-name () - (let ((name (if (string= (user-full-name) "") - (user-login-name) - (user-full-name)))) - (string-match "^[^ ]*" name) - (capitalize (match-string 0 name)))) - - -(defvar idris-words-of-encouragement - `("Let the hacking commence!" - "Hacks and glory await!" - "Hack and be merry!" - ,(format "%s, this could be the start of a beautiful program." - (idris-user-first-name)) - ,(format "%s, this could be the start of a beautiful proof." - (idris-user-first-name)) - "The terms have seized control of the means of computation - a glorious future awaits!" - "It typechecks! Ship it!" - "Do you know 'Land of My Fathers'?" - "Constructors are red / Types are blue / Your code always works / Because Idris loves you")) - -(defun idris-random-words-of-encouragement () - "Return a random string of encouragement" - (nth (random (length idris-words-of-encouragement)) - idris-words-of-encouragement)) - ;;; Process stuff (defvar idris-process nil "The Idris process.")