Subject: Re: bug#5937: 23.1.95; why saving empty abbrev tables

From: Leo <[email-masked]>
Date: Tue, 29 Mar 2011 13:16:23 +0800

On 2011-03-29 12:41 +0800, Leo wrote:
> +(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))
> +  (write-abbrev-file abbrev-file-name t))
> +
> +(defun abbrev-save-to-file (file)
> +  "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))