From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: source liu Newsgroups: gmane.emacs.help Subject: Re: A problem in using font-lock-add-keywords Date: Tue, 5 Mar 2013 15:34:49 +0800 Message-ID: References: <87d2veigrz.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1362468904 17411 80.91.229.3 (5 Mar 2013 07:35:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 07:35:04 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Dmitry Gutov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 05 08:35:28 2013 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 1UCmPF-0001nZ-JQ for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 08:35:25 +0100 Original-Received: from localhost ([::1]:45117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCmOu-0007GB-29 for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 02:35:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCmOh-0007F2-V8 for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 02:34:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCmOg-0007cA-KI for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 02:34:51 -0500 Original-Received: from mail-wg0-f53.google.com ([74.125.82.53]:60844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCmOg-0007bl-EI for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 02:34:50 -0500 Original-Received: by mail-wg0-f53.google.com with SMTP id fn15so5268932wgb.20 for ; Mon, 04 Mar 2013 23:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=lrs3SVtQd9fVlv7NwMF7wRAMqXyIOuXvyg62JT3avts=; b=Wo8KubFkoKze2kOobkK3irylYqlRpTn6LuIhkApRC9NZht8gGS32ZzOGJUmvthK2Lu 6+vnKYBO41HDUcBkCMSGaMvw50ynIfih9yLkoW0uAvmpBXCawWv4LCXVJ4soQBF9+LJE P1wCGy+OtDzWhBnT2MsKxaXEcDJRgtAnuWPi8G2G0DrfV87iw0jv8EB8gouiadWuUqI8 d73gAQOAa4IttjO4/qDDLlg8S+fX4vbmBfBjYKGvdJcZJSxD/jLgBHIBAELknAAryAuk MNFrPRBqRHOcemv3/8gVMo8ss/YNJe6tjDs/+2uY+Npp+yV4WNHil9xyLL5FDljwGtuh /xXQ== X-Received: by 10.180.72.148 with SMTP id d20mr16384160wiv.31.1362468889715; Mon, 04 Mar 2013 23:34:49 -0800 (PST) Original-Received: by 10.227.204.74 with HTTP; Mon, 4 Mar 2013 23:34:49 -0800 (PST) In-Reply-To: <87d2veigrz.fsf@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.82.53 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:89359 Archived-At: done! the quote teach me a lesson. Thank you, Dmitry by the way, if i use this way, are there any restriction to the list, i mean, length, or size of the 'mylist' as metioned below. > The problem is likely with quoting. You need to expand the `regexp-opt' > call: > > (font-lock-add-keywords nil > `((,(regexp-opt mylist t) 1 font-lock-warning-face prepend) > ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)) > > By the way, as long as you want to highlight the whole match, you can > use the group number 0 and no grouping. -- Liu An Institution of modern physics, Shanghai, China