From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: elisp exercise: toggle-letter-case Date: Sun, 19 Oct 2008 10:46:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: <481420b9-7665-4b47-b54f-be99fdc83d26@u28g2000hsc.googlegroups.com> References: <420ba543-19ba-4987-9f3a-a57878777c9d@n33g2000pri.googlegroups.com> <1224286525.260548@arno.fh-trier.de> <44503f09-7f13-41c4-80dd-4dcda150b76d@b31g2000prb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224506800 31544 80.91.229.12 (20 Oct 2008 12:46:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2008 12:46:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 20 14:46:46 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KrdDp-0005sZ-Q8 for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Oct 2008 20:41:50 +0200 Original-Received: from localhost ([127.0.0.1]:51913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KrdCk-00078A-K6 for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Oct 2008 14:40:42 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!u28g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1224438383 32761 127.0.0.1 (19 Oct 2008 17:46:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 19 Oct 2008 17:46:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u28g2000hsc.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163596 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58948 Archived-At: On Oct 19, 8:26 am, Nikolaj Schumacher wrote: > Xah wrote: > > it doesn't use (&optional beg end) with the associated > > =E2=80=9C(interactive ...)=E2=80=9D 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 =E2=88=91 http://xahlee.org/ =E2=98=84