emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Colin Fraizer <orgmode@cfraizer.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Capture feature suggestion: place the mark from a template
Date: Tue, 24 Apr 2012 10:53:39 -0400	[thread overview]
Message-ID: <12935.1335279219@alphaville> (raw)
In-Reply-To: Message from "Colin Fraizer" <orgmode@cfraizer.com> of "Tue, 24 Apr 2012 06:46:20 EDT." <00da01cd2207$7cfe04b0$76fa0e10$@cfraizer.com>

Colin Fraizer <orgmode@cfraizer.com> wrote:

> I use a capture template like this:
> 
> ("t" "Todo" entry (file+headline "todo.org" "Tasks") 
>   "* TODO %?\n  :HIDDEN:\n  %U\n  :END:\n%!" :prepend t)
> 
> to create todo items.  I want the cursor to be at the end of the
> headline so I can type that in, but then I want to be able to quickly
> jump to the end so I can type any details that I want.
> 
> I use "the mark" for that purpose, so I can type "C-x C-x" to jump
> right where I want.  So I modified the function
> org-capture-place-entry to add the following lines:
> 
>     (goto-char beg)
>     (if (re-search-forward "%!" end t)
>         (progn
>           (push-mark nil t nil)
>           (replace-match "")))
> 
> just before the final (goto-char beg) that will put the cursor
> position at "%?".
> 
> (I guess I could have put that following ``(goto-char beg)'' inside
> that ``(progn ...)''.)
> 
> Would anyone else find this a useful addition to the capture template
> mechanism?
> 

Maybe - but in this particular case, you could just go to the end of the 
buffer with  M-> (end-of-buffer), right?

And there might be a problem with your proposal: if I push a bunch of
marks during the capture, what happens after the capture is done? Are
they still on the stack? If so, should they be?

Nick

  reply	other threads:[~2012-04-24 14:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 10:46 Capture feature suggestion: place the mark from a template Colin Fraizer
2012-04-24 14:53 ` Nick Dokos [this message]
2012-04-24 15:02 ` Carsten Dominik
2012-04-25  9:22   ` Colin Fraizer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12935.1335279219@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@cfraizer.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).