From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jack-mac Newsgroups: gmane.emacs.help Subject: Re: My humble additions to AUCTeX Date: Mon, 13 Jan 2014 08:35:32 -0800 (PST) Message-ID: <0b7644c6-18c5-4b4c-b5c6-1c08fecd1918@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389631217 7674 80.91.229.3 (13 Jan 2014 16:40:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jan 2014 16:40:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 13 17:40:24 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W2kYn-0005cL-AO for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jan 2014 17:40:21 +0100 Original-Received: from localhost ([::1]:43541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2kYm-0007bY-Pw for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Jan 2014 11:40:20 -0500 X-Received: by 10.66.141.231 with SMTP id rr7mr623533pab.47.1389630932692; Mon, 13 Jan 2014 08:35:32 -0800 (PST) X-Received: by 10.49.104.69 with SMTP id gc5mr75623qeb.23.1389630932638; Mon, 13 Jan 2014 08:35:32 -0800 (PST) Original-Path: usenet.stanford.edu!kk17no8770021pbb.0!news-out.google.com!fv6ni2943qab.1!nntp.google.com!6no8321902qao.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=90.32.168.219; posting-account=OWLhBgoAAAD1H7ELDXVfr3-5BJaMOe1v Original-NNTP-Posting-Host: 90.32.168.219 User-Agent: G2/1.0 Injection-Date: Mon, 13 Jan 2014 16:35:32 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:203099 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95368 Archived-At: Le lundi 13 janvier 2014 00:28:18 UTC+1, Marcin Borkowski a =E9crit=A0: > Also, I still consider myself an Elisp newbie, so it is well possible > that I did violate some conventions ar good style... >=20 > http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski In this file, you wrote: (defun TeX+-letter (&optional at-is-letter) "Returns a character class matching letters (including \"@\" if AT-IS-LETTER is true)." (concat "a-zA-Z" (if at-is-letter "@"))) (defun TeX+-looking-at-letter (&optional at-is-letter) "Returns t if the point is at a letter (including \"@\" if AT-IS-LETTER; default is not)." (looking-at (concat "[" (TeX+-letter at-is-letter) "]"))) These function create a new string each time they are called (even if at-is= -letter is nil). For efficiency purpose, I would suggest to "compile" them by hand into some= thing like: (defconst TeX+-letter-ccml "a-zA-Z" "A character class matching letters") (defconst TeX+-letter-and-at-ccml (concat TeX+-letter-ccml "@") "A character class matching letters including \"@\"") (defconst TeX+-letter-re (concat "[" TeX+-letter-ccml "]") "A regexp for character class matching letters") (defconst TeX+-letter-and-at-re (concat "[" TeX+-letter-and-at-ccml "]") "A regexp for character class matching letters including \"@\"") (defun TeX+-letter (&optional at-is-letter) "Returns a character class matching letters (including \"@\" if AT-IS-LETTER is true)." (if at-is-letter TeX+-letter-and-at-ccml TeX+-letter-ccml)) (defun TeX+-looking-at-letter (&optional at-is-letter) "Returns t if the point is at a letter (including \"@\" if AT-IS-LETTER; default is not)." (looking-at (if at-is-letter TeX+-letter-and-at-re TeX+-letter-re))) HTH )jack(