[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112314: * progmodes/python.el (pytho
From: |
Fabián Ezequiel Gallina |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112314: * progmodes/python.el (python-syntax--context-compiler-macro): New defun. |
Date: |
Tue, 16 Apr 2013 23:52:50 -0300 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 112314
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: trunk
timestamp: Tue 2013-04-16 23:52:50 -0300
message:
* progmodes/python.el (python-syntax--context-compiler-macro): New defun.
(python-syntax-context): Use named compiler-macro for backwards
compatibility with Emacs 24.x.
modified:
lisp/ChangeLog
lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-04-17 01:46:26 +0000
+++ b/lisp/ChangeLog 2013-04-17 02:52:50 +0000
@@ -1,3 +1,9 @@
+2013-04-17 Fabián Ezequiel Gallina <address@hidden>
+
+ * progmodes/python.el (python-syntax--context-compiler-macro): New
defun.
+ (python-syntax-context): Use named compiler-macro for backwards
+ compatibility with Emacs 24.x.
+
2013-04-17 Leo Liu <address@hidden>
* progmodes/octave-mod.el (octave-mode-map): Fix key binding to
=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el 2013-04-16 17:28:11 +0000
+++ b/lisp/progmodes/python.el 2013-04-17 02:52:50 +0000
@@ -368,22 +368,24 @@
;;; Font-lock and syntax
+(eval-when-compile
+ (defun python-syntax--context-compiler-macro (form type &optional
syntax-ppss)
+ (pcase type
+ (`'comment
+ `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
+ (and (nth 4 ppss) (nth 8 ppss))))
+ (`'string
+ `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
+ (and (nth 3 ppss) (nth 8 ppss))))
+ (`'paren
+ `(nth 1 (or ,syntax-ppss (syntax-ppss))))
+ (_ form))))
+
(defun python-syntax-context (type &optional syntax-ppss)
"Return non-nil if point is on TYPE using SYNTAX-PPSS.
TYPE can be `comment', `string' or `paren'. It returns the start
character address of the specified TYPE."
- (declare (compiler-macro
- (lambda (form)
- (pcase type
- (`'comment
- `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
- (and (nth 4 ppss) (nth 8 ppss))))
- (`'string
- `(let ((ppss (or ,syntax-ppss (syntax-ppss))))
- (and (nth 3 ppss) (nth 8 ppss))))
- (`'paren
- `(nth 1 (or ,syntax-ppss (syntax-ppss))))
- (_ form)))))
+ (declare (compiler-macro python-syntax--context-compiler-macro))
(let ((ppss (or syntax-ppss (syntax-ppss))))
(pcase type
(`comment (and (nth 4 ppss) (nth 8 ppss)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112314: * progmodes/python.el (python-syntax--context-compiler-macro): New defun.,
Fabián Ezequiel Gallina <=