When using separedit to edit an Emacs Lisp string, such as a docstring, quotes (like 'hello world') are syntax highlighted. This leads to incorrect highlighting of docstrings idioms like `asdf'.
This behavior is seems to be caused by separedit-{double,single}-quote-string-mode being defined as generic modes. As far as I can tell, it would be better if they were implemented as major modes derived from fundamental-mode.
The follow patch fixes that:
--- separedit.el (r1)
+++ separedit.el
@@ -1884,12 +1884,10 @@
map)
"Keymap for `separedit-double-quote-string-mode'.")
-(define-generic-mode 'separedit-double-quote-string-mode
- nil nil nil nil
- '((lambda ()
- (modify-syntax-entry ?' "\"")
- (use-local-map separedit-double-quote-string-mode-map)))
- "Major mode for editing double-quoted string.")
+(define-derived-mode separedit-double-quote-string-mode
+ fundamental-mode "Separedit-Double-Quote-String"
+ "Major mode for editing double-quoted string."
+ (modify-syntax-entry ?' "\""))
(defvar separedit-single-quote-string-mode-map
(let ((map (make-sparse-keymap)))
@@ -1897,12 +1895,10 @@
map)
"Keymap for `separedit-single-quote-string-mode'.")
-(define-generic-mode 'separedit-single-quote-string-mode
- nil nil nil nil
- '((lambda ()
- (modify-syntax-entry ?' "\"")
- (use-local-map separedit-single-quote-string-mode-map)))
- "Major mode for editing single-quoted string.")
+(define-derived-mode separedit-single-quote-string-mode
+ fundamental-mode "Separedit-Single-Quote-String"
+ "Major mode for editing single-quoted string."
+ (modify-syntax-entry ?' "\""))
;;;###autoload
(defun separedit-dwim-described-variable ()
When using separedit to edit an Emacs Lisp string, such as a docstring, quotes (like
'hello world') are syntax highlighted. This leads to incorrect highlighting of docstrings idioms like `asdf'.This behavior is seems to be caused by separedit-{double,single}-quote-string-mode being defined as generic modes. As far as I can tell, it would be better if they were implemented as major modes derived from fundamental-mode.
The follow patch fixes that: