emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Turning on/off tree-sitter modes


From: Dmitry Gutov
Subject: Re: Turning on/off tree-sitter modes
Date: Tue, 26 Nov 2024 20:45:29 +0200
User-agent: Mozilla Thunderbird

On 26/11/2024 20:42, Dmitry Gutov wrote:
On 26/11/2024 16:29, Eli Zaretskii wrote:
Maybe like this:

    Major Mode Remap Alist:
    List of remappings:
    INS DEL Remap:
                From major mode: js-mode
                To mode (or function): js-ts-mode
I'd prefer

    Major Mode Remap Alist:
    List of remappings:
    INS DEL
             Remap from major mode: js-mode
             To mode (or function): js-ts-mode

If we use the less-compact version, then the separate label "Remap:" (or "Repeat" by default) is not optional - it has to be there.

But if the word "Alist" was the issue, we can replace it:

  Major Mode Remap Alist:
  Remappings:
  INS DEL From major mode: js-mode
              To mode (or function): js-ts-mode

diff --git a/lisp/files.el b/lisp/files.el
index 9c105dbe1a5..9249585df0c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3606,7 +3606,10 @@ major-mode-remap-alist
 FUNCTION is typically a major mode which \"does the same thing\" as
 MODE, but can also be nil to hide other entries (either in this var or
 in `major-mode-remap-defaults') and means that we should call MODE."
-  :type '(alist (symbol) (function)))
+  :type '(alist
+          :tag "Remappings"
+          :key-type (symbol :tag "From major mode")
+          :value-type (function :tag "To mode (or function)")))

 (defvar major-mode-remap-defaults nil
   "Alist mapping file-specified modes to alternative modes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]