Commits

didierv  committed 4724015

enable-multibyte-characters fix

  • Participants
  • Parent commits 4eba7da

Comments (0)

Files changed (2)

+1999-09-29  Didier Verna  <didier@xemacs.org>
+
+	* ispell.el (ispell-xemacs): new variable.
+	(ispell-menu-map-needed): use it.
+	(ispell-help): ditto.
+	(ispell-highlight-spelling-error): ditto.
+	(ispell-overlay-window): ditto.
+	(ispell-enable-multibyte-characters): new function.
+	(ispell-decode-string): use it.
+	(ispell-init-process): ditto.
+
 1999-07-22  SL Baur  <steve@miho>
 
 	* ispell.el (ispell-kill-ispell): sleep-for only takes one
 
 ;;; Break out XEmacs menu and split into several calls to avoid having
 ;;; long lines in loaddefs.el.  Detect need off following constant.
+(defconst ispell-xemacs (string-match "Lucid\\|XEmacs" emacs-version)
+  "Non nil if running XEmacs.")
 
 ;;; Set up dictionary
 ;;;###autoload
   ;; only needed when not version 18 and not XEmacs.
   (and (not ispell-menu-map)
        (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
-       (not (string-match "Lucid\\|XEmacs" emacs-version))))
+       (not ispell-xemacs)))
 
 ;;;###autoload
 (if ispell-menu-map-needed
 
 ;;; XEmacs version 19 & 20
 (if (and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
-	 (string-match "Lucid\\|XEmacs" emacs-version)
+	 ispell-xemacs
 	 (featurep 'menubar)
 	 (null ispell-menu-xemacs)
 	 (not (and (boundp 'infodock-version) infodock-version)))
 This is passed to the ispell process using the `-d' switch and is
 used as key in `ispell-dictionary-alist' (which see).")
 
+(defun ispell-enable-multibyte-characters ()
+  (or ispell-xemacs
+      (and (boundp 'enable-multibyte-characters)
+	   enable-multibyte-characters)))
+
 (defun ispell-decode-string (str)
   "Decodes multibyte character strings."
-  (if (and (boundp 'enable-multibyte-characters)
+  (if (and (ispell-enable-multibyte-characters)
 	   (fboundp 'decode-coding-string)
-	   enable-multibyte-characters
 	   (ispell-get-coding-system))
       (decode-coding-string str (ispell-get-coding-system))
     str))
 	  (select-window (minibuffer-window))
 	  ;;(enlarge-window 2)
 	  (erase-buffer)
-	  (cond ((string-match "Lucid\\|XEmacs" emacs-version)
+	  (cond (ispell-xemacs
 		 (message help-3)
 		 (enlarge-window 1)
 		 (message help-2)
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
   (cond
-   ((string-match "Lucid\\|XEmacs" emacs-version)
+   (ispell-xemacs
     (ispell-highlight-spelling-error-xemacs start end highlight))
    ((and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
 	 (featurep 'faces) window-system)
       ;; line) is demanded, the last line is not visible.
       ;; At least this happens on AIX 3.2, XEmacs w/ Motif, font 9x15.
       ;; So we increment the height for this case.
-      (if (and (string-match "Lucid\\|XEmacs" emacs-version)
+      (if (and ispell-xemacs
 	       (string-match "19\\.9\\.[0-9]+" emacs-version))
 	  (setq height (1+ height)))
       ;; if frame is unsplitable, temporarily disable that...
 	  ispell-filter-continue nil
 	  ispell-process-directory default-directory)
     (set-process-filter ispell-process 'ispell-filter)
-    (if (and (boundp 'enable-multibyte-characters)
-	     (fboundp 'set-process-coding-system)
-	     enable-multibyte-characters)
+    (if (and (ispell-enable-multibyte-characters)
+	     (fboundp 'set-process-coding-system))
 	(set-process-coding-system ispell-process (ispell-get-coding-system)
 				   (ispell-get-coding-system)))
     ;; Get version ID line