From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp exercise: toggle-letter-case
Date: Sun, 19 Oct 2008 10:46:22 -0700 (PDT) [thread overview]
Message-ID: <481420b9-7665-4b47-b54f-be99fdc83d26@u28g2000hsc.googlegroups.com> (raw)
In-Reply-To: mailman.1506.1224429976.25473.help-gnu-emacs@gnu.org
On Oct 19, 8:26 am, Nikolaj Schumacher <m...@nschum.de> wrote:
> Xah<xah...@gmail.com> wrote:
> > it doesn't use (&optional beg end) with the associated
> > “(interactive ...)” code because i think when a command is designed
> > only for interactive use, then it makes sense to not support calling
> > it in elisp as much as possible.
>
> But it limits the code's re-usability. Imagine someone wants a function
> that toggles the case for the current symbol or sentence (instead of
> word).
i think this function is not suitable for calling in elisp program
because its behavior is somewhat unpredictable.
When called interactively, user has visual feedback on what's the
current state, so she can decide whether to call again.
When used programmatically, it's rather unpredictable what's would be
the letter case after calling this function unless the programer put
more code to check what are the letter cases to begin with.
If the programer wants to, for example, downcase/upcase/initCap region/
word, it's much simpler by calling elisp's default functions on these,
at most 2 calls.
Xah
∑ http://xahlee.org/
☄
prev parent reply other threads:[~2008-10-19 17:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-17 21:02 elisp exercise: toggle-letter-case Xah
2008-10-17 23:29 ` Andreas Politz
2008-10-18 1:06 ` Nikolaj Schumacher
[not found] ` <mailman.1411.1224291972.25473.help-gnu-emacs@gnu.org>
2008-10-18 18:53 ` Xah
2008-10-18 20:47 ` Nikolaj Schumacher
2008-10-18 20:50 ` Xah
2008-10-19 15:26 ` Nikolaj Schumacher
[not found] ` <mailman.1506.1224429976.25473.help-gnu-emacs@gnu.org>
2008-10-19 17:46 ` Xah [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=481420b9-7665-4b47-b54f-be99fdc83d26@u28g2000hsc.googlegroups.com \
--to=xahlee@gmail.com \
--cc=help-gnu-emacs@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.