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 02:09:08 +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 1440547769 1012 80.91.229.3 (26 Aug 2015 00:09:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2015 00:09:29 +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 02:09:29 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 1ZUOHO-0008Kp-Im for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Aug 2015 02:09:26 +0200 Original-Received: from localhost ([::1]:35398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOHI-0001Ql-Jc for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Aug 2015 20:09:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOH8-0001QZ-AT for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 20:09:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUOH7-0003BH-Fv for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 20:09:10 -0400 Original-Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:33661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOH7-0003Aw-7Z for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 20:09:09 -0400 Original-Received: by lbbsx3 with SMTP id sx3so110121959lbb.0 for ; Tue, 25 Aug 2015 17:09:08 -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=qGVhU/L86Dy5EicdI3iDw8AVmE+73jUD8CaZTXHtyzg=; b=e/9eNUnI7DE3XJ/vXb6cdTM3m0/i5Fjg8aUseNEhu43/DKSQFAdX7VMxyPfUIgsPBL v/581JrMY42vSYWmsRtCfi/xjCd7GMQ7FIYBhxbtD8UUcoVALsqjXMbLuVM8JAEB1AmA HAVa4uTVmvCw0oTCkRK9wT1nuicIpYEXfoApS8ykJHdmStYGuZAPb4vKOZ/V7K/4yTLN 70DhAK30gdT7OVXOyE1Us9qN5rNABWXFSYopikYsawvLN8KBZ+swyHUuUuUnIWpP35vE Jvr0q8vUffGPEUpZo1W7hhb8rxHmyz49Y+gRuyogdg4t6NJTsHk5d405PERspmV9rVnm eJwA== X-Received: by 10.112.199.133 with SMTP id jk5mr28887016lbc.32.1440547748243; Tue, 25 Aug 2015 17:09:08 -0700 (PDT) Original-Received: by 10.112.34.17 with HTTP; Tue, 25 Aug 2015 17:09:08 -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::233 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:106843 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 ...)) Nevertheless, I still can't find a way to make (user-error "%s" (my-font-lock-string ...)) display colored output. Any suggestions? Regards, Alexander