emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2487c3a 07/12: Fix eval-expression detection.


From: Jackson Ray Hamilton
Subject: [elpa] master 2487c3a 07/12: Fix eval-expression detection.
Date: Sun, 21 Jun 2015 21:16:14 +0000

branch: master
commit 2487c3ab64f11c4b3d7ac883f95d5e2830e8f0f8
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Fix eval-expression detection.
---
 context-coloring.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 6685ff2..1967cdf 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -1044,6 +1044,10 @@ It could be a quoted or backquoted expression."
 
 ;;; eval-expression colorization
 
+(defun context-coloring-eval-expression-match ()
+  "Determine where expression starts in `eval-expression'."
+  (string-match "\\`Eval: " (buffer-string)))
+
 (defun context-coloring-eval-expression-colorize ()
   "Color the `eval-expression' minibuffer prompt as elisp."
   (interactive)
@@ -1051,7 +1055,7 @@ It could be a quoted or backquoted expression."
    (lambda ()
      (context-coloring-elisp-colorize-region-initially
       (progn
-        (string-match "\\`Eval: " (buffer-string))
+        (context-coloring-eval-expression-match)
         (1+ (match-end 0)))
       (point-max)))))
 
@@ -1171,7 +1175,8 @@ override `context-coloring-default-delay'.
 ;; rely on this predicate instead.
 (defun context-coloring-eval-expression-predicate ()
   "Non-nil if the minibuffer is for `eval-expression'."
-  (eq this-command 'eval-expression))
+  ;; Kinda better than checking `this-command', because `this-command' changes.
+  (context-coloring-eval-expression-match))
 
 (context-coloring-define-dispatch
  'eval-expression



reply via email to

[Prev in Thread] Current Thread [Next in Thread]