emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* killing all contents of a headline
@ 2013-02-19 11:01 42 147
  2013-02-19 11:13 ` Daimrod
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: 42 147 @ 2013-02-19 11:01 UTC (permalink / raw)
  To: emacs-orgmode


Title is self-explanatory. Is there a command that lets me place the
cursor on a headline and delete its contents (i.e., all of its text)?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 11:01 killing all contents of a headline 42 147
@ 2013-02-19 11:13 ` Daimrod
  2013-02-19 11:36 ` Marcel van der Boom
  2013-02-19 12:09 ` Bastien
  2 siblings, 0 replies; 10+ messages in thread
From: Daimrod @ 2013-02-19 11:13 UTC (permalink / raw)
  To: 42 147; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

42 147 <aeuster@gmail.com> writes:

> Title is self-explanatory. Is there a command that lets me place the
> cursor on a headline and delete its contents (i.e., all of its text)?

I don't think know if this command exists, but, assuming your cursor
is on the headline you can:
1. copy the title (C-a C-c SPC C-e M-w)
2. cut the subtree (C-c C-x C-w)
3. paste the previously copied headline C-y M-y

If you find yourself doing this very often you could put it in a
keyboardmacro.

-- 
Daimrod/Greg

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 11:01 killing all contents of a headline 42 147
  2013-02-19 11:13 ` Daimrod
@ 2013-02-19 11:36 ` Marcel van der Boom
  2013-02-19 12:09 ` Bastien
  2 siblings, 0 replies; 10+ messages in thread
From: Marcel van der Boom @ 2013-02-19 11:36 UTC (permalink / raw)
  To: 42 147; +Cc: emacs-orgmode



On Tue 19-Feb-2013 06:01
42 147 <aeuster@gmail.com> wrote:

> Title is self-explanatory. Is there a command that lets me place the
> cursor on a headline and delete its contents (i.e., all of its text)?

If you have the subtree collapsed and with your point on the heading,
'org-kill-line' kills the heading plus the content below it. It is
bound to C-k by default I think.

So, a clever combination of 'org-cycle' and 'org-kill-line' could be
combined to form one command to kill a heading and its contents,
regardless of the collapsed state.

hth

marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV    -- http://www.hsdev.com
We use bitcoin!      -- http://bitcoin.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 11:01 killing all contents of a headline 42 147
  2013-02-19 11:13 ` Daimrod
  2013-02-19 11:36 ` Marcel van der Boom
@ 2013-02-19 12:09 ` Bastien
  2013-02-19 15:43   ` Suvayu Ali
  2013-02-19 16:40   ` 42 147
  2 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2013-02-19 12:09 UTC (permalink / raw)
  To: 42 147; +Cc: emacs-orgmode

42 147 <aeuster@gmail.com> writes:

> Title is self-explanatory. Is there a command that lets me place the
> cursor on a headline and delete its contents (i.e., all of its text)?

C-c @ C-w

When using speedy commands (setq org-use-speed-commands t)

. C-w 

at the beginning of a headline.

I'm willing to update the "." speedy command and use "@" instead
to be consistent with the "C-c @" command.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 12:09 ` Bastien
@ 2013-02-19 15:43   ` Suvayu Ali
  2013-02-19 17:02     ` Bastien
  2013-02-19 16:40   ` 42 147
  1 sibling, 1 reply; 10+ messages in thread
From: Suvayu Ali @ 2013-02-19 15:43 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Tue, Feb 19, 2013 at 01:09:30PM +0100, Bastien wrote:
> When using speedy commands (setq org-use-speed-commands t)
> 
> . C-w 
> 
> at the beginning of a headline.
> 
> I'm willing to update the "." speedy command and use "@" instead
> to be consistent with the "C-c @" command.

Yes that would be good.  To save you some work, I attached a patch.

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: 0001-Change-default-org-mark-subtree-speed-command.patch --]
[-- Type: text/plain, Size: 919 bytes --]

From 664f375b7c2f65269e730fdb870cf81cd01f2bf2 Mon Sep 17 00:00:00 2001
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Date: Tue, 19 Feb 2013 16:40:14 +0100
Subject: [PATCH] Change default org-mark-subtree speed command

* org.el (org-speed-commands-default): Change default binding
  for org-mark-subtree from "." to "@" to be more consistent with "C-c
  @".

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 91763d3..85a6a4a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18658,7 +18658,7 @@ BEG and END default to the buffer boundaries."
     ("^" . org-sort)
     ("w" . org-refile)
     ("a" . org-archive-subtree-default-with-confirmation)
-    ("." . org-mark-subtree) ;; FIXME Better use @ (see C-c @) here?
+    ("@" . org-mark-subtree)
     ("#" . org-toggle-comment)
     ("Clock Commands")
     ("I" . org-clock-in)
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 12:09 ` Bastien
  2013-02-19 15:43   ` Suvayu Ali
