From 919d0cdb76bf6efab2d3a4b710db078d855bcce1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 1 Oct 2015 21:42:15 +0200 Subject: [PATCH] Fix "org-remove-if: Wrong type argument: number-or-marker-p, nil" * lisp/org.el (org-remove-latex-fragment-image-overlays): Remove overlays not associated to a buffer. Reported-by: Rainer M Krug --- lisp/org.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ea6c95525..8209d98f4 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -18980,10 +18980,12 @@ removed, nil otherwise." (end (or end (point-max)))) (org-remove-if (lambda (o) - (and (>= (overlay-start o) beg) - (<= (overlay-end o) end) - (progn (delete-overlay o) - (or removedp (setq removedp t))))) + (cond ((not (overlay-buffer o)) (delete-overlay o) t) + ((and (>= (overlay-start o) beg) + (<= (overlay-end o) end)) + (delete-overlay o) + (unless removedp (setq removedp t))) + (t nil))) org-latex-fragment-image-overlays))) removedp))