Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid ESS underscore automatic subsitution with '<-' when pasting text but keep it when writing an underscore

Tags:

emacs

r

ess

When using ESS under emacs for writing R code, is useful to have the default behavior os having '_' substituted by '<-' (inserting two consecutive '_' would insert the underscore itself). But when pasting code to any buffer in ESS-mode, this substituion also happens and any '_' gets substituted by '<-' and this is not a desired behavior by me.

Is there a way of preventing the substitution only when pasting text?

At the moment I have fully disabled the substitution adding this code to my .emacs

(ess-toggle-underscore nil)

But I would like to recover the '_' to '<-' substitution only when writing not when pasting.

Any idea?

like image 891
Pablo Marin-Garcia Avatar asked Dec 16 '12 16:12

Pablo Marin-Garcia


People also ask

How do you underline a word without underscore?

Now if we want to underline a word, we abandon the underscore key completely and click on the underline button in the menu bar. Rumor has it that some word processing programs (none that I can seem to find) can automatically convert a word into an underlined word if formatted with an underscore before and after the word, like this: _underscore_

How do you underscore on a keyboard?

In fact, it’s only a two-step process that can happen in less than a second (if you’re skilled at typing): Hold down the SHIFT key Press the hyphen/underscore key located to the right of the zero key on the number line of your keyboard That’s it—you now have an underscore!

Why do some files have underscore letters in their name?

However, if you still have old files on file, chances are there are underscores within the name. Just as the underscore was used back in the typewriter days to create an outline, the modern keyboard lets you create a fill-in-the-blank spot within a document by holding down the underscore key a few times without interruption.

What is the underscore?

The underscore is one of the few punctuation marks with many names. Sometimes it’s called the understrike, the underbar, the underdash, the low dash, the low line. And way back in the day, it was called the underline. Whatever you want to call it, the underscore looks like a dash that lives below the letters, like this:


1 Answers

This should not happen. Please report a bug with more details to ess-help or with M-x ess-submit-bug-report. You are pasting in a terminal session right?

like image 94
VitoshKa Avatar answered Oct 01 '22 13:10

VitoshKa