|
|
@ -13,13 +13,16 @@ |
|
|
|
"Face for abbreviation hints" |
|
|
|
:group 'auto-abbrev-faces) |
|
|
|
|
|
|
|
(setq auto-abbrev-directory "/home/macoy/Development/code/repositories/auto-abbrev") |
|
|
|
(setq auto-abbrev-python3 "python3") |
|
|
|
|
|
|
|
(defun auto-abbrev-turn-on () |
|
|
|
"Add auto-abbrev font locks and abbrevs to the current buffer" |
|
|
|
(abbrev-mode 1) |
|
|
|
;; Make sure we clear out the old keywords |
|
|
|
(clear-abbrev-table auto-abbrev-mode-abbrev-table) |
|
|
|
(font-lock-remove-keywords nil auto-abbrev-highlights) |
|
|
|
(load-file "/home/macoy/Development/code/repositories/auto-abbrev/.auto-abbrevs-for-buffer.el") |
|
|
|
(load-file (concat auto-abbrev-directory "/.auto-abbrevs-for-buffer.el")) |
|
|
|
(font-lock-add-keywords nil auto-abbrev-highlights) |
|
|
|
(font-lock-fontify-buffer)) |
|
|
|
|
|
|
@ -34,7 +37,7 @@ |
|
|
|
:lighter " Auto-Abbrev" |
|
|
|
(if auto-abbrev-mode |
|
|
|
(auto-abbrev-turn-on) |
|
|
|
(auto-abbrev-off))) |
|
|
|
(auto-abbrev-turn-off))) |
|
|
|
|
|
|
|
;; Filled out by script later |
|
|
|
(setq auto-abbrev-highlights nil) |
|
|
@ -52,10 +55,11 @@ |
|
|
|
(defun auto-abbrev-refresh-current-buffer () |
|
|
|
(interactive) |
|
|
|
;; We need to remove keywords first, otherwise changed ones will stick around |
|
|
|
(let ((process (start-process "Auto-Abbrev" "*Auto-Abbrev*" "python3" |
|
|
|
"/home/macoy/Development/code/repositories/auto-abbrev/AbbrevsFromFile.py" "--verbose" |
|
|
|
(let ((process (start-process "Auto-Abbrev" "*Auto-Abbrev*" auto-abbrev-python3 |
|
|
|
(concat auto-abbrev-directory "/AbbrevsFromFile.py") |
|
|
|
;; "--verbose" |
|
|
|
buffer-file-name "-o" |
|
|
|
"/home/macoy/Development/code/repositories/auto-abbrev/.auto-abbrevs-for-buffer.el"))) |
|
|
|
(concat auto-abbrev-directory "/.auto-abbrevs-for-buffer.el")))) |
|
|
|
(set-process-sentinel process |
|
|
|
(lambda (process _string) |
|
|
|
(auto-abbrev-generation-finished))))) |
|
|
|