## GNU TeXmacs - Bugs: bug #35246, Copy/paste of backslashes doesn't...

You are not allowed to post comments on this tracker with your current authentification level.

## bug #35246: Copy/paste of backslashes doesn't work

 Submitted by: Francois Poulain Submitted on: Thu Jan 5 14:10:36 2012 Category: User Interface Priority: 5 - Normal Item Group: Error Status: Fixed Privacy: Public Assigned to: Francois Poulain Originator Name: Open/Closed: Closed Release: Release: None Fixed Release: None Fixed Release: Keywords:

Thu Aug 9 10:01:32 2012, comment #7:

Yes, we need better mime type support for copy & paste;
there should be another bug or wish concerning this.
Indeed, conversions should take place in a lazy fashion:
only when needed. Notice however that this may raise a problem
if the document is changed before copy and paste.

Joris van der Hoeven <vdhoeven>
Sun Jul 29 19:03:33 2012, comment #6:

QClipboard (well, the clipboard actually) allows to add one chunk data with as many interpretations (MIME types) as we want.

This means that we can copy the selection to the clipboard as application/x-texmacs-clipboard AND as text/plain at the same time. When pasting, other applications will default to what they know, the plain text, but we can use the x-texmacs and when it isn't there, default to verbatim.

Maybe automagically accepting other formats would be good (or confusing).

The problem I see implementing this is that edit_select_rep::selection_set() converts the data before sending it to the Qt side to copy to the clipboard. Either we change that (passing several formats?) or we convert it right before copying to the clipboard (but then we need access to edit_typeset_rep::exec_verbatim() etc.) I like the first most.

Miguel de Benito <mdbenito>
Tue Apr 3 08:40:01 2012, comment #5:

When I submitted this bug, I didn't known why TeXmacs behave as this. I was only frustrated to not be able to copy / paste verbatim content.

I think the Joris proposal is a good one : verbatim pasting by default, unless the data being TeXmacs code (which, roughly, can be determined from the source of the copy).

Francois Poulain <fpoulain>
Thu Mar 8 13:55:55 2012, comment #4:

Edit -> Paste from -> Verbatim works for me.
This is the appropriate way to copy and paste verbatim text.

On the other hand, in the Qt version, it should be possible
to associate mime types to selections. In that way, we may
make 'verbatim' the default format for copy and paste to
external programs and 'texmacs' the default format when
copying to another instance of TeXmacs.

Joris van der Hoeven <vdhoeven>
Mon Mar 5 13:33:37 2012, comment #3:

So this is about pasting in verbatim mode, right? Or do you think backslashes should never be interpreted regardless of the current environment?

Miguel de Benito <mdbenito>
Mon Jan 30 10:01:25 2012, comment #2:

That's not about interpretation of code. I don't want the code to be interpreted.

Imagine, for example, I want to put a code snippet into a document. In a verbatim environment, I get the same bug : backslashes are not pasted, and they are sometime replaced by another char.

Tring to paste This is an \emph{emphasis}'' in a verbatim environment doesn't work for me (CVS version, under Debian GNU/Linux).

Francois Poulain <fpoulain>
Sat Jan 28 00:13:17 2012, comment #1:

I'm not sure I understand. What result do you expect exactly? If that's HTML (because of the <pre>), and use the menu action "Edit->Paste from->HTML", then the backslash has no special meaning and it's simply printed. If you "Paste from->LaTeX", then you see the non-latex tags, <pre>, but the emphasis is applied. Same for Verbatim mode.

Miguel de Benito <mdbenito>
Thu Jan 5 14:10:36 2012, original submission:

Copying/pasting of backslash '\' work only if it's done as an isolated letter. Copying/pasting something like
<pre>
This is an \emph{emphasis}.
</pre>
doesn't work.

The result obtained in TeXmacs (svn version of 2012-01-05), under debian GNU/Linux is
<pre>
This is an emph{emphasis}.
</pre>

Francois Poulain <fpoulain>

No files currently attached

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -unavailable- added by vdhoeven (Posted a comment)
• -unavailable- added by mdbenito (Posted a comment)
• -unavailable- added by fpoulain (Submitted the item)
•

Do you think this task is very important?
This task has 0 encouragements so far.

Only logged-in users can vote.

Please enter the title of George Orwell's famous dystopian book (it's a date):

Date Changed By Updated Field Previous Value => Replaced By
Tue Feb 12 18:25:58 2013fpoulainPriority4 - Bit lower5 - Normal
StatusNeed InfoFixed
Assigned tomdbenitofpoulain
Open/ClosedOpenClosed
Sun Jul 29 19:03:33 2012mdbenitoStatusWorks For MeNeed Info
Thu Mar 8 13:55:55 2012vdhoevenStatusConfirmedWorks For Me
Mon Mar 5 13:33:37 2012mdbenitoPriority3 - Low4 - Bit lower
StatusWorks For MeConfirmed
Sat Jan 28 00:13:17 2012mdbenitoPriority5 - Normal3 - Low
StatusNoneWorks For Me
Assigned toNonemdbenito