From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alessandro Bertulli Newsgroups: gmane.emacs.help Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex Date: Thu, 08 Sep 2022 14:08:37 +0200 Message-ID: <87wnae5aj4.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35994"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.9; emacs 29.0.50 Cc: Stefan Monnier , wilnerthomas@tutanota.com, help-gnu-emacs@gnu.org To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 08 14:34:20 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWGjc-0009Dx-HJ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 14:34:20 +0200 Original-Received: from localhost ([::1]:38030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWGjb-0000w8-ED for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 08:34:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGPf-0000P4-An for help-gnu-emacs@gnu.org; Thu, 08 Sep 2022 08:13:43 -0400 Original-Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:40642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWGPd-0005Db-C7 for help-gnu-emacs@gnu.org; Thu, 08 Sep 2022 08:13:42 -0400 Original-Received: by mail-ej1-x636.google.com with SMTP id l14so14095811eja.7 for ; Thu, 08 Sep 2022 05:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date; bh=zgfr7NTVEji6w9hasDnvn7f6Z8vuektiFqsZfg1lA9M=; b=qGMOnmQqP0aDOEqB338qhhN9V45uR5v6Pw98GnV80S5fcVHQggqZyRxgZy4UIY7Uu2 uMD3Es8ST/92Xeoa1pE/AeWnevqTnjPoIL4Hxwze85lHXkUlhdExm8NiAYDUme1K5h3k rw/Qd4An8c/erk0SIo82oFnQ/J982K7rC9LlRyrv/GPXKlYZIKVK7NKEBdVmnT86xZUj LC8DC0rhq+n16YQNSU/J1gVsvZu3/NHnEmkCC72ZSTUTFPNYroY0UFFXhb8F30Ps8E/s ayz+CJ5C/VGink98ZxccK7vIwRu2yGmGJ3Zyzb/D6bgocFtI5/66QlHAzplPYcsIznhe iLBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date; bh=zgfr7NTVEji6w9hasDnvn7f6Z8vuektiFqsZfg1lA9M=; b=dA67/O2+yCLS8h7uErYo0x92WB6xst+Ga41O+YL6MuJxWRvDxltIpQidBwrKa1T1Ir aOIGbUQdf3gGHioAGBWYEHYxB9/qabn7c7Ep4QCvwhGSOkaPVbYEq9VFVvrPeH6G1cgH skbL//h8wzS0IsvdYI/7C42VsHIg+xFR0mOfUZ4JXrMhlQHZ6bwtSMRK+AB3Zy8FPTDc KPWoaZmB5hUYMlGQb7f1sOxey2wE7kHM7cA62Ij1G824btMbDAtyOGt/8DATPu7TRPaV NgM/iriU2+38vt9kwuUOw0ORGxny3nCZx5qnzwrmuzhy+P8lL+mbnbd2q9iPXFPFeHcz CL8Q== X-Gm-Message-State: ACgBeo3dpAgWLvng9pFfsXvQXzejy4K9Oe7cgIu6qVol6DUUy6hdUkAj gtSop/jDUhZLTCESV3azYD/WYWitZlM= X-Google-Smtp-Source: AA6agR44vxoMT0TYvG59uOWPTNi6WyBWX842WB2DEARVeVAcfZX/QsJp0hxwfld7bytusooKPJ2i8A== X-Received: by 2002:a17:907:2710:b0:773:dd39:6344 with SMTP id w16-20020a170907271000b00773dd396344mr2204507ejk.411.1662639218183; Thu, 08 Sep 2022 05:13:38 -0700 (PDT) Original-Received: from commodoroII (2-235-154-9.ip228.fastwebnet.it. [2.235.154.9]) by smtp.gmail.com with ESMTPSA id gl17-20020a170906e0d100b007308bdef04bsm1175686ejb.103.2022.09.08.05.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 05:13:36 -0700 (PDT) In-reply-to: Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alessandro.bertulli96@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139325 Archived-At: > Have scrutinised this. The problem is the atrocious design around the implementation > of tex and latex major modes. > > This will work > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . LaTeX-mode)) > (add-hook 'LaTeX-mode-hook #'rainbow-delimiters-mode) > > But this will not > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . latex-mode)) > (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) I don't want to add more fuel, but just to clear a bit: latex-mode and tex-mode are the modes set up by vanilla Emacs. AUCTeX, which is an awesome package to provide a quick yet powerful LaTeX IDE in Emacs, provides LaTeX-mode and TeX-mode (note the capitalization). Is it confusing? Unfortunately, yes it is. > Work needs to be done so that there is just "tex-mode" and "latex-mode", > and getting rid with all this TeX-mode", "LaTeX-mode", TeX-mode-hook, > LaTeX-mode-hook, nonsense. I agree, but I guess the point is to not break compatibility with old codebases. I wonder if defining some aliases would work tho. > Tools are supposed to work well together but this is not the case with > "tex-related" modes. Actually they do, once corrected this thing. Probably you have auto-mode-alist set up so that .tex/.sty files are opened in LaTeX-mode, so latex-mode-hook is never actually run. Is this your problem, maybe? Anyway, I'm glad you got it work. -- Alessandro Bertulli