Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ol.el: Always prompt for description in `org-insert-link'
* lisp/ol.el (org-insert-link): Do not bypass code trying to generated description and prompt user when link path and description are identical. Make behavior of description prompt more consistent. Remove confusing `auto-desc' local variable. Originally the variable was added with implementation of completion of stored link target by the description in the commit 1e34c5d Bastien Guerry, "org.el: Fontify links to current buffer when inserting a link", 2012-08-03 14:08:20 +0200. The feature was broken soon by the commit 7f096ad Tony Day, "org-insert-link: Use ido when inserting links", 2012-10-12 14:39:53 +1100. Last decade users were not asked to edit description in the case of the same link target and description (a remained side effect of 1e34c5d). Recent commit 0432f4f Max Nikulin, "ol.el: Restore complete by description for insert link", 2022-09-10 17:23:13 +0700 restored completion by description. Due to the commit 4fc2c8d Ihor Radchenko, "org-store-link: Default to empty description for target/custom-id links", 2022-08-10 13:25:26 +0800 description identical to link path became a more rare case. An alternative would be fixing condition to allow users to edit description when it is the same as the path, but use stored description without additional interaction when the link is chosen by description completion. Despite it was likely the original intention, always asking the user to confirm or edit description may be more consistent behavior.
- Loading branch information