all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Yanking as HTML
@ 2016-10-30  9:42 Lars Ingebrigtsen
  2016-10-30  9:51 ` Andreas Schwab
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30  9:42 UTC (permalink / raw)
  To: emacs-devel

I've tried googling for this for a few minutes, but I haven't found
anything promising (without relying on uncommon external programs).

I sometimes copy text from Firefox to Emacs, and when I'm pasting into
HTML documents, I would sometimes prefer to retain the HTML formatting
of what I'm copying.

Does Emacs have support for this somehow?  And if not, has anybody
thought about what this support should look like?  Obviously, the user
must be able to control "how much" richness should be yanked when
yanking (just the text; the HTML formatting; perhaps images too?).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
@ 2016-10-30  9:51 ` Andreas Schwab
  2016-10-30 10:41   ` Lars Ingebrigtsen
  2016-10-30 10:05 ` Daniel Colascione
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Andreas Schwab @ 2016-10-30  9:51 UTC (permalink / raw)
  To: emacs-devel

On Okt 30 2016, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> I've tried googling for this for a few minutes, but I haven't found
> anything promising (without relying on uncommon external programs).

What are those programs doing?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
  2016-10-30  9:51 ` Andreas Schwab
@ 2016-10-30 10:05 ` Daniel Colascione
  2016-10-30 10:47   ` Lars Ingebrigtsen
  2016-10-30 10:15 ` YAMAMOTO Mitsuharu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Daniel Colascione @ 2016-10-30 10:05 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've tried googling for this for a few minutes, but I haven't found
> anything promising (without relying on uncommon external programs).
>
> I sometimes copy text from Firefox to Emacs, and when I'm pasting into
> HTML documents, I would sometimes prefer to retain the HTML formatting
> of what I'm copying.
>
> Does Emacs have support for this somehow?  And if not, has anybody
> thought about what this support should look like?  Obviously, the user
> must be able to control "how much" richness should be yanked when
> yanking (just the text; the HTML formatting; perhaps images too?).

A long time ago, I implemented support for rich-text copying _out_ of
Emacs in the HAVE_NTGUI case, but that code never landed in the
tree. The feature you're requesting is pretty straightforward to
implement, but it needs platform-specific C code. I agree about the user
options for controlling it --- perhaps on an operation-by-operation
basis via some kind of special prefix flag.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
  2016-10-30  9:51 ` Andreas Schwab
  2016-10-30 10:05 ` Daniel Colascione
@ 2016-10-30 10:15 ` YAMAMOTO Mitsuharu
  2016-10-30 10:43   ` Lars Ingebrigtsen
  2016-10-30 10:38 ` Igor Sosa Mayor
  2016-11-04  7:13 ` Thierry Volpiatto
  4 siblings, 1 reply; 25+ messages in thread
From: YAMAMOTO Mitsuharu @ 2016-10-30 10:15 UTC (permalink / raw)
  To: emacs-devel

>>>>> On Sun, 30 Oct 2016 10:42:10 +0100, Lars Ingebrigtsen <larsi@gnus.org> said:

> I've tried googling for this for a few minutes, but I haven't found
> anything promising (without relying on uncommon external programs).

> I sometimes copy text from Firefox to Emacs, and when I'm pasting
> into HTML documents, I would sometimes prefer to retain the HTML
> formatting of what I'm copying.

> Does Emacs have support for this somehow?  And if not, has anybody
> thought about what this support should look like?  Obviously, the
> user must be able to control "how much" richness should be yanked
> when yanking (just the text; the HTML formatting; perhaps images
> too?).

What would the result of (gui-get-selection 'CLIPBOARD 'TARGETS) look
like after copying text from the browser to the clipboard?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
                   ` (2 preceding siblings ...)
  2016-10-30 10:15 ` YAMAMOTO Mitsuharu
@ 2016-10-30 10:38 ` Igor Sosa Mayor
  2016-11-04  7:13 ` Thierry Volpiatto
  4 siblings, 0 replies; 25+ messages in thread
