]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-bytecomp.el
Add new maintainer (deego).
[gnu-emacs] / lisp / progmodes / cc-bytecomp.el
index 947ce7b89bc30c2ae73397773f7cb5f244abcbfc..39347415bd1d82d199e70ce0ab6245c1887e493c 100644 (file)
@@ -21,8 +21,8 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 ;; 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.
 
 \f
 ;;; Code:
@@ -221,18 +225,15 @@ to silence the byte compiler.  Don't use within `eval-when-compile'."
   "Bind the symbol as a function during compilation of the file,
 to silence the byte compiler.  Don't use within `eval-when-compile'."
   `(eval-when-compile
-     (if (not (assq ',fun cc-bytecomp-original-functions))
-        (setq cc-bytecomp-original-functions
-              (cons (list ',fun
-                          nil
-                          (if (fboundp ',fun)
-                              (symbol-function ',fun)
-                            'unbound))
-                    cc-bytecomp-original-functions)))
-     (if (and (cc-bytecomp-is-compiling)
-             (= cc-bytecomp-load-depth 0)
-             (not (fboundp ',fun)))
-        (fset ',fun 'cc-bytecomp-ignore))))
+     (if (fboundp ',fun)
+        nil
+       (if (not (assq ',fun cc-bytecomp-original-functions))
+          (setq cc-bytecomp-original-functions
+                (cons (list ',fun nil 'unbound)
+                      cc-bytecomp-original-functions)))
+       (if (and (cc-bytecomp-is-compiling)
+               (= cc-bytecomp-load-depth 0))
+          (fset ',fun 'cc-bytecomp-ignore)))))
 
 (put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
 (defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
@@ -265,7 +266,10 @@ the file.  Don't use outside `eval-when-compile'."
 Don't use within `eval-when-compile'."
   `(eval-when-compile
      (if (get ',symbol 'byte-obsolete-variable)
-        (cc-bytecomp-put ',symbol 'byte-obsolete-variable nil))))
+        (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.