aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorDavid Engster2011-10-31 09:00:32 +0800
committerChong Yidong2011-10-31 09:00:32 +0800
commit72b8747b4fb41633284f9bcf1d9544eda69519aa (patch)
tree9be6546997272d69a59b27f06384c0a185f403b3 /admin
parent84bd6e9e02c051816d8ba8e31fec2c3f912ae8fa (diff)
downloademacs-72b8747b4fb41633284f9bcf1d9544eda69519aa.tar.gz
emacs-72b8747b4fb41633284f9bcf1d9544eda69519aa.zip
* admin/grammars/bovine-grammar.el: Avoid using old-style backquotes.
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog4
-rw-r--r--admin/grammars/bovine-grammar.el19
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 @@
12011-10-31 David Engster <deng@randomsample.de>
2
3 * grammars/bovine-grammar.el: Avoid using old-style backquotes.
4
12011-10-28 Eli Zaretskii <eliz@gnu.org> 52011-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.
114FORM is a list in which we are substituting. 122FORM 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))