Yes, I think there could be arguments for different behaviors, but I suspect 
the expected behavior should be the same as when you select the link by other 
methods, such as starting a region at one end and then jumping to the beginning 
or end of the line with move-beginning-of-line or move-end-of-line. When 
killing the line or region after that movement, the entire text (URL, 
description, all brackets) is killed.

Also, when emphasis markers are hidden (org-hide-emphasis-markers t), and the 
same experiment is performed on a word at the beginning of a line that is 
emphasized , for example "/italicized/", all of the hidden slash characters are 
successfully killed. So I think that is another indication that the expected 
behavior would be to kill all of the characters, hidden or not. 

I think the fact that it is only some, perhaps underused, methods of selecting 
the text--arrow keys or mouse-dragging--that result in this unusual behavior, 
also points to the behavior not being intended.

On Wed, Apr 12, 2023, at 3:53 AM, Ihor Radchenko wrote:
> "Miguel Garza" <miguelga...@fastmail.com> writes:
> 
> > [[www.google.com][link]]
> >
> > Org Mode will turn the above text into a clickable link called "link".
> >
> > Now, select the link either by clicking and dragging the mouse from the end 
> > of the word "link" to the beginning of the word, or by starting a region at 
> > either the beginning or end of the word (or on the next line) and then 
> > using the arrow keys to move point to either the "l" or "k" in "link".
> >
> > Your region should now encompass "link" and nothing else.
> >
> > Now, kill the line or region.
> >
> > You will see immediately that the full text was not killed. Instead, the 
> > link description is killed, along with, depending on where point was, 
> > possibly some of the brackets, leaving behind the opening brackets, the 
> > link URL, the URL closing bracket, and in some cases the final two brackets.
> 
> Well. Part of the link text is indeed hidden, causing all kinds of
> unexpected behaviours depending on the point move direction.
> I am not sure what can be done here. I am not even sure what is the
> expected behaviour.
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
> 

Reply via email to