branch: elpa/lua-mode
commit 5a81583ba6350174649baf9e36277e2502ac0777
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
Restore compatibility with Emacs22 and earlier that was broken when
patching lua-mode-abbrev-table (should fix #11)
---
lua-mode.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 31f6656..c56bcb6 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -299,9 +299,18 @@ traceback location."
"Abbreviation table used in lua-mode buffers.")
(define-abbrev-table 'lua-mode-abbrev-table
- '(("end" "end" lua-indent-line :system t)
- ("else" "else" lua-indent-line :system t)
- ("elseif" "elseif" lua-indent-line :system t)))
+ ;; Emacs 23 introduced :system property that prevents abbrev
+ ;; entries from being written to file specified by abbrev-file-name
+ ;;
+ ;; Emacs 22 and earlier had this functionality implemented
+ ;; by simple nil/non-nil flag as positional parameter
+ (if (>= emacs-major-version 23)
+ '(("end" "end" lua-indent-line :system t)
+ ("else" "else" lua-indent-line :system t)
+ ("elseif" "elseif" lua-indent-line :system t))
+ '(("end" "end" lua-indent-line nil 'system)
+ ("else" "else" lua-indent-line nil 'system)
+ ("elseif" "elseif" lua-indent-line nil 'system)))
(eval-and-compile
(defalias 'lua-make-temp-file