emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104931: Fix XEmacs compilation warni


From: Bill Wohler
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104931: Fix XEmacs compilation warnings and errors in MH-E.
Date: Sun, 03 Jul 2011 20:11:28 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104931 [merge]
committer: Bill Wohler <address@hidden>
branch nick: trunk
timestamp: Sun 2011-07-03 20:11:28 -0700
message:
  Fix XEmacs compilation warnings and errors in MH-E.
  
  * mh-e.el: Just require mh-loaddefs since loading it in an
  eval-and-compile block causes compilation errors in XEmacs.
  
  * mh-acros.el,        mh-comp.el, mh-e.el, mh-folder.el, mh-letter.el:
  * mh-mime.el, mh-search.el, mh-seq.el: Shush XEmacs compiler in
  mh-do-in-xemacs block.
  
  * mh-compat.el (mh-window-full-height-p): Add compatibility function
  for XEmacs.
  * mh-show.el (mh-show-msg): Use it, and avoid compiler warning on
  XEmacs.
  
  * mh-letter.el (mh-letter-mode-map, mh-letter-complete)
  (mh-complete-word): Remove FIXME comments since these functions are
  still needed in other Emacsen. However, they can probably stand to be
  generalized like completion-at-point.
  (mh-letter-complete-or-space): Remove unused variable.
  
  * mh-compat.el (mh-test-completion): Add compatibility function for
  XEmacs.
  * mh-alias.el (mh-alias-letter-expand-alias): Use it, and avoid
  compiler warning on XEmacs.
  
  * mh-utils.el:
  * mh-mime.el: Shush XEmacs compiler in mh-do-in-xemacs block.
  
  * mh-folder.el: Use boundp instead of fboundp when testing
  existence of desktop-buffer-mode-handlers.
modified:
  lisp/mh-e/ChangeLog
  lisp/mh-e/mh-acros.el
  lisp/mh-e/mh-alias.el
  lisp/mh-e/mh-comp.el
  lisp/mh-e/mh-compat.el
  lisp/mh-e/mh-e.el
  lisp/mh-e/mh-folder.el
  lisp/mh-e/mh-letter.el
  lisp/mh-e/mh-mime.el
  lisp/mh-e/mh-search.el
  lisp/mh-e/mh-seq.el
  lisp/mh-e/mh-show.el
  lisp/mh-e/mh-utils.el
=== modified file 'lisp/mh-e/ChangeLog'
--- a/lisp/mh-e/ChangeLog       2011-05-12 16:30:17 +0000
+++ b/lisp/mh-e/ChangeLog       2011-07-04 02:53:16 +0000
@@ -1,3 +1,36 @@
+2011-07-04  Bill Wohler  <address@hidden>
+
+       * mh-e.el: Just require mh-loaddefs since loading it in an
+       eval-and-compile block causes compilation errors in XEmacs.
+
+       * mh-acros.el,  mh-comp.el, mh-e.el, mh-folder.el, mh-letter.el:
+       * mh-mime.el, mh-search.el, mh-seq.el: Shush XEmacs compiler in
+       mh-do-in-xemacs block.
+
+       * mh-compat.el (mh-window-full-height-p): Add compatibility
+       function for XEmacs.
+       * mh-show.el (mh-show-msg): Use it, and avoid compiler warning on
+       XEmacs.
+
+       * mh-letter.el (mh-letter-mode-map, mh-letter-complete)
+       (mh-complete-word): Remove FIXME comments since these functions
+       are still needed in other Emacsen. However, they can probably
+       stand to be generalized like completion-at-point.
+       (mh-letter-complete-or-space): Remove unused variable.
+
+2011-07-03  Bill Wohler  <address@hidden>
+
+       * mh-compat.el (mh-test-completion): Add compatibility function
+       for XEmacs.
+       * mh-alias.el (mh-alias-letter-expand-alias): Use it, and avoid
+       compiler warning on XEmacs.
+
+       * mh-utils.el:
+       * mh-mime.el: Shush XEmacs compiler in mh-do-in-xemacs block.
+
+       * mh-folder.el: Use boundp instead of fboundp when testing
+       existence of desktop-buffer-mode-handlers.
+
 2011-05-10  Jim Meyering  <address@hidden>
 
        Fix doubled-word typos.

