[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/firefox-javascript-repl 18fa0a257b 07/24: Enable font l
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] externals/firefox-javascript-repl 18fa0a257b 07/24: Enable font lock |
Date: |
Thu, 1 Jun 2023 00:41:51 -0400 (EDT) |
branch: externals/firefox-javascript-repl
commit 18fa0a257b17bd0ea9c2e27a4d2f4c1ac17f18ae
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Enable font lock
* firefox-javascript-repl.el: Require cc-langs.
(firefox-javascript-repl-mode): Remove some duplicated settings.
Set js-mode as indirect comint buffer. Enable
comint-fontify-input-mode.
---
firefox-javascript-repl.el | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/firefox-javascript-repl.el b/firefox-javascript-repl.el
index 4433d719be..888586573e 100644
--- a/firefox-javascript-repl.el
+++ b/firefox-javascript-repl.el
@@ -35,6 +35,7 @@
;; Tested 2023-05-19 on ppc64le Debian Firefox 102.11.0esr (64-bit).
;;; Code:
+(require 'cc-langs)
(require 'js)
(require 'comint)
@@ -53,7 +54,6 @@ ARGUMENTS will be used for FORMAT, like `messages'."
(defvar fjrepl--prompt "FJ> "
"The prompt used in the Firefox JavaScript buffer.")
-;; fixme: font-lock.
(defun fjrepl--input-sender (process string)
"Send to PROCESS the STRING. Set `comint-input-sender' to this function."
(process-send-string process (fjrepl--format-message
@@ -71,9 +71,8 @@ ARGUMENTS will be used for FORMAT, like `messages'."
:after-hook
(progn
(when (and (string= (buffer-name) "*firefox-javascript-repl*")
- (fjrepl--parse-prior-message (current-buffer)))
+ (fjrepl--parse-prior-message (current-buffer))) ; No accidents.
(delete-region (point-min) (point-max)))
- (setq-local font-lock-keywords nil)
;; From js.el.
;; Ensure all CC Mode "lang variables" are set to valid values.
(c-init-language-vars js-mode)
@@ -144,16 +143,6 @@ ARGUMENTS will be used for FORMAT, like `messages'."
c-comment-prefix-regexp "//+\\|\\**")
(c-setup-paragraph-variables))
- (setq-local font-lock-defaults
- (list js--font-lock-keywords nil nil nil nil
- '(font-lock-syntactic-face-function
- . js-font-lock-syntactic-face-function)))
- (setq-local syntax-propertize-function #'js-syntax-propertize)
- (add-hook 'syntax-propertize-extend-region-functions
- #'syntax-propertize-multiline 'append 'local)
- (add-hook 'syntax-propertize-extend-region-functions
- #'js--syntax-propertize-extend-region 'append 'local)
-
(goto-char (point-max))
(setq-local comint-prompt-regexp
@@ -175,18 +164,14 @@ ARGUMENTS will be used for FORMAT, like `messages'."
(set-marker (process-mark (get-buffer-process (current-buffer)))
(point))
(set-marker (cdr comint-last-prompt) (point-max))
+ (setq-local comint-indirect-setup-function 'js-mode)
+ (comint-indirect-buffer)
+ (comint-fontify-input-mode)
(minibuffer-message
(with-temp-buffer (js-mode)
(insert "// JavaScript tip of the day:\n")
(font-lock-ensure (point-min) (point-max))
(buffer-string)))))
-;; FIXME: make font lock work. Maybe make the mode derived from
-;; js-mode instead.
-;; (setq-local font-lock-defaults
-;; (list js--font-lock-keywords nil nil nil nil
-;; '(font-lock-syntactic-face-function
-;; . js-font-lock-syntactic-face-function)))
-
(defun fjrepl--create-profile-directory ()
"Create a profile directory."
- [elpa] branch externals/firefox-javascript-repl created (now 7b288e2dba), Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 18fa0a257b 07/24: Enable font lock,
Thomas Fitzsimmons <=
- [elpa] externals/firefox-javascript-repl f601354463 08/24: Show JavaScript quirk on startup, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 7c8f747bba 10/24: Add a JavaScript example with which to test, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 76fe78566b 11/24: Polish process management, debugging and naming, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 075bd87281 15/24: Adjust commentary wording, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 2016b0eafa 22/24: Make firefox-javascript-repl--mode private, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl c2a0f7f44a 04/24: Get basic REPL working, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl f0ed5fbf81 03/24: Get ready for asynchronous JavaScript evaluation, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 77c9907e3e 18/24: Move usage to start of commentary, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 1e0638d411 17/24: Mention throwaway profile in commentary, Thomas Fitzsimmons, 2023/06/01
- [elpa] externals/firefox-javascript-repl 7b288e2dba 24/24: Bump version to 0.9.0, Thomas Fitzsimmons, 2023/06/01