]> code.delx.au - gnu-emacs-elpa/commitdiff
Avoid image-mode and doc-view-mode
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 May 2015 15:39:41 +0000 (17:39 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 May 2015 15:39:41 +0000 (17:39 +0200)
* avy-jump.el (avy--regex-candidates): Update.

Re #1

avy-jump.el

index c76e2665999d86062aea45f6f110df6359542b89..5ad0ecd21433c523f2c692a44377048be52d2644 100644 (file)
@@ -129,16 +129,17 @@ When PRED is non-nil, it's a filter for matching point positions."
                      (window-list)
                    (list (selected-window))))
       (with-selected-window wnd
-        (let ((we (or end (window-end (selected-window) t))))
-          (save-excursion
-            (goto-char (or beg (window-start)))
-            (while (re-search-forward regex we t)
-              (unless (get-char-property (point) 'invisible)
-                (when (or (null pred)
-                          (funcall pred))
-                  (push (cons (cons (match-beginning 0)
-                                    (match-end 0))
-                              wnd) candidates))))))))
+        (unless (memq major-mode '(image-mode doc-view-mode))
+          (let ((we (or end (window-end (selected-window) t))))
+            (save-excursion
+              (goto-char (or beg (window-start)))
+              (while (re-search-forward regex we t)
+                (unless (get-char-property (point) 'invisible)
+                  (when (or (null pred)
+                            (funcall pred))
+                    (push (cons (cons (match-beginning 0)
+                                      (match-end 0))
+                                wnd) candidates)))))))))
     (nreverse candidates)))
 
 (defvar avy--overlay-offset 0