Skip to content

Commit 7811fc5

Browse files
committed
org-compat: Fix incorrect usage of `apply' in ea66579
* lisp/org-compat.el: (outline-next-visible-heading): (outline-back-to-heading): (outline-on-heading-p): (outline-hide-sublevels): (outline-toggle-children): Use `funcall' instead of `apply'. The former does not expect the last argument to be a list of arguments.
1 parent e81a094 commit 7811fc5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lisp/org-compat.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,13 +1463,13 @@ key."
14631463
"Run `org-fold-region' when in org-mode."
14641464
(if (derived-mode-p 'org-mode)
14651465
(org-fold-region (max from (point-min)) (min to (point-max)) flag 'headline)
1466-
(apply oldfun from to flag)))
1466+
(funcall oldfun from to flag)))
14671467

14681468
(define-advice outline-next-visible-heading (:around (oldfun arg) fix-for-org-fold)
14691469
"Run `org-next-visible-heading' when in org-mode."
14701470
(if (derived-mode-p 'org-mode)
14711471
(org-next-visible-heading arg)
1472-
(apply oldfun arg)))
1472+
(funcall oldfun arg)))
14731473

14741474
(define-advice outline-back-to-heading (:around (oldfun &optional invisible-ok) fix-for-org-fold)
14751475
"Run `org-back-to-heading' when in org-mode."
@@ -1487,19 +1487,19 @@ key."
14871487
(point)))))
14881488
(goto-char found)
14891489
found)))
1490-
(apply oldfun invisible-ok)))
1490+
(funcall oldfun invisible-ok)))
14911491

14921492
(define-advice outline-on-heading-p (:around (oldfun &optional invisible-ok) fix-for-org-fold)
14931493
"Run `org-at-heading-p' when in org-mode."
14941494
(if (derived-mode-p 'org-mode)
14951495
(org-at-heading-p (not invisible-ok))
1496-
(apply oldfun invisible-ok)))
1496+
(funcall oldfun invisible-ok)))
14971497

14981498
(define-advice outline-hide-sublevels (:around (oldfun levels) fix-for-org-fold)
14991499
"Run `org-fold-hide-sublevels' when in org-mode."
15001500
(if (derived-mode-p 'org-mode)
15011501
(org-fold-hide-sublevels levels)
1502-
(apply oldfun levels)))
1502+
(funcall oldfun levels)))
15031503

15041504
(define-advice outline-toggle-children (:around (oldfun) fix-for-org-fold)
15051505
"Run `org-fold-hide-sublevels' when in org-mode."
@@ -1510,7 +1510,7 @@ key."
15101510
(org-fold-hide-subtree)
15111511
(org-fold-show-children)
15121512
(org-fold-show-entry 'hide-drawers)))
1513-
(apply oldfun)))
1513+
(funcall oldfun)))
15141514

15151515
;; TODO: outline-headers-as-kill
15161516

0 commit comments

Comments
 (0)