]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify mode-indexed tables in packages
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Mar 2024 17:50:33 +0000 (12:50 -0500)
committerEshel Yaron <me@eshelyaron.com>
Mon, 11 Mar 2024 09:24:31 +0000 (10:24 +0100)
Now that we use extra-parents to group alternative major modes,
some tables can be simplified to mention only the group's leader.

* lisp/align.el (align-c++-modes, align-rules-list):
Don't bother listing TS alternatives.
(align-perl-modes): Don't bother listing CPerl alternative.

* lisp/info-look.el (perl-mode): Simplify.

* lisp/cedet/semantic/symref/grep.el (semantic-symref-filepattern-alist):
Don't bother listing TS alternatives.

* lisp/emulation/viper.el (viper-vi-state-mode-list): Don't bother
listing CPerl alternative.

* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions-if-enabled):
Take into account the modes hierarchy.
(gud-tooltip-modes): Don't bother listing TS alternatives.

* .dir-locals.el (c-ts-mode): Simplify.

(cherry picked from commit 41de53d4a1c49ef6c6e8ac4ecb0c10cb1b6e07ce)

.dir-locals.el
lisp/align.el
lisp/cedet/semantic/symref/grep.el
lisp/emulation/viper.el
lisp/htmlfontify.el
lisp/info-look.el
lisp/progmodes/gud.el
lisp/progmodes/hideshow.el

index 1a6acecc206c1587b34e8eb4574b1b23d94e7b18..b34949ae961f56ea0953bd7e46f82cb3a7ebadfd 100644 (file)
@@ -32,9 +32,7 @@
                (electric-quote-comment . nil)
                (electric-quote-string . nil)
               (mode . bug-reference-prog)))
- (c-ts-mode . ((c-ts-mode-indent-style . gnu)
-               (indent-tabs-mode . t)
-               (mode . bug-reference-prog)))
+ (c-ts-mode . ((c-ts-mode-indent-style . gnu))) ;Inherits `c-mode' settings.
  (log-edit-mode . ((log-edit-font-lock-gnu-style . t)
                    (log-edit-setup-add-author . t)
                   (vc-git-log-edit-summary-target-len . 50)
index fa95f24fa020975662a9f2093dcf333ae7423f2b..81ccc4b5e2d6f721b2a1293c89ee002c5e16d77f 100644 (file)
@@ -181,13 +181,12 @@ If nil, then no messages will ever be printed to the minibuffer."
   :type '(choice (const :tag "Align a large region silently" nil) integer)
   :group 'align)
 
-(defcustom align-c++-modes '( c++-mode c-mode java-mode
-                              c-ts-mode c++-ts-mode)
+(defcustom align-c++-modes '( c++-mode c-mode java-mode)
   "A list of modes whose syntax resembles C/C++."
   :type '(repeat symbol)
   :group 'align)
 
-(defcustom align-perl-modes '(perl-mode cperl-mode)
+(defcustom align-perl-modes '(perl-mode)
   "A list of modes where Perl syntax is to be seen."
   :type '(repeat symbol)
   :group 'align)
@@ -576,13 +575,13 @@ The possible settings for `align-region-separate' are:
                     "="
                     (group (zero-or-more (syntax whitespace)))))
      (group . (1 2))