From: Igor Sosa Mayor @ 2016-10-30 10:38 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've tried googling for this for a few minutes, but I haven't found
> anything promising (without relying on uncommon external programs).
>
> I sometimes copy text from Firefox to Emacs, and when I'm pasting into
> HTML documents, I would sometimes prefer to retain the HTML formatting
> of what I'm copying.
>
> Does Emacs have support for this somehow?  And if not, has anybody
> thought about what this support should look like?  Obviously, the user
> must be able to control "how much" richness should be yanked when
> yanking (just the text; the HTML formatting; perhaps images too?).

maybe I don't understand the question, but: why you don't take the
source code of the site you're copying? In firefox: Ctrl-U if I remember
rightly...


-- 
:: Igor Sosa Mayor     :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/      ::
:: jabberid: rogorido  ::                            ::




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:51 ` Andreas Schwab
@ 2016-10-30 10:41   ` Lars Ingebrigtsen
  2016-10-30 11:01     ` Andreas Schwab
  2016-10-30 17:17     ` Richard Stallman
  0 siblings, 2 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 10:41 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Okt 30 2016, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> I've tried googling for this for a few minutes, but I haven't found
>> anything promising (without relying on uncommon external programs).
>
> What are those programs doing?

Here's one on Linux:

[larsi@stories ~]$ xclip -o -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
text/html
text/_moz_htmlcontext
text/_moz_htmlinfo
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/x-moz-url-priv
[larsi@stories ~]$ xclip -o -t text/html
<div class="entry-meta">
                                                <span class="meta-prep meta-prep-author">BY</span> <span class="author vcard"><a class="url fn n" href="http://www.tcj.com/author/josselin-moneyron/" title="View all posts by Josselin Moneyron">Josselin Moneyron</a></span> <span class="entry-date">Oct 27, 2016</span>    </div>

So I guess it's ... looking at the various different clipboard contents?
(I am wholly unfamiliar with how cut-and-paste really works in X, I just
use Emacs :-)).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:15 ` YAMAMOTO Mitsuharu
@ 2016-10-30 10:43   ` Lars Ingebrigtsen
  2016-10-30 10:59     ` Yuri Khan
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 10:43 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> What would the result of (gui-get-selection 'CLIPBOARD 'TARGETS) look
> like after copying text from the browser to the clipboard?

(gui-get-selection 'CLIPBOARD 'TARGETS)
=> [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING COMPOUND_TEXT TEXT STRING]

Hm...  so it lacks the "text/html" target that xclip -o -t TARGETS
lists?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:05 ` Daniel Colascione
@ 2016-10-30 10:47   ` Lars Ingebrigtsen
  2016-10-30 10:52     ` Daniel Colascione
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 10:47 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel

Daniel Colascione <dancol@dancol.org> writes:

> A long time ago, I implemented support for rich-text copying _out_ of
> Emacs in the HAVE_NTGUI case, but that code never landed in the
> tree.

Oh, yeah, that's the other thing: It would be really nice if, when you
copy text from an eww buffer that it shows up as HTML if you paste it
into Firefox (or an Emacs HTML buffer, I guess).

> The feature you're requesting is pretty straightforward to
> implement, but it needs platform-specific C code.

Right.  Presumably on GNU/Linux first, and then the other platforms can
follow...

> I agree about the user
> options for controlling it --- perhaps on an operation-by-operation
> basis via some kind of special prefix flag.

