From 8ac31329572ba65c68c5b87a4d6fff2a9c323b4b Mon Sep 17 00:00:00 2001 From: Luke Lee Date: Wed, 31 Mar 2021 11:22:47 +0800 Subject: [PATCH] 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. --- lisp/progmodes/hideif.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))))) -- 2.39.2