From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Compiling Elisp to a native code with a GCC plugin Date: Thu, 16 Sep 2010 10:31:37 +0200 Organization: Organization?!? Message-ID: <87eicudr86.fsf@lola.goethe.zz> References: <87bp805ecr.fsf@gmail.com> <87iq26z97e.fsf@uwakimon.sk.tsukuba.ac.jp> <874odqfaaj.fsf@lola.goethe.zz> <878w32yuq1.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284625923 24581 80.91.229.12 (16 Sep 2010 08:32:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2010 08:32:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 16 10:32:02 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow9st-0007pB-RO for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 10:32:00 +0200 Original-Received: from localhost ([127.0.0.1]:41438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ow9ss-0002J5-QW for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 04:31:58 -0400 Original-Received: from [140.186.70.92] (port=47674 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ow9sm-0002Hs-68 for emacs-devel@gnu.org; Thu, 16 Sep 2010 04:31:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ow9sk-0005ir-Ty for emacs-devel@gnu.org; Thu, 16 Sep 2010 04:31:52 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:41415) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow9sk-0005il-Cg for emacs-devel@gnu.org; Thu, 16 Sep 2010 04:31:50 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ow9sh-0007hF-58 for emacs-devel@gnu.org; Thu, 16 Sep 2010 10:31:47 +0200 Original-Received: from p508edda0.dip.t-dialin.net ([80.142.221.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Sep 2010 10:31:47 +0200 Original-Received: from dak by p508edda0.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Sep 2010 10:31:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508edda0.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:RWbXNfz4Mqf8X4T4T2acDrpz4Vc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130248 Archived-At: "Stephen J. Turnbull" writes: > David Kastrup writes: > > > > (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. > > It might, but I would prefer a documentation patch. ;-) Can't really do the trick here. "If START or END are outside the accessible buffer region, an error is signaled. In case you wanted to check for the presence of a string str at buffer point, consider using `search-forward' with a LIMIT of (+ (length str) (point)) and a NOERROR of t. Or use (condition-case nil (string= s (buffer-substring (point) (+ (point) (length s)))) (args-out-of-range nil)) Or maybe (string= s (buffer-substring (point) (min (point-max) (+ (point) (length s))))) " I mean, get real. One can't write suggestions for all possible intended uses into a DOC string. Would make more sense to give buffer-substring a NOERROR argument of its own. Still ugh. -- David Kastrup