From 3ed338972b9d15ea01ff17c3a8da1507a07c0eeb Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 25 Feb 2000 02:41:01 +0000 Subject: [PATCH] (enriched-encode): Allow the 3rd argument ORIG-BUF for old Emacsen. --- ChangeLog | 5 +++++ emu.el | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7a0cd2e..bcc4303 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-02-25 Katsumi Yamaoka + + * emu.el (enriched-encode): Allow the 3rd argument ORIG-BUF for old + Emacsen. + 2000-02-21 Makoto Nakagawa * poe.el (format-time-string): New function for Emacs 19.28 and diff --git a/emu.el b/emu.el index d610c53..407ea4b 100644 --- a/emu.el +++ b/emu.el @@ -223,6 +223,29 @@ find-file-hooks, etc. (autoload 'enriched-decode "tinyrich") )) +(if (or (< emacs-major-version 20) + (and (eq emacs-major-version 20) + (< emacs-minor-version (if (featurep 'xemacs) 3 1)))) + (eval-after-load "enriched" + '(if (fboundp 'si:enriched-encode) + nil + (fset 'si:enriched-encode (symbol-function 'enriched-encode)) + (defun enriched-encode (from to &optional orig-buf) + (let* ((si:enriched-initial-annotation enriched-initial-annotation) + (enriched-initial-annotation + (if (stringp si:enriched-initial-annotation) + si:enriched-initial-annotation + (function + (lambda () + (save-excursion + ;; Eval this in the buffer we are annotating. This + ;; fixes a bug which was saving incorrect File-Width + ;; information, since we were looking at local + ;; variables in the wrong buffer. + (if orig-buf (set-buffer orig-buf)) + (funcall si:enriched-initial-annotation))))))) + (si::enriched-encode)))))) + ;;; @ end ;;; -- 1.7.10.4