From b365aac2597868f9fbcfe83e6d05244614d3738e Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Mon, 22 Nov 2021 01:26:01 +0530 Subject: [PATCH] [compile/org] preserve column --- init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index 8bc8e7b..38343eb 100644 --- a/init.org +++ b/init.org @@ -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)