emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Archive subtree and move to next visible task
Date: Wed, 8 Jul 2009 06:52:16 +0200	[thread overview]
Message-ID: <9608E452-2BDE-4E58-8F28-2D98EC27D26C@gmail.com> (raw)
In-Reply-To: <1247004016-7384-1-git-send-email-bernt@norang.ca>

Applied, thanks

- Carsten

On Jul 8, 2009, at 12:00 AM, Bernt Hansen wrote:

> This skips over blank lines preceeding the next task when archiving  
> a task or
> subtree.  This allows us to use a keyboard macro to remember the  
> archive key
> sequence incantation and skips to the next heading so we don't  
> accidentally
> archive the wrong task.
>
> This fixes an issue with blank line handling.  Tasks which have  
> blank lines
> following them do not include the blank lines -- they are part of  
> the following
> task.  This moves the point forward to the next visible headline so  
> that if we
> repeat the archive operation it affects the following task and not  
> the previous
> one by mistake.
> ---
> This patch is available at git://git.norang.ca/org-mode for-carsten
>
> lisp/org-archive.el |    8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-archive.el b/lisp/org-archive.el
> index 2c55a5c..35de4f9 100644
> --- a/lisp/org-archive.el
> +++ b/lisp/org-archive.el
> @@ -308,7 +308,9 @@ this heading."
> 	       (if (eq this-buffer buffer)
> 		   (concat "under heading: " heading)
> 		 (concat "in file: " (abbreviate-file-name afile))))))
> -  (org-reveal))
> +  (org-reveal)
> +  (if (looking-at "^[ \t]*$")
> +      (outline-next-visible-heading 1)))
>
> (defun org-archive-to-archive-sibling ()
>   "Archive the current heading by moving it under the archive sibling.
> @@ -360,7 +362,9 @@ sibling does not exist, it will be created at  
> the end of the subtree."
>       (hide-subtree)
>       (org-cycle-show-empty-lines 'folded)
>       (goto-char pos)))
> -  (org-reveal))
> +  (org-reveal)
> +  (if (looking-at "^[ \t]*$")
> +      (outline-next-visible-heading 1)))
>
> (defun org-archive-all-done (&optional tag)
>   "Archive sublevels of the current tree without open TODO items.
> -- 
> 1.6.3.2.198.g6096d
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2009-07-08  4:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 22:00 [PATCH] Archive subtree and move to next visible task Bernt Hansen
2009-07-08  4:52 ` Carsten Dominik [this message]

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=9608E452-2BDE-4E58-8F28-2D98EC27D26C@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /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).