|
From: | David Kastrup |
Subject: | Re: Compiling Elisp to a native code with a GCC plugin |
Date: | Thu, 16 Sep 2010 08:54:28 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
"Stephen J. Turnbull" <address@hidden> writes: > Lars Magne Ingebrigtsen writes: > > > Is there any function like > > > > (is-the-string-following-point-equal-to-this-string-p "foo ") > > Does every one-line function need to be a built-in? > > (defun is-the-string-following-point-equal-to-this-string-p (s) > (string= s (buffer-substring (point) (+ (point) (length s))))) > > or > > (defun is-the-string-following-point-equal-to-this-string-p (s) > (search-forward s (+ (point) (length s)) t)) The former will signal an error when the string is longer than the rest of the buffer. The latter won't. You can't figure this out by reading the doc strings of the used functions. You have to read their source code. Since a user is not likely to pick the correct one-liner, it might make sense to define a function for that. -- David Kastrup
[Prev in Thread] | Current Thread | [Next in Thread] |