From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Abbrev should preserve case Date: Thu, 21 Jun 2007 04:01:27 -0400 Message-ID: References: <200706201948.06271.andreas.roehler@online.de> <29696.128.165.0.81.1182397659.squirrel@webmail.lanl.gov> <200706210910.48499.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 1182412954 13196 80.91.229.12 (21 Jun 2007 08:02:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 08:02:34 +0000 (UTC) Cc: Glenn Morris , 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 10:02:32 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 1I1Hcd-0006ar-TH for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 10:02:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1Hcd-0001Qz-HH for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 04:02:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1Hbj-00017o-AI for emacs-devel@gnu.org; Thu, 21 Jun 2007 04:01:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1Hbe-00016n-I2 for emacs-devel@gnu.org; Thu, 21 Jun 2007 04:01:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1Hbe-00016k-Ef for emacs-devel@gnu.org; Thu, 21 Jun 2007 04:01:30 -0400 Original-Received: from bc.sympatico.ca ([209.226.175.184] helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I1Hbc-00016x-W5; Thu, 21 Jun 2007 04:01:29 -0400 Original-Received: from pastel.home ([70.53.192.71]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070621080127.RGIR875.tomts22-srv.bellnexxia.net@pastel.home>; Thu, 21 Jun 2007 04:01:27 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9BB44803F; Thu, 21 Jun 2007 04:01:27 -0400 (EDT) In-Reply-To: <200706210910.48499.andreas.roehler@online.de> ("Andreas =?iso-8859-1?Q?R=F6hler=22's?= message of "Thu\, 21 Jun 2007 09\:10\:47 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:73498 Archived-At: > Might it not be the best solution to drop the down-case > commands in abbrev.c? The case-insensitivity (and magical treatment of case in general) is a feature, as evidenced by the amount of extra code in abbrev.c to implement it. So we do not want to just throw it all out. > Imaging the use of machine written abbrevs for NLP, context analyses etc., > speed will matter. Therefore I suggest to do the work in C as far as > possible, avoid re-implementations. (I intend to take part here as far as > it's welcome and I'm able to.) The expand-abbrev code has no loop. So there is no issue w.r.t performance (at least as long as we stick to the current constraint that abbreviations can only contain chars of word-syntax"): the code of expand-abbrev basically extracts the word before point, looks it up in a hash-table (actually, an obarray) and then uses the result to do the expansion (if any). The only part that will get slower with larger abbrev-tables is the hash-lookup which is coded in C anyway. > Please consider if a derived mode must copy all the > abbrevs. I'd say a derived mode should rather note the > differences, but read the major-mode first. Then the > abbrev-file, which already counts 500K here, would > shrink a lot. This may be solved by the use of inheritance. Although given the rather limited amount of derived major modes in use, I'm not sure your 500KB would really shrink that much. Stefan