Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumerate reference link text when using markdown-insert-link #421

Closed
mitchellroe opened this issue Nov 20, 2019 · 1 comment
Closed

Enumerate reference link text when using markdown-insert-link #421

mitchellroe opened this issue Nov 20, 2019 · 1 comment

Comments

@mitchellroe
Copy link

When adding an implicit reference link via markdown-insert-link, the existing reference link names should be enumerated when entering the text.

Expected Behavior

Let's say my file looks like this (where the | is the cursor):

Here's another [website](http://foo.example.org).

See my | for more details.

[homepage]: https://www.example.org/homepage.html
  1. Hit C-c C-l or M-x markdown-insert-link.
  2. I am prompted for URL or [reference]:. I hit Tab and am offered a list of completions, which contains the following:
    1. [homepage]
    2. http://foo.example.org
    3. https://www.example.org/homepage.html
  3. I leave the prompt blank and hit Enter.
  4. I am prompted for Link text:. I hit Tab and am offered only one completion, homepage.
  5. I type hom, hit Tab, and homepage is filled for me.
  6. I hit Enter, and my file now looks like this:
Here's another [website](http://foo.example.org).

See my [homepage][]| for more details.

[homepage]: https://www.example.org/homepage.html

Actual Behavior

Starting with the same file as above:

Here's another [website](http://foo.example.org).

See my | for more details.

[homepage]: https://www.example.org/homepage.html
  1. Hit C-c C-l or M-x markdown-insert-link.
  2. I am prompted for URL or [reference]:. I hit Tab and am offered a list of completions, which contains the following:
    1. [homepage]
    2. http://foo.example.org
    3. https://www.example.org/homepage.html
  3. I leave the prompt blank and hit Enter.
  4. I am prompted for Link text:. I hit Tab.
  5. A Tab character is inserted in the minibuffer.

Steps to Reproduce

I guess I got ahead of myself. See the Actual Behavior section.

Backtrace

No error is produced.

Software Versions

  • Markdown Mode: markdown-mode, version 2.4-dev
  • Emacs: GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-07-31
  • OS: CentOS Linux release 7.7.1908
@syohex
Copy link
Collaborator

syohex commented Apr 21, 2020

I have merged #447

@syohex syohex closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants