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: Wed, 17 Oct 2007 16:48:50 -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: ger.gmane.org 1192654187 10907 80.91.229.12 (17 Oct 2007 20:49:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2007 20:49:47 +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 Wed Oct 17 22:49:46 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 1IiFpi-0006lR-41 for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 22:49:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiFpa-0007hv-Vg for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 16:49:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IiFox-000713-T3 for emacs-devel@gnu.org; Wed, 17 Oct 2007 16:48:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IiFox-000701-1j for emacs-devel@gnu.org; Wed, 17 Oct 2007 16:48:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiFow-0006zp-T8 for emacs-devel@gnu.org; Wed, 17 Oct 2007 16:48:50 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IiFow-00005s-Ln for emacs-devel@gnu.org; Wed, 17 Oct 2007 16:48:50 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IiFow-0003Au-16; Wed, 17 Oct 2007 16:48:50 -0400 In-reply-to: (message from Stefan Monnier on Tue, 16 Oct 2007 16:26:08 -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:81089 Archived-At: +;; - abbrevs could have a `predicate' so you can disable them in strings and +;; comments, for example. Maybe the predicate should be on the table +;; rather than on individual abbrevs. This may be enough to cover the +;; above request for context-dependent abbrevs. If you implement that on individual abbrevs and on tables, it will do both jobs. +(defun abbrev-get (sym prop) + (let ((plist (symbol-plist sym))) + (if (listp plist) + (plist-get plist prop) + (if (eq 'count prop) plist)))) That needs a doc string, and the doc string needs to explain the various types of arguments that are allowed. + ;; The loop has to be done via recursion rather than a `while'. Please add an explanation of why. +(defun abbrev-set-member (elem set) That needs a doc string, and it should fully explain what SET can look like. +(defun abbrev--active-tables (&optional tables) That needs a doc string. It should state the purpose of having the argument TABLES. Why not just write (or tables (abbrev--active-tables))? (I don't mind using `abbrev--' to start a function name, because it has `abbrev' at the beginning.) +(defun write--abbrev (sym) I do dislike `--' here since it doesn't start with `abbrev'. Also please give this a doc string.