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: A problem in using font-lock-add-keywords Date: Tue, 5 Mar 2013 10:54:20 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1362452072 16247 80.91.229.3 (5 Mar 2013 02:54:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 02:54:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 05 03:54:56 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 1UCi1n-0001py-7G for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 03:54:55 +0100 Original-Received: from localhost ([::1]:33439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCi1R-0004g0-Re for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Mar 2013 21:54:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCi1G-0004fu-Ns for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 21:54:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCi1F-00024L-PU for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 21:54:22 -0500 Original-Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:50253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCi1F-00024E-Ii for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 21:54:21 -0500 Original-Received: by mail-we0-f169.google.com with SMTP id t11so5464763wey.14 for ; Mon, 04 Mar 2013 18:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=HjWb8hwvgCZ0yf+puy/gNQthbG1jiEb4sPY41mUrRHg=; b=1DV+T+XXYHjSJZ49ZfjZ3JCTM3vuU7epyO6YJEKMAM7IPna23jDmyYCGGSkFgduz2E kAC7uu4zac9dsQUIenG9CnuC0MsOkYN+1arDMDM8hUJyhPNpG3YvGndyYQv6+iqLRfZ/ IkYkoj/WHkXSlV5WSRyd5XNKA2A8Ff+QoRa0yK6skiquv3gwFeD3M0fA5SdayDM8QJhR k8eF+/ogwTdAkCaldOj/qXG8/kF/kTcakyLDmm3gv9Ydw7jEjdY705FarHh4ZIeBtOk/ H+/YrXug/JSnMcGz/QW6lqcxFQvBC343BUUBrJDQUtNz+2BLzllyzl+lRdzWzW0kZKBl xB8Q== X-Received: by 10.180.81.193 with SMTP id c1mr15614028wiy.19.1362452060286; Mon, 04 Mar 2013 18:54:20 -0800 (PST) Original-Received: by 10.227.204.74 with HTTP; Mon, 4 Mar 2013 18:54:20 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::229 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:89354 Archived-At: Hi, list 1. about font-lock-add-keywords I'm new to elisp, and i want to add some keywords to a mode( say, c-mode), a list is below, (defvar my-list '("FIXME" "AND" "OR")) and I find some hint in emacs help C-h f "font-lock-add-keywords" ========= reference from the buff of help =========== (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend) ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face))))) ========================================== i've tested it, it works, but when i change the expression of "\\<(FIXME\\):" by (regexp-opt mylist t), it can't work. does someone give me some hint where my problem is? 2. by the way, does emacs list have a max length? i find when the list is beyond about 4600 words, the bracket ")" cant match "(" -- Liu An Institution of modern physics, Shanghai, China