about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ennum.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/ennum.el b/ennum.el
index 522ac2d..e7ee9f0 100644
--- a/ennum.el
+++ b/ennum.el
@@ -141,6 +141,13 @@ to delete. If the store path is relative, it is interpreted
 relative to `:working-directory'. Defaults to \".ennum\"."
   :group 'ennum)
 
+(defvar ennum-inhibit-file-name-handlers
+  '(openwith-file-handler)
+  "List of file name handlers that should be disabled.
+
+List of file name handlers that should be temporarily disabled
+when ennum builds its output.")
+
 (defmacro ennum-with-file-contents (file &rest body)
   "Create a temporary buffer, insert contents of FILE into that
 buffer and evaluate BODY. The value returned is the value of the
@@ -209,7 +216,11 @@ respectively by - and _, and the pad character = is optional."
   (with-temp-buffer
     ;; TODO: Use ennum-with-file-contents
     (set-buffer-multibyte nil)
-    (insert-file-contents-literally file)
+    (let ((inhibit-file-name-operation 'insert-file-contents)
+          (inhibit-file-name-handlers
+           (append ennum-inhibit-file-name-handlers
+                   inhibit-file-name-handlers)))
+      (insert-file-contents-literally file))
     (insert file)
     (ennum--hash)))