New answers tagged

0

Tried lots of solutions and none worked for me. After much trials and errors this is what worked for me (GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-08-22). The idea is to match all blank lines that may or may not contain spaces at once (many solutions only match one blank line for each match), and then replace them with just one blank line. To ...


0

I have figured it out. It looks like the second argument can be either regexp or a function. So this worked for me: (replace-regexp-in-string "\\[\\|\\]" (lambda (x) (format "\\\\%s" x)) "Major issue in [Bar] project") ;; => "Major issue in \\[Bar\\] project" But ultimately, I still don't understand how other ...


1

It’s an explicitly–numbered group. From chapter 34.3.1.3 Backslash Constructs in Regular Expressions of the Emacs Lisp manual: ‘\(?: ... \)’ is the “shy group” construct. A shy group serves the first two purposes of an ordinary group (controlling the nesting of other operators), but it does not get a number, so you cannot refer back to ...


1

I'll solve it using a dual strategy. First we say that case matters. M-: (setq case-fold-search nil) RET Then we keep the lines containing upper case. M-x keep-lines RET [[:upper:]] RET


Top 50 recent answers are included