[PATCH 4/4] emacs/show: fix for text/calendar display

Subject: [PATCH 4/4] emacs/show: fix for text/calendar display

Date: Wed, 29 May 2024 07:15:26 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


In certain scenarios involving symlinks and setting
find-file-visit-truename, text/calendar parts were not displayed
properly.

Following a suggestion of Al Haji-Ali [1], replace the use of
get-file-buffer with find-buffer-visiting.

[1]: id:m2wmneguh8.fsf@gmail.com
---
 emacs/notmuch-show.el   | 2 +-
 test/T450-emacs-show.sh | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 4c0ad74d..14e3c698 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -864,7 +864,7 @@ will return nil if the CID is unknown or cannot be retrieved."
 		    (unless (icalendar-import-buffer file t)
 		      (error "Icalendar import error. %s"
 			     "See *icalendar-errors* for more information"))
-		    (set-buffer (get-file-buffer file))
+		    (set-buffer (find-buffer-visiting file))
 		    (setq result (buffer-substring (point-min) (point-max)))
 		    (set-buffer-modified-p nil)
 		    (kill-buffer (current-buffer)))
diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh
index 027062cd..7c6a946a 100755
--- a/test/T450-emacs-show.sh
+++ b/test/T450-emacs-show.sh
@@ -341,7 +341,6 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "display of text/calendar, symlinked tmpdir"
-test_subtest_known_broken
 mkdir real-tmp
 ln -s real-tmp tmp
 test_emacs "(let ((notmuch-show-all-multipart/alternative-parts t)
-- 
2.43.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: