AUCTeX Sync -- Update all elisp to v11.92
[packages] / xemacs-packages / auctex / prv-xemacs.el
index a4bae71..ae20402 100644 (file)
@@ -1,7 +1,6 @@
 ;;; prv-xemacs.el --- XEmacs support for preview-latex
 
-;; Copyright (C) 2001, 02, 03, 04, 05,
-;;               2006 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2006, 2017 Free Software Foundation, Inc.
 
 ;; Author: David Kastrup
 ;; Keywords: convenience, tex, wp
     "List of macros only present when compiling/loading uncompiled.")
 
   (defmacro preview-defmacro (name &rest rest)
-    (push 
-     (if (fboundp name)
-        (cons name (symbol-function name))
-       name)
-     preview-compatibility-macros)
-    `(eval-when-compile (defmacro ,name ,@rest)))
+    (when (featurep 'xemacs)
+      (push
+       (if (fboundp name)
+          (cons name (symbol-function name))
+        name)
+       preview-compatibility-macros)
+      `(eval-when-compile (defmacro ,name ,@rest))))
   (push 'preview-defmacro preview-compatibility-macros))
 
 (preview-defmacro assoc-default (key alist test)
@@ -413,10 +413,9 @@ stream before the buffer characters can be identified.  XEmacs
 21.4 is rather bad at preserving incomplete multibyte characters
 in that process.  This variable makes it possible to use a
 reconstructable coding system in the run buffer instead.  Specify
-an alist of base coding system names here, which you can get
-using
+an alist of coding system names here, which you can get using
 
-  \(coding-system-name (coding-system-base buffer-file-coding-system))
+  \(coding-system-name buffer-file-coding-system)
 
 in properly detected buffers."
   :group 'preview-latex
@@ -431,6 +430,17 @@ in properly detected buffers."
                 preview-buffer-recoding-alist))
       base))
 
+(if (and (featurep 'mule)
+        (= emacs-major-version 21)
+        (< emacs-minor-version 5))
+    (defadvice coding-system-change-eol-conversion
+       (after fallback activate)
+      "Return CODING-SYSTEM as-is if the result is nil.
+XEmacs 21.4 mule-ucs fails to define utf-8 to respond properly to
+this function."
+      (unless ad-return-value
+       (setq ad-return-value (ad-get-arg 0)))))
+
 (defun preview-mode-setup ()
   "Setup proper buffer hooks and behavior for previews."
   (set (make-local-variable 'desktop-save-buffer)
@@ -734,6 +744,12 @@ of an insertion."
                                (nth 1 image)
                                (nth 2 image)))))
 
+(if (eq system-type 'windows-nt)
+    (defadvice preview-ps-quote-filename (around path-sep-to-slash)
+      "Make path separator to slash so that the function will not be confused."
+      (let ((directory-sep-char ?/))
+       ad-do-it)))
+
 (provide 'prv-xemacs)
 
 ;;; Local variables: