diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2017-12-22 22:55:31 +0000 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2017-12-22 22:56:09 +0000 |
| commit | ed23fa740151cd15c27ad56d8cef5fc84b63d003 (patch) | |
| tree | d474188394355ceb08404ae5c3e6af0c96d6b059 | |
| parent | 35242796b7223dfdd174e5c80722ff3f70e91e5e (diff) | |
Remove commands that are already defined in Emacs
Great suggestion from @narendraj9 in #24.
| -rw-r--r-- | helpful.el | 35 |
1 files changed, 2 insertions, 33 deletions
@@ -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 "<backtab>") #'helpful-backward-button) +(define-key helpful-mode-map (kbd "TAB") #'forward-button) +(define-key helpful-mode-map (kbd "<backtab>") #'backward-button) (provide 'helpful) ;;; helpful.el ends here |
