There were some incompatibilities in FKtPp’s merge, indicated in the
byte-compile warnings. This changes addresses (or indicates the lack of
addressing, but that should be for marginal functionality) them.
APPROVE COMMIT
NOTE: This patch has been committed.
xemacs-packages/eshell/ChangeLog addition:
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* esh-test.el (eshell-test-goto-func):
(eshell-show-usage-metrics):
* esh-cmd.el (eshell-find-alias-function):
Comment on some code that will fail under XEmacs.
* esh-var.el (esh-make-temp-file-1): New.
Add a #'make-temp-file substitute from GNUs, to use on 21.4 where
#'make-temp-file is not available.
* esh-var.el (eshell-parse-variable-ref):
Use it.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/eshell/esh-var.el
===================================================================
RCS xemacs-packages/eshell/esh-test.el
===================================================================
RCS xemacs-packages/eshell/esh-cmd.el
===================================================================
Index: xemacs-packages/eshell/esh-cmd.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/eshell/esh-cmd.el,v
retrieving revision 1.2
diff -u -u -r1.2 esh-cmd.el
--- xemacs-packages/eshell/esh-cmd.el 2008/08/27 21:26:33 1.2
+++ xemacs-packages/eshell/esh-cmd.el 2008/08/27 21:33:04
@@ -1287,7 +1287,8 @@
(defun eshell-find-alias-function (name)
"Check whether a function called `eshell/NAME' exists."
(let* ((sym (intern-soft (concat "eshell/" name)))
- (file (symbol-file sym 'defun)))
+ ;;; #### XEmacs; 21.4 doesn't accept the second argument.
+ (file (symbol-file sym))) ;; 'defun)))
;; If the function exists, but is defined in an eshell module
;; that's not currently enabled, don't report it as found
(if (and file
Index: xemacs-packages/eshell/esh-test.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/eshell/esh-test.el,v
retrieving revision 1.2
diff -u -u -r1.2 esh-test.el
--- xemacs-packages/eshell/esh-test.el 2008/08/27 21:26:34 1.2
+++ xemacs-packages/eshell/esh-test.el 2008/08/27 21:33:04
@@ -128,6 +128,7 @@
(let ((fsym (get-text-property (point) 'test-func)))
(when fsym
(let* ((def (symbol-function fsym))
+ ;;; #### XEmacs; 21.4 doesn't accept the second argument.
(library (locate-library (symbol-file fsym 'defun)))
(name (substring (symbol-name fsym)
(length "eshell-test--")))
@@ -214,6 +215,7 @@
(lambda ()
(setq eshell-metric-before-command
(if (eq eshell-show-usage-metrics t)
+ ;;; #### XEmacs; we don't support this.
(car (memory-use-counts))
(current-time))))) nil t)
Index: xemacs-packages/eshell/esh-var.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/eshell/esh-var.el,v
retrieving revision 1.2
diff -u -u -r1.2 esh-var.el
--- xemacs-packages/eshell/esh-var.el 2008/08/27 21:26:34 1.2
+++ xemacs-packages/eshell/esh-var.el 2008/08/27 21:33:04
@@ -121,6 +121,69 @@
(require 'env)
(require 'ring)
+;; XEmacs change; taken from Gnus. Remove once support for 21.4 is dropped.
+(defun esh-make-temp-file-1 (prefix &optional dir-flag suffix)
+ "Create a temporary file.
+The returned file name (created by appending some random characters at the end
+of PREFIX, and expanding against `temporary-file-directory' if necessary),
+is guaranteed to point to a newly created empty file.
+You can then use `write-region' to write new data into the file.
+
+If DIR-FLAG is non-nil, create a new empty directory instead of a file.
+
+If SUFFIX is non-nil, add that at the end of the file name."
+ (let ((umask (default-file-modes))
+ file)
+ (unwind-protect
+ (progn
+ ;; Create temp files with strict access rights. It's easy to
+ ;; loosen them later, whereas it's impossible to close the
+ ;; time-window of loose permissions otherwise.
+ (set-default-file-modes 448)
+ (while (condition-case err
+ (progn
+ (setq file
+ (make-temp-name
+ (expand-file-name
+ prefix
+ (if (fboundp 'temp-directory)
+ ;; XEmacs
+ (temp-directory)
+ temporary-file-directory))))
+ (if suffix
+ (setq file (concat file suffix)))
+ (if dir-flag
+ (make-directory file)
+ (if (or (featurep 'xemacs)
+ (= emacs-major-version 20))
+ ;; NOTE: This is unsafe if Emacs 20
+ ;; users and XEmacs users don't use
+ ;; a secure temp directory.
+ (if (file-exists-p file)
+ (signal 'file-already-exists
+ (list "File exists" file))
+ (write-region "" nil file nil 'silent))
+ (write-region "" nil file nil 'silent
+ nil 'excl)))
+ nil)
+ (file-already-exists t)
+ ;; The Emacs 20 and XEmacs versions of
+ ;; `make-directory' issue `file-error'.
+ (file-error (or (and (or (featurep 'xemacs)
+ (= emacs-major-version 20))
+ (file-exists-p file))
+ (signal (car err) (cdr err)))))
+ ;; the file was somehow created by someone else between
+ ;; `make-temp-name' and `write-region', let's try again.
+ nil)
+ file)
+ ;; Reset the umask.
+ (set-default-file-modes umask))))
+
+(defalias 'esh-make-temp-file
+ (or (and (fboundp 'make-temp-file) 'make-temp-file)
+ 'esh-make-temp-file-1))
+
;;; User Variables:
(defcustom eshell-var-load-hook '(eshell-var-initialize)
@@ -438,7 +501,10 @@
(let ((end (eshell-find-delimiter ?\< ?\>)))
(if (not end)
(throw 'eshell-incomplete ?\<)
- (let* ((temp (make-temp-file temporary-file-directory))
+ ;; XEmacs change:
+ (let* ((temp (esh-make-temp-file
+ (if (fboundp 'temp-directory) (temp-directory)
+ temporary-file-directory)))
(cmd (concat (buffer-substring (1+ (point)) end)
" > " temp)))
(prog1
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches