help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: next-property-change error


From: Drew Adams
Subject: RE: next-property-change error
Date: Sat, 22 Aug 2009 08:16:21 -0700

> (defun xhtlatex-href ()
>   (re-search-forward "=[\"'\n]*" nil t)
>   (let ((url (buffer-substring (point) (next-property-change
> (point)))))
>     (sgml-skip-tag-forward 1)
>     (insert "}")
>     (sgml-skip-tag-backward 1)
>     (sgml-delete-tag 1)
>     (insert (concat "\\href{" url "}{"))))
> 
> There's another function that finds the "<a", then calls the above
> function if "href" follows.
> When I load the file and run the program the first time it stops at
> the "<a" and gives the error:
> 
> let: Wrong type argument: integer-or-marker-p, nil
> 
> This only happens once; subsequent runs work as expected.
> 
> For what it's worth, I've found that doing a minibuffer evaluation of
> (next-property-change (point)) at some point in the buffer before the
> first run of the program enables execution up to that point.
> 
> I haven't made sense of this yet, can anyone else?

Probably (next-property-change (point)) is returning nil the first time through
(there is no next property change), so `buffer-substring' complains that its
second arg is nil, not an integer or a marker.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]