comparison lisp/emacs-lisp/bytecomp.el @ 83224:7a0245dd1848

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-653 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-654 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656 Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-662 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-663 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-664 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-665 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-666 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-670 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-671 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-64 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-65 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-66 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-67 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-264
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 06 Nov 2004 17:52:02 +0000
parents 0fc4928cc48e f57a9010e865
children 3ec251523b3e
comparison
equal deleted inserted replaced
83223:4056279af756 83224:7a0245dd1848
96 ;; a macro to a lambda or vice versa, 96 ;; a macro to a lambda or vice versa,
97 ;; or redefined to take other args) 97 ;; or redefined to take other args)
98 ;; `obsolete' (obsolete variables and functions) 98 ;; `obsolete' (obsolete variables and functions)
99 ;; `noruntime' (calls to functions only defined 99 ;; `noruntime' (calls to functions only defined
100 ;; within `eval-when-compile') 100 ;; within `eval-when-compile')
101 ;; `cl-warnings' (calls to CL functions)
102 ;; `interactive-only' (calls to commands that are
103 ;; not good to call from Lisp)
101 ;; byte-compile-compatibility Whether the compiler should 104 ;; byte-compile-compatibility Whether the compiler should
102 ;; generate .elc files which can be loaded into 105 ;; generate .elc files which can be loaded into
103 ;; generic emacs 18. 106 ;; generic emacs 18.
104 ;; emacs-lisp-file-regexp Regexp for the extension of source-files; 107 ;; emacs-lisp-file-regexp Regexp for the extension of source-files;
105 ;; see also the function byte-compile-dest-file. 108 ;; see also the function byte-compile-dest-file.
323 "*If true, the byte-compiler reports warnings with `error'." 326 "*If true, the byte-compiler reports warnings with `error'."
324 :group 'bytecomp 327 :group 'bytecomp
325 :type 'boolean) 328 :type 'boolean)
326 329
327 (defconst byte-compile-warning-types 330 (defconst byte-compile-warning-types
328 '(redefine callargs free-vars unresolved obsolete noruntime cl-functions) 331 '(redefine callargs free-vars unresolved
332 obsolete noruntime cl-functions interactive-only)
329 "The list of warning types used when `byte-compile-warnings' is t.") 333 "The list of warning types used when `byte-compile-warnings' is t.")
330 (defcustom byte-compile-warnings t 334 (defcustom byte-compile-warnings t
331 "*List of warnings that the byte-compiler should issue (t for all). 335 "*List of warnings that the byte-compiler should issue (t for all).
332 336
333 Elements of the list may be be: 337 Elements of the list may be be:
339 versa, or redefined to take a different number of arguments. 343 versa, or redefined to take a different number of arguments.
340 obsolete obsolete variables and functions. 344 obsolete obsolete variables and functions.
341 noruntime functions that may not be defined at runtime (typically 345 noruntime functions that may not be defined at runtime (typically
342 defined only under `eval-when-compile'). 346 defined only under `eval-when-compile').
343 cl-functions calls to runtime functions from the CL package (as 347 cl-functions calls to runtime functions from the CL package (as
344 distinguished from macros and aliases)." 348 distinguished from macros and aliases).
349 interactive-only
350 commands that normally shouldn't be called from Lisp code."
345 :group 'bytecomp 351 :group 'bytecomp
346 :type `(choice (const :tag "All" t) 352 :type `(choice (const :tag "All" t)
347 (set :menu-tag "Some" 353 (set :menu-tag "Some"
348 (const free-vars) (const unresolved) 354 (const free-vars) (const unresolved)
349 (const callargs) (const redefine) 355 (const callargs) (const redefine)
350 (const obsolete) (const noruntime) (const cl-functions)))) 356 (const obsolete) (const noruntime)
357 (const cl-functions) (const interactive-only))))
358
359 (defvar byte-compile-interactive-only-functions
360 '(beginning-of-buffer end-of-buffer replace-string replace-regexp
361 insert-file)
362 "List of commands that are not meant to be called from Lisp.")
351 363
352 (defvar byte-compile-not-obsolete-var nil 364 (defvar byte-compile-not-obsolete-var nil
353 "If non-nil, this is a variable that shouldn't be reported as obsolete.") 365 "If non-nil, this is a variable that shouldn't be reported as obsolete.")
354 366
355 (defcustom byte-compile-generate-call-tree nil 367 (defcustom byte-compile-generate-call-tree nil
2708 (let* ((fn (car form)) 2720 (let* ((fn (car form))
2709 (handler (get fn 'byte-compile))) 2721 (handler (get fn 'byte-compile)))
2710 (byte-compile-set-symbol-position fn) 2722 (byte-compile-set-symbol-position fn)
2711 (when (byte-compile-const-symbol-p fn) 2723 (when (byte-compile-const-symbol-p fn)
2712 (byte-compile-warn "`%s' called as a function" fn)) 2724 (byte-compile-warn "`%s' called as a function" fn))
2725 (and (memq 'interactive-only byte-compile-warnings)
2726 (memq (car form) byte-compile-interactive-only-functions)
2727 (byte-compile-warn "`%s' used from Lisp code\n\
2728 That command is designed for interactive use only" fn))
2713 (if (and handler 2729 (if (and handler
2714 (or (not (byte-compile-version-cond 2730 (or (not (byte-compile-version-cond
2715 byte-compile-compatibility)) 2731 byte-compile-compatibility))
2716 (not (get (get fn 'byte-opcode) 'emacs19-opcode)))) 2732 (not (get (get fn 'byte-opcode) 'emacs19-opcode))))
2717 (funcall handler form) 2733 (funcall handler form)