unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Support paragraph-local tab stops
Date: Wed, 27 May 2020 19:26:35 +0300	[thread overview]
Message-ID: <83v9khs5s4.fsf@gnu.org> (raw)
In-Reply-To: <C7AC86AB-A451-427B-A943-8D67A7239BEB@gmail.com> (message from Yuan Fu on Wed, 27 May 2020 11:48:35 -0400)

> From: Yuan Fu <casouri@gmail.com>
> Date: Wed, 27 May 2020 11:48:35 -0400
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> > IMO, TAB stops are not the right tool for the job here.  You need to
> > use the :align-to display property, which allows to align text with
> > pixel granularity.
> 
> I think both approach are equally appropriate. And the tab-based one aligns more closely to word processors. If we want to gradually add WYSIWYG editor features, and enable Emacs to edit rich text, this is an unavoidable feature.

TABs in Emacs use columns, so their resolution is more coarse.
Therefore, they fit this job less well, because they cannot handle
variable-pitch fonts.

> I just wrote a (very rough) proof-of-concept patch—it’s much easier than I thought. With the patch you can do something like
> 
> (put-text-property (region-beginning) (region-end)
>                    'pixel-tab-stop-list '(70 140 210 280 350 420))

This is not TAB stops, this is a new text property that does the same
job as :align-to.  Why invent a new property when we already have an
existing one that does the same?



  reply	other threads:[~2020-05-27 16:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 23:26 Support paragraph-local tab stops Yuan Fu
2020-05-27  0:27 ` Yuan Fu
2020-05-27 15:29 ` Eli Zaretskii
2020-05-27 15:48   ` Yuan Fu
2020-05-27 16:26     ` Eli Zaretskii [this message]
2020-05-27 16:51       ` Yuan Fu

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=83v9khs5s4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).