From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.devel Subject: Re: Errors in interactive commands Date: Wed, 03 Aug 2011 12:31:01 +0200 Message-ID: <4E392365.2080401@online.de> References: <87livbbta9.fsf@gmail.com> <4E38E70B.7030802@online.de> <87aabrhs2o.fsf@uwakimon.sk.tsukuba.ac.jp> <4E38FCC4.1030001@online.de> <8739hij1y3.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1312367486 16736 80.91.229.12 (3 Aug 2011 10:31:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2011 10:31:26 +0000 (UTC) Cc: emacs-devel@gnu.org, Lennart Borgman , Stefan Monnier , Antoine Levitt To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 03 12:31:21 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QoYjQ-00055E-08 for ged-emacs-devel@m.gmane.org; Wed, 03 Aug 2011 12:31:20 +0200 Original-Received: from localhost ([::1]:37413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoYjP-0006gF-Go for ged-emacs-devel@m.gmane.org; Wed, 03 Aug 2011 06:31:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoYjL-0006fQ-N9 for emacs-devel@gnu.org; Wed, 03 Aug 2011 06:31:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoYjK-0001rM-9x for emacs-devel@gnu.org; Wed, 03 Aug 2011 06:31:15 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:56538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoYjJ-0001r4-VP for emacs-devel@gnu.org; Wed, 03 Aug 2011 06:31:14 -0400 Original-Received: from [192.168.178.27] (brln-4db9eb85.pool.mediaWays.net [77.185.235.133]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MfBqk-1R0CUu3jiM-00OQw8; Wed, 03 Aug 2011 12:31:04 +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 In-Reply-To: <8739hij1y3.fsf@uwakimon.sk.tsukuba.ac.jp> X-Provags-ID: V02:K0:lMB582b3JiufYui1Z2HVNib8s+81E/RcFvVpIeibwky YK/tEnImjbXZwJaWTe7vPzMe8CtuuFQyuEvSot8JGLfaGpW3rB MgQq6e+pwSsaUNKoO+ijJqWSpgaqUpib9N0QlDzZ0g6QenOEl3 OnjYKGnjTYf6L43y/4ddpHk/ix3hARctsWA5pq1q1KZ4lsu2CI z3G1OJqCKMWr7pWSANJfABKhlIsmMj7olk6filh+CI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.186 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142802 Archived-At: 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/