bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode


From: Michal Nazarewicz
Subject: bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode'.
Date: Thu, 16 Oct 2014 11:34:36 +0200
User-agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu)

>> It is configured via two new customize variables:
>> `auto-tildify-pattern-alist' and `auto-tildify-check-envs'.

On Wed, Oct 15 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.

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).

* It will be less intuitive because text “far” behind a cursor will
  change, e.g. (^ denotes point):

      Foo Bar a ^

  and then after pressing “x” (_ denotes hard space):

      Foo Bar a_x^

* Furthermore, it might be hard/impossible to manually replace hard
  space with a soft space if user desires to do so.

>> +Breaking line after a single-character words are forbidden
>> +by Czech and Polish typography (and may be discouraged in other
>> +languages), so `auto-tildify-mode' makes it easier to create
>> +a typographically-correct documents.
>
> Indeed, that's why we have fill-single-char-nobreak-p.  You might like
> to write the above text is such a way to make it clear what's the
> difference between the two.

Would this be better:

** `tildify-mode' automatically hardens spaces as one types the text.
Breaking line after a single-character words is forbidden by Czech and Polish
typography.  `auto-tildify-mode' makes creating a typographically-correct markup
in formats such as HTML, LaTeX, Markdown, etc.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--





reply via email to

[Prev in Thread] Current Thread [Next in Thread]