emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Feature suggestion: context sensitive movement
Date: Sat, 20 Jun 2009 13:07:56 -0700	[thread overview]
Message-ID: <20524da70906201307o318d0692wa175b62b0cd4d4a0@mail.gmail.com> (raw)
In-Reply-To: <86D9A2F7-D027-44DF-930A-9AAC89E0770A@gmail.com>

Thanks, Carsten.

Using Carsten's comments in this thread, here is my c-m-ret command.
Don't know if it helps the OP, but I find it useful.

(defun alpha-org-up ()
  "Go up by moving point to the next-highest
item or headline in the following.

  - the item
  - the parent item
  - the headline
  - the parent headline
"
  (interactive)
  ;;'invisible-ok
  (cond
    ((org-at-item-p)
     (org-beginning-of-item-list)
     (backward-char 1)
     (if (org-in-item-p)
         (org-beginning-of-item)
       (beginning-of-line)))
    ((org-in-item-p) (org-beginning-of-item))
    ((org-at-heading-p) (call-interactively 'outline-up-heading))
    (t (outline-back-to-heading))))

On Sat, Jun 20, 2009 at 12:26, Carsten Dominik<carsten.dominik@gmail.com> wrote:
>
> On Jun 19, 2009, at 7:33 PM, Samuel Wales wrote:
>
>> These look very useful.  Is there one for moving to the parent item,
>
> no.  You can make it with
>
>   (org-beginning-of-item-list)
>   (backward-char 1)
>   (org-begining-if-item)
>
> or something like this (untested).
>
>> and is there one for moving to the item first line analogous to
>> back-to-heading?
>
> Yes, org-beginning-of-item
>
> HTH
>
> - Carsten
>
>
>>
>> My idea is to write a command that does something approx. like this:
>>
>> ;;;    (cond
>> ;;;      ((org-at-item-p) (org-item-up)) ;parent
>> ;;;      ((org-in-item-p) (org-back-to-item-heading))
>> ;;;      ((org-at-heading-p) (outline-up-heading))
>> ;;;      (t (outline-back-to-heading)))
>>
>> Thanks.
>>
>> On Thu, Jun 18, 2009 at 23:17, Carsten Dominik<carsten.dominik@gmail.com>
>> wrote:
>>>>
>>>> Are there any functions to navigate plain lists?
>>>
>>> org-beginning-of-item
>>> org-end-of-item
>>> org-next-item
>>> org-previous-item
>>> org-beginning-of-item-list
>>>
>>> You could make you bindings below work for lists as well by checking
>>> context
>>> with
>>>
>>>
>>> org-at-item-p    ;; first line only
>>> org-in-item-p    ;; does not have to be first line
>>> org-at-heading-p
>>>
>>
>>
>>
>> --
>> Myalgic encephalomyelitis denialism is causing death and severe suffering,
>> worse than MS.  Conflicts of interest are destroying research.  /You/ can
>> get the disease at any time permanently.  Do science and justice matter to
>> you?  http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
>
>



-- 
Myalgic encephalomyelitis denialism is causing death and severe suffering,
worse than MS.  Conflicts of interest are destroying research.  /You/ can
get the disease at any time permanently.  Do science and justice matter to
you?  http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

      reply	other threads:[~2009-06-20 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 11:10 Feature suggestion: context sensitive movement Rick Moynihan
2009-06-18 11:59 ` Russell Adams
2009-06-18 12:02 ` Matthew Lundin
2009-06-18 15:04   ` Bill White
2009-06-18 14:10 ` Sebastian Rose
2009-06-19 12:56   ` Daniel Clemente
2009-06-19 13:01     ` Bernt Hansen
2009-06-22  9:02       ` Daniel Clemente
2009-06-18 19:54 ` Samuel Wales
2009-06-19  6:17   ` Carsten Dominik
2009-06-19 17:33     ` Samuel Wales
2009-06-20 19:26       ` Carsten Dominik
2009-06-20 20:07         ` Samuel Wales [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=20524da70906201307o318d0692wa175b62b0cd4d4a0@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --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).