diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-10-19 20:08:09 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-10-19 20:08:09 +0200 |
commit | fe4c6a852901ae5f00d320e214ce8ffefd301e7f (patch) | |
tree | 09497418a5f902cfe97c11f627279b50dea80225 | |
parent | fce3e7395bd23ed5e24794b7d65d073e2b6a3811 (diff) | |
download | org-mode-fe4c6a852901ae5f00d320e214ce8ffefd301e7f.tar.gz |
Fix S-TAB when called on a block
* lisp/org.el (org-cycle): Call `org-hide-block-toggle-maybe' after
universal argument check. Also remove the function from
`org-tab-first-hook' to that effect.
-rw-r--r-- | lisp/org.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/org.el b/lisp/org.el index 992b277..0108c68 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6917,10 +6917,6 @@ if the variable `org-cycle-global-at-bob' is t." org-cycle-hook)) (pos (point))) - (when (or bob-special (equal arg '(4))) - ;; special case: use global cycling - (setq arg t)) - (cond ((equal arg '(16)) @@ -6932,6 +6928,11 @@ if the variable `org-cycle-global-at-bob' is t." (outline-show-all) (org-unlogged-message "Entire buffer visible, including drawers")) + ((equal arg '(4)) (org-cycle-internal-global)) + + ;; Try hiding block at point. + ((org-hide-block-toggle-maybe)) + ;; Try cdlatex TAB completion ((org-try-cdlatex-tab)) @@ -6944,11 +6945,10 @@ Use `\\[org-edit-special]' to edit table.el tables")) (org-table-justify-field-maybe) (call-interactively 'org-table-next-field)))) - ((run-hook-with-args-until-success - 'org-tab-after-check-for-table-hook)) + ((run-hook-with-args-until-success 'org-tab-after-check-for-table-hook)) ;; Global cycling: delegate to `org-cycle-internal-global'. - ((eq arg t) (org-cycle-internal-global)) + (bob-special (org-cycle-internal-global)) ;; Drawers: delegate to `org-flag-drawer'. ((save-excursion @@ -7556,8 +7556,6 @@ a block. Return a non-nil value when toggling is successful." (when (eq (overlay-get ov 'invisible) 'org-hide-block) (delete-overlay ov)))))))) -;; org-tab-after-check-for-cycling-hook -(add-hook 'org-tab-first-hook 'org-hide-block-toggle-maybe) ;; Remove overlays when changing major mode (add-hook 'org-mode-hook (lambda () (add-hook 'change-major-mode-hook |