This eliminates lots of errors when building the packages with an XEmacs
without X support; not all of them, unfortunately--I intend to commit a
change to eliminate most of the rest, but the x-symbol build failure is
something I can’t eliminate without spending a big chunk of the weekend at
it. It also eliminates the non-Mule package build error which we’ve seen
for a while no; this should be visible the next time the package smoketest
is executed.
APPROVE COMMIT
NOTE: This patch has been committed.
lisp/ChangeLog addition:
2007-10-13 Aidan Kehoe <kehoea(a)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.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: lisp/unicode.el
===================================================================
RCS lisp/simple.el
===================================================================
RCS lisp/select.el
===================================================================
RCS lisp/obsolete.el
===================================================================
RCS lisp/minibuf.el
===================================================================
RCS lisp/menubar.el
===================================================================
RCS lisp/map-ynp.el
===================================================================
RCS lisp/faces.el
===================================================================
RCS lisp/coding.el
===================================================================
RCS lisp/cmdloop.el
===================================================================
RCS
Index: lisp/cmdloop.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cmdloop.el,v
retrieving revision 1.23
diff -u -u -r1.23 cmdloop.el
--- lisp/cmdloop.el 2006/11/24 13:45:38 1.23
+++ lisp/cmdloop.el 2007/10/13 13:54:40
@@ -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)
Index: lisp/coding.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/coding.el,v
retrieving revision 1.11
diff -u -u -r1.11 coding.el
--- lisp/coding.el 2006/12/29 18:09:42 1.11
+++ lisp/coding.el 2007/10/13 13:54:40
@@ -266,13 +266,11 @@
(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")
Index: lisp/faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/faces.el,v
retrieving revision 1.40
diff -u -u -r1.40 faces.el
--- lisp/faces.el 2007/04/22 19:58:33 1.40
+++ lisp/faces.el 2007/10/13 13:54:44
@@ -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))
-
- (face-background 'toolbar)))
- '("foregroundToolBarColor"
- (or
- (and
- (featurep 'x)
- (x-get-resource "foregroundToolBarColor"
- "ForegroundToolBarColor" 'string
- nil nil 'warn))
- (face-foreground 'toolbar)))
- )))
+(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)))
+ )))
(when (featurep 'tty)
(set-face-highlight-p 'bold t 'global '(default tty))
Index: lisp/map-ynp.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/map-ynp.el,v
retrieving revision 1.5
diff -u -u -r1.5 map-ynp.el
--- lisp/map-ynp.el 2005/05/05 17:10:32 1.5
+++ lisp/map-ynp.el 2007/10/13 13:54:44
@@ -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)))
Index: lisp/menubar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/menubar.el,v
retrieving revision 1.12
diff -u -u -r1.12 menubar.el
--- lisp/menubar.el 2005/02/07 19:30:08 1.12
+++ lisp/menubar.el 2007/10/13 13:54:45
@@ -568,6 +568,7 @@
accelerator specs -- this works even if the specs have already been added."
(menu-split-long-menu (menu-sort-menu menu)))
+;;;###autoload
(defun menu-split-long-menu (menu)
"Split MENU according to `menu-max-items' and add accelerator specs.
If MENU already has accelerator specs, they will be removed and new ones
Index: lisp/minibuf.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/minibuf.el,v
retrieving revision 1.30
diff -u -u -r1.30 minibuf.el
--- lisp/minibuf.el 2005/10/18 20:49:42 1.30
+++ lisp/minibuf.el 2007/10/13 13:54:47
@@ -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))))
Index: lisp/obsolete.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/obsolete.el,v
retrieving revision 1.19
diff -u -u -r1.19 obsolete.el
--- lisp/obsolete.el 2006/08/11 01:30:23 1.19
+++ lisp/obsolete.el 2007/10/13 13:54:48
@@ -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)
-
-(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)
+(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)
-(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.")
Index: lisp/select.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/select.el,v
retrieving revision 1.17
diff -u -u -r1.17 select.el
--- lisp/select.el 2007/06/21 13:39:11 1.17
+++ lisp/select.el 2007/10/13 13:54:48
@@ -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)
Index: lisp/simple.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/simple.el,v
retrieving revision 1.59
diff -u -u -r1.59 simple.el
--- lisp/simple.el 2007/04/30 16:16:52 1.59
+++ lisp/simple.el 2007/10/13 13:54:53
@@ -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)
Index: lisp/unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/unicode.el,v
retrieving revision 1.25
diff -u -u -r1.25 unicode.el
--- lisp/unicode.el 2007/10/03 16:53:39 1.25
+++ lisp/unicode.el 2007/10/13 13:54:53
@@ -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)
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches