From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Modify text appearance (put spaces after commas just for display) Date: Tue, 26 Sep 2017 17:00:27 +0700 Message-ID: References: <87tvzpx1qo.fsf@eps142.cdf.udc.es> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1506420094 2159 195.159.176.226 (26 Sep 2017 10:01:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 10:01:34 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Alberto Luaces Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 26 12:01:22 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwmg0-000843-NB for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Sep 2017 12:01:16 +0200 Original-Received: from localhost ([::1]:46433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwmg8-0005lL-0D for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Sep 2017 06:01:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwmfg-0005kz-MO for help-gnu-emacs@gnu.org; Tue, 26 Sep 2017 06:00:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwmfa-0001Fk-RP for help-gnu-emacs@gnu.org; Tue, 26 Sep 2017 06:00:56 -0400 Original-Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:43342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwmfa-0001Ci-Ml for help-gnu-emacs@gnu.org; Tue, 26 Sep 2017 06:00:50 -0400 Original-Received: by mail-oi0-x22b.google.com with SMTP id r20so11093534oie.0 for ; Tue, 26 Sep 2017 03:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=tvYbtWyAh04wSwYce6I0bs30UAmNUEENK4F6nu8bElw=; b=trvknVPefrZJbJjzHGtzm1KZHyM12OabeATyZX7jisUwNoswlPWgM0NxcFEiBRneZd F+jkeUamt/7dzPWXpo3Q0dk3hMEY5TALluYlgIthmyoQJtwcCRA/cq/RjoWxjbnzuvzX 0QmGxST06mHGK2GkDMXXc28ltUef67qq0SBeaIKcQPcrcHJEU9IewPviPQFsaD0sbjP2 0S/+5+jCMPr/6tqgTp35jeD7vCWEdAIv1OMzETT9H9DistjpaaCUEWJGc0ZGCcahmzRx quy8gldk4YiWh0s7BwtZU90ZtdafZdBW2K70lrKcCa0j8xQVFcyMpsRcHd5NLEZ9g6kq NHwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=tvYbtWyAh04wSwYce6I0bs30UAmNUEENK4F6nu8bElw=; b=VohvZ1U5uWyfccL9Kr0zC+8m+fXa19e1aPoxM88go09/CMrcEcD57iOoju3rCNHxiX gNf5zhLUSujcP9xyBZfuP7c3od9iNuTDW67TW2vOzEWHnddchGYQmo1S12c4G/uSmXRc n75wTo6r8p9F8GJ95/sX+/6x/F8ggqZmKq0mHrWnT0a9iM/SdyPFA352EmeSJtxKoCyb N2g8jsiVBc64WmUo8AMUZUkbA8rccI7NwRG2q0lYoDWTM2IDTPxJlkCsTqWUBamlOMHz 8Coo8HhMHWieIjszmpNh3ngB3WE3dIXsiFmmS1o4ykDEm51OeCuIUeu0OMCT5IS48KSQ nW7A== X-Gm-Message-State: AHPjjUgXbt/0L1ll9voNnSGoPZMccIAA8ERda2H1bZ2G7ylxfvoUH4sR ZDKZWYFzBz+FuK04KTUh2q3X/2Ov2QykfWXUocw= X-Google-Smtp-Source: AOwi7QDNE7oAqRDwiesDAefiVmAINgOXkHOAs6w0Z8v4kUDiLxv015tPX7PAkJKDHfKeawnEzAo7OGWPC73p0mWOmGU= X-Received: by 10.202.69.85 with SMTP id s82mr9437400oia.269.1506420048180; Tue, 26 Sep 2017 03:00:48 -0700 (PDT) Original-Received: by 10.74.118.2 with HTTP; Tue, 26 Sep 2017 03:00:27 -0700 (PDT) In-Reply-To: <87tvzpx1qo.fsf@eps142.cdf.udc.es> X-Google-Sender-Auth: YsT8bZ3bYWskzDDlzcYnYnQGsOU X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:114411 Archived-At: On Tue, Sep 26, 2017 at 4:12 PM, Alberto Luaces wrote: > So, from the top of your head, what would be the less painful method to > change every comma to a comma+space, or at least change the color of the > commas to anything more distinguishable and attach it to the language > mode hook? One imperfect approximation would be to use prettify-symbols-mode. $ emacs -Q (add-to-list 'prettify-symbols-alist '("," . (?, (Br . Bl) ?\s))) M-x prettify-symbols-mode RET Limitations: * Does not act on commas in comments or string literals. * If a comma is followed by a space, you will see two spaces. If you want to overcome these, you will either want to write some custom predicates for prettify-symbols-mode, or dive a layer down and work with =E2=80=98font-lock-add-keywords=E2=80=99 directly.