And perhaps also (somehow) with different defaults pr mode.  If you're
yanking into an HTML buffer, `C-y' might default to yanking the
text/html clipboard?

And...  er...  what happens if you have an image in the clipboard?
Hm...  Well, it might make sense in a Message buffer?  It gets turned
into a image/jpeg (or whatever) part?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:47   ` Lars Ingebrigtsen
@ 2016-10-30 10:52     ` Daniel Colascione
  0 siblings, 0 replies; 25+ messages in thread
From: Daniel Colascione @ 2016-10-30 10:52 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Daniel Colascione <dancol@dancol.org> writes:
> And...  er...  what happens if you have an image in the clipboard?
> Hm...  Well, it might make sense in a Message buffer?  It gets turned
> into a image/jpeg (or whatever) part?  

The right answer clearly involves aalib.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:43   ` Lars Ingebrigtsen
@ 2016-10-30 10:59     ` Yuri Khan
  2016-10-30 11:18       ` Lars Ingebrigtsen
  2016-10-30 11:25       ` Lars Ingebrigtsen
  0 siblings, 2 replies; 25+ messages in thread
From: Yuri Khan @ 2016-10-30 10:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: YAMAMOTO Mitsuharu, Emacs developers

On Sun, Oct 30, 2016 at 5:43 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> (gui-get-selection 'CLIPBOARD 'TARGETS)
> => [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING COMPOUND_TEXT TEXT STRING]
>
> Hm...  so it lacks the "text/html" target that xclip -o -t TARGETS
> lists?

Your xclip invocation targets the PRIMARY selection (by default) while
the elisp snippet examines CLIPBOARD. This might be a reason for the
difference you observe.

In my test, text/html was present and I was able to see it as an Emacs
propertized string containing HTML tags.

Note that, in general, it is impossible to correctly copy-paste styled
HTML between documents:

* If you paste only the HTML, half the users will complain that “what
you get” in the target document differs from “what you see” of the
source document.

* If you paste both the HTML and CSS of the source, you introduce a
non-local effect (HTML is pasted at point while CSS needs to be pasted
at a different location).

* In a misguided attempt to sidestep the issue above, some programs
parse the HTML and CSS and apply CSS as direct formatting (HTML
style="" attribute). At this point, the other half of the users
(myself included) will complain that direct formatting is evil and any
tool that produces such where there was none is broken.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:41   ` Lars Ingebrigtsen
@ 2016-10-30 11:01     ` Andreas Schwab
  2016-10-30 11:08       ` Lars Ingebrigtsen
  2016-10-30 17:17     ` Richard Stallman
  1 sibling, 1 reply; 25+ messages in thread
From: Andreas Schwab @ 2016-10-30 11:01 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

On Okt 30 2016, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> On Okt 30 2016, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>>
>>> I've tried googling for this for a few minutes, but I haven't found
>>> anything promising (without relying on uncommon external programs).
>>
>> What are those programs doing?
>
> Here's one on Linux:
>
> [larsi@stories ~]$ xclip -o -t TARGETS
> TIMESTAMP
> TARGETS
> MULTIPLE
> text/html
> text/_moz_htmlcontext
> text/_moz_htmlinfo
> UTF8_STRING
> COMPOUND_TEXT
> TEXT
> STRING
> text/x-moz-url-priv
> [larsi@stories ~]$ xclip -o -t text/html

What do you get from (x-get-selection-internal 'CLIPBOARD 'text/html)?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 11:01     ` Andreas Schwab
@ 2016-10-30 11:08       ` Lars Ingebrigtsen
  2016-10-30 11:25         ` Stephen Berman
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 11:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> What do you get from (x-get-selection-internal 'CLIPBOARD 'text/html)?

nil

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:59     ` Yuri Khan
@ 2016-10-30 11:18       ` Lars Ingebrigtsen
  2016-10-30 11:34         ` mituharu
  2016-10-30 11:25       ` Lars Ingebrigtsen
  1 sibling, 1 reply; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 11:18 UTC (permalink / raw)
  To: Yuri Khan; +Cc: YAMAMOTO Mitsuharu, Emacs developers

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Sun, Oct 30, 2016 at 5:43 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> (gui-get-selection 'CLIPBOARD 'TARGETS)
>> => [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING
>> COMPOUND_TEXT TEXT STRING]
>>
>> Hm...  so it lacks the "text/html" target that xclip -o -t TARGETS
>> lists?
>
> Your xclip invocation targets the PRIMARY selection (by default) while
> the elisp snippet examines CLIPBOARD. This might be a reason for the
> difference you observe.

(gui-get-selection 'PRIMARY 'TARGETS)
=> [TIMESTAMP TARGETS MULTIPLE text/html text/_moz_htmlcontext text/_moz_htmlinfo UTF8_STRING COMPOUND_TEXT TEXT STRING text/x-moz-url-priv]

