unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: Milan Zamazal <pdm@zamazal.org>, 18730@debbugs.gnu.org
Subject: bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode'.
Date: Thu, 16 Oct 2014 16:16:38 +0200	[thread overview]
Message-ID: <xa1ta94wgkvt.fsf@mina86.com> (raw)
In-Reply-To: <m2egu8kvc6.fsf@lifelogs.com>

On Thu, Oct 16 2014, Ted Zlatanov <tzz@lifelogs.com> wrote:
> On Wed, 15 Oct 2014 10:01:26 +0200 Michal Nazarewicz <mina86@mina86.com> wrote: 
> MN> +** `auto-tildify-mode' allows to automatically add hard spaces as one types
> MN> +the text.  Breaking line after a single-character words are forbidden
> MN> +by Czech and Polish typography (and may be discouraged in other
> MN> +languages), so `auto-tildify-mode' makes it easier to create
> MN> +a typographically-correct documents.
>
> The name is kind of opaque, I expected it to do with tildes like the "~"
> character or maybe home directories but it's actually about
> typography.

The name, as I understand it, is historical because in the past it
indeed had to do with tildes.  In TeX (and LaTeX) tilde denotes
a non-breaking space.

I agree that the name may be confusing, but the mode has been around for
years, so changing the name now may be not worth it.

> As a suggestion, could it be a general `auto-typography-mode' with
> options, one of which would be
> `typography-no-linebreak-after-single-character-word'?  Similar to how
> `whitespace-mode' works?  There surely are other such typography
> options.

The way I see it, tildify is for fixing soft spaces, so perhaps a better
option would be to add a whitespace-mode style for that?

In particular, tildify is a bit heavy-weight as it implements
environment (or context) checking (e.g. checking if one is inside of
<pre> in HTML or inside of \begin{math} in LaTeX), which may be too slow
for whitespace-mode.  I don't have experience with fontifying though.

On Thu, Oct 16 2014, Ted Zlatanov <tzz@lifelogs.com> wrote:
> Another followup: it would be nice if `auto-{tildify,typography}-mode'
> worked with `fill-paragraph' as well. I don't think it will, as
> proposed (but haven't tested it).

There is, somewhat unrelated, fill-single-char-nobreak-p predicated:

  (when (fboundp 'fill-single-char-nobreak-p)
    (add-hook 'fill-nobreak-predicate 'fill-single-char-nobreak-p))

Again, it's much simpler than tildify since it does not check context,
but the way I see it is that one would use fill-paragraph for text that
needs to be formatted in source, while tildify is for cases where the
source is interpreted and rendered (like HTML where new lines are
treated the same way spaces are so how fill-paragraph fills does not
matter).

-- 
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	other threads:[~2014-10-16 14:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  8:01 bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Michal Nazarewicz
2014-10-15 14:35 ` Stefan Monnier
2014-10-16  9:34   ` Michal Nazarewicz
2014-10-16 14:03     ` Stefan Monnier
2014-10-16 14:57       ` Stefan Monnier
2014-10-16 16:07       ` Michal Nazarewicz
2014-10-16 19:39         ` Stefan Monnier
2014-10-17  8:44           ` Michal Nazarewicz
2014-10-17 13:06             ` Stefan Monnier
2014-10-22 23:19               ` Michal Nazarewicz
2014-10-24 22:51                 ` Stefan Monnier
2014-10-28 22:01                   ` bug#18730: [PATCH] tildify.el: introduce a `tildify-space-string' variable Michal Nazarewicz
2014-10-30 16:27                     ` Stefan Monnier
2014-11-03 15:59                       ` Michal Nazarewicz
2014-11-03 17:00                         ` Stefan Monnier
2014-11-17 15:41                           ` bug#18730: [PATCH 1/3] " Michal Nazarewicz
2014-11-17 15:41                             ` bug#18730: [PATCH 2/3] tildify.el: introduce a `tildify-pattern' variable Michal Nazarewicz
2014-11-17 15:41                             ` bug#18730: [PATCH 3/3] tildify.el: introduce a `tildify-foreach-region-function' variable Michal Nazarewicz
2014-11-17 17:38                             ` bug#18730: [PATCH 1/3] tildify.el: introduce a `tildify-space-string' variable Stefan Monnier
2014-10-16 13:17 ` bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Ted Zlatanov
2014-10-16 14:16   ` Michal Nazarewicz [this message]
2014-10-16 14:55     ` Stefan Monnier
2014-10-16 17:17       ` Ted Zlatanov
2014-10-16 13:19 ` Ted Zlatanov
2014-10-16 15:34 ` bug#18730: [PATCHv2 1/2] tildify.el (tildify--pick-alist-entry): rename from tildify-mode-alist Michal Nazarewicz
2014-10-16 15:34   ` bug#18730: [PATCHv2 2/2] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Michal Nazarewicz
2014-10-16 19:30   ` bug#18730: [PATCHv2 1/2] tildify.el (tildify--pick-alist-entry): rename from tildify-mode-alist Stefan Monnier
2014-11-24 14:20 ` bug#18730: [PATCH 1/2] tildify.el: Add `tildify-space' and `tildify-mode' Michal Nazarewicz
2014-11-24 14:20   ` bug#18730: [PATCH 2/2] tildify.el: Add `tildify-double-space-undos' Michal Nazarewicz
2014-12-10 17:44   ` bug#18730: [PATCH 1/2] tildify.el: Add `tildify-space' and `tildify-mode' Michal Nazarewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xa1ta94wgkvt.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=18730@debbugs.gnu.org \
    --cc=pdm@zamazal.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).