From d6979638d5fcd26f963e6fb47d65f0dce3b62a61 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 14 Jun 2007 02:16:22 +0000 Subject: [PATCH] Fix a few Emacs 21 bugs that caused errors during display 2007-06-13 Michael Olson * lisp/muse-colors.el (muse-colors-insert-image): Catch error that occurs in Emacs 21 when an image does not exist. * lisp/muse.el (muse-file-remote-p): In Emacs 21, ange-ftp-name-format is a list that has the regexp in its car. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-349 --- ChangeLog | 4 ++++ lisp/muse-colors.el | 7 +++++-- lisp/muse.el | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12df6ae..b716c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ make implicit interwiki links work properly again. (muse-link-face): Strip anchor from end of a path, so that this works with anchors in interwiki links. + (muse-colors-insert-image): Catch error that occurs in Emacs 21 + when an image does not exist. * lisp/muse-wiki.el (muse-wiki-update-interwiki-regexp): Permit anchors. @@ -20,6 +22,8 @@ about match 0. (muse-handle-explicit-link): Docfix: this does not modify the match data. + (muse-file-remote-p): In Emacs 21, ange-ftp-name-format is a list + that has the regexp in its car. 2007-06-12 Michael Olson diff --git a/lisp/muse-colors.el b/lisp/muse-colors.el index 7378c75..3caf03d 100644 --- a/lisp/muse-colors.el +++ b/lisp/muse-colors.el @@ -765,8 +765,11 @@ in place of an image link defined by BEG and END." (when (stringp image-file) (if (fboundp 'create-image) ;; use create-image and display property - (add-text-properties beg end - (list 'display (create-image image-file))) + (let ((display-stuff (condition-case nil + (create-image image-file) + (error nil)))) + (when display-stuff + (add-text-properties beg end (list 'display display-stuff)))) ;; use make-glyph and invisible property (and (setq glyph (muse-make-file-glyph image-file)) (progn diff --git a/lisp/muse.el b/lisp/muse.el index 28ed6c9..8a65f3c 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -490,7 +490,7 @@ on the system \"/user@host:\"." ((fboundp 'tramp-handle-file-remote-p) (tramp-handle-file-remote-p file)) ((and (boundp 'ange-ftp-name-format) - (string-match ange-ftp-name-format file)) + (string-match (car ange-ftp-name-format) file)) t) (t nil))) -- 2.11.4.GIT