annotate lisp/byte-run.el @ 31383:860d7ac182e3

(vc-rcs-show-log-entry): New function. (vc-rcs-checkin, vc-rcs-checkout): Don't set all properties. (vc-rcs-register): If there is no RCS subdir, ask the user whether to create one. (vc-rcs-state-heuristic): Use file-ownership-preserved-p. (vc-rcs-checkout): Remove the error-handling for missing-rcs. (vc-rcs-state-heuristic): Don't use file-writable-p. (vc-rcs-print-log): Insert in the current buffer. (vc-rcs-diff): Insert in the current buffer and remove unused arg CMP. (vc-rcs-workfile-unchanged-p): Use vc-do-command instead of vc-simple-command. (vc-rcs-fetch-master-state): Removed check for unlocked-changes to avoid doing a diff when opening a file. (vc-rcs-state): Added check for unlocked-changes. (vc-rcs-header): Escape Id. (vc-rcs-workfile-unchanged-p): Remove optional arg VERSION. (vc-rcs-state): Call vc-workfile-unchanged-p, not the RCS-specific version. (vc-rcs-state-heuristic): Use file-writable-p instead of comparing userids. (vc-rcs-fetch-master-state): Handle the case where rcs is missing. Simplify the logic by eliminating unreachable code. (vc-rcs-diff): Only pass `2' to vc-do-command if necessary and just do a recursive call if we need to retry. (vc-rcs-checkout): Handle the case where rcs is missing by making the buffer read-write if requested and re-signalling the error. (vc-rcs-find-most-recent-rev): New function. The code derives from the old vc-parse-buffer but uses the revision number rather than the date (much easier to compare robustly). (vc-rcs-fetch-master-state): Use `with-temp-buffer'. Adapt to the new vc-parse-buffer (and vc-rcs-find-most-recent-rev). Find the locking-user more directly. Check strict locking and set checkout-model appropriately. (vc-rcs-parse-locks): Remove. (vc-rcs-latest-on-branch-p): Use with-temp-buffer and adapt to the new vc-parse-buffer (and vc-rcs-find-most-recent-rev). (vc-rcs-system-release): Use with-current-buffer and vc-parse-buffer. (vc-rcs-register, vc-rcs-checkout): Use with-current-buffer. Merge in code from vc-rcs-hooks.el. Don't require 'vc anymore. (vc-rcs-responsible-p): Use expand-file-name instead of concat and file-directory-p instead of file-exists-p. (vc-rcs-exists): Remove. (vc-rcs-header): New var. Update Copyright. (vc-rcs-rename-file): New function. (vc-rcs-diff): Remove unused `backend' variable. (vc-rcs-clear-headers): New function; code moved here from vc-clear-headers in vc.el. (tail): Provide vc-rcs and remove vc-rcs-logentry-check. (vc-rcs-register): Parse command output to find master file name and workfile version. (vc-rcs-checkout): Removed call to vc-file-clear-masterprops. Require vc and vc-rcs-hooks. (vc-rcs-trunk-p, vc-rcs-branch-part): Move to vc-rcs-hooks. (vc-rcs-backend-release-p): Remove (use vc-rcs-release-p). (vc-release-greater-or-equal-p): Move from vc. (vc-rcs-trunk-p, vc-rcs-branch-p, vc-rcs-branch-part, vc-rcs-minor-part, vc-rcs-previous-version): Remove duplicates. (vc-rcs-checkout): Add a missing `new-version' argument in the call to vc-rcs-latest-on-branch-p. Hopefully that was the right one. (vc-rcs-steal-lock): Renamed from `vc-rcs-steal'. Updated everything to use `vc-checkout-model'. (vc-rcs-backend-release-p): function added. other stuff updated to reference this function instead of the old `vc-backend-release-p'. (vc-rcs-logentry-check): Function added. (vc-rcs-checkin, vc-rcs-previous-version) (vc-rcs-checkout): Name space cleaned up. No more revision number crunching function names that are not prefixed with vc-rcs. (vc-rcs-checkout-model): Function added. References to `vc-checkout-model' replaced. (vc-rcs-admin): Added the query-only option as required by the vc.el file. (vc-rcs-exists): Function added. (vc-*-checkout): Use with-temp-file instead of /bin/sh. Merged from mainline (vc-rcs-latest-on-branch-p): Moved to vc-rcs-hooks.el. (vc-rcs-latest-on-branch-p, vc-rcs-trunk-p) (vc-rcs-branch-p, vc-rcs-branch-part, vc-rcs-minor-part) (vc-rcs-previous-version): Functions added. (vc-rcs-diff): Function added. (vc-rcs-checkout) Bug (typo) found and fixed. (vc-rcs-register-switches) Variable `vc-rcs-register-switches' added. Require vc when compiling. (vc-rcs-print-log, vc-rcs-assign-name, vc-rcs-merge) (vc-rcs-check-headers, vc-rcs-steal, vc-rcs-uncheck, vc-rcs-revert) (vc-rcs-checkin): New functions (code from vc.el). (vc-rcs-previous-version, vc-rcs-system-release, vc-rcs-checkout): Doc fix. (vc-rcs-release): Deleted. (Duplicated vc-rcs-system-release). (vc-rcs-trunk-p, vc-rcs-branch-p, vc-rcs-branch-part) (vc-rcs-minor-part, vc-rcs-previous-version, vc-rcs-release) (vc-rcs-release-p, vc-rcs-admin, vc-rcs-checkout): New functions from vc.el. (vc-rcs-system-release): Renamed from vc-rcs-backend-release.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 04 Sep 2000 19:47:43 +0000
parents fa490904bee0
children 37645a051842
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2229
bd3c525fa6fc Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 957
diff changeset
1 ;;; byte-run.el --- byte-compiler support for inlining
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2
846
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
3 ;; Copyright (C) 1992 Free Software Foundation, Inc.
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
4
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
5 ;; Author: Jamie Zawinski <jwz@lucid.com>
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
6 ;; Hallvard Furuseth <hbf@ulrik.uio.no>
21045
cc3f3c1ea725 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
7 ;; Maintainer: FSF
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
8 ;; Keywords: internal
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; any later version.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; GNU General Public License for more details.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 2229
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 2229
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 2229
diff changeset
25 ;; Boston, MA 02111-1307, USA.
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
27 ;;; Commentary:
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 2229
diff changeset
29 ;; interface to selectively inlining functions.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 2229
diff changeset
30 ;; This only happens when source-code optimization is turned on.
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
32 ;;; Code:
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
33
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 ;; Redefined in byte-optimize.el.
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
35 ;; This is not documented--it's not clear that we should promote it.
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (fset 'inline 'progn)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 (put 'inline 'lisp-indent-hook 0)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 ;;; Interface to inline functions.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
42 ;; (defmacro proclaim-inline (&rest fns)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
43 ;; "Cause the named functions to be open-coded when called from compiled code.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
44 ;; They will only be compiled open-coded when byte-compile-optimize is true."
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
45 ;; (cons 'eval-and-compile
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
46 ;; (mapcar '(lambda (x)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
47 ;; (or (memq (get x 'byte-optimizer)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
48 ;; '(nil byte-compile-inline-expand))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
49 ;; (error
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
50 ;; "%s already has a byte-optimizer, can't make it inline"
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
51 ;; x))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
52 ;; (list 'put (list 'quote x)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
53 ;; ''byte-optimizer ''byte-compile-inline-expand))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
54 ;; fns)))
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
56 ;; (defmacro proclaim-notinline (&rest fns)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
57 ;; "Cause the named functions to no longer be open-coded."
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
58 ;; (cons 'eval-and-compile
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
59 ;; (mapcar '(lambda (x)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
60 ;; (if (eq (get x 'byte-optimizer) 'byte-compile-inline-expand)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
61 ;; (put x 'byte-optimizer nil))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
62 ;; (list 'if (list 'eq (list 'get (list 'quote x) ''byte-optimizer)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
63 ;; ''byte-compile-inline-expand)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
64 ;; (list 'put x ''byte-optimizer nil)))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
65 ;; fns)))
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 ;; This has a special byte-hunk-handler in bytecomp.el.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (defmacro defsubst (name arglist &rest body)
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
69 "Define an inline function. The syntax is just like that of `defun'."
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
70 (or (memq (get name 'byte-optimizer)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
71 '(nil byte-compile-inline-expand))
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
72 (error "`%s' is a primitive" name))
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 (list 'prog1
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 (cons 'defun (cons name (cons arglist body)))
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
75 (list 'eval-and-compile
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
76 (list 'put (list 'quote name)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
77 ''byte-optimizer ''byte-compile-inline-expand))))
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
79 (defun make-obsolete (fn new &optional when)
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
80 "Make the byte-compiler warn that FUNCTION is obsolete.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
81 The warning will say that NEW should be used instead.
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
82 If NEW is a string, that is the `use instead' message.
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
83 If provided, WHEN should be a string indicating when the function
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
84 was first made obsolete, for example a date or a release number."
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 (interactive "aMake function obsolete: \nxObsoletion replacement: ")
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 (let ((handler (get fn 'byte-compile)))
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 (if (eq 'byte-compile-obsolete handler)
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
88 (setq handler (nth 1 (get fn 'byte-obsolete-info)))
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
89 (put fn 'byte-compile 'byte-compile-obsolete))
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
90 (put fn 'byte-obsolete-info (list new handler when)))
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 fn)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
93 (defun make-obsolete-variable (var new &optional when)
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
94 "Make the byte-compiler warn that VARIABLE is obsolete,
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
95 and NEW should be used instead. If NEW is a string, then that is the
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
96 `use instead' message.
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
97 If provided, WHEN should be a string indicating when the variable
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
98 was first made obsolete, for example a date or a release number."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
99 (interactive
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
100 (list
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
101 (let ((str (completing-read "Make variable obsolete: " obarray 'boundp t)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
102 (if (equal str "") (error ""))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
103 (intern str))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
104 (car (read-from-string (read-string "Obsoletion replacement: ")))))
29352
fa490904bee0 * byte-run.el (make-obsolete, make-obsolete-variable):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 21045
diff changeset
105 (put var 'byte-obsolete-variable (cons new when))
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
106 var)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
107
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 (put 'dont-compile 'lisp-indent-hook 0)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 (defmacro dont-compile (&rest body)
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
110 "Like `progn', but the body always runs interpreted (not compiled).
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 846
diff changeset
111 If you think you need this, you're probably making a mistake somewhere."
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 ;;; interface to evaluating things at compile time and/or load time
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 ;;; these macro must come after any uses of them in this file, as their
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 ;;; definition in the file overrides the magic definitions on the
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 ;;; byte-compile-macro-environment.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 (put 'eval-when-compile 'lisp-indent-hook 0)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 (defmacro eval-when-compile (&rest body)
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
122 "Like `progn', but evaluates the body at compile time.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
123 The result of the body appears to the compiler as a quoted constant."
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 ;; Not necessary because we have it in b-c-initial-macro-environment
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 ;; (list 'quote (eval (cons 'progn body)))
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 (cons 'progn body))
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 (put 'eval-and-compile 'lisp-indent-hook 0)
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 (defmacro eval-and-compile (&rest body)
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
130 "Like `progn', but evaluates the body at compile time and at load time."
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 ;; Remember, it's magic.
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (cons 'progn body))
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
135 ;;; I nuked this because it's not a good idea for users to think of using it.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
136 ;;; These options are a matter of installation preference, and have nothing to
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
137 ;;; with particular source files; it's a mistake to suggest to users
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
138 ;;; they should associate these with particular source files.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
139 ;;; There is hardly any reason to change these parameters, anyway.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
140 ;;; --rms.
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
142 ;; (put 'byte-compiler-options 'lisp-indent-hook 0)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
143 ;; (defmacro byte-compiler-options (&rest args)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
144 ;; "Set some compilation-parameters for this file. This will affect only the
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
145 ;; file in which it appears; this does nothing when evaluated, and when loaded
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
146 ;; from a .el file.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
147 ;;
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
148 ;; Each argument to this macro must be a list of a key and a value.
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
149 ;;
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
150 ;; Keys: Values: Corresponding variable:
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
151 ;;
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
152 ;; verbose t, nil byte-compile-verbose
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
153 ;; optimize t, nil, source, byte byte-compile-optimize
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
154 ;; warnings list of warnings byte-compile-warnings
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
155 ;; Legal elements: (callargs redefine free-vars unresolved)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
156 ;; file-format emacs18, emacs19 byte-compile-compatibility
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
157 ;;
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
158 ;; For example, this might appear at the top of a source file:
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
159 ;;
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
160 ;; (byte-compiler-options
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
161 ;; (optimize t)
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
162 ;; (warnings (- free-vars)) ; Don't warn about free variables
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
163 ;; (file-format emacs19))"
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
164 ;; nil)
757
745b7fc3a3d3 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 757
diff changeset
166 ;;; byte-run.el ends here