From 4b0371099c1ba64354db14c84b1f9595a3eee417 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 25 Oct 2012 12:37:11 +0100 Subject: [PATCH] el/dot-emacs.el (mdw-fontify-pythonic): Handle word boundaries better. For some reason, in squeeze's Emacs, underscores cause a break in the middle of a token, and the individual pieces can be recognized as keywords or numbers. This is obviously wrong. Fix it by using different word-boundary regexp magic. This doesn't seem to happen in wheezy's Emacs, but I don't think this change will harm that. --- el/dot-emacs.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 503fa37..887dc1c 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -1667,12 +1667,12 @@ strip numbers instead." (list ;; Set up the keywords defined above. - (list (concat "\\<\\(" keywords "\\)\\>") + (list (concat "\\_<\\(" keywords "\\)\\_>") '(0 font-lock-keyword-face)) ;; At least numbers are simpler than C. - (list (concat "\\<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|" - "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\|\\)" + (list (concat "\\_<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|" + "\\_<[0-9][0-9_]*\\(\\.[0-9_]*\\|\\)" "\\([eE]\\([-+]\\|\\)[0-9_]+\\|[lL]\\|\\)") '(0 mdw-number-face)) -- 2.11.0