瀏覽代碼

org-compat: Fix incorrect usage of `apply' in ea665792b

* 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.
Ihor Radchenko 2 年之前
父節點
當前提交
7811fc5925
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      lisp/org-compat.el

+ 6 - 6
lisp/org-compat.el

@@ -1463,13 +1463,13 @@ key."
   "Run `org-fold-region' when in org-mode."
   (if (derived-mode-p 'org-mode)
       (org-fold-region (max from (point-min)) (min to (point-max)) flag 'headline)
-    (apply oldfun from to flag)))
+    (funcall oldfun from to flag)))
 
 (define-advice outline-next-visible-heading (:around (oldfun arg) fix-for-org-fold)
   "Run `org-next-visible-heading' when in org-mode."
   (if (derived-mode-p 'org-mode)
       (org-next-visible-heading arg)
-    (apply oldfun arg)))
+    (funcall oldfun arg)))
 
 (define-advice outline-back-to-heading (:around (oldfun &optional invisible-ok) fix-for-org-fold)
   "Run `org-back-to-heading' when in org-mode."
@@ -1487,19 +1487,19 @@ key."
 			           (point)))))
 	      (goto-char found)
 	      found)))
-    (apply oldfun invisible-ok)))
+    (funcall oldfun invisible-ok)))
 
 (define-advice outline-on-heading-p (:around (oldfun &optional invisible-ok) fix-for-org-fold)
   "Run `org-at-heading-p' when in org-mode."
   (if (derived-mode-p 'org-mode)
       (org-at-heading-p (not invisible-ok))
-    (apply oldfun invisible-ok)))
+    (funcall oldfun invisible-ok)))
 
 (define-advice outline-hide-sublevels (:around (oldfun levels) fix-for-org-fold)
   "Run `org-fold-hide-sublevels' when in org-mode."
   (if (derived-mode-p 'org-mode)
       (org-fold-hide-sublevels levels)
-    (apply oldfun levels)))
+    (funcall oldfun levels)))
 
 (define-advice outline-toggle-children (:around (oldfun) fix-for-org-fold)
   "Run `org-fold-hide-sublevels' when in org-mode."
@@ -1510,7 +1510,7 @@ key."
             (org-fold-hide-subtree)
           (org-fold-show-children)
           (org-fold-show-entry 'hide-drawers)))
-    (apply oldfun)))
+    (funcall oldfun)))
 
 ;; TODO: outline-headers-as-kill