emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch]: sort abbrevs before saving


From: Eric Hanchrow
Subject: [patch]: sort abbrevs before saving
Date: Thu, 14 Apr 2005 11:42:58 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/22.0.50 (gnu/linux)

--- 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]