From: Luke Lee Date: Wed, 31 Mar 2021 03:22:47 +0000 (+0800) Subject: Fix incorrect regular expression for more general text replacements. X-Git-Tag: emacs-28.0.90~3073 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ac31329572ba65c68c5b87a4d6fff2a9c323b4b;p=emacs.git Fix incorrect regular expression for more general text replacements. * lisp/progmodes/hideif.el (hif-evaluate-macro): fix regexp to trim off leading/trailing spaces, but not within. --- diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 6f1a8781b49..0d9b4b7a363 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -1600,7 +1600,7 @@ not be expanded." (result (funcall hide-ifdef-evaluator expr)) (exprstring (replace-regexp-in-string ;; Trim off leading/trailing whites - "^[ \t]*\\([^ \t]+\\)[ \t]*" "\\1" + "^[ \t]*\\|[ \t]*$" "" (replace-regexp-in-string "\\(//.*\\)" "" ; Trim off end-of-line comments (buffer-substring-no-properties start end)))))