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

    Simplify magic function
---
 dicom.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dicom.el b/dicom.el
index d28c2b59bd..91e9bb65cd 100644
--- a/dicom.el
+++ b/dicom.el
@@ -554,7 +554,7 @@ REUSE can be a buffer name to reuse."
 ;;;###autoload
 (progn
   (defun dicom--magic-p ()
-    (and (> (point-max) 133) (equal "DICM" (buffer-substring 129 133))))
+    (save-excursion (goto-char 129) (looking-at-p "DICM")))
   (add-to-list 'magic-mode-alist '(dicom--magic-p . dicom-auto-mode))
   (add-to-list 'auto-mode-alist '("\\.\\(?:dcm\\|ima\\)\\'" . dicom-auto-mode))
   (add-to-list 'auto-mode-alist '("DICOMDIR" . dicom-auto-mode)))

Reply via email to