* [RFC, mini] org-mark-element-parent
@ 2017-05-29 23:00 Marco Wahl
2017-05-30 7:01 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Marco Wahl @ 2017-05-29 23:00 UTC (permalink / raw)
To: emacs-orgmode
Hi Orgers,
is the following function worthy to occupy space in Orgmode?
#v+
(defun org-mark-element-parent ()
"Put point at beginning of the parent element, mark at end."
(interactive)
(let ((parent (org-element-property :parent (org-element-at-point))))
(when parent
(push-mark (org-element-property :end parent) t t)
(goto-char (org-element-property :begin parent)))))
#v-
Can be used to e.g.
- mark a table or
- a plain list
Best regards
Marco
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC, mini] org-mark-element-parent
2017-05-29 23:00 [RFC, mini] org-mark-element-parent Marco Wahl
@ 2017-05-30 7:01 ` Nicolas Goaziou
2017-05-30 7:51 ` Marco Wahl
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-05-30 7:01 UTC (permalink / raw)
To: Marco Wahl; +Cc: emacs-orgmode
Hello,
Marco Wahl <marcowahlsoft@gmail.com> writes:
> is the following function worthy to occupy space in Orgmode?
>
> #v+
> (defun org-mark-element-parent ()
> "Put point at beginning of the parent element, mark at end."
> (interactive)
> (let ((parent (org-element-property :parent (org-element-at-point))))
> (when parent
> (push-mark (org-element-property :end parent) t t)
> (goto-char (org-element-property :begin parent)))))
> #v-
>
> Can be used to e.g.
> - mark a table or
> - a plain list
There is already a binding to move to the beginning of the parent
element (C-c C-^, IIRC).
IMO, this is not only marginally useful. Also, it doesn't handle
headlines.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC, mini] org-mark-element-parent
2017-05-30 7:01 ` Nicolas Goaziou
@ 2017-05-30 7:51 ` Marco Wahl
0 siblings, 0 replies; 3+ messages in thread
From: Marco Wahl @ 2017-05-30 7:51 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Nicolas Goaziou
Hi!
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>> is the following function worthy to occupy space in Orgmode?
>>
>> #v+
>> (defun org-mark-element-parent ()
>> "Put point at beginning of the parent element, mark at end."
>> (interactive)
>> (let ((parent (org-element-property :parent (org-element-at-point))))
>> (when parent
>> (push-mark (org-element-property :end parent) t t)
>> (goto-char (org-element-property :begin parent)))))
>> #v-
>>
>> Can be used to e.g.
>> - mark a table or
>> - a plain list
>
> There is already a binding to move to the beginning of the parent
> element (C-c C-^, IIRC).
Nice!
How could I overlook `org-up-element'? `org-up-element' together with
org-mark-element (M-h) is my key combination of the day!
> IMO, this is not only marginally useful. Also, it doesn't handle
> headlines.
Let's commit that little RFC to the stream of oblivion.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-30 7:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-29 23:00 [RFC, mini] org-mark-element-parent Marco Wahl
2017-05-30 7:01 ` Nicolas Goaziou
2017-05-30 7:51 ` Marco Wahl
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.