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.
This commit is contained in:
parent
cd196f1256
commit
f291fe60fb
16 changed files with 52 additions and 51 deletions
|
@ -66,7 +66,6 @@ The return value of this function is not used."
|
|||
;; Redefined in byte-optimize.el.
|
||||
;; This is not documented--it's not clear that we should promote it.
|
||||
(fset 'inline 'progn)
|
||||
(put 'inline 'lisp-indent-function 0)
|
||||
|
||||
;;; Interface to inline functions.
|
||||
|
||||
|
|
|
@ -71,11 +71,6 @@
|
|||
;;; by capitalizing the first letter: Values, Multiple-value-*,
|
||||
;;; to avoid conflict with the new-style definitions in cl-macs.
|
||||
|
||||
(put 'Multiple-value-bind 'lisp-indent-function 2)
|
||||
(put 'Multiple-value-setq 'lisp-indent-function 2)
|
||||
(put 'Multiple-value-call 'lisp-indent-function 1)
|
||||
(put 'Multiple-value-prog1 'lisp-indent-function 1)
|
||||
|
||||
(defvar *mvalues-values* nil)
|
||||
|
||||
(defun Values (&rest val-forms)
|
||||
|
@ -91,18 +86,22 @@
|
|||
(list *mvalues-temp*))))
|
||||
|
||||
(defmacro Multiple-value-call (function &rest args)
|
||||
(declare (indent 1))
|
||||
(list 'apply function
|
||||
(cons 'append
|
||||
(mapcar (function (lambda (x) (list 'Multiple-value-list x)))
|
||||
args))))
|
||||
|
||||
(defmacro Multiple-value-bind (vars form &rest body)
|
||||
(declare (indent 2))
|
||||
(list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
|
||||
|
||||
(defmacro Multiple-value-setq (vars form)
|
||||
(declare (indent 2))
|
||||
(list 'multiple-value-setq vars (list 'Multiple-value-list form)))
|
||||
|
||||
(defmacro Multiple-value-prog1 (form &rest body)
|
||||
(declare (indent 1))
|
||||
(list 'prog1 form (list* 'let '((*mvalues-values* nil)) body)))
|
||||
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
;;; this file independent from cl-macs.
|
||||
|
||||
(defmacro cl-parsing-keywords (kwords other-keys &rest body)
|
||||
(declare (indent 2) (debug (sexp sexp &rest form)))
|
||||
(cons
|
||||
'let*
|
||||
(cons (mapcar
|
||||
|
@ -84,13 +85,13 @@
|
|||
(car cl-keys-temp)))
|
||||
'(setq cl-keys-temp (cdr (cdr cl-keys-temp)))))))
|
||||
body))))
|
||||
(put 'cl-parsing-keywords 'lisp-indent-function 2)
|
||||
(put 'cl-parsing-keywords 'edebug-form-spec '(sexp sexp &rest form))
|
||||
|
||||
(defmacro cl-check-key (x)
|
||||
(declare (debug edebug-forms))
|
||||
(list 'if 'cl-key (list 'funcall 'cl-key x) x))
|
||||
|
||||
(defmacro cl-check-test-nokey (item x)
|
||||
(declare (debug edebug-forms))
|
||||
(list 'cond
|
||||
(list 'cl-test
|
||||
(list 'eq (list 'not (list 'funcall 'cl-test item x))
|
||||
|
@ -101,20 +102,17 @@
|
|||
(list 'equal item x) (list 'eq item x)))))
|
||||
|
||||
(defmacro cl-check-test (item x)
|
||||
(declare (debug edebug-forms))
|
||||
(list 'cl-check-test-nokey item (list 'cl-check-key x)))
|
||||
|
||||
(defmacro cl-check-match (x y)
|
||||
(declare (debug edebug-forms))
|
||||
(setq x (list 'cl-check-key x) y (list 'cl-check-key y))
|
||||
(list 'if 'cl-test
|
||||
(list 'eq (list 'not (list 'funcall 'cl-test x y)) 'cl-test-not)
|
||||
(list 'if (list 'numberp x)
|
||||
(list 'equal x y) (list 'eq x y))))
|
||||
|
||||
(put 'cl-check-key 'edebug-form-spec 'edebug-forms)
|
||||
(put 'cl-check-test 'edebug-form-spec 'edebug-forms)
|
||||
(put 'cl-check-test-nokey 'edebug-form-spec 'edebug-forms)
|
||||
(put 'cl-check-match 'edebug-form-spec 'edebug-forms)
|
||||
|
||||
(defvar cl-test) (defvar cl-test-not)
|
||||
(defvar cl-if) (defvar cl-if-not)
|
||||
(defvar cl-key)
|
||||
|
|
|
@ -514,9 +514,9 @@ Applies to the frame whose line point is on in the backtrace."
|
|||
(insert ? )))
|
||||
(beginning-of-line))
|
||||
|
||||
(put 'debugger-env-macro 'lisp-indent-function 0)
|
||||
(defmacro debugger-env-macro (&rest body)
|
||||
"Run BODY in original environment."
|
||||
(declare (indent 0))
|
||||
`(save-excursion
|
||||
(if (null (buffer-name debugger-old-buffer))
|
||||
;; old buffer deleted
|
||||
|
|
|
@ -43,8 +43,6 @@ menus, turn this variable off, otherwise it is probably better to keep it on.")
|
|||
(defsubst easy-menu-intern (s)
|
||||
(if (stringp s) (intern s) s))
|
||||
|
||||
;;;###autoload
|
||||
(put 'easy-menu-define 'lisp-indent-function 'defun)
|
||||
;;;###autoload
|
||||
(defmacro easy-menu-define (symbol maps doc menu)
|
||||
"Define a menu bar submenu in maps MAPS, according to MENU.
|
||||
|
@ -151,6 +149,7 @@ unselectable text. A string consisting solely of hyphens is displayed
|
|||
as a solid horizontal line.
|
||||
|
||||
A menu item can be a list with the same format as MENU. This is a submenu."
|
||||
(declare (indent defun))
|
||||
`(progn
|
||||
,(if symbol `(defvar ,symbol nil ,doc))
|
||||
(easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu)))
|
||||
|
|
|
@ -1610,6 +1610,7 @@ SPEC-LIST is of a form similar to `let'. For example:
|
|||
Where each VAR is the local variable given to the associated
|
||||
SLOT. A slot specified without a variable name is given a
|
||||
variable name of the same name as the slot."
|
||||
(declare (indent 2))
|
||||
;; Transform the spec-list into a symbol-macrolet spec-list.
|
||||
(let ((mappings (mapcar (lambda (entry)
|
||||
(let ((var (if (listp entry) (car entry) entry))
|
||||
|
@ -1618,8 +1619,6 @@ variable name of the same name as the slot."
|
|||
spec-list)))
|
||||
(append (list 'symbol-macrolet mappings)
|
||||
body)))
|
||||
(put 'with-slots 'lisp-indent-function 2)
|
||||
|
||||
|
||||
;;; Simple generators, and query functions. None of these would do
|
||||
;; well embedded into an object.
|
||||
|
|
|
@ -298,6 +298,7 @@ The returned value is a list of strings, one per line."
|
|||
(defmacro lm-with-file (file &rest body)
|
||||
"Execute BODY in a buffer containing the contents of FILE.
|
||||
If FILE is nil, execute BODY in the current buffer."
|
||||
(declare (indent 1) (debug t))
|
||||
(let ((filesym (make-symbol "file")))
|
||||
`(let ((,filesym ,file))
|
||||
(if ,filesym
|
||||
|
@ -311,9 +312,6 @@ If FILE is nil, execute BODY in the current buffer."
|
|||
(with-syntax-table emacs-lisp-mode-syntax-table
|
||||
,@body))))))
|
||||
|
||||
(put 'lm-with-file 'lisp-indent-function 1)
|
||||
(put 'lm-with-file 'edebug-form-spec t)
|
||||
|
||||
;; Fixme: Probably this should be amalgamated with copyright.el; also
|
||||
;; we need a check for ranges in copyright years.
|
||||
|
||||
|
|
|
@ -1210,31 +1210,17 @@ This function also returns nil meaning don't specify the indentation."
|
|||
(put 'prog2 'lisp-indent-function 2)
|
||||
(put 'save-excursion 'lisp-indent-function 0)
|
||||
(put 'save-window-excursion 'lisp-indent-function 0)
|
||||
(put 'save-selected-window 'lisp-indent-function 0)
|
||||
(put 'save-restriction 'lisp-indent-function 0)
|
||||
(put 'save-match-data 'lisp-indent-function 0)
|
||||
(put 'save-current-buffer 'lisp-indent-function 0)
|
||||
(put 'with-current-buffer 'lisp-indent-function 1)
|
||||
(put 'combine-after-change-calls 'lisp-indent-function 0)
|
||||
(put 'with-output-to-string 'lisp-indent-function 0)
|
||||
(put 'with-temp-file 'lisp-indent-function 1)
|
||||
(put 'with-temp-buffer 'lisp-indent-function 0)
|
||||
(put 'with-temp-message 'lisp-indent-function 1)
|
||||
(put 'with-syntax-table 'lisp-indent-function 1)
|
||||
(put 'let 'lisp-indent-function 1)
|
||||
(put 'let* 'lisp-indent-function 1)
|
||||
(put 'while 'lisp-indent-function 1)
|
||||
(put 'if 'lisp-indent-function 2)
|
||||
(put 'read-if 'lisp-indent-function 2)
|
||||
(put 'catch 'lisp-indent-function 1)
|
||||
(put 'condition-case 'lisp-indent-function 2)
|
||||
(put 'unwind-protect 'lisp-indent-function 1)
|
||||
(put 'with-output-to-temp-buffer 'lisp-indent-function 1)
|
||||
(put 'eval-after-load 'lisp-indent-function 1)
|
||||
(put 'dolist 'lisp-indent-function 1)
|
||||
(put 'dotimes 'lisp-indent-function 1)
|
||||
(put 'when 'lisp-indent-function 1)
|
||||
(put 'unless 'lisp-indent-function 1)
|
||||
|
||||
(defun indent-sexp (&optional endpos)
|
||||
"Indent each line of the list starting just after point.
|
||||
|
|
|
@ -443,8 +443,6 @@ This function returns a timer object which you can use in `cancel-timer'."
|
|||
"This is the timer function used for the timer made by `with-timeout'."
|
||||
(throw tag 'timeout))
|
||||
|
||||
(put 'with-timeout 'lisp-indent-function 1)
|
||||
|
||||
(defvar with-timeout-timers nil
|
||||
"List of all timers used by currently pending `with-timeout' calls.")
|
||||
|
||||
|
@ -456,6 +454,7 @@ event (such as keyboard input, input from subprocesses, or a certain time);
|
|||
if the program loops without waiting in any way, the timeout will not
|
||||
be detected.
|
||||
\n(fn (SECONDS TIMEOUT-FORMS...) BODY)"
|
||||
(declare (indent 1))
|
||||
(let ((seconds (car list))
|
||||
(timeout-forms (cdr list)))
|
||||
`(let ((with-timeout-tag (cons nil nil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue