GNU bug report logs -
#67463
30.0.50; Eglot may manage js-json-mode buffers with wrong server
Previous Next
Reported by: Pengji Zhang <kunhtkun <at> gmail.com>
Date: Sun, 26 Nov 2023 21:17:02 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 67463 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>> I suggest the patch below instead, which also "quick" but much less dirty.
> I didn't see it, did you attach it?
See second try below.
> Extra parents, muted parents, siblings become parents,
> definitely some good 90's sitcom material :-)
can't wait to see your script,
Stefan
[js-json.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 0115feb0e97..f042774431d 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3702,6 +3702,9 @@ js-base-mode
(define-derived-mode js-mode js-base-mode "JavaScript"
"Major mode for editing JavaScript."
:group 'js
+ (js--mode-setup))
+
+(defun js--mode-setup ()
;; Ensure all CC Mode "lang variables" are set to valid values.
(c-init-language-vars js-mode)
(setq-local indent-line-function #'js-indent-line)
@@ -3924,7 +3927,8 @@ js-ts--syntax-propertize
(put-text-property (1- ne) ne 'syntax-table syntax)))))
;;;###autoload
-(define-derived-mode js-json-mode js-mode "JSON"
+(define-derived-mode js-json-mode prog-mode "JSON"
+ (js--mode-setup) ;Reuse most of `js-mode', but not as parent (bug#67463).
(setq-local js-enabled-frameworks nil)
;; Speed up `syntax-ppss': JSON files can be big but can't hold
;; regexp matchers nor #! thingies (and `js-enabled-frameworks' is nil).
This bug report was last modified 1 year and 127 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.