changeset 4222:38ef5a6da799

[xemacs-hg @ 2007-10-13 14:08:26 by aidan] Fix the nomule package build; eliminate some non-X compile time warnings.
author aidan
date Sat, 13 Oct 2007 14:08:30 +0000
parents 807c86a7612a
children 4026372d9525
files lisp/ChangeLog lisp/cmdloop.el lisp/coding.el lisp/faces.el lisp/map-ynp.el lisp/minibuf.el lisp/obsolete.el lisp/select.el lisp/simple.el lisp/unicode.el
diffstat 10 files changed, 115 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/ChangeLog	Sat Oct 13 14:08:30 2007 +0000
@@ -1,3 +1,47 @@
+2007-10-13  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cmdloop.el (yes-or-no-p):
+	Only call #'yes-or-no-p-dialog-box if it's bound. Eliminates a
+	compile-time warning; should not actually avoid any run-time
+	errors.
+	* coding.el:
+	* coding.el ('automatic-conversion): Removed.
+	On non-Mule builds, alias 'iso-8859-1 to 'no-conversion, not
+	'undecided, since the latter does coding system autorecognition
+	that is useless and leads to stack overflows without Mule. Delete
+	'iso-8859-2 as an alias on non-Mule
+	* faces.el (face-font-instance):
+	Only call get-charset if it's bound. 
+	* faces.el (xpm-color-symbols):
+	Only modify xpm-color-symbols if it's bound. 
+	* map-ynp.el (map-y-or-n-p):
+	Check that #'get-dialog-box-response is bound before calling it. 
+	* menubar.el:
+	List #'menu-split-long-menu as an autoload, for those builds that
+	don't use it at runtime but nonetheless have to compile code that
+	uses it. 
+	* minibuf.el (mouse-read-file-name-1):
+	Only use scrollbar-width if it's bound. 
+	* obsolete.el:
+	Only provide #'add-meu-item, #'add-menu,
+	#'package-get-download-menu if the menubar feature is available at
+	runtime. 
+	* obsolete.el (find-non-ascii-charset-string):
+	Only call #'charset-in-string if it's bound; else give nil. 
+	* obsolete.el (find-non-ascii-charset-region):
+	Only call #'charset-in-region if it's bound; else give nil. 
+	* select.el (activate-region-as-selection):
+	Only call #'mouse-track-rectangle-p if it's bound. 
+	* select.el (select-make-extent-for-selection):
+	Ditto. 
+	* simple.el (zmacs-make-extent-for-region):
+	Only call #'default-mouse-track-next-move-rect if it's bound. 
+	* simple.el (zmacs-activate-region):
+	Use and-boundp rather than (and (boundp ...))) when checking for a
+	variable. 
+	* unicode.el (featurep):
+	Don't bind res, which is not used, in the loop. 
+
 2007-10-06  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* x-faces.el (x-color-list-internal): Should return a list of