-     (modes . '(conf-toml-mode toml-ts-mode lua-mode lua-ts-mode)))
+     (modes . '(conf-toml-mode lua-mode)))
 
     (double-dash-comment
      (regexp . ,(rx (group (zero-or-more (syntax whitespace)))
                     "--"
                     (zero-or-more nonl)))
-     (modes  . '(lua-mode lua-ts-mode))
+     (modes  . '(lua-mode))
      (column . comment-column)
      (valid  . ,(lambda ()
                   (save-excursion
index 83e3bc36073410d03c9a5646713a8092c03c6f5f..cc4d1546c85288690acfcc04b6caa25f36271606 100644 (file)
@@ -44,9 +44,7 @@ those hits returned.")
 
 (defvar semantic-symref-filepattern-alist
   '((c-mode "*.[ch]")
-    (c-ts-mode "*.[ch]")
     (c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
-    (c++-ts-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
     (html-mode "*.html" "*.shtml" "*.php")
     (mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
                                             ; duplication of
@@ -55,12 +53,8 @@ those hits returned.")
                                             ; major mode definition?
     (ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
                "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
-    (ruby-ts-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
-                  "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
     (python-mode "*.py" "*.pyi" "*.pyw")
-    (python-ts-mode "*.py" "*.pyi" "*.pyw")
     (perl-mode "*.pl" "*.PL")
-    (cperl-mode "*.pl" "*.PL")
     (lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs")
     )
   "List of major modes and file extension pattern.
index 83fcdf89375391d4d680f322209a5f3eb6d8dac9..287292a24dcbf84c9f09aa0a93d9f2e60bf75c85 100644 (file)
@@ -388,7 +388,6 @@ widget."
     idl-mode
 
     perl-mode
-    cperl-mode
     javascript-mode
     tcl-mode
     python-mode
index 6b9c623f31fc4e557aeeb756d7d7256a903599a9..89c2bee2204f1832fdc23283c44925affcf2b818 100644 (file)
@@ -586,6 +586,7 @@ If a window system is unavailable, calls `hfy-fallback-color-values'."
 (defvar hfy-cperl-mode-kludged-p nil)
 
 (defun hfy-kludge-cperl-mode ()
+  ;; FIXME: Still?
   "CPerl mode does its damnedest not to do some of its fontification when not
 in a windowing system - try to trick it..."
   (declare (obsolete nil "28.1"))
index da7beafe500adcb5acceeab88c65c81dfac48f77..cd59fdf17d73a9e8e139ed26fda3d431a316c5c9 100644 (file)
@@ -985,9 +985,8 @@ Return nil if there is nothing appropriate in the buffer near point."
                                  finally return "(python)Index")))))
 
 (info-lookup-maybe-add-help
- :mode 'cperl-mode
- :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*"
- :other-modes '(perl-mode))
+ :mode 'perl-mode
+ :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*")
 
 (info-lookup-maybe-add-help
  :mode 'latex-mode
index b7c85fe7f43b3ff0ef69eb77ed8ae75ca3a9a79d..f10b047cc749223aa1e4b83e60e27e6bf5b1b818 100644 (file)
@@ -3671,8 +3671,7 @@ Treats actions as defuns."
        (remove-hook 'after-save-hook #'gdb-create-define-alist t))))
 
 (defcustom gud-tooltip-modes '( gud-mode c-mode c++-mode fortran-mode
-                               python-mode c-ts-mode c++-ts-mode
-                                python-ts-mode)
+                               python-mode)
   "List of modes for which to enable GUD tooltips."
   :type '(repeat (symbol :tag "Major mode"))
   :group 'tooltip)
@@ -3708,10 +3707,9 @@ only tooltips in the buffer containing the overlay arrow."
               #'gud-tooltip-activate-mouse-motions-if-enabled)
   (dolist (buffer (buffer-list))
     (with-current-buffer buffer
-      (if (and gud-tooltip-mode
-              (memq major-mode gud-tooltip-modes))
-         (gud-tooltip-activate-mouse-motions t)
-       (gud-tooltip-activate-mouse-motions nil)))))
+     (gud-tooltip-activate-mouse-motions
+      (and gud-tooltip-mode
+              (derived-mode-p gud-tooltip-modes))))))
 
 (defvar gud-tooltip-mouse-motions-active nil
   "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
index b181b21118f4ee70ffa0496f122ad084190c9524..07616960565c06d05e8cbbf52c33f3c8a1db5ee3 100644 (file)
@@ -254,6 +254,9 @@ This has effect only if `search-invisible' is set to `open'."
 
 ;;;###autoload
 (defvar hs-special-modes-alist
+  ;; FIXME: Currently the check is made via
+  ;; (assoc major-mode hs-special-modes-alist) so it doesn't pay attention
+  ;; to the mode hierarchy.
   (mapcar #'purecopy
   '((c-mode "{" "}" "/[*/]" nil nil)
     (c-ts-mode "{" "}" "/[*/]" nil nil)