Oh, yeah, there it is.

(x-get-selection-internal 'PRIMARY 'text/html)
=>
#("\377\376<div class=\"entry-meta\">
						<span class=\"meta-prep meta-prep-author\">BY</span> <span class=\"author vcard\"><a class=\"url fn n\" href=\"http://www.tcj.com/author/josselin-moneyron/\" title=\"View all posts by Josselin Moneyron\">Josselin Moneyron</a></span> <span class=\"entry-date\">Oct 27, 2016</span>					</div>" 0 620 (foreign-selection STRING))

Fun!  Apparently the support for doing this is in Emacs already, but it
needs some tweaking (the selection is in utf-16 or something and needs
decoding before usage?), so the main issue is really one of user
interface and not the low-level support (that much).

> Note that, in general, it is impossible to correctly copy-paste styled
> HTML between documents:
>
> * If you paste only the HTML, half the users will complain that “what
> you get” in the target document differs from “what you see” of the
> source document.

Well...  People know that Emacs isn't a wysiwyg editor, so I don't think
that is a complaint that will be common.  The complaint will be 50% "why
is it outputting all this HTML junk into my buffer?" and 50% "why isn't
it outputting any HTML into my buffer?"  :-)

So creating a user interface that for this that annoys the least number
of people is what's important.

And it could even be a total opt-in thing, like a global minor mode
like, er, `clever-yank-mode'.

What about drag-and-drop?  Is that basically the same as selections?  If
I were to drag an image from Firefox to this Message mode buffer, is it
feasible to make that do something useful?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:59     ` Yuri Khan
  2016-10-30 11:18       ` Lars Ingebrigtsen
@ 2016-10-30 11:25       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 11:25 UTC (permalink / raw)
  To: Emacs developers

[Uhm, I sent a message with NUL characters that was apparently dropped
by the GNU mail servers, so I'm resending.  Apologies if this shows up
twice.] 

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Sun, Oct 30, 2016 at 5:43 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> (gui-get-selection 'CLIPBOARD 'TARGETS)
>> => [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING
>> COMPOUND_TEXT TEXT STRING]
>>
>> Hm...  so it lacks the "text/html" target that xclip -o -t TARGETS
>> lists?
>
> Your xclip invocation targets the PRIMARY selection (by default) while
> the elisp snippet examines CLIPBOARD. This might be a reason for the
> difference you observe.

(gui-get-selection 'PRIMARY 'TARGETS)
=> [TIMESTAMP TARGETS MULTIPLE text/html text/_moz_htmlcontext text/_moz_htmlinfo UTF8_STRING COMPOUND_TEXT TEXT STRING text/x-moz-url-priv]

Oh, yeah, there it is.

(x-get-selection-internal 'PRIMARY 'text/html)
=>
#("<div class=\"entry-meta\">
						<span class=\"meta-prep meta-prep-author\">BY</span> <span class=\"author vcard\"><a class=\"url fn n\" href=\"http://www.tcj.com/author/josselin-moneyron/\" title=\"View all posts by Josselin Moneyron\">Josselin Moneyron</a></span> <span class=\"entry-date\">Oct 27, 2016</span>					</div>" 0 620 (foreign-selection STRING))

Fun!  Apparently the support for doing this is in Emacs already, but it
needs some tweaking (the selection is in utf-16 or something and needs
decoding before usage?), so the main issue is really one of user
interface and not the low-level support (that much).

[And when I eval-ed this in Emacs, I got a NUL byte before each ASCII
character, which seems to indicate UTF-16.]

> Note that, in general, it is impossible to correctly copy-paste styled
> HTML between documents:
>
> * If you paste only the HTML, half the users will complain that “what
> you get” in the target document differs from “what you see” of the
> source document.

Well...  People know that Emacs isn't a wysiwyg editor, so I don't think
that is a complaint that will be common.  The complaint will be 50% "why
is it outputting all this HTML junk into my buffer?" and 50% "why isn't
it outputting any HTML into my buffer?"  :-)

So creating a user interface that for this that annoys the least number
of people is what's important.

And it could even be a total opt-in thing, like a global minor mode
like, er, `clever-yank-mode'.

