unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Antoine Levitt <antoine.levitt@gmail.com>,
	Lennart Borgman <lennart.borgman@gmail.com>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel@gnu.org
Subject: Re: Errors in interactive commands
Date: Wed, 03 Aug 2011 09:46:12 +0200	[thread overview]
Message-ID: <4E38FCC4.1030001@online.de> (raw)
In-Reply-To: <87aabrhs2o.fsf@uwakimon.sk.tsukuba.ac.jp>

Am 03.08.2011 09:28, schrieb Stephen J. Turnbull:
> Andreas Röhler writes:
>
>   >  A move-forward at the end of the buffer isn't a wrong command as such,
>   >  just will not be successful.
>   >
>   >  Therefor it should not be raised an error, just nil returned.
>
> This is problematic, IMO.  Suppose you have a buffer which is supposed
> to have an even number of objects in it, and you want to delete every
> second then.  Then
>
> (progn
>    (goto (point-min))
>    (while (not (eobp))
>      (forward-object 2)
>      (delete-object -1)))
>
> DTRTs, including detecting the "incorrect state" of an odd number of
> objects, and not deleting the first object on an incomplete last line.
>
> If you're going to change the behavior of the movement commands here,
> I think it would be better to have them return the number of objects
> left to move over.  Then 0 would mean (complete) success (how Un*x-y!)
>
> But this would be a major change.
>
>

Hi Steve,

thanks verifying.

Nonetheless think arguments are wrong here, mixing up two levels of 
execution.

To get what you want, it's a state-of-affairs variable to introduce 
pointing at the action.

Ie 'Delete-every-second' is the matter at stake, whilst "forward-" below 
resp. inside.

With a little bit pseudo-code introduced:

  (progn
     (goto (point-min))
     (while (and (QUERY Delete-every-second-state)(not (eobp)))
       (forward-object 2)
       (delete-object -1)
       (UPDATE Delete-every-second-state)))

Useful return values of "forward-" is important for a wide range of 
things, not just to serve several specific cases.

Sorting execution levels might be the term at stake.
Would like to read another term from experts. Pretty sure exists some in 
informatics.

Andreas



  reply	other threads:[~2011-08-03  7:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 17:46 Errors in interactive commands Antoine Levitt
2011-08-02 19:04 ` Andreas Röhler
2011-08-02 19:15 ` Lennart Borgman
2011-08-02 19:18   ` Lars Magne Ingebrigtsen
2011-08-03  7:13   ` Stephen J. Turnbull
2011-08-03  9:28     ` Lennart Borgman
2011-08-02 19:25 ` Stefan Monnier
2011-08-02 19:36   ` Lennart Borgman
2011-08-03  6:13     ` Andreas Röhler
2011-08-03  7:28       ` Stephen J. Turnbull
2011-08-03  7:46         ` Andreas Röhler [this message]
2011-08-03  8:08           ` David Kastrup
2011-08-03  8:34             ` Andreas Röhler
2011-08-03  9:09           ` Stephen J. Turnbull
2011-08-03 10:31             ` Andreas Röhler
2011-08-04  2:15               ` Stephen J. Turnbull
2011-08-03  9:37         ` Lennart Borgman
2011-08-03  9:45           ` Andreas Schwab
2011-08-03 14:41             ` Stefan Monnier
2011-08-03 15:01               ` Lennart Borgman

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=4E38FCC4.1030001@online.de \
    --to=andreas.roehler@online.de \
    --cc=antoine.levitt@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=stephen@xemacs.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).