[compile/org] preserve column

This commit is contained in:
contrapunctus 2021-11-22 01:26:01 +05:30
parent 6623a59e04
commit b365aac259
1 changed files with 2 additions and 1 deletions

View File

@ -3821,6 +3821,7 @@ Potentially useful - https://www.draketo.de/software/emacs-javascript.html
(let (buffer position column tangled-file-p)
(save-window-excursion
(funcall oldfn)
(setq column (- (point) (point-at-bol)))
;; `compile-goto-error' might be called from the output of
;; `literate-elisp-byte-compile-file', which means
;; `org-babel-tangle-jump-to-org' would error
@ -3835,7 +3836,7 @@ Potentially useful - https://www.draketo.de/software/emacs-javascript.html
(if (window-live-p org-window)
(select-window org-window)
(switch-to-buffer buffer))
(goto-char position))
(goto-char (+ position column)))
(funcall oldfn))))
(advice-add 'compile-goto-error :around #'my-org-lp-goto-error)