[compile/org] extend docstring

This commit is contained in:
contrapunctus 2021-11-22 18:31:09 +05:30
parent 19129eae62
commit 50014f4b99
1 changed files with 8 additions and 4 deletions

View File

@ -3816,11 +3816,15 @@ Potentially useful - https://www.draketo.de/software/emacs-javascript.html
#+BEGIN_SRC emacs-lisp
(defun my-org-lp-goto-error (oldfn &optional prefix &rest args)
"Make `compile-goto-error' lead to an Org literate program."
"Make `compile-goto-error' lead to an Org literate program, if present.
This is meant to be used as `:around' advice for `compile-goto-error'.
OLDFN is `compile-goto-error'.
With PREFIX arg, just run `compile-goto-error' as though unadvised.
ARGS are ignored."
(interactive "P")
(if prefix
(funcall oldfn)
(let (buffer position column tangled-file-p)
(let (buffer position column tangled-file-exists-p)
(save-window-excursion
(funcall oldfn)
(setq column (- (point) (point-at-bol)))
@ -3830,9 +3834,9 @@ Potentially useful - https://www.draketo.de/software/emacs-javascript.html
(when (ignore-errors (org-babel-tangle-jump-to-org))
(setq buffer (current-buffer)
position (point)
tangled-file-p t)))
tangled-file-exists-p t)))
;; back to where we started - the `compilation-mode' buffer
(if tangled-file-p
(if tangled-file-exists-p
(let ((org-window (get-buffer-window buffer)))
;; if the Org buffer is visible, switch to its window
(if (window-live-p org-window)