From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.bugs Subject: bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode'. Date: Thu, 16 Oct 2014 18:07:30 +0200 Organization: http://mina86.com/ Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413475704 28727 80.91.229.3 (16 Oct 2014 16:08:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 16:08:24 +0000 (UTC) Cc: Milan Zamazal , 18730@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 16 18:08:16 2014 Return-path: Envelope-to: geb-bug-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 1Xenb5-0004g2-T0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Oct 2014 18:08:16 +0200 Original-Received: from localhost ([::1]:51172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xenb5-0005UO-1z for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Oct 2014 12:08:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xenax-0005UG-Sy for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 12:08:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xenat-0007Gj-9p for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 12:08:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xenat-0007Ge-6f for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 12:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xenas-0003fT-U1 for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 12:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Oct 2014 16:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18730-submit@debbugs.gnu.org id=B18730.141347566514064 (code B ref 18730); Thu, 16 Oct 2014 16:08:02 +0000 Original-Received: (at 18730) by debbugs.gnu.org; 16 Oct 2014 16:07:45 +0000 Original-Received: from localhost ([127.0.0.1]:46149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XenaW-0003eg-S9 for submit@debbugs.gnu.org; Thu, 16 Oct 2014 12:07:45 -0400 Original-Received: from mail-wg0-f44.google.com ([74.125.82.44]:46535) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XenaQ-0003eM-W8 for 18730@debbugs.gnu.org; Thu, 16 Oct 2014 12:07:39 -0400 Original-Received: by mail-wg0-f44.google.com with SMTP id y10so4064024wgg.3 for <18730@debbugs.gnu.org>; Thu, 16 Oct 2014 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:face:date:message-id:mime-version:content-type :content-transfer-encoding; bh=SyllO3clmmy8yBxhMTH53PtMu0My7pG/zhq8yvuoofs=; b=O4Phhh1yM2GZCJ98L1C7pWixJYFq7GxN4tcwjKO7z+kqg4DFCKydpdjp5WaRdZACrq dZ/UFRhyF5iQ77YFq0CmRmAa8n+zIuQQIf4ppX635xc/yjG5IGaOSfvGNN2HLAkZT4uO mL0GO1r/724Smk7k3lmXhYyqL0t7zHc8y6Io+FjuMHiLBn2BLys000GbHb+rRhwhdQMW x0MSgYCmf910QE0bgsszlGfUx6bsK9sKaj2JU2SFh0NeAwi9uwAbJ53hUsrDjHjJp+5J XXolJwVJtNq61MGzWOSvgpsE7T1xkSlzuj9rcTuv57ZwkEjHzWsmJWUYllwWWsd1JNhY zHfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to :organization:references:user-agent:face:date:message-id :mime-version:content-type:content-transfer-encoding; bh=SyllO3clmmy8yBxhMTH53PtMu0My7pG/zhq8yvuoofs=; b=lKOY7htA5Q1+vdfyLdLwrC8YMJJ0RZy44oKeO0FIZIbCWzKfvWMH8OdEB83zEL7WJz auKaRPSTgMw+JeSpf8rpgZqthaBnfERkteWU/BfkRCKDz15o0KR5yGj/ziNgNpMtII3B kqlLVIVN5fplhXXsyqv/ZRS510LANJrkpaaKqLOIRpa4Sho+tFUVsA1GQLv1BLzdBHdl 2OeHUt1Dmb/yv2tt+IkghEc5wyPaahMoWDxOcVCX0lRFsiOaKWzb/KQrjK4noDRby/x5 t0y8jurHFQ7IQ0PxtAycgy39zfnD/kLx8MkH3rq5AlAAMp/WcNcgEHl/TNZUqLRCoEbl pHaQ== X-Gm-Message-State: ALoCoQmoJ55ZXb2oT8nlcIqYifF9zwmU3FPa9kyB2a9iBaglURVP7qwOtQOiCW2p4ysw+T4RsYFC X-Received: by 10.180.187.130 with SMTP id fs2mr21656126wic.24.1413475654067; Thu, 16 Oct 2014 09:07:34 -0700 (PDT) Original-Received: from mpn-glaptop.roam.corp.google.com ([172.16.39.141]) by mx.google.com with ESMTPSA id hu3sm27939251wjb.17.2014.10.16.09.07.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Oct 2014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kKTFHDWfPniR 4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:141016:pdm@zamazal.org::h1FOWKyxMFFOeA//:000WWB X-Hashcash: 1:20:141016:monnier@iro.umontreal.ca::zvBTPsL+5VnlpFoz:00000000000000000000000000000000000001x2l X-Hashcash: 1:20:141016:18730@debbugs.gnu.org::osHJMxic8bnqo+xa:00000000000000000000000000000000000000004NtN X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94635 On Thu, Oct 16 2014, Stefan Monnier wrote: >>> Could it use the existing tildify-pattern-alist? >> In the current implementation those two have to be a separate alists. >> tildify-pattern-alist assumes that the whole text is available so the >> patterns may check text before and after the soft space. Patterns in >> auto-tildify-pattern-alist can only look back before the space >> character. > > Is there a particular reason we can't use tildify-pattern-alist anyway > (and look both before *and* after)? > > Or recognize the entries of tildify-pattern-alist which can't be used > (e.g. make sure that the char modified is the one right before point)? No, because with the default pattern, it won't be the character before point that is being changed. You can create a buffer, set latex-mode, and insert "Foo v bar v " (i.e. with trailing space at the end) and you'll see that when you run `tildify-buffer') the space after first v will be replaced, but the final one won't. So with automatic tildifying, the space will be hardened only after some word-character is inserted after the final space. >> The implementation could be changed to use tildify-pattern-alist but: >> * It will be slower because it would have to match pattern after every >> inserted character (whereas currently the pattern is matched only if >> character at point is space and character before it is a word >> character). > > Why? Can't we just check (eq last-command-event ?\s)? We cannot, see above. Of course, we can change `tildify-pattern-alist''s default value and require that it does not look past the white-space that is being replaced, in which case auto-tildify will be able to use it. I would be fine with that myself, but I don't know how strict should we be about backward compatibility. --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo--