typographic quotes, “like this”, in text modes, and in comments in
non-text modes.
+---
+** 'write-abbrev-file' now includes special properties.
+'write-abbrev-file' now writes special properties like ':case-fixed'
+for abbrevs that have them.
+
\f
* Changes in Specialized Modes and Packages in Emacs 27.1
(prin1 (symbol-value sym))
(insert " ")
(prin1 (symbol-function sym))
- (insert " ")
+ (insert " :count ")
(prin1 (abbrev-get sym :count))
+ (when (abbrev-get sym :case-fixed)
+ (insert " :case-fixed ")
+ (prin1 (abbrev-get sym :case-fixed)))
+ (when (abbrev-get sym :enable-function)
+ (insert " :enable-function ")
+ (prin1 (abbrev-get sym :enable-function)))
(insert ")\n")))
(defun abbrev--describe (sym)
(abbrev-table-put ert-test-abbrevs :ert-test "ert-test-value")
ert-test-abbrevs)
+(defun setup-test-abbrev-table-with-props ()
+ (defvar ert-test-abbrevs nil)
+ (define-abbrev-table 'ert-test-abbrevs '(("fb" "fooBar" nil :case-fixed t)))
+ (abbrev-table-put ert-test-abbrevs :ert-test "ert-test-value")
+ ert-test-abbrevs)
+
(ert-deftest abbrev-table-p-test ()
(should-not (abbrev-table-p 42))
(should-not (abbrev-table-p "aoeu"))
(should (equal "abbrev-ert-test" (abbrev-expansion "a-e-t" ert-test-abbrevs)))
(delete-file temp-test-file)))
+(ert-deftest read-write-abbrev-file-test-with-props ()
+ "Test reading and writing abbrevs from file"
+ (let ((temp-test-file (make-temp-file "ert-abbrev-test"))
+ (ert-test-abbrevs (setup-test-abbrev-table-with-props)))
+ (write-abbrev-file temp-test-file)
+ (clear-abbrev-table ert-test-abbrevs)
+ (should (abbrev-table-empty-p ert-test-abbrevs))
+ (read-abbrev-file temp-test-file)
+ (should (equal "fooBar" (abbrev-expansion "fb" ert-test-abbrevs)))
+ (delete-file temp-test-file)))
+
(ert-deftest abbrev-edit-save-to-file-test ()
"Test saving abbrev definitions in buffer to file"
(defvar ert-save-test-table nil)