From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: steve-humphreys@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Including tex commands in a list Date: Thu, 28 Jan 2021 22:05:30 +0100 Message-ID: References: <87k0ryf0ho.fsf@web.de> <87lfcdnnr3.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12848"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 28 22:06:29 2021 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 1l5EUn-0003Fx-IK for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 22:06:29 +0100 Original-Received: from localhost ([::1]:38332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5EUm-0008Lj-Gy for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 16:06:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5ETv-0008Lb-2I for help-gnu-emacs@gnu.org; Thu, 28 Jan 2021 16:05:35 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:51557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5ETt-0002TM-4U for help-gnu-emacs@gnu.org; Thu, 28 Jan 2021 16:05:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1611867930; bh=8PNK7QED5qI+ZaW2MimrpVgHeB+JSkRz3enWLho3qO4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=KeeKm6hxNyMcSDjK+8jkZrjMQxt3oDYDI8iwjjpcRbfctH3nGpOy661Xnn5yQ2PWx q7GHznDK7x5kPTlOFX7ZNw176iRWMtjQI0cRz15pPARkp18hrtjKp1f2FmxzykDwWr dmuv3RwGp1sc1DvNmHqQnxRWOqTRVSfXO/aCL9kc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs02.server.lan [172.19.170.129]) (via HTTP); Thu, 28 Jan 2021 22:05:30 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87lfcdnnr3.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:HSM7ghY8mZqraOhoJWjdu2OjzuR/QYobnIujkg0zcoZZHQMj+GgXIn1AI0MKCwZMait1p +1lKtXsINv0k5VKJf/NPJNPZLuRYysqA/4p9hfDXYu61d3IWWQyjuHrr8Jr35e/gVbXrXEYXQh8W YjcnNL8GkYu57Ofl605x2VdSaPKopTwvViVYKNxezgrFlF4nVe0LxQIzgQ6AIK74Jgvdv84S8D8A ABe8y4/oWtk6NHImBONXVJ3/ZoeL+4wJHCTCSfszLUFtyN5ySyHMogCEVJvFVRqdx66zhK6/ygsZ Dk= X-UI-Out-Filterresults: notjunk:1;V03:K0:5Ud1mjDmHNI=:JlPSGdhTnZIGw2+FDIMbYl C6Ailu4AqsX+GSPSUIRIOd+6HAeNVGdzXvlw7sVz1FlVRFZbla77LAwBtwR2QfvVCSQtDmNre /1yqdpNXrz4njpJfMHgQ3xIzTQwzCzA5g9wlmni8+6FBorDL78XTUktc1HiM7F7ObUvT6llXq YkAuSrXYrtThsqTExWQ9Wr/WDsBMtIjxDRo/sYyHWsMcp+HxBuM1t1rk8xcONg+3nLVXbYBRJ HogfPy8bRczX9+9McgNHkl+YloeBnhafl4dxlhNj7AsjsB44wkEWlbjWJsXjfllYjoHmOZpUp HuiyB/1MibbjOwWOxDuBIA55/Jy5ixVxkM57OJol5zZA31FGJB5za04mvhnXQoq/9sJqexOyj 9r/iTuQSvQkZo07rVev4CVZ6rY2r6RmKEwoZ6MxFHCtEeZRsESRKmJ8pi3e3NdNXgpDtWL/sA ZxJT6k23nB0Ssrl2oHs4w3cblYcIuA8t6Y4rmkxejW/9VQB46RxiwrYgV8NNBw73j1w7BCcqX xbGtWWxq4ZbqYGadq7HwHiHSkhYkQIWw7UhNXLq+po7GuyDnnuwh9WSuX1vcDmPnlD635eXyX Qo1exUrVrRTaU= Received-SPF: pass client-ip=212.227.15.15; envelope-from=steve-humphreys@gmx.com; helo=mout.gmx.net 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:127407 Archived-At: I am using font lock to highlight keywords in a minor mode. Have changed from using "concat" to using "rx" as you suggested. However it does not seem equivalent. (defconst crucible-mtksy-keywords `(;; Greek (,(concat "\\\\\\<\\(alpha\\|beta\\|chi\\|delta\\|" "Delta\\|epsilon\\|varepsilon\\|eta\\|" "gamma\\|Gamma\\|iota\\|kappa \\|" "lambda\\|Lambda\\|mu\\|nu\\|" "omega\\|Omega\\|phi\\|varphi\\|" "Phi\\|pi\\|varpi\\|Pi\\|" "psi\\|Psi\\|rho\\|varrho\\|" "sigma\\|varsigma\\|Sigma\\|tau\\|" "theta\\|vartheta\\|Theta\\|upsilon\\|" "Upsilon\\|xi\\|Xi\\|zeta\\)\\>") (0 'crucible-mtksy-tfc))) "Fontification for letters and symbols.") (defun crucible-mtksy-tfc () "Font-lock setup for mathematical symbols." (font-lock-flush (point-min) (point-max)) (if crucible-mode (progn (font-lock-add-keywords nil crucible-mtksy-keywords t) (font-lock-add-keywords nil crucible-supinf-font-lock t)) (font-lock-remove-keywords nil crucible-mtksy-keywords) (crucible-supinf-disable (point-min) (point-max))) (font-lock-flush (point-min) (point-max))) > Sent: Friday, January 29, 2021 at 2:24 AM > From: "Michael Heerdegen" > To: steve-humphreys@gmx.com > Cc: help-gnu-emacs@gnu.org > Subject: Re: Including tex commands in a list > > steve-humphreys@gmx.com writes: > > > (defconst crucible-mtksy-keywords > > `(;; Greek > > (,(concat "\\\\\\<\\(alpha\\|beta\\|chi\\|delta\\|" > > "Delta\\|epsilon\\|varepsilon\\|eta\\|" > > "gamma\\|Gamma\\|iota\\|kappa \\|" > > "lambda\\|Lambda\\|mu\\|nu\\|" > > "omega\\|Omega\\|phi\\|varphi\\|" > > "Phi\\|pi\\|varpi\\|Pi\\|" > > "psi\\|Psi\\|rho\\|varrho\\|" > > "sigma\\|varsigma\\|Sigma\\|tau\\|" > > "theta\\|vartheta\\|Theta\\|upsilon\\|" > > "Upsilon\\|xi\\|Xi\\|zeta\\)\\>") > > (0 'crucible-mtksy-tfc)) ; > > > > It would help if I had an example of using "rx" for this. > > That would look like this (you want to add the missing greek letter > names): > > (defconst crucible-mtksy-keywords > `(;; Greek > (,(rx "\\" word-start > (or "alpha" "beta") ;add the other letters here > word-end) > (0 'crucible-mtksy-tfc)))) > > The result will be a slightly optimized regexp (equivalent to yours of > course). > > If you want to go that way, I think it would also be possible to avoid > the repetition of uncapitalized followed by a capitalized letter name. > > HTH, > > Michael. >