Fix removal of autocorrect abbrevs
This commit is contained in:
parent
44e3a693da
commit
755020d591
16
config.org
16
config.org
|
@ -4408,13 +4408,15 @@ split the actual reading and the abbrev generation into two parts though.
|
||||||
(defun autocorrect--remove-invalid-abbrevs ()
|
(defun autocorrect--remove-invalid-abbrevs ()
|
||||||
"Ensure that all entries of the abbrev table are valid."
|
"Ensure that all entries of the abbrev table are valid."
|
||||||
(obarray-map
|
(obarray-map
|
||||||
(lambda (misspelling)
|
(lambda (misspelling-symb)
|
||||||
(when (stringp misspelling) ; Abbrev's obarrays start with a symbol
|
(let ((misspelling (symbol-name misspelling-symb)))
|
||||||
(let ((corrections (gethash misspelling autocorrect-record-table)))
|
(unless (string-empty-p misspelling) ; Abbrev uses an empty symbol for metadata.
|
||||||
(unless (and (= (length corrections) 1)
|
(let ((corrections (gethash misspelling autocorrect-record-table)))
|
||||||
(>= (cdar corrections)
|
(unless (and (= (length corrections) 1)
|
||||||
autocorrect-count-threshold-history))
|
(>= (cdar corrections)
|
||||||
(define-abbrev autocorrect-abbrev-table misspelling nil)))))
|
autocorrect-count-threshold-history))
|
||||||
|
(define-abbrev autocorrect-abbrev-table misspelling nil)
|
||||||
|
(unintern misspelling-symb autocorrect-abbrev-table))))))
|
||||||
autocorrect-abbrev-table))
|
autocorrect-abbrev-table))
|
||||||
|
|
||||||
(defun autocorrect--create-history-abbrevs ()
|
(defun autocorrect--create-history-abbrevs ()
|
||||||
|
|
Loading…
Reference in New Issue