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

Previous Next

Package: emacs;

Reported by: Tom Regner <thomas.regner <at> fb-research.de>

Date: Thu, 28 Sep 2017 15:23:01 UTC

Severity: normal

Tags: fixed

Found in version 25.2

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 28634 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tom Regner <thomas.regner <at> fb-research.de>
Cc: David Engster <deng <at> randomsample.de>, 28634 <at> debbugs.gnu.org
Subject: Re: bug#28634: 25.2; minimap.el: next-single-property-change
 returns `nil`
Date: Mon, 15 Jul 2019 11:34:03 +0200
Tom Regner <thomas.regner <at> fb-research.de> 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




This bug report was last modified 6 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.