=== modified file 'lisp/mh-e/mh-acros.el'
--- a/lisp/mh-e/mh-acros.el     2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-acros.el     2011-07-04 02:17:42 +0000
@@ -132,9 +132,10 @@
                (boundp 'mark-active) mark-active))))
 
 ;; Shush compiler.
-(defvar struct)                         ; XEmacs
-(defvar x)                              ; XEmacs
-(defvar y)                              ; XEmacs
+(mh-do-in-xemacs
+  (defvar struct)
+  (defvar x)
+  (defvar y))
 
 ;;;###mh-autoload
 (defmacro mh-defstruct (name-spec &rest fields)

=== modified file 'lisp/mh-e/mh-alias.el'
--- a/lisp/mh-e/mh-alias.el     2011-05-23 17:57:17 +0000
+++ b/lisp/mh-e/mh-alias.el     2011-07-03 22:27:19 +0000
@@ -316,8 +316,7 @@
                         res)
                   res)))
              ((t) (all-completions string mh-alias-alist pred))
-             ((lambda) (if (fboundp 'test-completion)
-                      (test-completion string mh-alias-alist pred))))))))))
+             ((lambda) (mh-test-completion string mh-alias-alist pred)))))))))
 
 
 ;;; Alias File Updating

=== modified file 'lisp/mh-e/mh-comp.el'
--- a/lisp/mh-e/mh-comp.el      2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-comp.el      2011-07-04 02:17:42 +0000
@@ -223,7 +223,8 @@
       (setq other-headers (cdr other-headers)))))
 
 ;; Shush compiler.
