From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.devel Subject: [patch] abbrev.el (write-abbrev-file): Write table entries in alphabetical order by table name. Date: Thu, 14 Apr 2005 11:50:09 -0700 Message-ID: <8764yp19cu.fsf@offby1.atm01.sea.blarg.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113506720 26930 80.91.229.2 (14 Apr 2005 19:25:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2005 19:25:20 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 14 21:25:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DM9xg-0007xX-DQ for ged-emacs-devel@m.gmane.org; Thu, 14 Apr 2005 21:25:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMA12-0005Hq-Ce for ged-emacs-devel@m.gmane.org; Thu, 14 Apr 2005 15:28:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DM9t1-0001Wu-Bj for emacs-devel@gnu.org; Thu, 14 Apr 2005 15:20:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DM9r8-0001FS-M9 for emacs-devel@gnu.org; Thu, 14 Apr 2005 15:18:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DM9r7-00015F-2u for emacs-devel@gnu.org; Thu, 14 Apr 2005 15:18:25 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DM9SH-0004vY-Vd for emacs-devel@gnu.org; Thu, 14 Apr 2005 14:52:46 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DM9Ny-00026O-Vo for emacs-devel@gnu.org; Thu, 14 Apr 2005 20:48:18 +0200 Original-Received: from offby1.atm01.sea.blarg.net ([206.124.138.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2005 20:48:18 +0200 Original-Received: from offby1 by offby1.atm01.sea.blarg.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2005 20:48:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 35 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: offby1.atm01.sea.blarg.net User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:C50dZSmN+77gSjFEKxK3pnR/dfM= 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:35986 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35986 The motivation for this should be clear from the comment. * abbrev.el (write-abbrev-file): Write table entries in alphabetical order by table name. --- abbrev.el 11 Apr 2005 11:13:44 -0700 1.39 +++ abbrev.el 14 Apr 2005 11:40:56 -0700 @@ -221,7 +221,20 @@ (let ((coding-system-for-write 'emacs-mule)) (with-temp-file file (insert ";;-*-coding: emacs-mule;-*-\n") - (dolist (table abbrev-table-name-list) + (dolist (table + + ;; We sort the table in order to ease the automatic + ;; merging of different versions of the user's abbrevs + ;; file. This is useful, for example, for when the + ;; user keeps their home directory in a revision + ;; control system, and is therefore keeping multiple + ;; slightly-differing copies loosely synchronized. + (sort (copy-list abbrev-table-name-list) + (lambda (s1 s2) + (string< (symbol-name s1) + (symbol-name s2)))) + + ) (insert-abbrev-table-description table nil))))) (defun add-mode-abbrev (arg) -- If you're trying to choose between two theories and one gives you an excuse for being lazy, the other one is probably right. -- Paul Graham