Re: Custom function for killing the thing at point

2021-08-14 Thread Ihor Radchenko
John Kitchin writes: > alternatively, fall back to org-mark-element. I am not sure what > differences in what you are trying to achieve and this are, but this should > cover all org elements: Sounds more reasonable as a default. (org-mark-element) will mark everything including affiliated keywor

Re: Custom function for killing the thing at point

2021-08-14 Thread John Kitchin
alternatively, fall back to org-mark-element. I am not sure what differences in what you are trying to achieve and this are, but this should cover all org elements: (defun org-kill-element () (interactive) (org-mark-element) (call-interactively #'kill-region)) John

Re: Custom function for killing the thing at point

2021-08-13 Thread Ihor Radchenko
Rodrigo Morales writes: > (t >(error "The element at point couldn't be copied."))) I would fall back to region between :begin and :end of the element. Also, it might be helpful to print a short message about what element have just been copied. Best, Ihor

Re: Custom function for killing the thing at point

2021-08-13 Thread Juan Manuel MacĂ­as
Hi Rodrigo, Thanks for sharing, it seems interesting and useful. But I think this function is missing in your post: `my/kill-new'. Best regards, Juan Manuel Rodrigo Morales writes: > I just created this function for copying the thing under the cursor (it > works for some #+BEGIN blocks and li

Custom function for killing the thing at point

2021-08-13 Thread Rodrigo Morales
I just created this function for copying the thing under the cursor (it works for some #+BEGIN blocks and links). I think it would be useful for others, so I'm creating this post for getting feedback on the Elisp code and sharing it to those interested. #+BEGIN_SRC elisp (defun my/org-kill-thing