Getting rid of the backslash at the end of wrapped lines (for copy-paste)

Emacs in text mode places the \ character (backslash) at the end of the wrapped string.

I would like this to not be displayed, so I can copy-paste from such a window to another without receiving \ in the pasted text.

I am sure there is a simple solution for this, but I could not find it (neither on the Internet, nor in the emacs manual). The closest seems to turn off the small arrows at the far end of the line .


Distilled from all the answers and links in it, this is what I used for emacs (22.1.1), included in Mac OS X 10.8.3. It works great. Thanks again for the help!

;; copy to Mac clipboard (for copying text the wrapped '\' lines (defun copy-to-mac-clipboard () "Copy currently selected region to Mac clipboard (useful for wrapped '\\' lines)" (interactive) (if (> (- (region-end) (region-beginning)) 0) (progn (shell-command-on-region (region-beginning) (region-end) "pbcopy") (message "region copied to Mac clipboard (%d chars)" (- (region-end) (region-beginning))) (if (and transient-mark-mode mark-active) (deactivate-mark))) (progn (message "no region active")) )) ;; put this next to Mw, which is kill-ring-save (copy to emacs clipboard) (global-set-key "\Me" 'copy-to-mac-clipboard) 
+4
source share
1 answer

These \ (and $) items are placed in what we call "fringe." And unfortunately, Emacs currently does not allow you to control fringe when working in text mode. I think the answer Angus points out is "the best we have."

OTOH, for your specific problem, besides starting Emacs in GUI mode, you can let Emacs interact directly with your mail clip (not the terminal emulator), which then solves this problem and also allows you to copy the text even if it isn’t is displayed.

For the X11 package, there is the xclip.el package, and someone posted a patch (not yet integrated) to make it work on Mac OS X.

+2
source

Source: https://habr.com/ru/post/1485216/


All Articles