(defun mytemp-file-handler (operation &rest args) "Bug test. Fall back to default handler." (let ((inhibit-file-name-handlers (cons 'mytemp-file-handler (and (eq inhibit-file-name-operation operation) inhibit-file-name-handlers))) (inhibit-file-name-operation operation)) (apply operation args))) (put 'mytemp-file-handler 'operation '(insert-file-contents)) (defun mytemp-enable-handler () (interactive) (add-to-list 'file-name-handler-alist (cons "\\.[a-z]+\\'" 'mytemp-file-handler) t)) (defun mytemp-disable-handler () (interactive) (setq file-name-handler-alist (delete (cons "\\.[a-z]+\\'" 'mytemp-file-handler) file-name-handler-alist)))