Subject: bug#22564: Fundamental mode isn't fundamental enough.

From: Eli Zaretskii <[email-masked]>
Date: Sun, 07 Feb 2016 21:09:39 +0200

> From: Achim Gratz <[email-masked]>
> Date: Sat, 06 Feb 2016 17:59:04 +0100
> 
> Mark Oteiza writes:
> >> What is "bracketed paste"?  The term appears only in xterm.el, but that
> >> file doesn't say what it is.
> >
> > It's in NEWS as well. Paraphrasing: it means Emacs understands a chunk of
> > text that is "bracketed" (surrounded) by escape characters as a string
> > to be inserted, instead of interpreting each character in the pasted
> > text as actual user input.
> 
> That entry does absolutely nothing to explain what "bracketed paste
> mode" actually is or how it can be used in Emacs.

I tried to clarify that entry.

> A cursory search leads me to believe that this is something that
> some terminal emulators optionally can do and is switched off by
> default even then.  In other words, it is completely useless if
> you're not using one of those terminal emulators that do support it
> or on those that do and have it switched off.

The mode is always turned off by default; Emacs automatically turns it
on if the terminal supports it.

> The list of instances where bracketed paste mode isn't available
> includes the GUI Emacs frame apparently, so it really shouldn't be
> peddled as a solution for the mess that electric indent produces in many
> modes when you're pasting stuff in (in my case most often via the middle
> mouse button).

Do you see the indentation happen when you paste into a GUI session?
I don't think this happens on GUI frames; in particular, I cannot
reproduce Alan's original report when I paste the text he provided
into a GUI frame.

AFAIK, this problem is specific to pasting into a TTY frame, so the
bracketed paste mode is indeed relevant.