From 41c23f3ccbc86669dff1ea69d53b7b54a1cbdffc Mon Sep 17 00:00:00 2001 From: Daniel Bergey Date: Fri, 5 Feb 2016 13:48:01 -0500 Subject: [PATCH 1/2] run stylish-haskell before save --- haskell-mode.el | 3 ++- haskell.el | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/haskell-mode.el b/haskell-mode.el index 62fabad2a..2b96f49dd 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -872,7 +872,8 @@ To be added to `flymake-init-create-temp-buffer-copy'." (defun haskell-mode-before-save-handler () "Function that will be called before buffer's saving." - ) + (when haskell-stylish-on-save + (ignore-errors (haskell-mode-stylish-buffer)))) ;; From Bryan O'Sullivan's blog: ;; http://www.serpentine.com/blog/2007/10/09/using-emacs-to-insert-scc-annotations-in-haskell-code/ diff --git a/haskell.el b/haskell.el index 8995d97a1..7ada2ee25 100644 --- a/haskell.el +++ b/haskell.el @@ -381,8 +381,6 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (when haskell-tags-on-save (ignore-errors (when (and (boundp 'haskell-session) haskell-session) (haskell-process-generate-tags)))) - (when haskell-stylish-on-save - (ignore-errors (haskell-mode-stylish-buffer)) (let ((before-save-hook '()) (after-save-hook '())) (basic-save-buffer)))) From df528b8e39fba2138f66dd302165a0c86ff00b2f Mon Sep 17 00:00:00 2001 From: Daniel Bergey Date: Fri, 5 Feb 2016 13:50:25 -0500 Subject: [PATCH 2/2] Remove save-hook suppression closes #1074 --- haskell.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/haskell.el b/haskell.el index 7ada2ee25..a454c54d6 100644 --- a/haskell.el +++ b/haskell.el @@ -380,10 +380,7 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." "Function that will be called after buffer's saving." (when haskell-tags-on-save (ignore-errors (when (and (boundp 'haskell-session) haskell-session) - (haskell-process-generate-tags)))) - (let ((before-save-hook '()) - (after-save-hook '())) - (basic-save-buffer)))) + (haskell-process-generate-tags))))) ;;;###autoload (defun haskell-mode-tag-find (&optional _next-p)