comparison lisp/emacs-lisp/bytecomp.el @ 99747:51f96d4c63b0

* emacs-lisp/bytecomp.el (byte-compile-dynamic-docstrings) (byte-compile-output-docform): Reflow docstrings. (no-byte-compile): Fix typo in docstring. (byte-recompile-directory, compile-defun): Doc fixes. (emacs-lisp-file-regexp, byte-compile-verbose) (byte-compile-compatibility, byte-optimize, byte-compile-delete-errors) (byte-compile-dynamic-docstrings, byte-optimize-log) (byte-compile-error-on-warn, byte-compile-warnings) (byte-compile-generate-call-tree, byte-compile-call-tree-sort): Remove * from defcustom docstrings.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 20 Nov 2008 12:13:49 +0000
parents d0522fd272de
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
99746:07389f46a9e0 99747:51f96d4c63b0
196 (defgroup bytecomp nil 196 (defgroup bytecomp nil
197 "Emacs Lisp byte-compiler." 197 "Emacs Lisp byte-compiler."
198 :group 'lisp) 198 :group 'lisp)
199 199
200 (defcustom emacs-lisp-file-regexp "\\.el$" 200 (defcustom emacs-lisp-file-regexp "\\.el$"
201 "*Regexp which matches Emacs Lisp source files. 201 "Regexp which matches Emacs Lisp source files.
202 You may want to redefine the function `byte-compile-dest-file' 202 You may want to redefine the function `byte-compile-dest-file'
203 if you change this variable." 203 if you change this variable."
204 :group 'bytecomp 204 :group 'bytecomp
205 :type 'regexp) 205 :type 'regexp)
206 206
242 ;; thing to do. 242 ;; thing to do.
243 (autoload 'byte-decompile-bytecode "byte-opt") 243 (autoload 'byte-decompile-bytecode "byte-opt")
244 244
245 (defcustom byte-compile-verbose 245 (defcustom byte-compile-verbose
246 (and (not noninteractive) (> baud-rate search-slow-speed)) 246 (and (not noninteractive) (> baud-rate search-slow-speed))
247 "*Non-nil means print messages describing progress of byte-compiler." 247 "Non-nil means print messages describing progress of byte-compiler."
248 :group 'bytecomp 248 :group 'bytecomp
249 :type 'boolean) 249 :type 'boolean)
250 250
251 (defcustom byte-compile-compatibility nil 251 (defcustom byte-compile-compatibility nil
252 "*Non-nil means generate output that can run in Emacs 18. 252 "Non-nil means generate output that can run in Emacs 18.
253 This only means that it can run in principle, if it doesn't require 253 This only means that it can run in principle, if it doesn't require
254 facilities that have been added more recently." 254 facilities that have been added more recently."
255 :group 'bytecomp 255 :group 'bytecomp
256 :type 'boolean) 256 :type 'boolean)
257 257
261 ;; "*If this is true, then the byte-compiler will generate bytecode which 261 ;; "*If this is true, then the byte-compiler will generate bytecode which
262 ;; makes use of byte-ops which are present only in Emacs 19. Code generated 262 ;; makes use of byte-ops which are present only in Emacs 19. Code generated
263 ;; this way can never be run in Emacs 18, and may even cause it to crash.") 263 ;; this way can never be run in Emacs 18, and may even cause it to crash.")
264 264
265 (defcustom byte-optimize t 265 (defcustom byte-optimize t
266 "*Enable optimization in the byte compiler. 266 "Enable optimization in the byte compiler.
267 Possible values are: 267 Possible values are:
268 nil - no optimization 268 nil - no optimization
269 t - all optimizations 269 t - all optimizations
270 `source' - source-level optimizations only 270 `source' - source-level optimizations only
271 `byte' - code-level optimizations only" 271 `byte' - code-level optimizations only"
274 (const :tag "all" t) 274 (const :tag "all" t)
275 (const :tag "source-level" source) 275 (const :tag "source-level" source)
276 (const :tag "byte-level" byte))) 276 (const :tag "byte-level" byte)))
277 277
278 (defcustom byte-compile-delete-errors nil 278 (defcustom byte-compile-delete-errors nil
279 "*If non-nil, the optimizer may delete forms that may signal an error. 279 "If non-nil, the optimizer may delete forms that may signal an error.
280 This includes variable references and calls to functions such as `car'." 280 This includes variable references and calls to functions such as `car'."
281 :group 'bytecomp 281 :group 'bytecomp
282 :type 'boolean) 282 :type 'boolean)
283 283
284 (defvar byte-compile-dynamic nil 284 (defvar byte-compile-dynamic nil
298 (defvar byte-compile-disable-print-circle nil 298 (defvar byte-compile-disable-print-circle nil
299 "If non-nil, disable `print-circle' on printing a byte-compiled code.") 299 "If non-nil, disable `print-circle' on printing a byte-compiled code.")
300 ;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) 300 ;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
301 301
302 (defcustom byte-compile-dynamic-docstrings t 302 (defcustom byte-compile-dynamic-docstrings t
303 "*If non-nil, compile doc strings for lazy access. 303 "If non-nil, compile doc strings for lazy access.
304 We bury the doc strings of functions and variables 304 We bury the doc strings of functions and variables inside comments in
305 inside comments in the file, and bring them into core only when they 305 the file, and bring them into core only when they are actually needed.
306 are actually needed.
307 306
308 When this option is true, if you load the compiled file and then move it, 307 When this option is true, if you load the compiled file and then move it,
309 you won't be able to find the documentation of anything in that file. 308 you won't be able to find the documentation of anything in that file.
310 309
311 To disable this option for a certain file, make it a file-local variable 310 To disable this option for a certain file, make it a file-local variable
317 :group 'bytecomp 316 :group 'bytecomp
318 :type 'boolean) 317 :type 'boolean)
319 ;;;###autoload(put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp) 318 ;;;###autoload(put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
320 319
321 (defcustom byte-optimize-log nil 320 (defcustom byte-optimize-log nil
322 "*If true, the byte-compiler will log its optimizations into *Compile-Log*. 321 "If true, the byte-compiler will log its optimizations into *Compile-Log*.
323 If this is 'source, then only source-level optimizations will be logged. 322 If this is 'source, then only source-level optimizations will be logged.
324 If it is 'byte, then only byte-level optimizations will be logged." 323 If it is 'byte, then only byte-level optimizations will be logged."
325 :group 'bytecomp 324 :group 'bytecomp
326 :type '(choice (const :tag "none" nil) 325 :type '(choice (const :tag "none" nil)
327 (const :tag "all" t) 326 (const :tag "all" t)
328 (const :tag "source-level" source) 327 (const :tag "source-level" source)
329 (const :tag "byte-level" byte))) 328 (const :tag "byte-level" byte)))
330 329
331 (defcustom byte-compile-error-on-warn nil 330 (defcustom byte-compile-error-on-warn nil
332 "*If true, the byte-compiler reports warnings with `error'." 331 "If true, the byte-compiler reports warnings with `error'."
333 :group 'bytecomp 332 :group 'bytecomp
334 :type 'boolean) 333 :type 'boolean)
335 334
336 (defconst byte-compile-warning-types 335 (defconst byte-compile-warning-types
337 '(redefine callargs free-vars unresolved 336 '(redefine callargs free-vars unresolved
338 obsolete noruntime cl-functions interactive-only 337 obsolete noruntime cl-functions interactive-only
339 make-local mapcar) 338 make-local mapcar)
340 "The list of warning types used when `byte-compile-warnings' is t.") 339 "The list of warning types used when `byte-compile-warnings' is t.")
341 (defcustom byte-compile-warnings t 340 (defcustom byte-compile-warnings t
342 "*List of warnings that the byte-compiler should issue (t for all). 341 "List of warnings that the byte-compiler should issue (t for all).
343 342
344 Elements of the list may be: 343 Elements of the list may be:
345 344
346 free-vars references to variables not in the current lexical scope. 345 free-vars references to variables not in the current lexical scope.
347 unresolved calls to unknown functions. 346 unresolved calls to unknown functions.
431 430
432 (defvar byte-compile-not-obsolete-var nil 431 (defvar byte-compile-not-obsolete-var nil
433 "If non-nil, this is a variable that shouldn't be reported as obsolete.") 432 "If non-nil, this is a variable that shouldn't be reported as obsolete.")
434 433
435 (defcustom byte-compile-generate-call-tree nil 434 (defcustom byte-compile-generate-call-tree nil
436 "*Non-nil means collect call-graph information when compiling. 435 "Non-nil means collect call-graph information when compiling.
437 This records which functions were called and from where. 436 This records which functions were called and from where.
438 If the value is t, compilation displays the call graph when it finishes. 437 If the value is t, compilation displays the call graph when it finishes.
439 If the value is neither t nor nil, compilation asks you whether to display 438 If the value is neither t nor nil, compilation asks you whether to display
440 the graph. 439 the graph.
441 440
448 invoked interactively are excluded from this list." 447 invoked interactively are excluded from this list."
449 :group 'bytecomp 448 :group 'bytecomp
450 :type '(choice (const :tag "Yes" t) (const :tag "No" nil) 449 :type '(choice (const :tag "Yes" t) (const :tag "No" nil)
451 (other :tag "Ask" lambda))) 450 (other :tag "Ask" lambda)))
452 451
453 (defvar byte-compile-call-tree nil "Alist of functions and their call tree. 452 (defvar byte-compile-call-tree nil
453 "Alist of functions and their call tree.
454 Each element looks like 454 Each element looks like
455 455
456 \(FUNCTION CALLERS CALLS\) 456 \(FUNCTION CALLERS CALLS\)
457 457
458 where CALLERS is a list of functions that call FUNCTION, and CALLS 458 where CALLERS is a list of functions that call FUNCTION, and CALLS
459 is a list of functions for which calls were generated while compiling 459 is a list of functions for which calls were generated while compiling
460 FUNCTION.") 460 FUNCTION.")
461 461
462 (defcustom byte-compile-call-tree-sort 'name 462 (defcustom byte-compile-call-tree-sort 'name
463 "*If non-nil, sort the call tree. 463 "If non-nil, sort the call tree.
464 The values `name', `callers', `calls', `calls+callers' 464 The values `name', `callers', `calls', `calls+callers'
465 specify different fields to sort on." 465 specify different fields to sort on."
466 :group 'bytecomp 466 :group 'bytecomp
467 :type '(choice (const name) (const callers) (const calls) 467 :type '(choice (const name) (const callers) (const calls)
468 (const calls+callers) (const nil))) 468 (const calls+callers) (const nil)))
1584 ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00134.html 1584 ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00134.html
1585 ;;;###autoload 1585 ;;;###autoload
1586 (defun byte-recompile-directory (bytecomp-directory &optional bytecomp-arg 1586 (defun byte-recompile-directory (bytecomp-directory &optional bytecomp-arg
1587 bytecomp-force) 1587 bytecomp-force)
1588 "Recompile every `.el' file in BYTECOMP-DIRECTORY that needs recompilation. 1588 "Recompile every `.el' file in BYTECOMP-DIRECTORY that needs recompilation.
1589 This is if a `.elc' file exists but is older than the `.el' file. 1589 This happens when a `.elc' file exists but is older than the `.el' file.
1590 Files in subdirectories of BYTECOMP-DIRECTORY are processed also. 1590 Files in subdirectories of BYTECOMP-DIRECTORY are processed also.
1591 1591
1592 If the `.elc' file does not exist, normally this function *does not* 1592 If the `.elc' file does not exist, normally this function *does not*
1593 compile the corresponding `.el' file. However, if the prefix argument 1593 compile the corresponding `.el' file. However, if the prefix argument
1594 BYTECOMP-ARG is 0, that means do compile all those files. A nonzero 1594 BYTECOMP-ARG is 0, that means do compile all those files. A nonzero
1675 (if (> skip-count 0) (format ", %d skipped" skip-count) "") 1675 (if (> skip-count 0) (format ", %d skipped" skip-count) "")
1676 (if (> dir-count 1) 1676 (if (> dir-count 1)
1677 (format " in %d directories" dir-count) ""))))) 1677 (format " in %d directories" dir-count) "")))))
1678 1678
1679 (defvar no-byte-compile nil 1679 (defvar no-byte-compile nil
1680 "Non-nil to prevent byte-compiling of emacs-lisp code. 1680 "Non-nil to prevent byte-compiling of Emacs Lisp code.
1681 This is normally set in local file variables at the end of the elisp file: 1681 This is normally set in local file variables at the end of the elisp file:
1682 1682
1683 ;; Local Variables:\n;; no-byte-compile: t\n;; End: ") 1683 ;; Local Variables:\n;; no-byte-compile: t\n;; End: ")
1684 ;;;###autoload(put 'no-byte-compile 'safe-local-variable 'booleanp) 1684 ;;;###autoload(put 'no-byte-compile 'safe-local-variable 'booleanp)
1685 1685
1840 ;;; compiling a single function 1840 ;;; compiling a single function
1841 ;;;###autoload 1841 ;;;###autoload
1842 (defun compile-defun (&optional arg) 1842 (defun compile-defun (&optional arg)
1843 "Compile and evaluate the current top-level form. 1843 "Compile and evaluate the current top-level form.
1844 Print the result in the echo area. 1844 Print the result in the echo area.
1845 With argument, insert value in current buffer after the form." 1845 With argument ARG, insert value in current buffer after the form."
1846 (interactive "P") 1846 (interactive "P")
1847 (save-excursion 1847 (save-excursion
1848 (end-of-defun) 1848 (end-of-defun)
1849 (beginning-of-defun) 1849 (beginning-of-defun)
1850 (let* ((byte-compile-current-file nil) 1850 (let* ((byte-compile-current-file nil)
2094 "Print a form with a doc string. INFO is (prefix doc-index postfix). 2094 "Print a form with a doc string. INFO is (prefix doc-index postfix).
2095 If PREFACE and NAME are non-nil, print them too, 2095 If PREFACE and NAME are non-nil, print them too,
2096 before INFO and the FORM but after the doc string itself. 2096 before INFO and the FORM but after the doc string itself.
2097 If SPECINDEX is non-nil, it is the index in FORM 2097 If SPECINDEX is non-nil, it is the index in FORM
2098 of the function bytecode string. In that case, 2098 of the function bytecode string. In that case,
2099 we output that argument and the following argument (the constants vector) 2099 we output that argument and the following argument
2100 together, for lazy loading. 2100 \(the constants vector) together, for lazy loading.
2101 QUOTED says that we have to put a quote before the 2101 QUOTED says that we have to put a quote before the
2102 list that represents a doc string reference. 2102 list that represents a doc string reference.
2103 `autoload' and `custom-declare-variable' need that." 2103 `autoload' and `custom-declare-variable' need that."
2104 ;; We need to examine byte-compile-dynamic-docstrings 2104 ;; We need to examine byte-compile-dynamic-docstrings
2105 ;; in the input buffer (now current), not in the output buffer. 2105 ;; in the input buffer (now current), not in the output buffer.
3314 (cond 3314 (cond
3315 ((= 1 len) (byte-compile-constant 0)) 3315 ((= 1 len) (byte-compile-constant 0))
3316 ((= 2 len) 3316 ((= 2 len)
3317 (byte-compile-form (cadr form)) 3317 (byte-compile-form (cadr form))
3318 (byte-compile-out 'byte-negate 0)) 3318 (byte-compile-out 'byte-negate 0))
3319 ((= 3 len) 3319 ((= 3 len)
3320 (byte-compile-form (nth 1 form)) 3320 (byte-compile-form (nth 1 form))
3321 (byte-compile-form (nth 2 form)) 3321 (byte-compile-form (nth 2 form))
3322 (byte-compile-out 'byte-diff 0)) 3322 (byte-compile-out 'byte-diff 0))
3323 ;; Don't use binary operations for > 2 operands, as that may 3323 ;; Don't use binary operations for > 2 operands, as that may
3324 ;; cause overflow/truncation in float operations. 3324 ;; cause overflow/truncation in float operations.