;;; 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)
(lambda ()
(context-coloring-elisp-colorize-region-initially
(progn
- (string-match "\\`Eval: " (buffer-string))
+ (context-coloring-eval-expression-match)
(1+ (match-end 0)))
(point-max)))))
;; 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