I want to advise
org-edit-special so that a function runs before Emacs enters
org-src-mode. I am not particularly tied to
org-edit-special. If there is a hook like
org-src-mode-hook (but that triggers before
org-src-mode runs, that would be perfect.
So I have the following code:
#+BEGIN_SRC emacs-lisp (defun my-function () (message "bingo!")) (add-function :before (org-edit-special) #'(lambda () (my-function))) #+END_SRC
C-c C-c this block, I get
user-error: No special environment to edit here. Can you see the mistake?