From ed23fa740151cd15c27ad56d8cef5fc84b63d003 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 22 Dec 2017 22:55:31 +0000 Subject: Remove commands that are already defined in Emacs Great suggestion from @narendraj9 in #24. --- helpful.el | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/helpful.el b/helpful.el index 2ca0be8..b54f9e2 100644 --- a/helpful.el +++ b/helpful.el @@ -1365,37 +1365,6 @@ See also `helpful-callable' and `helpful-variable'." (widen)) (goto-char pos)))) -(defun helpful--forward-button (direction) - "Move point the next/previous button." - (let ((step (if (< direction 0) -1 1))) - ;; Step over the current button, if any. - (while (and - (not (if (< direction 0) (bobp) (eobp))) - (get-text-property (point) 'button)) - (forward-char step)) - ;; Move forward until we hit a button. - (while (and - (not (if (< direction 0) (bobp) (eobp))) - (not (get-text-property (point) 'button))) - (forward-char step)) - ;; Ensure we're on the first char of the button. - (while (and - (not (if (< direction 0) (bobp) (eobp))) - (get-text-property (point) 'button)) - (forward-char -1)) - (unless (bobp) - (forward-char 1)))) - -(defun helpful-forward-button () - "Move point forward to the next button." - (interactive) - (helpful--forward-button 1)) - -(defun helpful-backward-button () - "Move point backward to the next button." - (interactive) - (helpful--forward-button -1)) - (defun helpful-kill-buffers () "Kill all `helpful-mode' buffers. @@ -1408,8 +1377,8 @@ See also `helpful-max-buffers'." (define-key helpful-mode-map (kbd "g") #'helpful-update) (define-key helpful-mode-map (kbd "RET") #'helpful-visit-reference) -(define-key helpful-mode-map (kbd "TAB") #'helpful-forward-button) -(define-key helpful-mode-map (kbd "") #'helpful-backward-button) +(define-key helpful-mode-map (kbd "TAB") #'forward-button) +(define-key helpful-mode-map (kbd "") #'backward-button) (provide 'helpful) ;;; helpful.el ends here -- cgit v1.0