From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: insert gives args out of range Date: Sat, 17 Aug 2024 00:26:56 +0200 Message-ID: <87ttfkkssv.fsf@gmx.net> References: <87h6bkmz5k.fsf@gmx.net> <9gWogDhaCBXEnTOijkijtCrrcAbhYY04AgDjXlqWxAN1m7xvAUbl31U_6aBjyp6Q8iu2M7SIMHNmyvD0QJ6NnC2PSFHIpdgos1q7eVM-CLI=@protonmail.com> <87a5hcmr9y.fsf@gmx.net> <1LrMW6VZOGaiPZeu9oQzAEzURNe5DSG4qEIpTAcMJIYlF_Ror7Qi4fwKLeEtID86cPFTghDDGsf78h3ngmTMitZ_kbjiPZ2L_COpl5uJRFc=@protonmail.com> <875xs0mqgx.fsf@gmx.net> <871q2oma1l.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 17 00:27:45 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sf5Q9-0006aI-Cy for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 17 Aug 2024 00:27:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sf5PV-0006MQ-IQ; Fri, 16 Aug 2024 18:27:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sf5PU-0006ME-Fk for help-gnu-emacs@gnu.org; Fri, 16 Aug 2024 18:27:04 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sf5PR-000743-HB for help-gnu-emacs@gnu.org; Fri, 16 Aug 2024 18:27:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1723847217; x=1724452017; i=stephen.berman@gmx.net; bh=y2j+OCvichLg2r3aH0/M0cNgrj4CqCC/visONBtPT0E=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=abE+ONC+ITRVtKtYCDZURst9P1nczKbzoLrf5eu0SAiF9Ajfwq+VcP8MnxWrfgN6 hhHBLu/E0bQSDyfeabn7qEb95MwB4kkkvbbsbL9POoPSAQZmEVYx0Cshby4Z05iv0 rKiushSp1iRzW0h/g5g+Q9Y4bEPBuxHGe7f8v2qdeye1KwzCTULfzg0bdZHIVazWH dvXKKsCV4x+iX79TGORqfaKQ8d2NzQ8YM/s+NYMaOcbuVe3wGT/AUr8BnPdjn3SKg vlp9ZgrJWxmf3Bfj4VJB+1Jr4rWfsXU7IB2UxghZp8fixGVwT6tOjkE3kw7yhFhOO oeel5oIymn9VGuEgpA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.95.228]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M59GA-1sdzTp0wjs-007ujC; Sat, 17 Aug 2024 00:26:57 +0200 In-Reply-To: (Heime's message of "Fri, 16 Aug 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p9XpSyH2Da0iFc+BwfVdrFmmGS3m45rYeEcJ3SZ48 Received-SPF: pass client-ip=212.227.15.18; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147723 Archived-At: On Fri, 16 Aug 2024 21:47:07 +0000 Heime wrot= e: > On Saturday, August 17th, 2024 at 9:29 AM, Stephen Berman > wrote: > >> On Fri, 16 Aug 2024 17:32:49 +0000 Heime heimeborgia@protonmail.com wro= te: >> >> > On Saturday, August 17th, 2024 at 3:34 AM, Stephen Berman >> > stephen.berman@gmx.net wrote: >> > >> > > On Fri, 16 Aug 2024 15:21:12 +0000 Heime heimeborgia@protonmail.com= wrote: >> >> [...] >> >> > > > I have solved the problem by adding (forward-line 1) after settin= g >> > > > blank-lines >> > > > >> > > > (while (and (< blank-lines 2) >> > > > (re-search-forward "^\\s-*$" nil t)) >> > > > (setq blank-lines (1+ blank-lines)) >> > > > ;; Move point forward to avoid re-matching the same blank line >> > > > (forward-line 1)) >> > > > >> > > > Could this fail on some circumstances ? >> > > >> > > Depends on what you consider failure: with the buffer "test" I gave= as >> > > an example above, output-buffer contains not just two but three emp= ty >> > > lines between the two defuns, and not just one but two empty lines = at >> > > the end; is that what you want? >> > > >> > > Steve Berman >> > >> > By failure, I mean this: Could Emacs fire an error buffer based on >> > some unforeseen structure of the file when re-search-forward >> > executes ? >> >> >> Yes. Steve Berman > > Perhaps you can help me write an improved, more robust implementation, > if the problem is evident. If you post code and I see problems with it I can point them out and may be able to suggest improvements, but I can make no useful response to vague questions like whether the code could fail in "some circumstances" or "based on some unforeseen structure of the file". Steve Berman