There is a way to link to a specific link of code in org babel src block. with org-store-link.

Here is an example:

 ;;; This is comment | line. |
 (describe-char | (point)) ; | comment |
 (message | "hello, world") |

NOTE: The vertical bar (|) is the point positions. I need a way to auto detect current position, whether it is in comment area. If yes, then don't add comment char. If no, then auto add comment char like at the third line.

An advice for elisp or some way else.

1 Answer 1

;;; auto prefix with comment char when create code ref in src block with
;;; `org-store-link'.
(advice-add 'org-store-link :before #'comment-dwim)
  • This advice seems can work in most cases, but currently not work in ob-clojure src block. weird. Commented Apr 30, 2017 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.