unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: insert gives args out of range
Date: Fri, 16 Aug 2024 21:47:07 +0000	[thread overview]
Message-ID: <CtSHGb31T_nVfYbFzelKJridg0C5BxyfNlyJBjnlv-16FXFIoy2gfU2LNL8oM1WjhYk6PioC2DGTGuXl6J2Ee3zFcq8TDjud2avuJHdcuJE=@protonmail.com> (raw)
In-Reply-To: <871q2oma1l.fsf@gmx.net>

On Saturday, August 17th, 2024 at 9:29 AM, Stephen Berman <stephen.berman@gmx.net> wrote:

> On Fri, 16 Aug 2024 17:32:49 +0000 Heime heimeborgia@protonmail.com wrote:
> 
> > 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 setting 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 empty
> > > 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.



  reply	other threads:[~2024-08-16 21:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16  9:24 insert gives args out of range Heime
2024-08-16  9:54 ` Stephen Berman
2024-08-16 10:20   ` Heime
2024-08-16 10:59     ` Heime
2024-08-16 11:51       ` Stephen Berman
2024-08-16 12:03         ` Heime
2024-08-16 12:10           ` Heime
2024-08-16 12:26             ` Stephen Berman
2024-08-16 15:01               ` Heime
2024-08-16 15:09                 ` Heime
2024-08-16 15:16                   ` Stephen Berman
2024-08-16 15:21                     ` Heime
2024-08-16 15:34                       ` Stephen Berman
2024-08-16 17:32                         ` Heime
2024-08-16 21:29                           ` Stephen Berman
2024-08-16 21:47                             ` Heime [this message]
2024-08-16 22:26                               ` Stephen Berman
2024-08-17  9:47                                 ` Heime

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CtSHGb31T_nVfYbFzelKJridg0C5BxyfNlyJBjnlv-16FXFIoy2gfU2LNL8oM1WjhYk6PioC2DGTGuXl6J2Ee3zFcq8TDjud2avuJHdcuJE=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).