[Top][All Lists]

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

Variable-width font indentation: pasting outside Emacs

From: Drew Adams
Subject: Variable-width font indentation: pasting outside Emacs
Date: Tue, 6 Mar 2018 10:21:47 -0800 (PST)


I see lots of discussion about different ways that Emacs might
implement appropriate display wrt indentation and alignment, for
code and other text, and in particular, for variable-width fonts.

But all of that is only about how the text appears inside Emacs.
What about copying text and pasting it into other applications?

Today, with a fixed-width font, you can copy and paste text,
including code, into other apps and have it appear pretty much
as you might expect/hope.  (At least, that is, provided the
text uses only SPC and not tab chars for indentation, or
provided you first use `untabify'.)

Should some consideration be given to pasting variable-width
text outside Emacs in a way that pretty much does what a user
might want/expect?  If so, how to do that for variable-width

Could we, for example, (optionally) affect copy or paste
operations, to automatically try to compensate by inserting
the (more or less) right number of SPC chars of the
variable-width font (of the first non-whitespace char on the

Should we perhaps have different such conversions available
while copying, depending on the destination (paste) environment,
i.e., whether or not it handles variable-width text?

People communicate about code and other text in more and more
ways, many of which are and will remain outside Emacs.  Can we
try to DTRT for variable-width text, so that the result of
pasting into another app gives indentation and alignment that
at least approximates what one would want/expect?  If so,
should we try to do that?

Shouldn't we take a point of view in which Emacs is part of
the wider world and text is exchanged between Emacs and other
apps?  Thinking about that fact of exchange should maybe
affect decisions about how to indent and align variable-width
fonts inside Emacs.

Or if it doesn't, maybe we should at least think about how
we might convert text for exchange, from whatever design we
choose to solve the inside-Emacs problem of displaying
variable-width text with appropriate indentation and alignment.

Put differently, if we choose this or that implementation to
show variable-width text appropriately in Emacs, that might
affect how well the result of pasting outside Emacs reflects
the appearance inside Emacs.

reply via email to

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