From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Abbrev tables in elisp with some extra stuff Date: Sat, 13 Oct 2007 02:41:08 -0400 Message-ID: References: <200706201948.06271.andreas.roehler@online.de> <4nvedib77v.fsf@fencepost.gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1192257775 22847 80.91.229.12 (13 Oct 2007 06:42:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Oct 2007 06:42:55 +0000 (UTC) Cc: rgm@gnu.org, andreas.roehler@online.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 13 08:42:45 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 1Igahq-0004Lw-JX for ged-emacs-devel@m.gmane.org; Sat, 13 Oct 2007 08:42:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Igahk-0000qe-4V for ged-emacs-devel@m.gmane.org; Sat, 13 Oct 2007 02:42:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IgagQ-0008V0-BR for emacs-devel@gnu.org; Sat, 13 Oct 2007 02:41:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IgagP-0008UZ-PE for emacs-devel@gnu.org; Sat, 13 Oct 2007 02:41:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgagP-0008US-JO for emacs-devel@gnu.org; Sat, 13 Oct 2007 02:41:09 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IgagP-0006gy-9s for emacs-devel@gnu.org; Sat, 13 Oct 2007 02:41:09 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IgagO-0001QC-Fh; Sat, 13 Oct 2007 02:41:08 -0400 In-reply-to: (message from Stefan Monnier on Fri, 12 Oct 2007 17:26:06 -0400) X-detected-kernel: by monty-python.gnu.org: 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:80769 Archived-At: In my experience, this exception usually holds for groups of abbreviations or even for all abbrevs defined in a mode (typically for skeleton-abbrevs), so it seems convenient to set it once and for all for the whole group. The simple, natural, and general interface is to specify this per abbrev. Please provide and document that method. Likewise for :enable-function. > If we have some abbrevs that are from skeletons, and some abbrevs that > are not, we don't want to have to put them in different abbrev tables. Why not? Because you should not have to know that a certain mode uses two abbrev tables and choose the right one. > The right way to do this is to have minor-mode-abbrev-table-alist > which would work like minor-mode-map-alist. We could do that as well, but it didn't seem to be much better and makes for more complex processing in expand-abbrev which is likely to be more often executed than enabling/disabling minor modes. As long as the minor mode is enabled/disabled via the function, we can provide the same behavior in either case. That is precisely what I want to avoid. It is unclean that minor modes have to be turned on or off by a function. Would you please implement minor-mode-abbrev-table-alist? > Using `labels' in this way also requires an explanation > of why it is written this way. It's just so as to use lexical scoping, which is much cleaner than going through the gensym rigmarole. > Did you try to write it in a more straightforward way, without > `labels'? If so, what was the problem with that approach? lexical scoping *is* the straightforward way. I had to struggle to understand it. Please see if this can be implemented straightforwardly in another way, without `labels'. > +(defun write--abbrev (sym) > This name should start with `internal-'. > +(defun describe--abbrev (sym) > Likewise. I like the "--" convention used in a few other packages, mostly because it still sticks to the normal prefix. Which packages do you have in mind?