all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
To: Alan Mackenzie <acm@muc.de>
Cc: XEmacs-Beta@xemacs.org, emacs-devel@gnu.org
Subject: Re: return values
Date: Fri, 13 Nov 2009 11:56:40 +0100	[thread overview]
Message-ID: <4AFD3B68.1010507@online.de> (raw)
In-Reply-To: <20091110131021.GB1385@muc.de>

Alan Mackenzie wrote:
> Hi, Andreas!
> 
> On Tue, Nov 10, 2009 at 11:33:39AM +0100, Andreas Roehler wrote:
> 
>> Hi,
> 
>> IMHO it might be helpful, if classes of functions have a regular return
>> value.
> 
>> For example functions which move point should return point.
> 
> Here, it's probably more accurate to say "would have been a good idea",
> since some users of the current functions will use the current return
> values, even if only relying on the fact that they're always nil.
> 
>> `goto-char' does it presently, beginning/end-of-defun not.
> 
> Indeed.
> 
>> Also I suggest mentioning the return value in docstring.
> 
> I am in favour of mentioning the return value of EVERY function, even
> when (or _especially_ when :-) it's only a sentence like "The return
> value is of no significance".

...


Hi Alan,

what about not to have just one return value
hard-coded, but let it being choosed via optional
return-flags?

Let's consider the case of `forward-comment' employed
inside a `delete-comments-in-region' function.

First `forward-comment' must move. If a comment-section
is reached, function must determine its borders in
order to delete.

Now this second operations basically is redundant, as
`forward-comment' determined borders already, otherwise
it couldn't know about nested comments.

A forward-comment is already able to deliver beg, end
--separately or as a list-- and the comment itself as a
string.

So instead of executing two consecutive functions to
determine, forward-comment could take a flag:

For example

b - return beginning
e - return end
l - return beginning and end as a list
s - return found item as a string

Cheers

Andreas

--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/





      reply	other threads:[~2009-11-13 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10 10:33 return values Andreas Roehler
2009-11-10 13:10 ` Alan Mackenzie
2009-11-13 10:56   ` Andreas Roehler [this message]

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

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

  git send-email \
    --in-reply-to=4AFD3B68.1010507@online.de \
    --to=andreas.roehler@online.de \
    --cc=XEmacs-Beta@xemacs.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.