[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode 3d43b91d82 209/253: Add syntax highlighting to R
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode 3d43b91d82 209/253: Add syntax highlighting to REPL. |
Date: |
Sat, 29 Jan 2022 08:28:58 -0500 (EST) |
branch: elpa/raku-mode
commit 3d43b91d8208ddf4a387c0b634d72b5a7a6c2a36
Author: Tim Van den Langenbergh <tmt_vdl@gmx.com>
Commit: Tim Van den Langenbergh <tmt_vdl@gmx.com>
Add syntax highlighting to REPL.
Remove the comint-related variables from the major mode as we need a
separate comint mode.
---
raku-mode.el | 4 ----
raku-repl.el | 23 +++++++++++++++++++++++
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/raku-mode.el b/raku-mode.el
index 8d08db5f6b..9be44b1c5a 100644
--- a/raku-mode.el
+++ b/raku-mode.el
@@ -77,10 +77,6 @@
(setq-local comment-start-skip "#+ *")
(setq-local comment-use-syntax t)
(setq-local comment-end "")
- ;; REPL
- (setq comint-prompt-regexp raku-prompt-regexp)
- (setq comint-prompt-read-only t)
- (set (make-local-variable 'paragraph-start) raku-prompt-regexp)
;; Indentation (see SMIE in the Emacs manual)
;; TODO add rules for HEREDOC indentation
(smie-setup raku-smie-grammar #'raku-smie-rules
diff --git a/raku-repl.el b/raku-repl.el
index 5ea7fcc4cf..948042aec9 100644
--- a/raku-repl.el
+++ b/raku-repl.el
@@ -5,6 +5,7 @@
;;; Code:
(require 'comint)
+(require 'raku-font-lock)
(defcustom raku-exec-path "raku"
"Raku executable path."
@@ -22,6 +23,26 @@
(defvar raku-buffer-name "Raku REPL"
"Buffer name for `run-raku.")
+(define-derived-mode raku-repl-mode comint-mode "Raku"
+ "Major mode for `run-raku'."
+ ;; Set up the prompt and make it read only.
+ (setq-local comint-prompt-regexp raku-prompt-regexp)
+ (setq-local comint-prompt-readonly t)
+ ;; See raku-mode.el.
+ (setq-local syntax-propertize-function #'raku-syntax-propertize)
+ (add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline nil 'local)
+ (setq-local font-lock-syntactic-face-function
#'raku-font-lock-syntactic-face)
+ (setq-local font-lock-defaults '(raku-font-lock-keywords nil nil))
+ (add-hook 'raku-mode-hook 'imenu-add-menubar-index)
+ (setq imenu-generic-expression raku-imenu-generic-expression
+ imenu-case-fold-search nil)
+ (setq-local comment-start "#")
+ (setq-local comment-start-skip "#+ *")
+ (setq-local comment-use-syntax t)
+ (setq-local comment-end "")
+ ;; Don't jump beyond the prompt with M-{ or M-}.
+ (setq-local paragraph-start raku-prompt-regexp))
+
(defun run-raku ()
"Run an inferior instance of `raku' inside Emacs."
(interactive)
@@ -33,6 +54,8 @@
raku-exec-path
'()
(split-string raku-exec-arguments))))
+ (with-current-buffer buffer
+ (raku-repl-mode))
(display-buffer buffer)))
(defun raku-comint-get-process ()
- [nongnu] elpa/raku-mode d62231e902 167/253: Merge branch 'my-branch' of https://github.com/tbrowder/perl6-mode, (continued)
- [nongnu] elpa/raku-mode d62231e902 167/253: Merge branch 'my-branch' of https://github.com/tbrowder/perl6-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e53f3d4f94 194/253: Update README, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode f3256bb3fd 159/253: add some more test names, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 282dd2c9e1 199/253: detect '.raku' and '.rakumod' extensions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode afad310b14 198/253: Remove 'paragraph-separate variable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3ae6b19b24 235/253: Make keybindings more understandable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 357a72be71 229/253: Fix syntax highlighting for code blocks in POD., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 43fd562825 227/253: Merge pull request #36 from matiaslina/dont-highlight-operators-in-variables, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 5f885f4961 177/253: There's no need to install this, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode f6dcbaf9a4 190/253: Add raku exec path to customization group, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3d43b91d82 209/253: Add syntax highlighting to REPL.,
ELPA Syncer <=
- [nongnu] elpa/raku-mode e0639c89a3 230/253: Merge pull request #35 from tmtvl/24-highlight-pod-the-same-as-comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 4ed7c06294 200/253: also detect '.rakutest' extension, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode b6a5535e27 219/253: Merge pull request #29 from tmtvl/auto-insert-skeletons, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 8a6e17f174 234/253: Merge pull request #41 from anquegi/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 6fa383e25f 003/253: More robust magic matching of Perl 6 code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode ce3ef00b82 026/253: Syntax propertize <quoted words>, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 3cf62b8383 002/253: Only check if .t/.pl/.pm files contain Perl 6 code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 1b0698744b 015/253: Move Perl 6 detection into perl6-detect.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 2f3b6f5eec 039/253: Remvoe superfluous space, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 1a7cb03101 050/253: Slight change in wording, ELPA Syncer, 2022/01/29