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: Apply Emacs-Lisp `font-lock' rules to a string Date: Mon, 24 Aug 2015 05:19:02 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1440428373 25828 80.91.229.3 (24 Aug 2015 14:59:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Aug 2015 14:59:33 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 24 16:59:27 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 1ZTtDb-0000Se-DC for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 16:59:27 +0200 Original-Received: from localhost ([::1]:49005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTtDa-0004Pz-Kv for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 10:59:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTiHp-0004tS-IE for help-gnu-emacs@gnu.org; Sun, 23 Aug 2015 23:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTiHo-0007tq-W7 for help-gnu-emacs@gnu.org; Sun, 23 Aug 2015 23:19:05 -0400 Original-Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:33144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTiHo-0007sK-Gv for help-gnu-emacs@gnu.org; Sun, 23 Aug 2015 23:19:04 -0400 Original-Received: by lbbsx3 with SMTP id sx3so71737632lbb.0 for ; Sun, 23 Aug 2015 20:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=s71O8yy3VScQKIg3iT3XoDGmopuzYn2yMgkVLk+NP1g=; b=RyiL5gVuoFF5S/r3dh7XpWsN7uCiTxHoCi2a/FSUz8t7hbZiPC9VQhsryINUGo/MPb GHo4GcjlrvF62RVU/kwNgG4t2G6KK3s8HwMujk1UWGFDreelbzZrdqzs03HBdNE6grof XGtSKStnJk3KP8lqofgSxd50l9yo7inO1SAtBt7IXh2K8AjOIq0Yce20dUQVC3YigB7P SuyVwKNv3H1d8NcyOMspAOnBoanSVnv8Wn9gF7gddMOeaLqcg1x8wFYofxQWMY2/92Z9 GfBqhoh9+GKrp8j74QiEJnvogRuy3ZVrofqOhxHZIon2m+eWQuKIZkv04PQJBI5N3NSE 9VmQ== X-Received: by 10.112.171.68 with SMTP id as4mr18120035lbc.64.1440386342114; Sun, 23 Aug 2015 20:19:02 -0700 (PDT) Original-Received: by 10.112.34.17 with HTTP; Sun, 23 Aug 2015 20:19:02 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::234 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:106787 Archived-At: Assume I have a string somewhere in Emacs-Lisp program. I want this string to be propertized in such a way that when I display this string somewhere, it should have identical highlighting as if it would have been typed in Emacs-Lisp major mode (with `font-lock'). To expand on the problem, I have a string which contains regular expression, which I display in the echo area. It would be nice to apply standard highlighting to it. Is there any way to achieve this smoothly (preferably with one or a few calls to built-in functions)? Thanks. Regards, Alexander