emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Errors in interactive commands


From: Andreas Röhler
Subject: Re: Errors in interactive commands
Date: Wed, 03 Aug 2011 12:31:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

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 via email to

[Prev in Thread] Current Thread [Next in Thread]