-(defvar sendmail-coding-system)         ; XEmacs
+(mh-do-in-xemacs
+  (defvar sendmail-coding-system))
 
 ;;;###autoload
 (defun mh-send-letter (&optional arg)

=== modified file 'lisp/mh-e/mh-compat.el'
--- a/lisp/mh-e/mh-compat.el    2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-compat.el    2011-07-04 00:27:22 +0000
@@ -122,6 +122,16 @@
   "XEmacs does not have `font-lock-add-keywords'.
 This function returns nil on that system.")
 
+(defun-mh mh-window-full-height-p
+  window-full-height-p (&optional WINDOW)
+  "Return non-nil if WINDOW is not the result of a vertical split.
+This function is defined in XEmacs as it lacks
+`window-full-height-p'. The values of the functions
+`window-height' and `frame-height' are compared instead. The
+argument WINDOW is ignored."
+  (= (1+ (window-height))
+     (frame-height)))
+
 (defun-mh mh-image-load-path-for-library
   image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images used by LIBRARY.
@@ -260,6 +270,12 @@
 `replace-in-string' are ignored."
   (replace-in-string string regexp rep literal))
 
+(defun-mh mh-test-completion
+  test-completion (string collection &optional predicate)
+  "Return non-nil if STRING is a valid completion.
+XEmacs does not have `test-completion'. This function returns nil
+on that system." nil)
+
 ;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
 (if (not (boundp 'url-unreserved-chars))
     (defconst mh-url-unreserved-chars

=== modified file 'lisp/mh-e/mh-e.el'
--- a/lisp/mh-e/mh-e.el 2011-05-23 17:57:17 +0000
+++ b/lisp/mh-e/mh-e.el 2011-07-04 02:53:16 +0000
@@ -90,10 +90,7 @@
 ;; Provide functions to the rest of MH-E. However, mh-e.el must not
 ;; use any definitions in files that require mh-e from mh-loaddefs,
 ;; for if it does it will introduce a require loop.
-(eval-and-compile
-  ;; Load it during compilation as well, since it defines the macro
-  ;; mh-require-cl.
-  (load "mh-loaddefs" nil 'nomessage))
+(require 'mh-loaddefs)
 
 (mh-require-cl)
 
@@ -616,7 +613,8 @@
   (mh-exchange-point-and-mark-preserving-active-mark))
 
 ;; Shush compiler.
-(defvar mark-active)                    ; XEmacs
+(mh-do-in-xemacs
+  (defvar mark-active))
 
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.

=== modified file 'lisp/mh-e/mh-folder.el'
--- a/lisp/mh-e/mh-folder.el    2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-folder.el    2011-07-04 02:17:42 +0000
@@ -77,7 +77,7 @@
 ;;; Desktop Integration
 
 ;; desktop-buffer-mode-handlers appeared in Emacs 22.
-(if (fboundp 'desktop-buffer-mode-handlers)
+(if (boundp 'desktop-buffer-mode-handlers)
     (add-to-list 'desktop-buffer-mode-handlers
                  '(mh-folder-mode . mh-restore-desktop-buffer)))
 
@@ -526,7 +526,8 @@
 ;; Shush compiler.
 (defvar desktop-save-buffer)
 (defvar font-lock-auto-fontify)
-(defvar font-lock-defaults)             ; XEmacs
+(mh-do-in-xemacs
+  (defvar font-lock-defaults))
 
 ;; Ensure new buffers won't get this mode if default major-mode is nil.
 (put 'mh-folder-mode 'mode-class 'special)

=== modified file 'lisp/mh-e/mh-letter.el'
--- a/lisp/mh-e/mh-letter.el    2011-04-28 15:32:28 +0000
+++ b/lisp/mh-e/mh-letter.el    2011-07-04 02:17:42 +0000
@@ -185,7 +185,7 @@
   "\C-c\C-w"            mh-check-whom
   "\C-c\C-y"            mh-yank-cur-msg
   "\C-c\M-d"            mh-insert-auto-fields
-  "\M-\t"               mh-letter-complete ;; FIXME: completion-at-point
+  "\M-\t"               mh-letter-complete
   "\t"                  mh-letter-next-header-field-or-indent
   [backtab]             mh-letter-previous-header-field)
 
@@ -273,7 +273,8 @@
 ;;; MH-Letter Mode
 
 ;; Shush compiler.
-(defvar font-lock-defaults)             ; XEmacs
+(mh-do-in-xemacs
+  (defvar font-lock-defaults))
 
 ;; Ensure new buffers won't get this mode if default major-mode is nil.
 (put 'mh-letter-mode 'mode-class 'special)
@@ -502,10 +503,13 @@
         (or (funcall func) #'ignore)
       mh-letter-complete-function)))
 
-(defalias 'mh-letter-complete
-  (if (fboundp 'completion-at-point) #'completion-at-point
-    (lambda ()
-      "Perform completion on header field or word preceding point.
+;; TODO Now that completion-at-point performs the task of
+;; mh-letter-complete, perhaps mh-letter-complete along with
+;; mh-complete-word should be rewritten as a more general function for
+;; XEmacs, renamed to mh-completion-at-point, and moved to
+;; mh-compat.el.
+(defun-mh mh-letter-complete completion-at-point ()
+  "Perform completion on header field or word preceding point.
 
 If the field contains addresses (for example, \"To:\" or \"Cc:\")
 or folders (for example, \"Fcc:\") then this command will provide
@@ -521,7 +525,7 @@
                 (end (nth 1 data))
                 (table (nth 2 data)))
             (mh-complete-word (buffer-substring-no-properties start end)
-                              table start end))))))))
+                              table start end))))))
 
 (defun mh-letter-complete-or-space (arg)
   "Perform completion or insert space.
@@ -531,8 +535,7 @@
 space is inserted; use a prefix argument ARG to specify more than
 one space."
   (interactive "p")
-  (let ((func nil)
-        (end-of-prev (save-excursion
+  (let ((end-of-prev (save-excursion
                        (goto-char (mh-beginning-of-word))
                        (mh-beginning-of-word -1))))
     (cond ((not mh-compose-space-does-completion-flag)
@@ -889,7 +892,6 @@
 
 ;;;###mh-autoload
 (defun mh-complete-word (word choices begin end)
-  ;; FIXME: Only needed when completion-at-point doesn't exist.
   "Complete WORD from CHOICES.
 Any match found replaces the text from BEGIN to END."
   (let ((completion (try-completion word choices))

=== modified file 'lisp/mh-e/mh-mime.el'
--- a/lisp/mh-e/mh-mime.el      2011-05-23 17:57:17 +0000
+++ b/lisp/mh-e/mh-mime.el      2011-07-04 02:17:42 +0000
@@ -835,7 +835,7 @@
 ;;; Button Display
 
 ;; Shush compiler.
-(when (featurep 'xemacs)
+(mh-do-in-xemacs
   (defvar dots)
   (defvar type)
   (defvar ov))
@@ -885,7 +885,8 @@
 ;; Shush compiler.
 (defvar mm-verify-function-alist)       ; < Emacs 22
 (defvar mm-decrypt-function-alist)      ; < Emacs 22
-(defvar pressed-details)                ; XEmacs
+(mh-do-in-xemacs
+  (defvar pressed-details))
 
 (defun mh-insert-mime-security-button (handle)
   "Display buttons for PGP message, HANDLE."

=== modified file 'lisp/mh-e/mh-search.el'
--- a/lisp/mh-e/mh-search.el    2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-search.el    2011-07-04 02:17:42 +0000
@@ -321,7 +321,8 @@
                        count (> (hash-table-count msg-hash) 0)))))))
 
 ;; Shush compiler.
-(defvar pick-folder)                    ; XEmacs
+(mh-do-in-xemacs
+  (defvar pick-folder))
 
 (defun mh-search-folder (folder window-config)
   "Search FOLDER for messages matching a pattern.
@@ -401,8 +402,9 @@
   (mh-index-sequenced-messages folders mh-tick-seq))
 
 ;; Shush compiler.
-(defvar mh-mairix-folder)               ; XEmacs
-(defvar mh-flists-search-folders)       ; XEmacs
+(mh-do-in-xemacs
+  (defvar mh-mairix-folder)
+  (defvar mh-flists-search-folders))
 
 ;;;###mh-autoload
 (defun mh-index-sequenced-messages (folders sequence)
@@ -1442,7 +1444,8 @@
   mh-index-data)
 
 ;; Shush compiler
-(defvar mh-speed-flists-inhibit-flag)   ; XEmacs
+(mh-do-in-xemacs
+  (defvar mh-speed-flists-inhibit-flag))
 
 ;;;###mh-autoload
 (defun mh-index-execute-commands ()

=== modified file 'lisp/mh-e/mh-seq.el'
--- a/lisp/mh-e/mh-seq.el       2011-01-25 04:08:28 +0000
+++ b/lisp/mh-e/mh-seq.el       2011-07-04 02:17:42 +0000
@@ -198,7 +198,8 @@
                         " "))))
 
 ;; Shush compiler.
-(defvar tool-bar-mode)                  ; XEmacs
+(mh-do-in-xemacs
+  (defvar tool-bar-mode))
 (defvar tool-bar-map)
 
 ;;;###mh-autoload

=== modified file 'lisp/mh-e/mh-show.el'
--- a/lisp/mh-e/mh-show.el      2011-01-26 08:36:39 +0000
+++ b/lisp/mh-e/mh-show.el      2011-07-04 00:35:48 +0000
@@ -146,9 +146,7 @@
             (if (not clean-message-header)
                 (mh-start-of-uncleaned-message)))
         (mh-display-msg msg folder)))
-    (unless (if (fboundp 'window-full-height-p)
-                (window-full-height-p)
-              (= (1+ (window-height)) (frame-height))) ; not vertically split
+    (unless (mh-window-full-height-p) ; not vertically split
       (shrink-window (- (window-height) (or mh-summary-height
                                             (mh-summary-height)))))
     (mh-recenter nil)

=== modified file 'lisp/mh-e/mh-utils.el'
--- a/lisp/mh-e/mh-utils.el     2011-04-28 15:32:28 +0000
+++ b/lisp/mh-e/mh-utils.el     2011-07-03 21:30:28 +0000
@@ -732,8 +732,9 @@
                    (t (file-directory-p path))))))))
 
 ;; Shush compiler.
-(defvar completion-root-regexp)          ; XEmacs
-(defvar minibuffer-completing-file-name) ; XEmacs
+(mh-do-in-xemacs
+  (defvar completion-root-regexp)
+  (defvar minibuffer-completing-file-name))
 
 (defun mh-folder-completing-read (prompt default allow-root-folder-flag)
   "Read folder name with PROMPT and default result DEFAULT.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]