tramp-devel
[Top][All Lists]
Advanced

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

[PATCH] Fix XEmacs prob & don't require base64 if we don't need to.


From: Steve Youngs
Subject: [PATCH] Fix XEmacs prob & don't require base64 if we don't need to.
Date: Sat, 31 Aug 2002 12:26:15 +1000
User-agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.5 (brussels sprouts, i686-pc-linux)

Hi Kai!

I just built tramp for the first time in ages, came across a problem
for XEmacs, and I finally got around to addressing an annoyance.

The problem was that 'find-operation-coding-system' doesn't appear to
exist in XEmacs.  I had a look through the code and the only place it
is in Tramp isn't used anywhere (your ChangeLog entry confirms this).
So I simply wrapped it in a '(unless (featurep 'xemacs)...)'.

The annoyance for me was the '(require base64)'.  Most modern Emacsen
have the base64 functions built in, but for some reason there are
always copies of base64.el laying around in people's load-path.  My
solution here was to wrap the require in a test to see if the
encode/decode functions are already bound.


NOTE: This patch has been committed.

Tramp patch:
ChangeLog files diff command: cvs -q diff -U 0
Files affected:               lisp/ChangeLog
Source files diff command:    cvs -q diff -uN
Files affected:               lisp/tramp.el

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/tramp/tramp/lisp/ChangeLog,v
retrieving revision 2.178
diff -u -U0 -r2.178 ChangeLog
--- lisp/ChangeLog      29 Aug 2002 19:31:40 -0000      2.178
+++ lisp/ChangeLog      31 Aug 2002 02:09:15 -0000
@@ -0,0 +1,9 @@
+2002-08-31  Steve Youngs  <address@hidden>
+
+       * tramp.el (require 'base64): Most modern Emacsen have the base64
+       encode/decode functions built in, so test to see if they are bound
+       before we go blindly requiring base64.el.
+       (tramp-feature-write-region-fix): XEmacs doesn't have a
+       'find-operation-coding-system' and this variable doesn't seem to
+       be used anywhere so wrap it in (unless (featurep 'xemacs)).
+
Index: lisp/tramp.el
===================================================================
RCS file: /cvsroot/tramp/tramp/lisp/tramp.el,v
retrieving revision 2.186
diff -u -u -r2.186 tramp.el
--- lisp/tramp.el       29 Aug 2002 19:31:40 -0000      2.186
+++ lisp/tramp.el       31 Aug 2002 02:08:59 -0000
@@ -80,7 +80,9 @@
 
 (require 'timer)
 (require 'format-spec)                  ;from Gnus 5.8, also in tar ball
-(require 'base64)                       ;for the mimencode methods
+(unless (and (fboundp 'base64-encode-region)
+            (fboundp 'base64-decode-region))
+  (require 'base64))                       ;for the mimencode methods
 (require 'shell)
 (require 'advice)
 
@@ -1414,12 +1416,13 @@
 This variable is buffer-local in every buffer.")
 (make-variable-buffer-local 'tramp-last-cmd-time)
 
-(defvar tramp-feature-write-region-fix
-  (let ((file-coding-system-alist '(("test" emacs-mule))))
-    (find-operation-coding-system 'write-region 0 0 "" nil "test"))
-  "Internal variable to say if `write-region' chooses the right coding.
+(unless (featurep 'xemacs)
+  (defvar tramp-feature-write-region-fix
+    (let ((file-coding-system-alist '(("test" emacs-mule))))
+      (find-operation-coding-system 'write-region 0 0 "" nil "test"))
+    "Internal variable to say if `write-region' chooses the right coding.
 Older versions of Emacs chose the coding system for `write-region' based
-on the FILENAME argument, even if VISIT was a string.")
+on the FILENAME argument, even if VISIT was a string."))
 
 ;; New handlers should be added here.  The following operations can be
 ;; handled using the normal primitives: file-name-as-directory,

-- 
|---<Steve Youngs>---------------<GnuPG KeyID: 10D5C9C5>---|
|            XEmacs - It's not just an editor.             |
|                    It's a way of life.                   |
|------------------------------------<address@hidden>---|




reply via email to

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