From 2689ece0045ef99a3c22016d10046f885e232b7d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 13 Aug 2014 16:24:58 +0900 Subject: [PATCH] emacs: do not enable view-mode for diff-mode when visiting files --- emacs.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 6cee9af..729a7d2 100644 --- a/emacs.el +++ b/emacs.el @@ -914,8 +914,9 @@ found, otherwise returns nil." (setq diff-switches "-u") (add-hook 'diff-mode-hook (lambda () - (when (eq major-mode - 'diff-mode) + (when (and (eq major-mode + 'diff-mode) + (not buffer-file-name)) ;; do not pass when major-mode is derived mode of diff-mode (view-mode 1)) (set-face-attribute 'diff-header nil