Skip to content

Commit 11a0c5d

Browse files
committed
Merge pull request #1075 from gracjan/pr-inline-jump-loc
Inline haskell-mode-jump-to-loc
2 parents 6c9d845 + cefd979 commit 11a0c5d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

haskell-commands.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,12 @@ Returns:
454454
"Either jump to or echo a generic location LOC.
455455
Either a file or a library."
456456
(cl-case (car loc)
457-
(file (haskell-mode-jump-to-loc (cdr loc)))
457+
(file (progn
458+
(find-file (elt loc 1))
459+
(goto-char (point-min))
460+
(forward-line (1- (elt loc 2)))
461+
(goto-char (+ (line-beginning-position)
462+
(1- (elt loc 3))))))
458463
(library (message "Defined in `%s' (%s)."
459464
(elt loc 2)
460465
(elt loc 1)))

haskell-mode.el

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,15 +863,6 @@ To be added to `flymake-init-create-temp-buffer-copy'."
863863
"Function that will be called before buffer's saving."
864864
)
865865

866-
(defun haskell-mode-jump-to-loc (loc)
867-
"Jump to the given location.
868-
LOC = (list FILE LINE COL)"
869-
(find-file (elt loc 0))
870-
(goto-char (point-min))
871-
(forward-line (1- (elt loc 1)))
872-
(goto-char (+ (line-beginning-position)
873-
(1- (elt loc 2)))))
874-
875866
;; From Bryan O'Sullivan's blog:
876867
;; http://www.serpentine.com/blog/2007/10/09/using-emacs-to-insert-scc-annotations-in-haskell-code/
877868
(defun haskell-mode-try-insert-scc-at-point ()

0 commit comments

Comments
 (0)