From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.help Subject: Re: Apply Emacs-Lisp `font-lock' rules to a string Date: Wed, 26 Aug 2015 00:38:38 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1440542334 20485 80.91.229.3 (25 Aug 2015 22:38:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2015 22:38:54 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: John Mastro Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 26 00:38:54 2015 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 1ZUMrk-000574-5i for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Aug 2015 00:38:52 +0200 Original-Received: from localhost ([::1]:35052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUMrj-0007MT-DG for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Aug 2015 18:38:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUMrZ-0007MO-0c for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 18:38:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUMrY-0003aO-4l for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 18:38:40 -0400 Original-Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:34706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUMrX-0003aI-T2 for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 18:38:40 -0400 Original-Received: by lbbtg9 with SMTP id tg9so109723512lbb.1 for ; Tue, 25 Aug 2015 15:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pq1tYGV+CvkVkGFCiXa5uMQKgZwQA03IKyxlEhbdE50=; b=0B800EcGiHltYS+jEN3+uQDfSQQnIsduqpHMumcTqSIC1AOIXBAhZpBtSsCfvDZM2Q REISDtidHdvNjeT3lrQcGcgEJZevhUsswaCIXOCuUa6tjbVpYFJ1kZA+Yj1tWhY55Tg/ etFQb+DAbwHiWK0fOwvpZBlqd4pQ2RSoZHN6NJ8K6aRJ+z1+julXu5klgPOG7eJA0MiJ s3qHdI2jxcv9k4EHksKUiBSotQtawpbcZu59sdRdwspL9KMZke2yHdPMCo8fWNF/EDiR esmDpXDb4k5YWxYC6W7f2JrQJ0IiYLPD7a6NArPPHruYgkHRNy2XPSCqnZbbzwUh1qxG isNg== X-Received: by 10.152.18.164 with SMTP id x4mr23704862lad.35.1440542318921; Tue, 25 Aug 2015 15:38:38 -0700 (PDT) Original-Received: by 10.112.34.17 with HTTP; Tue, 25 Aug 2015 15:38:38 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::232 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:106841 Archived-At: >> (minibuffer-message >> (my-font-lock-string #'emacs-lisp-mode "\"\\\\(1\\\\|2\\\\)\"")) > > Oops, got the arguments backward there: > > (minibuffer-message > (my-font-lock-string "\"\\\\(1\\\\|2\\\\)\"" #'emacs-lisp-mode)) Cool! Thanks, John. I just want to point out that plain `message' also works fine if you do it like this (which is recommended anyway, even in the documentation): (message "%s" (my-font-lock-string ...)) Regards, Alexander