bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#5937: 23.1.95; why saving empty abbrev tables


From: Stefan Monnier
Subject: bug#5937: 23.1.95; why saving empty abbrev tables
Date: Tue, 29 Mar 2011 09:49:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> +(defun abbrev-save-buffer ()
>> +  "Save all user-level abbrev definitions in current buffer.
>> +The saved abbrevs are written to the file specified by
>> +`abbrev-file-name'."
>> +  (interactive)
>> +  (and (derived-mode-p 'edit-abbrevs-mode)
>> +       (edit-abbrevs-redefine))

No need for the derived-mode-p check.  But this reminds me: the name
should include "edit" (e.g. abbrev-edit-save-buffer) to make it clear
that it's about edit-abbrevs.

>> +(defun abbrev-save-to-file (file)

Same here.

>> +  "Save all user-level abbrev definitions in current buffer to FILE."
>> +  (interactive
>> +   (list (read-file-name "Save abbrevs to file: "
>> +                     (file-name-directory
>> +                      (expand-file-name abbrev-file-name))
>> +                     abbrev-file-name)))
>> +  (and (derived-mode-p 'edit-abbrevs-mode)
>> +       (edit-abbrevs-redefine))
>> +  (write-abbrev-file file t))

> Should define abbrev-save-buffer as:

> (defun abbrev-save-buffer ()
>   "Save all user-level abbrev definitions in current buffer.
> The saved abbrevs are written to the file specified by
> `abbrev-file-name'."
>   (interactive)
>   (abbrev-save-to-file abbrev-file-name))

Yes, that sounds like a good idea.


        Stefan





reply via email to

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