What about drag-and-drop?  Is that basically the same as selections?  If
I were to drag an image from Firefox to this Message mode buffer, is it
feasible to make that do something useful?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 11:08       ` Lars Ingebrigtsen
@ 2016-10-30 11:25         ` Stephen Berman
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Berman @ 2016-10-30 11:25 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andreas Schwab, emacs-devel

On Sun, 30 Oct 2016 12:08:19 +0100 Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> What do you get from (x-get-selection-internal 'CLIPBOARD 'text/html)?
>
> nil

When I select a region of a browser page,
e.g. http://www.gnu.org/software/emacs/, with the mouse and type C-c,
then switch to *scratch* in Emacs, which already contains the above sexp
with point at the closing paren, and type C-j, I get this (displayed
here with line breaks for legibility instead of as a single line):

#("<div class=\"logo\" style=\"margin: 0px; padding: 0px; border: 0px;
 font-family: 'fira sans', sans; font-size: 18px; font-style: normal;
 font-variant: normal; font-weight: normal; line-height: 26px;
 vertical-align: baseline; overflow: hidden; text-align: center;
 z-index: 1; color: rgb(63, 59, 59); letter-spacing: normal; orphans: 2;
 text-indent: 0px; text-transform: none; white-space: normal; widows: 2;
 word-spacing: 0px; -webkit-text-size-adjust: auto;
 -webkit-text-stroke-width: 0px; background-color: rgb(245, 245,
 237);\"><a href=\"http://www.gnu.org/software/emacs/emacs.html\"
 style=\"margin: 0px; padding: 0px; border: 0px; font-family: inherit;
 font-size: inherit; font-style: inherit; font-variant: inherit;
 font-weight: inherit; line-height: inherit; vertical-align: baseline;
 color: rgb(118, 49, 159); text-decoration: none;\"><img
 src=\"http://www.gnu.org/software/emacs/images/emacs.png\"
 alt=\"Emacs\" style=\"margin: 0px; padding: 0px; border: 0px;
 font-family: inherit; font-size: inherit; font-style: inherit;
 font-variant: inherit; font-weight: inherit; line-height: inherit;
 vertical-align: top; max-height: 100px;\"></a><span
 class=\"Apple-converted-space\">\302\240</span><h1 style=\"margin: 0px
 10px; padding: 0px; border: 0px; font-family: inherit; font-size: 4em;
 font-style: inherit; font-variant: inherit; font-weight: 600;
 line-height: 110px; vertical-align: baseline; display: inline;\">GNU
 Emacs</h1></div><h2 style=\"margin: 20px auto 10px; padding: 0px;
 border: 0px; font-family: 'fira sans', sans; font-size: 2.6em;
 font-style: normal; font-variant: normal; font-weight: 300;
 line-height: 1.3em; vertical-align: baseline; z-index: 1; text-align:
 center; max-width: 760px; color: rgb(63, 59, 59); letter-spacing:
 normal; orphans: 2; text-indent: 0px; text-transform: none;
 white-space: normal; widows: 2; word-spacing: 0px;
 -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
 background-color: rgb(245, 245, 237);\">An extensible, customizable,<a
 href=\"http://www.gnu.org/philosophy/free-sw.html\" style=\"margin:
 0px; padding: 0px; border: 0px; font-family: inherit; font-size:
 inherit; font-style: inherit; font-variant: inherit; font-weight:
 inherit; line-height: inherit; vertical-align: baseline; color:
 rgb(118, 49, 159); text-decoration: none;\">free/libre</a><span
 class=\"Apple-converted-space\">\302\240</span>text editor \342\200\224
 and more.</h2>" 0 2360 (foreign-selection STRING))

Steve Berman



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 11:18       ` Lars Ingebrigtsen
@ 2016-10-30 11:34         ` mituharu
  2016-10-30 12:01           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 25+ messages in thread
From: mituharu @ 2016-10-30 11:34 UTC (permalink / raw)
  To: Emacs developers

