summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2016-07-15 10:04:14 +0200
committerrekado <rekado@elephly.net>2016-07-15 10:04:14 +0200
commit8aadcdb5c7b11e2a051e80632a57b553286448ad (patch)
tree20e1d9af622bd771aa8e9f8d34140239f82c0f38 /init.org
parent305132b25eb60da67dbc27223d63d5a4588b63e0 (diff)
Expand collapsed org src block arguments at point.
Diffstat (limited to 'init.org')
-rw-r--r--init.org28
1 files changed, 16 insertions, 12 deletions
diff --git a/init.org b/init.org
index 5cd315c..f81a0ae 100644
--- a/init.org
+++ b/init.org
@@ -324,7 +324,11 @@ from [[https://pank.eu/blog/pretty-babel-src-blocks.html][the blog of Rasmus Pan
(setq prettify-symbols--keywords (prettify-symbols--make-keywords))
(font-lock-add-keywords nil prettify-symbols--keywords)
(while (re-search-forward re nil t)
- (font-lock-flush (line-beginning-position) (line-end-position))))))
+ (font-lock-flush (line-beginning-position) (line-end-position)))
+ ;; Toggle prettify-symbols-mode to restore composition of
+ ;; regions on which the "composition" text-property was deleted.
+ (prettify-symbols-mode -1)
+ (prettify-symbols-mode +1))))
(defun rasmus/org-prettify-src ()
"Hide src options via `prettify-symbols-mode'.
@@ -336,17 +340,17 @@ may not be efficient."
(beginning-of-line)
(looking-at my/org-src-begin-regexp))))
;; Test if we moved out of a block.
- (when (or (and rasmus/org-at-src-begin
- (not at-src-block))
- ;; File was just opened.
- (eq rasmus/org-at-src-begin -1))
- (rasmus/org-prettify-src--update))
- ;; Remove composition if at line; doesn't work properly.
- ;; (when at-src-block
- ;; (with-silent-modifications
- ;; (remove-text-properties (match-end 0)
- ;; (1+ (line-end-position))
- ;; '(composition))))
+ (cond ((or (and rasmus/org-at-src-begin
+ (not at-src-block))
+ ;; File was just opened.
+ (eq rasmus/org-at-src-begin -1))
+ (rasmus/org-prettify-src--update))
+ ;; Remove composition if at line
+ (at-src-block
+ (with-silent-modifications
+ (remove-text-properties (match-end 0)
+ (1+ (line-end-position))
+ '(composition)))))
(setq rasmus/org-at-src-begin at-src-block)))
(defun rasmus/org-prettify-symbols ()