From: Juanma Barranquero Date: Wed, 14 Jan 2009 02:29:52 +0000 (+0000) Subject: * minibuffer.el (minibuffer-message): Fix regexp so it doesn't exclude X-Git-Tag: emacs-pretest-23.0.90~475 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f3618b5f0bcbbe8e133041befac1497d2597ccb;p=emacs.git * minibuffer.el (minibuffer-message): Fix regexp so it doesn't exclude MESSAGEs with internal square brackets (i.e., " this [test] message"). Use `string-match-p'. (completion--make-envvar-table, completion--file-name-table) (completion-pcm--string->pattern, completion-pcm--all-completions) (completion-pcm--filename-try-filter): Use `string-match-p'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d917297e933..f99721f3c83 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2009-01-14 Juanma Barranquero + + * minibuffer.el (minibuffer-message): Fix regexp so it doesn't exclude + MESSAGEs with internal square brackets (i.e., " this [test] message"). + Use `string-match-p'. + (completion--make-envvar-table, completion--file-name-table) + (completion-pcm--string->pattern, completion-pcm--all-completions) + (completion-pcm--filename-try-filter): Use `string-match-p'. + 2009-01-14 Juri Linkov * progmodes/bug-reference.el (bug-reference-fontify): Check for @@ -16,7 +25,7 @@ 2009-01-13 Jason Rumney - * faces.el (face-valid-attribute-values): No stipple on w32. (Bug#884) + * faces.el (face-valid-attribute-values): No stipple on w32. (Bug#884) 2009-01-12 Juanma Barranquero diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index fc42905c3df..9e762d4ba32 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -250,7 +250,7 @@ Enclose MESSAGE in [...] if this is not yet the case. If ARGS are provided, then pass MESSAGE through `format'." ;; Clear out any old echo-area message to make way for our new thing. (message nil) - (setq message (if (and (null args) (string-match "\\[.+\\]" message)) + (setq message (if (and (null args) (string-match-p "\\` *\\[.+\\]\\'" message)) ;; Make sure we can put-text-property. (copy-sequence message) (concat " [" message "]"))) @@ -949,7 +949,7 @@ the completions buffer." (defun completion--make-envvar-table () (mapcar (lambda (enventry) - (substring enventry 0 (string-match "=" enventry))) + (substring enventry 0 (string-match-p "=" enventry))) process-environment)) (defconst completion--embedded-envvar-re @@ -985,7 +985,7 @@ the completions buffer." ;; FIXME: Actually, this is not always right in the presence of ;; envvars, but there's not much we can do, I think. (let ((start (length (file-name-directory string))) - (end (string-match "/" (cdr action)))) + (end (string-match-p "/" (cdr action)))) (list* 'boundaries start end))) (t @@ -1359,7 +1359,7 @@ or a symbol chosen among `any', `star', `point'." (p 0) (p0 0)) - (while (setq p (string-match completion-pcm--delim-wild-regex string p)) + (while (setq p (string-match-p completion-pcm--delim-wild-regex string p)) (push (substring string p0 p) pattern) (if (eq (aref string p) ?*) (progn @@ -1415,7 +1415,7 @@ PATTERN is as returned by `completion-pcm--string->pattern'." compl (let ((poss ())) (dolist (c compl) - (when (string-match regex c) (push c poss))) + (when (string-match-p regex c) (push c poss))) poss))))) (defun completion-pcm--hilit-commonality (pattern completions) @@ -1614,9 +1614,9 @@ filter out additional entries (because TABLE migth not obey PRED)." (regexp-opt completion-ignored-extensions) "\\)\\'"))) (dolist (f all) - (unless (string-match re f) (push f try))) + (unless (string-match-p re f) (push f try))) (or try all)))) - + (defun completion-pcm--merge-try (pattern all prefix suffix) (cond