From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: Abbrev should preserve case Date: Wed, 20 Jun 2007 18:18:28 -0400 Message-ID: <4nvedib77v.fsf@fencepost.gnu.org> References: <200706201948.06271.andreas.roehler@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182377937 21171 80.91.229.12 (20 Jun 2007 22:18:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Jun 2007 22:18:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas =?iso-8859-1?Q?R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 00:18:56 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I18Vr-0005UP-Rb for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 00:18:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I18Vq-0002Nh-Hg for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2007 18:18:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I18VR-0001xT-HG for emacs-devel@gnu.org; Wed, 20 Jun 2007 18:18:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I18VQ-0001wZ-O6 for emacs-devel@gnu.org; Wed, 20 Jun 2007 18:18:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I18VQ-0001wP-J6 for emacs-devel@gnu.org; Wed, 20 Jun 2007 18:18:28 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I18VQ-0002sg-PH for emacs-devel@gnu.org; Wed, 20 Jun 2007 18:18:28 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1I18VQ-0004B8-7W; Wed, 20 Jun 2007 18:18:28 -0400 X-Spook: bce munitions MILSATCOM number key $400 million in gold X-Ran: T:{AVZ[F,9>HG0P#sqm5@u8F)u=ZTJX*g?/{DJ/~O^5Q$nH*sf|RU|l{r+rpWRW1&OZD|t X-Hue: magenta X-Attribution: GM In-Reply-To: <200706201948.06271.andreas.roehler@online.de> (Andreas =?iso-8859-1?Q?R=F6hler's?= message of "Wed, 20 Jun 2007 19:48:05 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73476 Archived-At: > ,---- > | Abbrev expansion preserves case; thus, `foo' expands into `find > | outer otter'; `Foo' into `Find outer otter', and `FOO' into `FIND OUTER > | OTTER' > `---- > > From there users may guess, it would be possible to define `foo', > `Foo' and `FOO' as abbrev names likewise and altogether. I don't understand what you mean. To me, the quoted text implies that case is irrelevant in abbrev names. Perhaps it could explicitly say something about this. > Which don't work, because `add-abbrev' in line 289 abbrev.el > down-cases every input, thus only down-cased names are registered. > > ,---- > | (define-abbrev table (downcase name) exp)))) > `---- > > Exists a reason for that? Because otherwise the abbrev mechanism could not work as described in your first quote. expand-abbrev in abbrev.c downcases words in the buffer before comparing against the defined abbrevs. If define-abbrev did allow you to define "FOO" as an abbrev, it would never be expanded. > I would much appreciate, if I could mix freely up- and downcase > chars. This would extend the range of possible abbrev-names > considerably. > > The latter is of interest, if you don't use abbrev the common way, > but for whole phrases, defined by machine. I don't understand what you mean. Perhaps an example would help. > If no one objects, I would try to change that. I don't know what you want to do. How would you tell the difference between `FOO' meaning "expand to the upper-case expansion of `foo'" (as it works now), and `FOO' a totally separate abbreviation? I guess you could try a case-insensitive match first, then a case-sensitive one if it fails. This would mean that `FOO' could expand to something different than `foo' only if `foo' were not defined as an abbrev. Seems a bit complex though. Admittedly, I think the way it works now is a bit odd, but it's always been like that.