branch: externals/dicom
commit 08fc103c106f08bf3a043da21d65024fd578515e
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Minor simplification
---
 dicom.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dicom.el b/dicom.el
index 9743a5957c..1b2f6d6287 100644
--- a/dicom.el
+++ b/dicom.el
@@ -271,7 +271,7 @@ progress:${percent-pos}%%' %s) & disown"
 
 (defun dicom--image-buffer ()
   "Return image buffer or throw an error."
-  (or (and (eq major-mode #'dicom-mode)
+  (or (and dicom--file
            (if (dicom--dir-p)
                (and (buffer-live-p dicom--image-buffer)
                     dicom--image-buffer)
@@ -280,11 +280,10 @@ progress:${percent-pos}%%' %s) & disown"
 
 (defun dicom--dir-buffer ()
   "Return dir buffer or throw an error."
-  (or (and (eq major-mode #'dicom-mode)
+  (or (and dicom--file
            (if (dicom--dir-p)
                (current-buffer)
-             (when-let ((dicom--file)
-                        (dir (locate-dominating-file dicom--file "DICOMDIR")))
+             (when-let ((dir (locate-dominating-file dicom--file "DICOMDIR")))
                (get-buffer (dicom--buffer-name (concat dir "DICOMDIR"))))))
       (user-error "DICOM: No open DICOMDIR found")))
 

Reply via email to