diff options
| author | Glenn Morris | 2012-10-06 17:27:31 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-10-06 17:27:31 -0700 |
| commit | 1595ecfac950d69ae94c270fb9829529a421c56c (patch) | |
| tree | 3ddc61cab36ab147abbb831bcc8802c8880faaec | |
| parent | 82ed3ab40dfa2ac4f9a20b0dd8333058e45e1cfb (diff) | |
| download | emacs-1595ecfac950d69ae94c270fb9829529a421c56c.tar.gz emacs-1595ecfac950d69ae94c270fb9829529a421c56c.zip | |
* lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile.
Fixes: debbugs:7161
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/hi-lock.el | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4469c6112f8..b91d9715bfa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-10-07 Glenn Morris <rgm@gnu.org> | 1 | 2012-10-07 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * hi-lock.el (hi-lock-process-phrase): | ||
| 4 | Try to make it less fragile. (Bug#7161) | ||
| 5 | |||
| 3 | * hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. | 6 | * hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. |
| 4 | 7 | ||
| 5 | 2012-10-06 Glenn Morris <rgm@gnu.org> | 8 | 2012-10-06 Glenn Morris <rgm@gnu.org> |
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 0bbb3150874..59743124cc5 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el | |||
| @@ -547,7 +547,11 @@ and initial lower-case letters made case insensitive." | |||
| 547 | ;; FIXME fragile; better to just bind case-fold-search? (Bug#7161) | 547 | ;; FIXME fragile; better to just bind case-fold-search? (Bug#7161) |
| 548 | (setq mod-phrase | 548 | (setq mod-phrase |
| 549 | (replace-regexp-in-string | 549 | (replace-regexp-in-string |
| 550 | "\\<[a-z]" (lambda (m) (format "[%s%s]" (upcase m) m)) phrase)) | 550 | "\\(^\\|\\s-\\)\\([a-z]\\)" |
| 551 | (lambda (m) (format "%s[%s%s]" | ||
| 552 | (match-string 1 m) | ||
| 553 | (upcase (match-string 2 m)) | ||
| 554 | (match-string 2 m))) phrase)) | ||
| 551 | ;; FIXME fragile; better to use search-spaces-regexp? | 555 | ;; FIXME fragile; better to use search-spaces-regexp? |
| 552 | (setq mod-phrase | 556 | (setq mod-phrase |
| 553 | (replace-regexp-in-string | 557 | (replace-regexp-in-string |