From 25760b109092d14a34ea7d9ca5c4bddaca9b6c13 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Wed, 19 Dec 2007 02:16:18 +0000 Subject: [PATCH] * netrc.el: Bind encrypt-file-alist for Emacs 21 and XEmacs when compiling. (netrc-bound-and-true-p): New macro. (netrc-parse): Use it instead of bound-and-true-p that is not available in XEmacs 21.4. --- lisp/ChangeLog | 8 ++++++++ lisp/netrc.el | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index feaeece1d..2530c7efe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-12-19 Katsumi Yamaoka + + * netrc.el: Bind encrypt-file-alist for Emacs 21 and XEmacs when + compiling. + (netrc-bound-and-true-p): New macro. + (netrc-parse): Use it instead of bound-and-true-p that is not available + in XEmacs 21.4. + 2007-12-19 Teodor Zlatanov * gnus-registry.el (gnus-registry-mark-article) diff --git a/lisp/netrc.el b/lisp/netrc.el index a41ced27b..3f75bb46e 100644 --- a/lisp/netrc.el +++ b/lisp/netrc.el @@ -42,6 +42,14 @@ (if (fboundp 'point-at-eol) 'point-at-eol 'line-end-position)) +(eval-when-compile + (defvar encrypt-file-alist) + ;; This is unnecessary in the compiled version as it is a macro. + (if (fboundp 'bound-and-true-p) + (defalias 'netrc-bound-and-true-p 'bound-and-true-p) + (defmacro netrc-bound-and-true-p (var) + "Return the value of symbol VAR if it is bound, else nil." + `(and (boundp (quote ,var)) ,var)))) (defgroup netrc nil "Netrc configuration." @@ -58,7 +66,7 @@ (let ((tokens '("machine" "default" "login" "password" "account" "macdef" "force" "port")) - (encryption-model (when (bound-and-true-p encrypt-file-alist) + (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist) (encrypt-find-model file))) alist elem result pair) (if encryption-model -- 2.34.1