diff lisp/obsolete.el @ 4317:15d36164ebd7

Eliminate lost docstring warnings on 21.5. 2007-12-09 Aidan Kehoe <kehoea@parhasard.net> * unicode.el (load-unicode-mapping-tables): Call #'set-default-unicode-precedence wrapped with #'declare-fboundp, to avoid warnings on non-Mule builds. * unicode.el (ccl-encode-to-ucs-2): * unicode.el (unicode-error-sequence-regexp-range): * unicode.el (frob-unicode-errors-region): * unicode.el (unicode-error-translate-region): Unconditionally provide these functions and variables at top level in the code, to make them available to make-docfile. For the INITVALUE args to #'defvar, conditionalise on (featurep 'mule); ditto for the code that tests the lookup tables and provides the WGL4 characters as jit-ucs-charset-0 characters. Unintern the function and variable symbols if (featurep 'mule) is not true, so their function definitions and so on get garbage collected at dump time in non-Mule builds. * obsolete.el (add-menu-item): * obsolete.el (add-menu): * obsolete.el (add-menu): * obsolete.el (package-get-download-menu): Provide these functions at top level, in order to make them available to make-docfile.c, which has trouble interpreting byte code. Unintern their symbols if the menubar feature is not available, which means they will be garbage collected on non-menubar builds.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Dec 2007 14:55:03 +0100
parents 38ef5a6da799
children 8f1ee2d15784
line wrap: on
line diff
--- a/lisp/obsolete.el	Sun Dec 09 14:04:13 2007 +0100
+++ b/lisp/obsolete.el	Sun Dec 09 14:55:03 2007 +0100
@@ -222,23 +222,28 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff
 
-(when (featurep 'menubar)
-  (defun add-menu-item (menu-path item-name function enabled-p &optional before)
-    "Obsolete.  See the function `add-menu-button'."
-    (or item-name (error "must specify an item name"))
-    (add-menu-button menu-path (vector item-name function enabled-p) before))
-  (make-obsolete 'add-menu-item 'add-menu-button)
+(defun add-menu-item (menu-path item-name function enabled-p &optional before)
+  "Obsolete.  See the function `add-menu-button'."
+  (or item-name (error "must specify an item name"))
+  (declare-fboundp (add-menu-button menu-path (vector item-name function enabled-p) before)))
+(make-obsolete 'add-menu-item 'add-menu-button)
 
-  (defun add-menu (menu-path menu-name menu-items &optional before)
-    "See the function `add-submenu'."
-    (or menu-name (error "must specify a menu name"))
-    (or menu-items (error "must specify some menu items"))
-    (add-submenu menu-path (cons menu-name menu-items) before))
-  ;; Can't make this obsolete.  easymenu depends on it.
-  (make-compatible 'add-menu 'add-submenu)
+(defun add-menu (menu-path menu-name menu-items &optional before)
+  "See the function `add-submenu'."
+  (or menu-name (error "must specify a menu name"))
+  (or menu-items (error "must specify some menu items"))
+  (declare-fboundp (add-submenu menu-path (cons menu-name menu-items) before)))
+;; Can't make this obsolete.  easymenu depends on it.
+(make-compatible 'add-menu 'add-submenu)
 
-  (define-obsolete-function-alias 'package-get-download-menu 
-    'package-ui-download-menu))
+(define-obsolete-function-alias 'package-get-download-menu 
+  'package-ui-download-menu)
+
+(unless (featurep 'menubar)
+  ;; Don't provide the last three functions unless the menubar feature is
+  ;; available. This approach (with #'unintern) avoids warnings about lost
+  ;; docstrings since make-docfile doesn't parse bytecode.
+  (mapcar #'unintern '(add-menu-item add-menu package-get-download-menu)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer