is there a way to keep only source code inside source code, that is make #+BEGIN_SRC and #+END_SRC invisible? It's cosmetic but it makes things clearer when one have to deal with a lot of short code snippets. For exemple:
(defun org-xor (a b)
"Exclusive or."
(if a (not b) b))
instead of :
#+BEGIN_SRC emacs-lisp
(defun org-xor (a b)
"Exclusive or."
(if a (not b) b))
#+END_SRC
(save-excursion (goto-char (point-max)) (while (re-search-backward "#\\+BEGIN_SRC\\|#\\+END_SRC" nil t) (let ((ov (make-overlay (line-beginning-position) (1+ (line-end-position))))) (overlay-put ov 'invisible t))))
To unhide everything, use(remove-overlays)
. Further work needs to be done for individual entries, and removing only select overlays (instead of all overlays), but that is the general idea.