[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Raw strings (experimental patches inside)

From: Vr Rm
Subject: Re: Raw strings (experimental patches inside)
Date: Thu, 09 Aug 2012 18:33:10 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0


Sorry for jumping in on this thread so late! But this is the biggest, by far, usability problem I have with Emacs. I don't really have a good idea of the amount of effort raw strings would be (in my eyes, pretty much all all Emacs changes seem to have been accomplish by super-humans.) But the difficulty in using Emacs regular expressions shouldn't be underestimated, especially for those of us on the dim side of the superhuman spectrum.

Several years ago I finally bit the bullet and decided that I was going to figure out how to find and replace buffer carriage returns in a file I was editing even if I had to instrument the sum total of Emacs' elisp code and single step through it all defun by defun. It took me an ungodly amount of time, I think over an hour, before I finally managed to find the solution, I know that it had something to do with c-j. And when I blogged about it, it was and still is by far the most trafficked item I have ever posted. And now that the blog is long defunct, I still don't know how to search for tabs, carriage returns or use Emacs regular expressions, meaning that I still, to this day -- in 2012!, have to use grep and awk to do do regular expression editing operations that were standard issue for editors in the 80s. I do love Emacs and it would take vastly more than that to dissuade me from using it for pretty much all my editing. And of course the capability for these things is there, I just don't either have the natural aptitude or the inclination to learn them. (though I have tried)

Still, I'm certainly not alone in my inability. Regular expression handling continues I would say is the biggest Bugbear for many people learning Emacs or using it to it's full capabilities. And it's obviously a core piece of editor functionality.

On 08/04/2012 04:47 PM, Stefan Monnier wrote:
When I type a regex I'm always annoyed by the amount of escaping
I have to do.  I've always wished Emacs Lisp had raw strings
ie. a syntax to type litteral text without interpretation.
AFAIK, the only real use-case is indeed regexp, and for them a better
solution would be to not escape the parentheses at all.
That doesn't handle the horror that is searching for backslashes...

That is not a problem significant enough to warrant the introduction of
something like raw-strings.

It would also be nice to have a function which takes a string representation
and converts it to an `rx' representation, which I couldn't find in rx when
I looked.

Indeed, we don't have that right now.
My lex.el includes something pretty close, but I'd rather not include
lex.el into Emacs because it's not clean enough.  OTOH maybe I could add
it to GNU ELPA.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]