diff options
| author | David Engster | 2011-10-31 09:00:32 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-10-31 09:00:32 +0800 |
| commit | 72b8747b4fb41633284f9bcf1d9544eda69519aa (patch) | |
| tree | 9be6546997272d69a59b27f06384c0a185f403b3 /admin | |
| parent | 84bd6e9e02c051816d8ba8e31fec2c3f912ae8fa (diff) | |
| download | emacs-72b8747b4fb41633284f9bcf1d9544eda69519aa.tar.gz emacs-72b8747b4fb41633284f9bcf1d9544eda69519aa.zip | |
* admin/grammars/bovine-grammar.el: Avoid using old-style backquotes.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 4 | ||||
| -rw-r--r-- | admin/grammars/bovine-grammar.el | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 7c2f1a743b2..f91d53194ce 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-10-31 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * grammars/bovine-grammar.el: Avoid using old-style backquotes. | ||
| 4 | |||
| 1 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | 5 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * nt/README-ftp-server: Mention UNICOWS.DLL as prerequisite for | 7 | * nt/README-ftp-server: Mention UNICOWS.DLL as prerequisite for |
diff --git a/admin/grammars/bovine-grammar.el b/admin/grammars/bovine-grammar.el index 5a948608671..0e8756e1c5b 100644 --- a/admin/grammars/bovine-grammar.el +++ b/admin/grammars/bovine-grammar.el | |||
| @@ -109,6 +109,14 @@ NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." | |||
| 109 | ;; Cache of macro definitions currently in use. | 109 | ;; Cache of macro definitions currently in use. |
| 110 | (defvar bovine--grammar-macros nil) | 110 | (defvar bovine--grammar-macros nil) |
| 111 | 111 | ||
| 112 | ;; Detect if we have an Emacs with newstyle unquotes allowed outside | ||
| 113 | ;; of backquote. | ||
| 114 | ;; This should probably be changed to a test to (= emacs-major-version 24) | ||
| 115 | ;; when it is released, but at the moment it might be possible that people | ||
| 116 | ;; are using an older snapshot. | ||
| 117 | (defvar bovine--grammar-newstyle-unquote | ||
| 118 | (equal '(, test) (read ",test"))) | ||
| 119 | |||
| 112 | (defun bovine-grammar-expand-form (form quotemode &optional inplace) | 120 | (defun bovine-grammar-expand-form (form quotemode &optional inplace) |
| 113 | "Expand FORM into a new one suitable to the bovine parser. | 121 | "Expand FORM into a new one suitable to the bovine parser. |
| 114 | FORM is a list in which we are substituting. | 122 | FORM is a list in which we are substituting. |
| @@ -142,6 +150,17 @@ expanded from elsewhere." | |||
| 142 | (while form | 150 | (while form |
| 143 | (setq first (car form) | 151 | (setq first (car form) |
| 144 | form (cdr form)) | 152 | form (cdr form)) |
| 153 | ;; Hack for dealing with new reading of unquotes outside of | ||
| 154 | ;; backquote (introduced in rev. 102591 in emacs-bzr). | ||
| 155 | (when (and bovine--grammar-newstyle-unquote | ||
| 156 | (listp first) | ||
| 157 | (or (equal (car first) '\,) | ||
| 158 | (equal (car first) '\,@))) | ||
| 159 | (if (listp (cadr first)) | ||
| 160 | (setq form (append (cdr first) form) | ||
| 161 | first (car first)) | ||
| 162 | (setq first (intern (concat (symbol-name (car first)) | ||
| 163 | (symbol-name (cadr first))))))) | ||
| 145 | (cond | 164 | (cond |
| 146 | ((eq first nil) | 165 | ((eq first nil) |
| 147 | (when (and (not inlist) (not inplace)) | 166 | (when (and (not inlist) (not inplace)) |