emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-mode 19922b81ed 14/24: Fix code based on suggestio


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-mode 19922b81ed 14/24: Fix code based on suggestions
Date: Tue, 1 Nov 2022 22:58:52 -0400 (EDT)

branch: elpa/haskell-mode
commit 19922b81ed6eb2f46637d7f3b17f5ee8035c4b0f
Author: Tikhon Jelvis <tikhon@jelv.is>
Commit: Tikhon Jelvis <tikhon@jelv.is>

    Fix code based on suggestions
    
    (beginning-of-buffer) → (goto-char (point-min))
    
    haskell-mode-add-language-pragma → haskell-command-insert-language-pragma
---
 haskell-commands.el         | 4 ++--
 tests/haskell-mode-tests.el | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/haskell-commands.el b/haskell-commands.el
index 89f02e5991..c916e26489 100644
--- a/haskell-commands.el
+++ b/haskell-commands.el
@@ -936,13 +936,13 @@ newlines and extra whitespace in signature before 
insertion."
         (insert sig "\n")
         (indent-to col)))))
 
-(defun haskell-mode-add-language-pragma (extension)
+(defun haskell-command-insert-language-pragma (extension)
   "Insert a {-# LANGUAGE _ #-} pragma at the top of the current
 buffer for the given extension."
   (interactive
    (list (completing-read "Extension: " haskell-ghc-supported-extensions)))
   (save-excursion
-    (beginning-of-buffer)
+    (goto-char (point-min))
     (insert (format "{-# LANGUAGE %s #-}\n" extension))))
 
 (provide 'haskell-commands)
diff --git a/tests/haskell-mode-tests.el b/tests/haskell-mode-tests.el
index e6c9264f36..47b8d8a133 100644
--- a/tests/haskell-mode-tests.el
+++ b/tests/haskell-mode-tests.el
@@ -671,7 +671,7 @@ moves over sexps."
     (haskell-mode)
     (insert "module Main where\n")
     (end-of-buffer)
-    (haskell-mode-add-language-pragma "ViewPatterns")
+    (haskell-command-insert-language-pragma "ViewPatterns")
     (should (string= (buffer-string)
                      "{-# LANGUAGE ViewPatterns #-}\nmodule Main where\n"))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]