--- a/lisp/cmdloop.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/cmdloop.el	Sat Oct 13 14:08:30 2007 +0000
@@ -488,7 +488,10 @@
 The user must confirm the answer with RET,
 and can edit it until it as been confirmed."
   (if (should-use-dialog-box-p)
-      (yes-or-no-p-dialog-box prompt)
+      ;; and-fboundp is redundant, since yes-or-no-p-dialog-box is only
+      ;; bound if (featurep 'dialog). But it eliminates a compile-time
+      ;; warning.
+      (and-fboundp #'yes-or-no-p-dialog-box (yes-or-no-p-dialog-box prompt))
     (yes-or-no-p-minibuf prompt)))
 
 (defun y-or-n-p (prompt)
--- a/lisp/coding.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/coding.el	Sat Oct 13 14:08:30 2007 +0000
@@ -266,14 +266,12 @@
 (when (not (featurep 'mule))
   (define-coding-system-alias 'escape-quoted 'binary)
   ;; these are so that gnus and friends work when not mule
-  (define-coding-system-alias 'iso-8859-1 'undecided)
-  (define-coding-system-alias 'iso-8859-2 'undecided)
+  (define-coding-system-alias 'iso-8859-1 'no-conversion)
+  ;; We're misrepresenting ourselves to the gnus code by saying we support
+  ;; both.
+  ; (define-coding-system-alias 'iso-8859-2 'no-conversion)
   (define-coding-system-alias 'ctext 'binary))
 
-
-;; compatibility for old XEmacsen (don't use it)
-(define-coding-system-alias 'automatic-conversion 'undecided)
-
 (make-compatible-variable 'enable-multibyte-characters "Unimplemented")
 
 ;;; coding.el ends here
--- a/lisp/faces.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/faces.el	Sat Oct 13 14:08:30 2007 +0000
@@ -472,7 +472,9 @@
     (let (matchspec)
       ;; get-charset signals an error if its argument doesn't have an
       ;; associated charset.
-      (setq charset (get-charset charset)
+      (setq charset (if-fboundp #'get-charset
+                        (get-charset charset)
+                      (error 'unimplemented "Charset support not available"))
 	    matchspec (cons charset nil))
       (or (null (setcdr matchspec 'initial))
 	  (face-property-matching-instance 
@@ -2059,29 +2061,31 @@
 		     'global)
 
 ;; Define some logical color names to be used when reading the pixmap files.
-(if (featurep 'xpm)
-    (setq xpm-color-symbols
-	  (list
-	   '("foreground" (face-foreground 'default))
-	   '("background" (face-background 'default))
-	   '("backgroundToolBarColor"
-	     (or
-	      (and
-	       (featurep 'x)
-	       (x-get-resource "backgroundToolBarColor"
-			       "BackgroundToolBarColor" 'string
-			       nil nil 'warn))
+(and-boundp 
+    'xpm-color-symbols
+  (featurep 'xpm)
+  (setq xpm-color-symbols
+        (list
+         '("foreground" (face-foreground 'default))
+         '("background" (face-background 'default))
+         '("backgroundToolBarColor"
+           (or
+            (and
+             (featurep 'x)
+             (x-get-resource "backgroundToolBarColor"
+                             "BackgroundToolBarColor" 'string
+                             nil nil 'warn))
 
-	      (face-background 'toolbar)))
-	   '("foregroundToolBarColor"
-	     (or
-	      (and
-	       (featurep 'x)
-	       (x-get-resource "foregroundToolBarColor"
-			       "ForegroundToolBarColor" 'string
-			       nil nil 'warn))
-	      (face-foreground 'toolbar)))
-	   )))
+            (face-background 'toolbar)))
+         '("foregroundToolBarColor"
+           (or
+            (and
+            (featurep 'x)
+            (x-get-resource "foregroundToolBarColor"
+                            "ForegroundToolBarColor" 'string
+                            nil nil 'warn))
+            (face-foreground 'toolbar)))
+         )))
 
 (when (featurep 'tty)
   (set-face-highlight-p 'bold                    t 'global '(default tty))
--- a/lisp/map-ynp.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/map-ynp.el	Sat Oct 13 14:08:30 2007 +0000
@@ -162,9 +162,11 @@
 		   ;; Prompt the user about this object.
 		   (setq quit-flag nil)
 		   (if mouse-event ; XEmacs
-		       (setq def (or (get-dialog-box-response
-				      mouse-event
-				      (cons prompt map))
+		       (setq def (or (and-fboundp 
+                                         #'get-dialog-box-response
+                                         (get-dialog-box-response
+                                          mouse-event
+                                          (cons prompt map)))
 				     'quit))
 		     ;; Prompt in the echo area.
 		     (let ((cursor-in-echo-area (not no-cursor-in-echo-area)))
--- a/lisp/minibuf.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/minibuf.el	Sat Oct 13 14:08:30 2007 +0000
@@ -2095,7 +2095,7 @@
 		 ;; any more. --ben
 		 (lambda ()
 		   (mouse-rfn-setup-vars prompt)
-		   (when (featurep 'scrollbar)
+		   (when-boundp #'scrollbar-width
 		     (set-specifier scrollbar-width 0 (current-buffer)))
 		   (setq truncate-lines t))))
 	    
--- a/lisp/obsolete.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/obsolete.el	Sat Oct 13 14:08:30 2007 +0000
@@ -222,22 +222,23 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu stuff
 
-(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)
+(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 (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"))
+    (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))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; minibuffer
 
@@ -345,7 +346,7 @@
   "Return a list of charsets in the STRING except ascii.
 It might be available for compatibility with Mule 2.3,
 because its `find-charset-string' ignores ASCII charset."
-  (delq 'ascii (charsets-in-string string)))
+  (delq 'ascii (and-fboundp #'charsets-in-string (charsets-in-string string))))
 (make-obsolete 'find-non-ascii-charset-string
 	       "use (delq 'ascii (charsets-in-string STRING)) instead.")
 
@@ -353,7 +354,8 @@
   "Return a list of charsets except ascii in the region between START and END.
 It might be available for compatibility with Mule 2.3,
 because its `find-charset-string' ignores ASCII charset."
-  (delq 'ascii (charsets-in-region start end)))
+  (delq 'ascii (and-fboundp #'charsets-in-region
+                 (charsets-in-region start end))))
 (make-obsolete 'find-non-ascii-charset-region
 	       "use (delq 'ascii (charsets-in-region START END)) instead.")
 
--- a/lisp/select.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/select.el	Sat Oct 13 14:08:30 2007 +0000
@@ -276,7 +276,9 @@
 ;; application asserts the selection.  This is probably not a big deal.
 
 (defun activate-region-as-selection ()
-  (cond (mouse-track-rectangle-p (mouse-track-activate-rectangular-selection))
+  (cond ((and-fboundp #'mouse-track-rectangle-p
+           (mouse-track-rectangle-p
+            (mouse-track-activate-rectangular-selection))))
 	((marker-buffer (mark-marker t))
 	 (own-selection (cons (point-marker t) (mark-marker t))))))
 
@@ -346,10 +348,11 @@
 	(set-extent-property previous-extent 'end-open nil)
 
 	(cond
-	 (mouse-track-rectangle-p
-	  (setq previous-extent (list previous-extent))
-	  (default-mouse-track-next-move-rect start end previous-extent)
-	  ))
+	 ((and-fboundp #'mouse-track-rectangle-p 
+            (mouse-track-rectangle-p
+             (setq previous-extent (list previous-extent))
+             (default-mouse-track-next-move-rect start end previous-extent)
+             ))))
 	previous-extent))))
 
 (defun valid-simple-selection-p (data)
--- a/lisp/simple.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/simple.el	Sat Oct 13 14:08:30 2007 +0000
@@ -3969,7 +3969,8 @@
       (cond
        (zmacs-region-rectangular-p
 	(setq zmacs-region-extent (list zmacs-region-extent))
-	(default-mouse-track-next-move-rect start end zmacs-region-extent)
+        (when-fboundp #'default-mouse-track-next-move-rect
+          (default-mouse-track-next-move-rect start end zmacs-region-extent))
 	))
 
       zmacs-region-extent)))
@@ -3995,8 +3996,8 @@
       nil
     (setq zmacs-region-active-p t
 	  zmacs-region-stays t
-	  zmacs-region-rectangular-p (and (boundp 'mouse-track-rectangle-p)
-					  mouse-track-rectangle-p))
+	  zmacs-region-rectangular-p (and-boundp 'mouse-track-rectangle-p
+                                       mouse-track-rectangle-p))
     (if (marker-buffer (mark-marker t))
 	(zmacs-make-extent-for-region (cons (point-marker t) (mark-marker t))))
     (run-hooks 'zmacs-activate-region-hook)
--- a/lisp/unicode.el	Fri Oct 12 21:51:07 2007 +0000
+++ b/lisp/unicode.el	Sat Oct 13 14:08:30 2007 +0000
@@ -538,7 +538,6 @@
     (loop
       for i from ?\x00 to ?\xFF
       with to-check = (make-string 20 ?\x20) 
-      with res = t
       do 
       (delete-region (point-min) (point-max))
       (insert to-check)