view lisp/progmodes/cc-bytecomp.el @ 99501:e3acb52d33e1

2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-yank): Make any prefix force normal yanking. Suppress folding if text would be swallowed into a folded subtree. (org-yank-folded-subtrees, org-yank): Docstring updates. * org-agenda.el (org-agenda-compare-effort): Treat no effort defined as 0. * org-exp.el (org-export-language-setup): Add Catalan and Esperanto language entries. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-refile): Allow refiling of entire regions. * org-clock.el (org-clock-time%): New function. * org.el (org-entry-get, org-entry-delete): Use safer regexps to retrieve property values. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-list): Handle the value `only' of org-agenda-show-log'. (org-agenda-log-mode): Interpret a double prefix arg. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-html-footnotes-section): New variable. (org-export-as-html): Use `org-export-html-footnotes-section' to insert the footnotes. (org-export-language-setup): Add "Footnotes" to language words. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-yank): Fix bug when not inserting a subtree. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org-vm.el (org-vm-follow-link): Call `vm-preview-current-message' instead of `vm-beginning-of-message'. * org.el (org-make-link-regexps): Make sure that links to gnus can contain brackets. 2008-11-12 Carsten Dominik <carsten.dominik@gmail.com> * org-attach.el (org-attach-dir): Remove duplicate ID creation code. * org-id.el (org-id-new): Use `org-trim' to extract the uuid from shell output. * org.el (org-link-abbrev-alist): Improve customization type. * org-attach.el (org-attach-expand-link, org-attach-expand): New functions. * org-agenda.el (org-agenda-get-progress): Renamed from `org-get-closed'. Implement searching for state changes as well. (org-agenda-log-mode-items): New option. (org-agenda-log-mode): New option prefix argument, interpreted as request to show all possible progress info. (org-agenda-get-day-entries): Call `org-get-progress' instead of `org-get-closed'. (org-agenda-set-mode-name): Handle the more complex log mode settings. (org-get-closed): New alias, pointing to `org-get-progress'. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-file-apps-defaults-gnu) (org-file-apps-defaults-macosx) (org-file-apps-defaults-windowsnt): Add an entry defining the system command. (org-file-apps): Allow `system' as key and value. (org-open-at-point): Explain the effect of a double prefix arg. (org-open-file): If the argument `in-emacs' is (16), i.e. corresponding to a double prefix argument, try to open the file externally. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-insert-link): Abbreviate absolute files names in links. Also, fix a bug in which the double C-u prefix would not be honored. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-insert-heading): If buffer does not end with a newline, add one if necessary to insert headline correctly. * org-exp.el (org-export-as-html): Make sure that <hr/> is between paragraphs, not inside. * org.el (org-todo): Quote `org-agenda-headline-snapshot-before-repeat'. * org-exp.el (org-export-as-html): Fully process link descriptions. (org-export-html-format-desc): New function. (org-export-as-html): Collect footnotes into the correct basket. (org-html-protect): No longer protect quotations marks here, this goes wrong. * org-agenda.el (org-agenda-remove-marked-text): Bind variable BEG. * org-compat.el (org-fit-window-to-buffer): New function (not really, a preliminary and incomplete version was present earlier, but not used). * org.el (org-fast-todo-selection, org-fast-tag-selection): Use `org-fit-window-to-buffer'. * org-exp.el (org-export): Use `org-fit-window-to-buffer'. * org-agenda.el (org-agenda-get-restriction-and-command) (org-fit-agenda-window, org-agenda-convert-date): Use `org-fit-window-to-buffer'. * org-exp.el (org-export-as-html): Process href links through `org-export-html-format-href'. (org-export-html-format-href): New function. * org-agenda.el (org-agenda-todo): Update only the current headline if this is a repeated TODO, marked done for today. (org-agenda-change-all-lines): New argument JUST-THIS, to change only the current line. * org.el (org-todo): Take a snapshot of the headline if the repeater might change it. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org-publish.el (org-publish-find-title): Remove buffers visited only for extracting the title. * org-exp.el (org-export-html-style) (org-export-html-style-default): Mark style definitions as unparsed CDATA. * org-publish.el (org-publish-validate-link): Function re-introduced. 2008-11-12 Charles Sebold <csebold@gmail.com> * org-plot.el (org-plot/add-options-to-plist): Supports timefmt property. (org-plot-quote-timestamp-field): New function. (org-plot-quote-tsv-field): Call timestamp field function when necessary rather than just quoting as a string. (org-plot/gnuplot-to-data): Pass in timefmt property. (org-plot/gnuplot-script): Supports timefmt property. (org-plot/gnuplot): Checks for timestamp column before checking for text index column. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-insert-heading): Improve behavior with hidden subtrees. * org-publish.el (org-publish-org-index): Create a section in the index file. (org-publish-org-index): Stop linking to directories. * org.el (org-emphasis-alist): Use span instead of <u> to underline text. * org-exp.el (org-export-as-html): Make sure <p> is closed before <pre> sections. 2008-11-12 Sebastian Rose <sebastian_rose@gmx.de> * org-jsinfo.el (org-infojs-template): Remove language attribute from script tag. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org-agenda.el (org-agenda-remove-marked-text): New function. (org-agenda-mark-filtered-text) (org-agenda-unmark-filtered-text): New functions. (org-write-agenda): Remove fltered text. * org.el (org-make-tags-matcher): Give access to TODO "property" without speed penalty. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-link-frame-setup): Add `org-gnus-no-new-news' as an option. (org-store-link-props): Make sure adding to the plist works correctly. * org-gnus.el (org-gnus-no-new-news): New function. (org-gnus-follow-link): Allow the article ID to be a message-id, in addition to allowing article numbers. Message IDs make much more roubust links. (org-gnus-store-link): Use message-id to create link. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-emphasize): Reverse the selection array. (org-emphasis-alist): Set <code> tags for the verbatim environment. * org-remember.el (org-remember-handler): Fix bug with prefix-related changing of the note storage target. * org-exp.el (org-print-icalendar-entries): Make the exported priorities compatible with RFC 2445. * org-clock.el (org-clock-save): Insert time stamp without dependence on time-stamp.el. 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org.el ("saveplace"): If saveplace puts point into an invisible location, make it visible. (org-make-tags-matcher): Allow inactive time stamps in time comparisons. (org-yank-adjusted-subtrees): New option. (org-yank): Incorporate adjusting trees. (org-paste-subtree): New argument FOR-YANK which will cause insertion at point without backing up over white lines, and leave point at the end of the inserted text. Also if the cursor is at the beginning of a headline, use the same level or the inserted tree. * org-publish.el (org-publish-get-base-files-1): Deal correctly with broken symlinks 2008-11-12 Carsten Dominik <dominik@science.uva.nl> * org-exp.el (org-export-select-tags, org-get-current-options): Fix typo.
author Carsten Dominik <dominik@science.uva.nl>
date Wed, 12 Nov 2008 08:01:06 +0000
parents 52b7a8c22af5
children a9dc0e7c3f2b
line wrap: on
line source

;;; cc-bytecomp.el --- compile time setup for proper compilation

;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
;;   Free Software Foundation, Inc.

;; Author:     Martin Stjernholm
;; Maintainer: bug-cc-mode@gnu.org
;; Created:    15-Jul-2000
;; Version:    See cc-mode.el
;; Keywords:   c languages oop

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This file is used to ensure that the CC Mode files are correctly
;; compiled regardless the environment (e.g. if an older CC Mode with
;; outdated macros are loaded during compilation).  It also provides
;; features to defeat the compiler warnings for selected symbols.
;;
;; There's really nothing CC Mode specific here; this functionality
;; ought to be provided by the byte compilers or some accompanying
;; library.  To use it from some package "foo.el", begin by putting
;; the following blurb at the top of the file:
;;
;;   (eval-when-compile
;;     (let ((load-path
;;            (if (and (boundp 'byte-compile-dest-file)
;;                     (stringp byte-compile-dest-file))
;;                (cons (file-name-directory byte-compile-dest-file) load-path)
;;              load-path)))
;;       (load "cc-bytecomp" nil t))
;;
;; This (unfortunately rather clumsy) form will ensure that the
;; cc-bytecomp.el in the same directory as foo.el is loaded during
;; byte compilation of the latter.
;;
;; At the end of foo.el there should normally be a "(provide 'foo)".
;; Replace it with "(cc-provide 'foo)"; that is necessary to restore
;; the environment after the byte compilation.  If you don't have a
;; `provide' at the end, you have to add the following as the very
;; last form in the file:
;;
;;   (eval-when-compile (cc-bytecomp-restore-environment))
;;
;; Now everything is set to use the various functions and macros in
;; this package.
;;
;; If your package is split into several files, you should use
;; `cc-require', `cc-require-when-compile' or `cc-load' to load them.
;; That ensures that the files in the same directory always are
;; loaded, to avoid mixup with other versions of them that might exist
;; elsewhere in the load path.
;;
;; To suppress byte compiler warnings, use the macros
;; `cc-bytecomp-defun', `cc-bytecomp-defvar',
;; `cc-bytecomp-obsolete-fun', and `cc-bytecomp-obsolete-var'.
;;
;; This file is not used at all after the package has been byte
;; compiled.  It is however necessary when running uncompiled.


;;; Code:

(defvar cc-bytecomp-unbound-variables nil)
(defvar cc-bytecomp-original-functions nil)
(defvar cc-bytecomp-original-properties nil)
(defvar cc-bytecomp-loaded-files nil)
(defvar cc-bytecomp-environment-set nil)

(defmacro cc-bytecomp-debug-msg (&rest args)
  ;;`(message ,@args)
  )

(defun cc-bytecomp-setup-environment ()
  ;; Eval'ed during compilation to setup variables, functions etc
  ;; declared with `cc-bytecomp-defvar' et al.
  (if (not load-in-progress)
      ;; Look at `load-in-progress' to tell whether we're called
      ;; directly in the file being compiled or just from some file
      ;; being loaded during compilation.
      (let (p)
	(if cc-bytecomp-environment-set
	    (error "Byte compilation environment already set - \
perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere"))
	(setq p cc-bytecomp-unbound-variables)
	(while p
	  (if (not (boundp (car p)))
	      (progn
		(eval `(defvar ,(car p)))
		(set (car p) (intern (concat "cc-bytecomp-ignore-var:"
					     (symbol-name (car p)))))
		(cc-bytecomp-debug-msg
		 "cc-bytecomp-setup-environment: Covered variable %s"
		 (car p))))
	  (setq p (cdr p)))
	(setq p cc-bytecomp-original-functions)
	(while p
	  (let ((fun (car (car p)))
		(temp-macro (car (cdr (car p)))))
	    (if (not (fboundp fun))
		(if temp-macro
		    (progn
		      (eval `(defmacro ,fun ,@temp-macro))
		      (cc-bytecomp-debug-msg
		       "cc-bytecomp-setup-environment: Bound macro %s" fun))
		  (fset fun (intern (concat "cc-bytecomp-ignore-fun:"
					    (symbol-name fun))))
		  (cc-bytecomp-debug-msg
		   "cc-bytecomp-setup-environment: Covered function %s" fun))))
	  (setq p (cdr p)))
	(setq p cc-bytecomp-original-properties)
	(while p
	  (let ((sym (car (car (car p))))
		(prop (cdr (car (car p))))
		(tempdef (car (cdr (car p)))))
	    (put sym prop tempdef)
	    (cc-bytecomp-debug-msg
	     "cc-bytecomp-setup-environment: Bound property %s for %s to %s"
	     prop sym tempdef))
	  (setq p (cdr p)))
	(setq cc-bytecomp-environment-set t)
	(cc-bytecomp-debug-msg
	 "cc-bytecomp-setup-environment: Done"))))

(defun cc-bytecomp-restore-environment ()
  ;; Eval'ed during compilation to restore variables, functions etc
  ;; declared with `cc-bytecomp-defvar' et al.
  (if (not load-in-progress)
      (let (p)
	(setq p cc-bytecomp-unbound-variables)
	(while p
	  (let ((var (car p)))
	    (if (boundp var)
		(if (eq (intern (concat "cc-bytecomp-ignore-var:"
					(symbol-name var)))
			(symbol-value var))
		    (progn
		      (makunbound var)
		      (cc-bytecomp-debug-msg
		       "cc-bytecomp-restore-environment: Unbound variable %s"
		       var))
		  (cc-bytecomp-debug-msg
		   "cc-bytecomp-restore-environment: Not restoring variable %s"
		   var))))
	  (setq p (cdr p)))
	(setq p cc-bytecomp-original-functions)
	(while p
	  (let ((fun (car (car p)))
		(temp-macro (car (cdr (car p))))
		(def (car (cdr (cdr (car p))))))
	    (if (fboundp fun)
		(if (eq (or temp-macro
			    (intern (concat "cc-bytecomp-ignore-fun:"
					    (symbol-name fun))))
			   (symbol-function fun))
		    (if (eq def 'unbound)
			(progn
			  (fmakunbound fun)
			  (cc-bytecomp-debug-msg
			   "cc-bytecomp-restore-environment: Unbound function %s"
			   fun))
		      (fset fun def)
		      (cc-bytecomp-debug-msg
		       "cc-bytecomp-restore-environment: Restored function %s"
		       fun))
		  (cc-bytecomp-debug-msg
		   "cc-bytecomp-restore-environment: Not restoring function %s"
		   fun))))
	  (setq p (cdr p)))
	(setq p cc-bytecomp-original-properties)
	(while p
	  (let ((sym (car (car (car p))))
		(prop (cdr (car (car p))))
		(tempdef (car (cdr (car p))))
		(origdef (cdr (cdr (car p)))))
	    (if (eq (get sym prop) tempdef)
		(progn
		  (put sym prop origdef)
		  (cc-bytecomp-debug-msg
		   "cc-bytecomp-restore-environment: Restored property %s for %s to %s"
		   prop sym origdef))
	      (cc-bytecomp-debug-msg
	       "cc-bytecomp-restore-environment: Not restoring property %s for %s"
	       prop sym)))
	  (setq p (cdr p)))
	(setq cc-bytecomp-environment-set nil)
	(cc-bytecomp-debug-msg
	 "cc-bytecomp-restore-environment: Done"))))

(eval
 ;; This eval is to avoid byte compilation of the function below.
 ;; There's some bug in XEmacs 21.4.6 that can cause it to dump core
 ;; here otherwise.  My theory is that `cc-bytecomp-load' might be
 ;; redefined recursively during the `load' inside it, and if it in
 ;; that case is byte compiled then the byte interpreter gets
 ;; confused.  I haven't succeeded in isolating the bug, though. /mast

 '(defun cc-bytecomp-load (cc-part)
    ;; Eval'ed during compilation to load a CC Mode file from the source
    ;; directory (assuming it's the same as the compiled file
    ;; destination dir).
    (if (and (boundp 'byte-compile-dest-file)
	     (stringp byte-compile-dest-file))
	(progn
	  (cc-bytecomp-restore-environment)
	  (let ((load-path
		 (cons (file-name-directory byte-compile-dest-file)
		       load-path))
		(cc-file (concat cc-part ".el")))
	    (if (member cc-file cc-bytecomp-loaded-files)
		()
	      (setq cc-bytecomp-loaded-files
		    (cons cc-file cc-bytecomp-loaded-files))
	      (cc-bytecomp-debug-msg
	       "cc-bytecomp-load: Loading %S" cc-file)
	      (load cc-file nil t t)
	      (cc-bytecomp-debug-msg
	       "cc-bytecomp-load: Loaded %S" cc-file)))
	  (cc-bytecomp-setup-environment)
	  t))))

(defmacro cc-require (cc-part)
  "Force loading of the corresponding .el file in the current directory
during compilation, but compile in a `require'.  Don't use within
`eval-when-compile'.

Having cyclic cc-require's will result in infinite recursion.  That's
somewhat intentional."
  `(progn
     (eval-when-compile (cc-bytecomp-load (symbol-name ,cc-part)))
     (require ,cc-part)))

(defmacro cc-provide (feature)
  "A replacement for the `provide' form that restores the environment
after the compilation.  Don't use within `eval-when-compile'."
  `(progn
     (eval-when-compile (cc-bytecomp-restore-environment))
     (provide ,feature)))

(defmacro cc-load (cc-part)
  "Force loading of the corresponding .el file in the current directory
during compilation.  Don't use outside `eval-when-compile' or
`eval-and-compile'.

Having cyclic cc-load's will result in infinite recursion.  That's
somewhat intentional."
  `(or (and (featurep 'cc-bytecomp)
	    (cc-bytecomp-load ,cc-part))
       (load ,cc-part nil t nil)))

(defmacro cc-require-when-compile (cc-part)
  "Force loading of the corresponding .el file in the current directory
during compilation, but do a compile time `require' otherwise.  Don't
use within `eval-when-compile'."
  `(eval-when-compile
     (if (and (featurep 'cc-bytecomp)
	      (cc-bytecomp-is-compiling))
	 (if (or (not load-in-progress)
		 (not (featurep ,cc-part)))
	     (cc-bytecomp-load (symbol-name ,cc-part)))
       (require ,cc-part))))

(defmacro cc-external-require (feature)
  "Do a `require' of an external package.
This restores and sets up the compilation environment before and
afterwards.  Don't use within `eval-when-compile'."
  `(progn
     (eval-when-compile (cc-bytecomp-restore-environment))
     (require ,feature)
     (eval-when-compile (cc-bytecomp-setup-environment))))

(defun cc-bytecomp-is-compiling ()
  "Return non-nil if eval'ed during compilation.  Don't use outside
`eval-when-compile'."
  (and (boundp 'byte-compile-dest-file)
       (stringp byte-compile-dest-file)))

(defmacro cc-bytecomp-defvar (var)
  "Binds the symbol as a variable during compilation of the file,
to silence the byte compiler.  Don't use within `eval-when-compile'."
  `(eval-when-compile
     (if (boundp ',var)
	 (cc-bytecomp-debug-msg
	  "cc-bytecomp-defvar: %s bound already as variable" ',var)
       (if (not (memq ',var cc-bytecomp-unbound-variables))
	   (progn
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defvar: Saving %s (as unbound)" ',var)
	     (setq cc-bytecomp-unbound-variables
		   (cons ',var cc-bytecomp-unbound-variables))))
       (if (and (cc-bytecomp-is-compiling)
		(not load-in-progress))
	   (progn
	     (defvar ,var)
	     (set ',var (intern (concat "cc-bytecomp-ignore-var:"
					(symbol-name ',var))))
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defvar: Covered variable %s" ',var))))))

(defmacro cc-bytecomp-defun (fun)
  "Bind the symbol as a function during compilation of the file,
to silence the byte compiler.  Don't use within `eval-when-compile'.

If the symbol already is bound as a function, it will keep that
definition.  That means that this macro will not shut up warnings
about incorrect number of arguments.  It's dangerous to try to replace
existing functions since the byte compiler might need the definition
at compile time, e.g. for macros and inline functions."
  `(eval-when-compile
     (if (fboundp ',fun)
	 (cc-bytecomp-debug-msg
	  "cc-bytecomp-defun: %s bound already as function" ',fun)
       (if (not (assq ',fun cc-bytecomp-original-functions))
	   (progn
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defun: Saving %s (as unbound)" ',fun)
	     (setq cc-bytecomp-original-functions
		   (cons (list ',fun nil 'unbound)
			 cc-bytecomp-original-functions))))
       (if (and (cc-bytecomp-is-compiling)
		(not load-in-progress))
	   (progn
	     (fset ',fun (intern (concat "cc-bytecomp-ignore-fun:"
					 (symbol-name ',fun))))
	     (cc-bytecomp-debug-msg
	      "cc-bytecomp-defun: Covered function %s" ',fun))))))

(put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
(defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
  "Bind the symbol as a macro during compilation (and evaluation) of the
file.  Don't use outside `eval-when-compile'."
  `(let ((orig-fun (assq ',fun cc-bytecomp-original-functions)))
     (if (not orig-fun)
	 (setq orig-fun
	       (list ',fun
		     nil
		     (if (fboundp ',fun)
			 (progn
			   (cc-bytecomp-debug-msg
			    "cc-bytecomp-defmacro: Saving %s" ',fun)
			   (symbol-function ',fun))
		       (cc-bytecomp-debug-msg
			"cc-bytecomp-defmacro: Saving %s as unbound" ',fun)
		       'unbound))
	       cc-bytecomp-original-functions
	       (cons orig-fun cc-bytecomp-original-functions)))
     (defmacro ,fun ,@temp-macro)
     (cc-bytecomp-debug-msg
      "cc-bytecomp-defmacro: Bound macro %s" ',fun)
     (setcar (cdr orig-fun) (symbol-function ',fun))))

(defmacro cc-bytecomp-put (symbol propname value)
  "Set a property on a symbol during compilation (and evaluation) of
the file.  Don't use outside `eval-when-compile'."
  `(eval-when-compile
     (if (not (assoc (cons ,symbol ,propname) cc-bytecomp-original-properties))
	 (progn
	   (cc-bytecomp-debug-msg
	    "cc-bytecomp-put: Saving property %s for %s with value %s"
	    ,propname ,symbol (get ,symbol ,propname))
	   (setq cc-bytecomp-original-properties
		 (cons (cons (cons ,symbol ,propname)
			     (cons ,value (get ,symbol ,propname)))
		       cc-bytecomp-original-properties))))
     (put ,symbol ,propname ,value)
     (cc-bytecomp-debug-msg
      "cc-bytecomp-put: Bound property %s for %s to %s"
      ,propname ,symbol ,value)))

(defmacro cc-bytecomp-obsolete-var (symbol)
  "Suppress warnings that the given symbol is an obsolete variable.
Don't use within `eval-when-compile'."
  `(eval-when-compile
     (if (get ',symbol 'byte-obsolete-variable)
	 (cc-bytecomp-put ',symbol 'byte-obsolete-variable nil)
       ;; This avoids a superfluous compiler warning
       ;; about calling `get' for effect.
       t)))

(defun cc-bytecomp-ignore-obsolete (form)
  ;; Wraps a call to `byte-compile-obsolete' that suppresses the warning.
  (let ((byte-compile-warnings byte-compile-warnings))
    (byte-compile-disable-warning 'obsolete)
    (byte-compile-obsolete form)))

(defmacro cc-bytecomp-obsolete-fun (symbol)
  "Suppress warnings that the given symbol is an obsolete function.
Don't use within `eval-when-compile'."
  `(eval-when-compile
     (if (eq (get ',symbol 'byte-compile) 'byte-compile-obsolete)
	 (cc-bytecomp-put ',symbol 'byte-compile
			  'cc-bytecomp-ignore-obsolete)
       ;; This avoids a superfluous compiler warning
       ;; about calling `get' for effect.
       t)))

(defmacro cc-bytecomp-boundp (symbol)
  "Return non-nil if the given symbol is bound as a variable outside
the compilation.  This is the same as using `boundp' but additionally
exclude any variables that have been bound during compilation with
`cc-bytecomp-defvar'."
  (if (and (cc-bytecomp-is-compiling)
	   (memq (car (cdr symbol)) cc-bytecomp-unbound-variables))
      nil
    `(boundp ,symbol)))

(defmacro cc-bytecomp-fboundp (symbol)
  "Return non-nil if the given symbol is bound as a function outside
the compilation.  This is the same as using `fboundp' but additionally
exclude any functions that have been bound during compilation with
`cc-bytecomp-defun'."
  (let (fun-elem)
    (if (and (cc-bytecomp-is-compiling)
	     (setq fun-elem (assq (car (cdr symbol))
				  cc-bytecomp-original-functions))
	     (eq (elt fun-elem 2) 'unbound))
	nil
      `(fboundp ,symbol))))


(provide 'cc-bytecomp)

;; arch-tag: 2d71b3ad-57b0-4b13-abd3-ab836e08f975
;;; cc-bytecomp.el ends here