From c299a046a8d66fd8c4273320af2ae6aded1da67f Mon Sep 17 00:00:00 2001 From: yuhan0 Date: Wed, 2 Jan 2019 20:29:46 +0800 Subject: [PATCH] Tidy: remove orphan function outshine-toggle-subtree-comment-status Also resolves the byte-compiling errors about looking-back called with too few arguments. --- outshine.el | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/outshine.el b/outshine.el index 930dd9e..25e7e55 100644 --- a/outshine.el +++ b/outshine.el @@ -1855,47 +1855,6 @@ With a numeric prefix ARG, show all headlines up to that level." (save-excursion (insert (concat " :" outshine-comment-tag ":")))) -(defun outshine-toggle-subtree-comment-status (&optional arg) - "Tag (or untag) subtree at point with `outshine-comment-tag'. - -Unless point is on a heading, this function acts on the previous -visible heading when ARG is non-nil, otherwise on the previous -heading." - (interactive "P") - (let* ((com-end-p - (and - outshine-normalized-comment-end - (> (length outshine-normalized-comment-end) 0))) - (comtag (concat ":" outshine-comment-tag ":")) - (comtag-rgxp - (if com-end-p - (concat comtag - " *" - (regexp-quote - outshine-normalized-comment-end) - " *") - (concat comtag " *")))) - (unless (outline-on-heading-p) - (if arg - (outline-previous-visible-heading 1) - (outline-previous-heading))) - (end-of-line) - (cond - ((looking-back comtag-rgxp) - (let ((start (match-beginning 0))) - (delete-region (1- start) (+ start (length comtag))))) - ((and com-end-p - (looking-back - (concat - (regexp-quote outshine-normalized-comment-end) " *"))) - (goto-char (match-beginning 0)) - (if (looking-back " ") - (insert (concat comtag " ")) - (insert (concat " " comtag)))) - (t (if (looking-back " ") - (insert comtag) - (insert (concat " " comtag))))))) - ;; Cycle comment subtrees anyway (defun outshine-force-cycle-comment () "Cycle subtree even if it comment."