Skip to content

Instantly share code, notes, and snippets.

@Philonous
Created May 26, 2014 17:37
Show Gist options
  • Select an option

  • Save Philonous/8db4eb9fdcd8198f7045 to your computer and use it in GitHub Desktop.

Select an option

Save Philonous/8db4eb9fdcd8198f7045 to your computer and use it in GitHub Desktop.
haskell-qualify-import-line
(defun haskell-qualify-import-line (&optional no-toggle)
"Toggle \"qualified\" modifier of current import line"
(interactive "P")
(require 'haskell-align-imports)
(save-excursion
(beginning-of-line)
(cond
((looking-at "import qualified\\([ ]?\\)[ ]*")
(unless no-toggle
(replace-match "import\\1")
(haskell-align-imports)))
((looking-at "import\\([ ]?\\)[ ]*")
(replace-match "import qualified\\1")
(haskell-align-imports))
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment