Skip to content

Commit 28a7da4

Browse files
authored
Merge pull request #7 from purcell/shorter-name
Use shorter command name
2 parents 175fe2e + 1a0518e commit 28a7da4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ P.S. Inspired by [Visual Studio Code](https://code.visualstudio.com/) goto line
2121
## Usage ##
2222
Call it from `minibuffer` directly,
2323
```
24-
M-x goto-line-preview-goto-line
24+
M-x goto-line-preview
2525
```
2626
Or you can just bind to any key you want.
2727
```el
28-
(define-key global-map (kbd "M-g") #'goto-line-preview-goto-line)
28+
(define-key global-map (kbd "M-g") #'goto-line-preview)
2929
```
3030

3131

goto-line-preview.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ LINE-NUM : Target line number to navigate to."
7373

7474

7575
;;;###autoload
76-
(defun goto-line-preview-goto-line ()
76+
(defun goto-line-preview ()
7777
"Preview goto line.
7878
LINE-NUM : Target line number to navigate to."
7979
(interactive)
@@ -87,10 +87,12 @@ LINE-NUM : Target line number to navigate to."
8787
(unless jumped
8888
(set-window-point window window-point)))))
8989

90+
;;;###autoload
91+
(define-obsolete-function-alias 'goto-line-preview-goto-line 'goto-line-preview)
9092

9193
(defun goto-line-preview-minibuffer-setup ()
9294
"Locally set up preview hooks for this minibuffer command."
93-
(when (eq 'goto-line-preview-goto-line this-command)
95+
(when (memq this-command '(goto-line-preview goto-line-preview-goto-line))
9496
(add-hook 'post-command-hook
9597
#'goto-line-preview-do-preview nil t)))
9698

0 commit comments

Comments
 (0)