Subject: bug#28634: 25.2; minimap.el: next-single-property-change returns `nil`

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 15 Jul 2019 11:34:03 +0200

Tom Regner <[email-masked]> writes:

> Hello,
>
> in version 1.2 of minimap.el as distributed via elpa, in line 771 the
> call to `next-single-property-change`, intended to set `pos`, returns
> `nil` for a file I tried to activate it for, resulting in a
> 'minimap-enlarge-faces: Wrong type argument: integer-or-marker-p, nil '
> error. Checking for this outcome and leaving pos alone in that case, by
> changing the line 771 from
>
>                 (setq pos (next-single-property-change pos 'face))))
>
> to (wrapping the call with `or`)
>
>                 (setq pos (or (next-single-property-change pos 'face) pos))))
>
> fixes this for me.

Thanks; I've now applied the patch below to the package in ELPA.
Perhaps David will want to bump the version number (or not).

diff --git a/packages/minimap/minimap.el b/packages/minimap/minimap.el
index 231c04900..e6f2b727b 100644
--- a/packages/minimap/minimap.el
+++ b/packages/minimap/minimap.el
@@ -768,7 +768,7 @@ You can specify those properties with
 	(with-current-buffer minimap-buffer-name
 	  (setq ov
 		(make-overlay pos
-			      (setq pos (next-single-property-change pos 'face))))
+			      (setq pos (or (next-single-property-change pos 'face) pos))))
 	  (overlay-put ov 'face `(:family ,(face-font 'default)))
 	  (overlay-put ov 'priority 5)))
       (setq pos (next-single-property-change pos 'face)))))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no