>> * If you paste only the HTML, half the users will complain that “what
>> you get” in the target document differs from “what you see” of the
>> source document.
>
> Well...  People know that Emacs isn't a wysiwyg editor, so I don't think
> that is a complaint that will be common.  The complaint will be 50% "why
> is it outputting all this HTML junk into my buffer?" and 50% "why isn't
> it outputting any HTML into my buffer?"  :-)
>
> So creating a user interface that for this that annoys the least number
> of people is what's important.
>
> And it could even be a total opt-in thing, like a global minor mode
> like, er, `clever-yank-mode'.

The Mac port does something related for image data in the
clipboard: when the clipboard has both textual and image data,
yank (C-y) inserts the former and push both into the kill ring so
the latter can be inserted with yank-pop (M-y) afterwards.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 11:34         ` mituharu
@ 2016-10-30 12:01           ` Lars Ingebrigtsen
  2016-10-30 15:26             ` Lars Ingebrigtsen
  2016-10-31 12:41             ` Ted Zlatanov
  0 siblings, 2 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 12:01 UTC (permalink / raw)
  To: mituharu; +Cc: Emacs developers

mituharu@math.s.chiba-u.ac.jp writes:

> The Mac port does something related for image data in the
> clipboard: when the clipboard has both textual and image data,
> yank (C-y) inserts the former and push both into the kill ring so
> the latter can be inserted with yank-pop (M-y) afterwards.

Hm, interesting.  I guess the same would make sense for HTML?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 12:01           ` Lars Ingebrigtsen
@ 2016-10-30 15:26             ` Lars Ingebrigtsen
  2016-10-31 12:41             ` Ted Zlatanov
  1 sibling, 0 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-30 15:26 UTC (permalink / raw)
  To: Emacs developers

Hm...  perhaps commands like `w' in eww (which copies the URL under
point to the kill ring) could also put the link's entire HTML into the
text/html clipboard selection thingie?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 10:41   ` Lars Ingebrigtsen
  2016-10-30 11:01     ` Andreas Schwab
@ 2016-10-30 17:17     ` Richard Stallman
  1 sibling, 0 replies; 25+ messages in thread
From: Richard Stallman @ 2016-10-30 17:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: schwab, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Here's one on Linux:

It's running on the GNU/Linux system, which includes GNU
(which we are working on here).

To call the system "Linux" means attributing our work to someone else.
Would you please avoid from doing that?

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30 12:01           ` Lars Ingebrigtsen
  2016-10-30 15:26             ` Lars Ingebrigtsen
@ 2016-10-31 12:41             ` Ted Zlatanov
  2016-10-31 13:21               ` Lars Ingebrigtsen
  1 sibling, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2016-10-31 12:41 UTC (permalink / raw)
  To: emacs-devel

On Sun, 30 Oct 2016 13:01:25 +0100 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> mituharu@math.s.chiba-u.ac.jp writes:
>> The Mac port does something related for image data in the
>> clipboard: when the clipboard has both textual and image data,
>> yank (C-y) inserts the former and push both into the kill ring so
>> the latter can be inserted with yank-pop (M-y) afterwards.

LI> Hm, interesting.  I guess the same would make sense for HTML?

I like this UI! But please, if you implement it, add a transient message
so the user knows it is available.

Ted




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-31 12:41             ` Ted Zlatanov
@ 2016-10-31 13:21               ` Lars Ingebrigtsen
  2016-10-31 15:48                 ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-10-31 13:21 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

> I like this UI! But please, if you implement it, add a transient message
> so the user knows it is available.

