]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix incorrect regular expression for more general text replacements.
authorLuke Lee <luke.lee@synaptics.com>
Wed, 31 Mar 2021 03:22:47 +0000 (11:22 +0800)
committerLuke Lee <luke.lee@synaptics.com>
Wed, 31 Mar 2021 03:42:33 +0000 (11:42 +0800)
* lisp/progmodes/hideif.el (hif-evaluate-macro): fix regexp to trim
  off leading/trailing spaces, but not within.

lisp/progmodes/hideif.el

index 6f1a8781b491e593126722c85a6250c2b610cdb1..0d9b4b7a363ef3a381475b6cbadc050d41f6af38 100644 (file)
@@ -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)))))