1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-09 15:50:21 +00:00

Mark all def* functions that should indent as `defun'

* lisp/abbrev.el (define-abbrev):
(define-abbrev-table): Mark all functions that have names that
start with "def" that should indent according to the current
heuristics (bug#43329).
* lisp/autoinsert.el (define-auto-insert):

* lisp/button.el (define-button-type):

* lisp/subr.el (define-key-after):
(define-mail-user-agent):
(define-keymap):

* lisp/widget.el (define-widget):

* lisp/emacs-lisp/package.el (define-package):

* lisp/international/mule-cmds.el (define-char-code-property):

* lisp/international/mule.el (define-charset):
(define-coding-system):
(define-translation-table):
(define-translation-hash-table):
This commit is contained in:
Lars Ingebrigtsen 2021-10-13 21:21:23 +02:00
parent 5be4483d33
commit 43f59b91aa
8 changed files with 14 additions and 2 deletions

View File

@ -583,6 +583,7 @@ PROPS is a property list. The following properties are special:
An obsolete but still supported calling form is:
\(define-abbrev TABLE NAME EXPANSION &optional HOOK COUNT SYSTEM)."
(declare (indent defun))
(when (and (consp props) (or (null (car props)) (numberp (car props))))
;; Old-style calling convention.
(setq props `(:count ,(car props)
@ -1139,7 +1140,7 @@ Properties with special meaning:
- `:enable-function' can be set to a function of no argument which returns
non-nil if and only if the abbrevs in this table should be used for this
instance of `expand-abbrev'."
(declare (doc-string 3))
(declare (doc-string 3) (indent defun))
;; We used to manually add the docstring, but we also want to record this
;; location as the definition of the variable (in load-history), so we may
;; as well just use `defvar'.

View File

@ -415,6 +415,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
"Associate CONDITION with (additional) ACTION in `auto-insert-alist'.
Optional AFTER means to insert action after all existing actions for CONDITION,
or if CONDITION had no actions, after all other CONDITIONs."
(declare (indent defun))
(let ((elt (assoc condition auto-insert-alist)))
(if elt
(setcdr elt

View File

@ -130,6 +130,7 @@ In addition, the keyword argument :supertype may be used to specify a
`button-type' from which NAME inherits its default property values
(however, the inheritance happens only when NAME is defined; subsequent
changes to a supertype are not reflected in its subtypes)."
(declare (indent defun))
(let ((catsym (make-symbol (concat (symbol-name name) "-button")))
(super-catsym
(button-category-symbol

View File

@ -714,6 +714,7 @@ REQUIREMENTS is a list of dependencies on other packages.
where OTHER-VERSION is a string.
EXTRA-PROPERTIES is currently unused."
(declare (indent defun))
;; FIXME: Placeholder! Should we keep it?
(error "Don't call me!"))

View File

@ -2927,6 +2927,7 @@ Optional 3rd argument DOCSTRING is a documentation string of the property.
See also the documentation of `get-char-code-property' and
`put-char-code-property'."
(declare (indent defun))
(or (symbolp name)
(error "Not a symbol: %s" name))
(if (char-table-p table)

View File

@ -218,6 +218,7 @@ corresponding Unicode character code.
If it is a string, it is a name of file that contains the above
information. The file format is the same as what described for `:map'
attribute."
(declare (indent defun))
(when (vectorp (car props))
;; Old style code:
;; (define-charset CHARSET-ID CHARSET-SYMBOL INFO-VECTOR)
@ -890,6 +891,7 @@ non-nil.
VALUE non-nil means Emacs prefers UTF-8 on code detection for
non-ASCII files. This attribute is meaningful only when
`:coding-type' is `undecided'."
(declare (indent defun))
(let* ((common-attrs (mapcar 'list
'(:mnemonic
:coding-type
@ -2320,6 +2322,7 @@ This function sets properties `translation-table' and
`translation-table-id' of SYMBOL to the created table itself and the
identification number of the table respectively. It also registers
the table in `translation-table-vector'."
(declare (indent defun))
(let ((table (if (and (char-table-p (car args))
(eq (char-table-subtype (car args))
'translation-table))
@ -2394,6 +2397,7 @@ Value is what BODY returns."
Analogous to `define-translation-table', but updates
`translation-hash-table-vector' and the table is for use in the CCL
`lookup-integer' and `lookup-character' functions."
(declare (indent defun))
(unless (and (symbolp symbol)
(hash-table-p table))
(error "Bad args to define-translation-hash-table"))

View File

@ -1000,6 +1000,7 @@ Bindings are always added before any inherited map.
The order of bindings in a keymap matters only when it is used as
a menu, so this function is not useful for non-menu keymaps."
(declare (indent defun))
(unless after (setq after t))
(or (keymapp keymap)
(signal 'wrong-type-argument (list 'keymapp keymap)))
@ -5572,6 +5573,7 @@ If HOOKVAR is nil, `mail-send-hook' is used.
The properties used on SYMBOL are `composefunc', `sendfunc',
`abortfunc', and `hookvar'."
(declare (indent defun))
(put symbol 'composefunc composefunc)
(put symbol 'sendfunc sendfunc)
(put symbol 'abortfunc (or abortfunc #'kill-buffer))
@ -6491,6 +6493,7 @@ also be the special symbol `:menu', in which case DEFINITION
should be a MENU form as accepted by `easy-menu-define'.
\(fn &key FULL PARENT SUPPRESS NAME PREFIX KEYMAP &rest [KEY DEFINITION]...)"
(declare (indent defun))
(define-keymap--define definitions))
(defun define-keymap--define (definitions)

View File

@ -83,7 +83,7 @@ create identical widgets:
* (apply #\\='widget-create CLASS ARGS)
The third argument DOC is a documentation string for the widget."
(declare (doc-string 3))
(declare (doc-string 3) (indent defun))
;;
(unless (or (null doc) (stringp doc))
(error "Widget documentation must be nil or a string"))