Hm...  I could see how that might be annoying, too.  Or perhaps not?  In
most cases, there will be no text/html version available, I guess, so in
the vast majority of cases, there'll be no message.  So perhaps
messaging would be nice.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-31 13:21               ` Lars Ingebrigtsen
@ 2016-10-31 15:48                 ` Eli Zaretskii
  2016-11-03 23:55                   ` Chad Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2016-10-31 15:48 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Mon, 31 Oct 2016 14:21:38 +0100
> 
> Ted Zlatanov <tzz@lifelogs.com> writes:
> 
> > I like this UI! But please, if you implement it, add a transient message
> > so the user knows it is available.
> 
> Hm...  I could see how that might be annoying, too.  Or perhaps not?  In
> most cases, there will be no text/html version available, I guess, so in
> the vast majority of cases, there'll be no message.  So perhaps
> messaging would be nice.

I would suggest to provide also a more explicit UI, like "Edit->Paste As"
or some such.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-31 15:48                 ` Eli Zaretskii
@ 2016-11-03 23:55                   ` Chad Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Chad Brown @ 2016-11-03 23:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


> On 31Oct, 2016, at 08:48, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Date: Mon, 31 Oct 2016 14:21:38 +0100
>> 
>> Ted Zlatanov <tzz@lifelogs.com> writes:
>> 
>>> I like this UI! But please, if you implement it, add a transient message
>>> so the user knows it is available.
>> 
>> Hm...  I could see how that might be annoying, too.  Or perhaps not?  In
>> most cases, there will be no text/html version available, I guess, so in
>> the vast majority of cases, there'll be no message.  So perhaps
>> messaging would be nice.
> 
> I would suggest to provide also a more explicit UI, like "Edit->Paste As"
> or some such.

The various (sadly proprietary, often based on UI/code from Microsoft)
programs that I run into during work typically do this with something
like “Paste Special”, “Paste Formatted”, or “Paste and Match Style”.
In the cases where the default is to include styles, I sometimes
see “Paste Simple” as well.

~Chad


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
                   ` (3 preceding siblings ...)
  2016-10-30 10:38 ` Igor Sosa Mayor
@ 2016-11-04  7:13 ` Thierry Volpiatto
  2016-11-04  8:49   ` Lars Ingebrigtsen
  4 siblings, 1 reply; 25+ messages in thread
From: Thierry Volpiatto @ 2016-11-04  7:13 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've tried googling for this for a few minutes, but I haven't found
> anything promising (without relying on uncommon external programs).
>
> I sometimes copy text from Firefox to Emacs, and when I'm pasting into
> HTML documents, I would sometimes prefer to retain the HTML formatting
> of what I'm copying.

Isn't https://addons.mozilla.org/en-US/firefox/addon/copy-html/
what you are looking for ?




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Yanking as HTML
  2016-11-04  7:13 ` Thierry Volpiatto
@ 2016-11-04  8:49   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars Ingebrigtsen @ 2016-11-04  8:49 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Isn't https://addons.mozilla.org/en-US/firefox/addon/copy-html/
> what you are looking for ?

Nope.  Altering all other programs because of missing functionality in
Emacs isn't the way to go.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-11-04  8:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-30  9:42 Yanking as HTML Lars Ingebrigtsen
2016-10-30  9:51 ` Andreas Schwab
2016-10-30 10:41   ` Lars Ingebrigtsen
2016-10-30 11:01     ` Andreas Schwab
2016-10-30 11:08       ` Lars Ingebrigtsen
2016-10-30 11:25         ` Stephen Berman
2016-10-30 17:17     ` Richard Stallman
2016-10-30 10:05 ` Daniel Colascione
2016-10-30 10:47   ` Lars Ingebrigtsen
2016-10-30 10:52     ` Daniel Colascione
2016-10-30 10:15 ` YAMAMOTO Mitsuharu
2016-10-30 10:43   ` Lars Ingebrigtsen
2016-10-30 10:59     ` Yuri Khan
2016-10-30 11:18       ` Lars Ingebrigtsen
2016-10-30 11:34         ` mituharu
2016-10-30 12:01           ` Lars Ingebrigtsen
2016-10-30 15:26             ` Lars Ingebrigtsen
2016-10-31 12:41             ` Ted Zlatanov
2016-10-31 13:21               ` Lars Ingebrigtsen
2016-10-31 15:48                 ` Eli Zaretskii
2016-11-03 23:55                   ` Chad Brown
2016-10-30 11:25       ` Lars Ingebrigtsen
2016-10-30 10:38 ` Igor Sosa Mayor
2016-11-04  7:13 ` Thierry Volpiatto
2016-11-04  8:49   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.