Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
73ed6836
Commit
73ed6836
authored
May 17, 2012
by
Fabián Ezequiel Gallina
Committed by
Fabián Ezequiel Gallina
May 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python.el now bytecompiles without warnings
parent
e2803784
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
lisp/progmodes/python.el
lisp/progmodes/python.el
+31
-27
No files found.
lisp/progmodes/python.el
View file @
73ed6836
...
...
@@ -119,12 +119,15 @@
;;; Code:
(
require
'comint
)
(
require
'ansi-color
)
(
require
'
outl
in
e
)
(
require
'
com
in
t
)
(
eval-when-compile
(
require
'cl
))
(
require
'cl
)
;; Avoid compiler warnings
(
defvar
view-return-to-alist
)
(
defvar
compilation-error-regexp-alist
)
(
defvar
outline-heading-end-regexp
))
(
autoload
'comint-mode
"comint"
)
...
...
@@ -218,22 +221,23 @@
;;; Python specialized rx
(
defconst
python-rx-constituents
(
list
`
(
block-start
.
,
(
rx
symbol-start
(
or
"def"
"class"
"if"
"elif"
"else"
"try"
"except"
"finally"
"for"
"while"
"with"
)
symbol-end
))
`
(
defun
.
,
(
rx
symbol-start
(
or
"def"
"class"
)
symbol-end
))
`
(
open-paren
.
,
(
rx
(
or
"{"
"["
"("
)))
`
(
close-paren
.
,
(
rx
(
or
"}"
"]"
")"
)))
`
(
simple-operator
.
,
(
rx
(
any
?+
?-
?/
?&
?^
?~
?| ?* ?< ?> ?= ?%)))
`(not-simple-operator . ,(rx (not (any ?+ ?- ?/ ?& ?^ ?~ ?|
?*
?<
?>
?=
?%
))))
`
(
operator
.
,
(
rx
(
or
"+"
"-"
"/"
"&"
"^"
"~"
"|"
"*"
"<"
">"
"="
"%"
"**"
"//"
"<<"
">>"
"<="
"!="
"=="
">="
"is"
"not"
)))
`
(
assignment-operator
.
,
(
rx
(
or
"="
"+="
"-="
"*="
"/="
"//="
"%="
"**="
">>="
"<<="
"&="
"^="
"|="
))))
)
(
eval-when-compile
(
defconst
python-rx-constituents
(
list
`
(
block-start
.
,
(
rx
symbol-start
(
or
"def"
"class"
"if"
"elif"
"else"
"try"
"except"
"finally"
"for"
"while"
"with"
)
symbol-end
))
`
(
defun
.
,
(
rx
symbol-start
(
or
"def"
"class"
)
symbol-end
))
`
(
open-paren
.
,
(
rx
(
or
"{"
"["
"("
)))
`
(
close-paren
.
,
(
rx
(
or
"}"
"]"
")"
)))
`
(
simple-operator
.
,
(
rx
(
any
?+
?-
?/
?&
?^
?~
?| ?* ?< ?> ?= ?%)))
`(not-simple-operator . ,(rx (not (any ?+ ?- ?/ ?& ?^ ?~ ?|
?*
?<
?>
?=
?%
))))
`
(
operator
.
,
(
rx
(
or
"+"
"-"
"/"
"&"
"^"
"~"
"|"
"*"
"<"
">"
"="
"%"
"**"
"//"
"<<"
">>"
"<="
"!="
"=="
">="
"is"
"not"
)))
`
(
assignment-operator
.
,
(
rx
(
or
"="
"+="
"-="
"*="
"/="
"//="
"%="
"**="
">>="
"<<="
"&="
"^="
"|="
)))))
)
(
defmacro
python-rx
(
&rest
regexps
)
"Python mode especialized rx macro which supports common python named REGEXPS."
...
...
@@ -1537,14 +1541,14 @@ The skeleton will be bound to python-skeleton-NAME and will
be added to `python-mode-abbrev-table'."
(
let*
((
name
(
symbol-name
name
))
(
function-name
(
intern
(
concat
"python-skeleton-"
name
))))
(
define-abbrev
python-mode-abbrev-table
name
""
function-name
)
(
setq
python-skeleton-available
(
cons
function-name
python-skeleton-available
))
`
(
define-skeleton
,
function-name
,
(
or
doc
(
format
"Insert %s statement."
name
))
,@
skel
)
))
`
(
progn
(
define-abbrev
python-mode-abbrev-table
,
name
""
',function-name
)
(
setq
python-skeleton-available
(
cons
',function-name
python-skeleton-available
))
(
define-skeleton
,
function-name
,
(
or
doc
(
format
"Insert %s statement."
name
))
,@
skel
))))
(
put
'python-skeleton-define
'lisp-indent-function
2
)
(
defmacro
python-define-auxiliary-skeleton
(
name
doc
&optional
&rest
skel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment