comparison lisp/progmodes/python.el @ 110034:c87f89486bb7

Use `declare' in defmacros. * lisp/window.el (save-selected-window): * lisp/subr.el (with-temp-file, with-temp-message, with-syntax-table): * lisp/progmodes/python.el (def-python-skeleton): * lisp/net/dbus.el (dbus-ignore-errors): * lisp/jka-cmpr-hook.el (with-auto-compression-mode): * lisp/international/mule.el (with-category-table): * lisp/emacs-lisp/timer.el (with-timeout): * lisp/emacs-lisp/lisp-mnt.el (lm-with-file): * lisp/emacs-lisp/eieio.el (with-slots): * lisp/emacs-lisp/easymenu.el (easy-menu-define): * lisp/emacs-lisp/debug.el (debugger-env-macro): * lisp/emacs-lisp/cl-compat.el (Multiple-value-bind, Multiple-value-setq) (Multiple-value-call, Multiple-value-prog1): * lisp/emacs-lisp/cl-seq.el (cl-parsing-keywords, cl-check-key) (cl-check-test-nokey, cl-check-test, cl-check-match): Move indent and edebug rule to definition. * lisp/emacs-lisp/lisp-mode.el (save-selected-window) (with-current-buffer, combine-after-change-calls) (with-output-to-string, with-temp-file, with-temp-buffer) (with-temp-message, with-syntax-table, read-if, eval-after-load) (dolist, dotimes, when, unless): * lisp/emacs-lisp/byte-run.el (inline): Remove indent rule, redundant.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 30 Aug 2010 15:03:05 +0200
parents ba4a9b0e3879
children 0dcf6ddbe02b
comparison
equal deleted inserted replaced
110033:2c9ea5d32862 110034:c87f89486bb7
2283 :enable-function (lambda () (not (python-in-string/comment)))) 2283 :enable-function (lambda () (not (python-in-string/comment))))
2284 2284
2285 (eval-when-compile 2285 (eval-when-compile
2286 ;; Define a user-level skeleton and add it to the abbrev table. 2286 ;; Define a user-level skeleton and add it to the abbrev table.
2287 (defmacro def-python-skeleton (name &rest elements) 2287 (defmacro def-python-skeleton (name &rest elements)
2288 (declare (indent 2))
2288 (let* ((name (symbol-name name)) 2289 (let* ((name (symbol-name name))
2289 (function (intern (concat "python-insert-" name)))) 2290 (function (intern (concat "python-insert-" name))))
2290 `(progn 2291 `(progn
2291 ;; Usual technique for inserting a skeleton, but expand 2292 ;; Usual technique for inserting a skeleton, but expand
2292 ;; to the original abbrev instead if in a comment or string. 2293 ;; to the original abbrev instead if in a comment or string.
2295 ',function 2296 ',function
2296 nil t)) ; system abbrev 2297 nil t)) ; system abbrev
2297 (define-skeleton ,function 2298 (define-skeleton ,function
2298 ,(format "Insert Python \"%s\" template." name) 2299 ,(format "Insert Python \"%s\" template." name)
2299 ,@elements))))) 2300 ,@elements)))))
2300 (put 'def-python-skeleton 'lisp-indent-function 2)
2301 2301
2302 ;; From `skeleton-further-elements' set below: 2302 ;; From `skeleton-further-elements' set below:
2303 ;; `<': outdent a level; 2303 ;; `<': outdent a level;
2304 ;; `^': delete indentation on current line and also previous newline. 2304 ;; `^': delete indentation on current line and also previous newline.
2305 ;; Not quite like `delete-indentation'. Assumes point is at 2305 ;; Not quite like `delete-indentation'. Assumes point is at