@ 2013-02-19 16:40   ` 42 147
  2013-02-19 17:05     ` Bastien
  2013-02-19 17:11     ` Suvayu Ali
  1 sibling, 2 replies; 10+ messages in thread
From: 42 147 @ 2013-02-19 16:40 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

>> to be consistent with the "C-c @" command.
>
> Yes that would be good.  To save you some work, I attached a patch.
>

Precisely what I was looking for. I'm always up for macro creation, but
I didn't want to do so if a command already existed. Always looking to
expand my org-vocabulary.

The @ replacement is also a sensible idea -- can either of you send me
the source code for this? Or how would I update my org-mode to include
it?

Not exactly well-versed in Emacs,

John


2013/2/19 Bastien <bzg@altern.org>

> 42 147 <aeuster@gmail.com> writes:
>
> > Title is self-explanatory. Is there a command that lets me place the
> > cursor on a headline and delete its contents (i.e., all of its text)?
>
> C-c @ C-w
>
> When using speedy commands (setq org-use-speed-commands t)
>
> . C-w
>
> at the beginning of a headline.
>
> I'm willing to update the "." speedy command and use "@" instead
> to be consistent with the "C-c @" command.
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1623 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 15:43   ` Suvayu Ali
@ 2013-02-19 17:02     ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2013-02-19 17:02 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Hi Suvayu,

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Yes that would be good.  To save you some work, I attached a patch.

Applied, thanks a lot!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 16:40   ` 42 147
@ 2013-02-19 17:05     ` Bastien
  2013-02-19 20:29       ` 42 147
  2013-02-19 17:11     ` Suvayu Ali
  1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2013-02-19 17:05 UTC (permalink / raw)
  To: 42 147; +Cc: emacs-orgmode

Hi John,

42 147 <aeuster@gmail.com> writes:

> The @ replacement is also a sensible idea -- can either of you send
> me the source code for this? Or how would I update my org-mode to
> include it?

If you want to use Org development branch, simply clone and build:

~$ git clone git://orgmode.org/org-mode.git
~$ cd org-mode
~$ make

Then make sure you set the correct `load-path'.

See http://orgmode.org/org.html#Installation for details.

The change Suvayu sent is now in master.

> Not exactly well-versed in Emacs,

You'll soon get hooked, dont worry :)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 16:40   ` 42 147
  2013-02-19 17:05     ` Bastien
@ 2013-02-19 17:11     ` Suvayu Ali
  1 sibling, 0 replies; 10+ messages in thread
From: Suvayu Ali @ 2013-02-19 17:11 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Feb 19, 2013 at 11:40:31AM -0500, 42 147 wrote:
> The @ replacement is also a sensible idea -- can either of you send me
> the source code for this? Or how would I update my org-mode to include
> it?

Take a look at the following FAQ and the two after:

  <http://orgmode.org/worg/org-faq.html#updating-org>

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: killing all contents of a headline
  2013-02-19 17:05     ` Bastien
@ 2013-02-19 20:29       ` 42 147
  0 siblings, 0 replies; 10+ messages in thread
From: 42 147 @ 2013-02-19 20:29 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Thanks, the update worked, however with some post-update oddities:

org-hide-leading stars t hides the stars -- but only if I manually switch
from the Emacs default color theme to my favorite one
(color-theme-renegade). If I leave (color-theme-renegade) in my init, on
boot-up, org-mode does not hide the stars.

This never used to happen.

Secondly, now I have a bunch of information in my modeline that I had
customized out -- the names of headlines and sub-headlines at point.

While a nice feature, I prefer my modeline *only* to read what I had before
(the git branch I am on).

2013/2/19 Bastien <bzg@altern.org>

> Hi John,
>
> 42 147 <aeuster@gmail.com> writes:
>
> > The @ replacement is also a sensible idea -- can either of you send
> > me the source code for this? Or how would I update my org-mode to
> > include it?
>
> If you want to use Org development branch, simply clone and build:
>
> ~$ git clone git://orgmode.org/org-mode.git
> ~$ cd org-mode
> ~$ make
>
> Then make sure you set the correct `load-path'.
>
> See http://orgmode.org/org.html#Installation for details.
>
> The change Suvayu sent is now in master.
>
> > Not exactly well-versed in Emacs,
>
> You'll soon get hooked, dont worry :)
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1913 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-02-19 20:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19 11:01 killing all contents of a headline 42 147
2013-02-19 11:13 ` Daimrod
2013-02-19 11:36 ` Marcel van der Boom
2013-02-19 12:09 ` Bastien
2013-02-19 15:43   ` Suvayu Ali
2013-02-19 17:02     ` Bastien
2013-02-19 16:40   ` 42 147
2013-02-19 17:05     ` Bastien
2013-02-19 20:29       ` 42 147
2013-02-19 17:11     ` Suvayu Ali

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).