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: emacs-devel@gnu.org, Lennart Borgman <lennart.borgman@gmail.com>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	Antoine Levitt <antoine.levitt@gmail.com>
Subject: Re: Errors in interactive commands
Date: Wed, 03 Aug 2011 12:31:01 +0200	[thread overview]
Message-ID: <4E392365.2080401@online.de> (raw)
In-Reply-To: <8739hij1y3.fsf@uwakimon.sk.tsukuba.ac.jp>

Am 03.08.2011 11:09, schrieb Stephen J. Turnbull:
> Andreas Röhler writes:
>
>   >  Useful return values of "forward-" is important for a wide range of
>   >  things, not just to serve several specific cases.
>
> Unfortunately, when there are "several specific cases", they often
> have different requirements.  Your term "useful" is undefined,

obviously

  and you
> need to define it and show that there is a unified definition powerful
> enough to make it worthwhile to introduce a backward-incompatible
> change.
>
> One way to present such definitions is to describe use cases.  Mine is
> an important one: "iterating over a presumed-to-be array-structured
> buffer, executing a destructive action on each element of the structure."
>
> On the other hand, your pseudo-code is way too "pseudo" to be useful
> to me.  Please *define* the functions that check and update
> "delete-second-state".  I think you will find it is rather hard to do
> as efficiently as my code, without duplicating my code (perhaps
> implicitly).
>
>

for example the implemented form forward-word already sends nil, not 
error, when buffer-end is reached. Remains still to get it messaged.

Thus implemented forward-word would allow a similar writing as below.
However, that is not convention in Emacs Lisp yet.

Also the return of `t' isn't as useful as `point' IMHO

Maybe the following function using `(setq erg'

might provide sense onto the terms missed definition:

(defun my-collects ()
  "Report and return all word boundaries in current buffer, a list. "
   (interactive)
   (goto-char (point-min))
   (let ((positions-reached nil)
         (word-bounderies nil)
         erg bnds)
     (while (setq erg (ar-forward-word-atpt))
       (add-to-list 'positions-reached erg)
       (setq bnds (ar-bounds-of-word-atpt))
       (add-to-list 'word-bounderies bnds))
     (when (interactive-p) (message "positions-reached: %s" 
positions-reached))
     (when (interactive-p) (message "word-bounderies: %s" word-bounderies))
;;    positions-reached
     word-bounderies
     ))

Just try to write that with means commonly available.

To get

(ar-forward-word-atpt)

thing-at-point-utils.el and thingatpt-utils-base.el

from
https://launchpad.net/s-x-emacs-werkstatt/

is needed

Andreas

--
https://launchpad.net/python-mode
https://launchpad.net/s-x-emacs-werkstatt/









  reply	other threads:[~2011-08-03 10:31 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
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 [this message]
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=4E392365.2080401@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).