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: Thu, 21 Jun 2007 03:00:25 -0400 Message-ID: References: <200706201948.06271.andreas.roehler@online.de> <4nvedib77v.fsf@fencepost.gnu.org> <29696.128.165.0.81.1182397659.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182409232 1421 80.91.229.12 (21 Jun 2007 07:00:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 07:00:32 +0000 (UTC) Cc: Andreas =?iso-8859-1?Q?R=F6hler?= , emacs-devel@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 09:00:31 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 1I1Ged-0004JM-6o for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 09:00:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1Gec-0006sY-QT for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 03:00:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1GeZ-0006rz-BJ for emacs-devel@gnu.org; Thu, 21 Jun 2007 03:00:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1GeZ-0006rj-1c for emacs-devel@gnu.org; Thu, 21 Jun 2007 03:00:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1GeY-0006rd-PG for emacs-devel@gnu.org; Thu, 21 Jun 2007 03:00:26 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I1GeY-0005wm-9H for emacs-devel@gnu.org; Thu, 21 Jun 2007 03:00:26 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1I1GeX-0002co-KI; Thu, 21 Jun 2007 03:00:25 -0400 X-Spook: codes bootleg Aldergrove arrangements eternity server 64 X-Ran: -(}WuymenVBeeASOZsz2Kp&ZTY*-m5o#<%C*C(R=r|8lWIfrC;.T@y>x//!M|~BgiKGJZY X-Hue: black X-Attribution: GM In-Reply-To: <29696.128.165.0.81.1182397659.squirrel@webmail.lanl.gov> (Davis Herring's message of "Wed, 20 Jun 2007 20:47:39 -0700 (PDT)") 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:73495 Archived-At: "Davis Herring" wrote: > Surely you mean do a case-sensitive search first and then > insensitive? Obviously the sensitive one can't work if the > insensitive one fails. Then you go on to say that "FOO" could only > be -different- if there is nothing than which to be different; > instead we want to say "`FOO' can only expand as upcased `foo' if > `FOO' is not its own abbrev", right? It doesn't really matter what I meant if Stefan's already invented this particular wheel. I was using "case-insensitive" in a confusing (ie wrong) way. What I meant was: You have a word (FOO) in the buffer. Downcase it, and compare with the abbrev table. If you find a match (foo), return the expansion, with the existing abbrev case-fiddling applied. This is the same as happens as present. If you don't find a match (and if the word is not all lower-case), go on to try the un-downcased version (FOO) against the abbrev table. If you find a match, return the expansion. This would enable existing abbrevs to function as they always have, and allow for new mixed-case abbrevs so long as they don't conflict with old-style abbrevs. If you do it the other way round, you would break backwards compatibility.