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: Testing new abbrev tables in elisp Date: Wed, 31 Oct 2007 13:44:33 -0400 Message-ID: References: <200706201948.06271.andreas.roehler@online.de> <200710262113.34899.andreas.roehler@online.de> <200710281514.00722.andreas.roehler@online.de> <87lk9kw23x.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193852741 408 80.91.229.12 (31 Oct 2007 17:45:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2007 17:45:41 +0000 (UTC) Cc: andreas.roehler@online.de, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 31 18:45:42 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 1InHcY-0001rC-2M for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 18:44:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHcO-0001N6-8G for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 13:44:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InHcL-0001K7-3k for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:44:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InHcK-0001Hk-Cl for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:44:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHcJ-0001Gz-U4 for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:44:35 -0400 Original-Received: from tomts20.bellnexxia.net ([209.226.175.74] helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InHcJ-00024n-9x for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:44:35 -0400 Original-Received: from pastel.home ([74.12.208.145]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20071031174433.IRMF8273.tomts20-srv.bellnexxia.net@pastel.home> for ; Wed, 31 Oct 2007 13:44:33 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 676F47F9F; Wed, 31 Oct 2007 13:44:33 -0400 (EDT) In-Reply-To: <87lk9kw23x.fsf@jurta.org> (Juri Linkov's message of "Wed\, 31 Oct 2007 18\:09\:32 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: 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:82239 Archived-At: > But maybe abbrev-mode should try to update :regexp automatically when the > user interactively defines a new multi-word abbrev? So instead of giving > the error message "Some abbrev characters are not word constituents" it > could run something like: > (let ((abbrevs ())) > (mapatoms (lambda (sym) > (if (symbol-value sym) (push (symbol-name sym) abbrevs))) > global-abbrev-table) > (abbrev-table-put global-abbrev-table :regexp (regexp-opt abbrevs 'words))) > to rebuild :regexp from all abbrevs when at least one of them is not > word constituent? Indeed it could. It could even rebuild it dynamically from the abbrev table's :enable-function by looking at the :abbrev-table-modiff value to detect changes. Stefan PS: I believe I've provided enough hooks to do most such crazy things. My own personal interest in improving abbrevs was in their use for skeletons, so I'll let other people work on other aspects.