]> code.delx.au - gnu-emacs/commitdiff
(rx-check-any, rx-check-not): Quote "]"s in regexps when they have no
authorEli Zaretskii <eliz@gnu.org>
Fri, 3 Mar 2006 12:20:26 +0000 (12:20 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 3 Mar 2006 12:20:26 +0000 (12:20 +0000)
special meaning.

lisp/ChangeLog
lisp/emacs-lisp/rx.el

index 207c6c89ce878522e050382d4e05ba5a3589bbae..88bcf6f98c1a31f8db54e73a7a5e63ef9070b9a7 100644 (file)
@@ -1,5 +1,10 @@
 2006-03-03  Martin Rudalics  <rudalics@gmx.at>
 
+       * font-lock.el (lisp-font-lock-keywords-2)
+       * emacs-lisp/rx.el (rx-check-any, rx-check-not)
+       * generic-x.el (reg-generic-mode): Quote "]"s in regexps when
+       they have no special meaning.
+
        * midnight.el (clean-buffer-list): Handle case where base-buffer of
         indirect buffer gets killed before indirect buffer.  Use dolist.
 
index 763aa97f2146e3cf2dfc834a1617ad82f2c836ab..694544e3c525d0c6e1095680b437d28ea71ad180 100644 (file)
@@ -372,8 +372,8 @@ FORM is of the form `(and FORM1 ...)'."
      (if (eq ?^ (aref arg 0))
         (setq arg (concat "\\" arg)))
      ;; Remove ] and set flag for adding it to start of overall result.
-     (when (string-match "]" arg)
-       (setq arg (replace-regexp-in-string "]" "" arg)
+     (when (string-match "\\]" arg)
+       (setq arg (replace-regexp-in-string "\\]" "" arg)
             rx-bracket "]")))
    (when (symbolp arg)
      (let ((translation (condition-case nil
@@ -405,7 +405,7 @@ ARG is optional."
 (defun rx-check-not (arg)
   "Check arg ARG for Rx `not'."
   (unless (or (and (symbolp arg)
-                  (string-match "\\`\\[\\[:[-a-z]:]]\\'"
+                  (string-match "\\`\\[\\[:[-a-z]:\\]\\]\\'"
                                 (condition-case nil
                                     (rx-to-string arg 'no-group)
                                   (error ""))))