victorhge / iedit

Modify multiple occurrences simultaneously
https://www.emacswiki.org/emacs/Iedit
402 stars 43 forks source link

Low priority overlay #33

Closed Mzyxptlk closed 11 years ago

Mzyxptlk commented 11 years ago

When I try to use iedit in a buffer with flymake errors, flymake's overlay overrules iedit's match highlighting because it has a higher priority. I made the following change to fix it:

Index: iedit.el
===================================================================
--- iedit.el    (revision 1784)
+++ iedit.el    (working copy)
@@ -76,6 +76,11 @@
   :type 'face
   :group 'iedit)

+(defcustom iedit-overlay-priority 200
+  "The priority of the overlay used to indicated matches."
+  :type 'integer
+  :group 'iedit)
+
 (defcustom iedit-current-word-default 't
   "If no-nil, use current word by default for the occurrence."
   :type 'boolean
@@ -271,6 +276,7 @@
     (overlay-put occurrence 'insert-in-front-hooks '(iedit-occurrence-update))
     (overlay-put occurrence 'insert-behind-hooks '(iedit-occurrence-update))
     (overlay-put occurrence 'modification-hooks '(iedit-occurrence-update))
+    (overlay-put occurrence 'priority iedit-overlay-priority)
     occurrence))

 (defun iedit-make-unmatched-lines-overlay (begin end)

200 is a higher priority than highlight-current-line (60) and flymake (100) use, but lower than show-paren (1000) and auto-complete (9999) do.

(Excuse the svn diff format.)

victorhge commented 11 years ago

I have integrated the change to the master branch.