From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5937: 23.1.95; why saving empty abbrev tables Date: Mon, 28 Mar 2011 09:58:09 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301321602 11756 80.91.229.12 (28 Mar 2011 14:13:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2011 14:13:22 +0000 (UTC) Cc: 5937@debbugs.gnu.org To: Leo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 28 16:13:18 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4DC1-0002Ug-R9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Mar 2011 16:13:18 +0200 Original-Received: from localhost ([127.0.0.1]:54003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4D98-0006yT-BT for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Mar 2011 10:10:18 -0400 Original-Received: from [140.186.70.92] (port=44026 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4D68-0005U6-Mx for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 10:07:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4D66-0000cP-SH for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 10:07:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4D66-0000cL-Qp for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2011 10:07:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q4CyE-0005Nf-Fc; Mon, 28 Mar 2011 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Mar 2011 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5937 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5937-submit@debbugs.gnu.org id=B5937.130132069920624 (code B ref 5937); Mon, 28 Mar 2011 13:59:02 +0000 Original-Received: (at 5937) by debbugs.gnu.org; 28 Mar 2011 13:58:19 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4CxV-0005Mb-N0 for submit@debbugs.gnu.org; Mon, 28 Mar 2011 09:58:18 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4CxT-0005MO-G6 for 5937@debbugs.gnu.org; Mon, 28 Mar 2011 09:58:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAE6TkE1MCqRC/2dsb2JhbAClPniIa7oNhWkElgU X-IronPort-AV: E=Sophos;i="4.63,255,1299474000"; d="scan'208";a="98345314" Original-Received: from 76-10-164-66.dsl.teksavvy.com (HELO ceviche.home) ([76.10.164.66]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 28 Mar 2011 09:58:09 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3E2E5660F8; Mon, 28 Mar 2011 09:58:09 -0400 (EDT) In-Reply-To: (Leo's message of "Mon, 28 Mar 2011 12:45:47 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 28 Mar 2011 09:59:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45417 Archived-At: >> You mean keep C-c C-c bound to edit-abbrevs-redefine, but change C-x C-s >> to call write-abbrev-file? Sounds good (tho it'll have to call >> edit-abbrevs-redefine before write-abbrev-file beforehand, of course). >> Oh and by the way: the abbrev.el file should be (slowly) fixed to use >> the "abbrev-" prefix for all functions and commands, so whenever you >> introduce a new function/command/variable please use this prefix rather >> than the previous style of -abbrev-. > How about this patch? > @@ -225,6 +227,7 @@ > abbrev-file-name))) > (or (and file (> (length file) 0)) > (setq file abbrev-file-name)) > + (edit-abbrevs-redefine) > (let ((coding-system-for-write 'utf-8)) > (with-temp-buffer > (dolist (table > @@ -247,7 +250,14 @@ > 'emacs-mule))) > (goto-char (point-min)) > (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) > - (write-region nil nil file nil 0)))) > + (write-region nil nil file nil (and (not verbose) 0))))) > + > +(defun abbrev-save-buffer () > + "Save all user-level abbrev definitions in current buffer. > +The file name to use is `abbrev-file-name'." > + (interactive) > + (write-abbrev-file abbrev-file-name t)) write-abbrev-file may be called from a non-"edit-abbrevs" buffer (e.g. from save-some-buffer), so I think that calling edit-abbrevs-redefine from it is problematic. Is there a particular reason why you put the call to edit-abbrevs-redefine in write-abbrev-file rather than in abbrev-save-buffer. Stefan