emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Philipp Kiefer <phil.kiefer@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Suggestion to increase usefulness of TAB key / 'org-cycle' function
Date: Fri, 28 Apr 2023 17:17:30 +0200	[thread overview]
Message-ID: <CAEGK9xmhNHRRszra1_YSTc9K5MjZ1VMKWgq=-m=UYoG77GgSEQ@mail.gmail.com> (raw)
In-Reply-To: <87cz3o2vdb.fsf@ucl.ac.uk>

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

Thanks, Eric, I am aware of customization options.

My suggestion was aimed at improving the out-of-the-box experience of (new)
Org users by extending the usefulness of 'org-cycle' by folding the subtree
at point from anywhere inside it that is not itself a parent item rather
than doing nothing at all in those positions. I've used two flavours of
dedicated outlining software for many years and both have easy shortcuts to
fold the current subtree from any position - it is a frequently used action.



Fraga, Eric <e.fraga@ucl.ac.uk> schrieb am Fr., 28. Apr. 2023, 11:45:

> Hi Philipp,
>
> On Friday, 28 Apr 2023 at 10:49, Philipp Kiefer wrote:
> > Well, it could simplify things a good deal further if, on issuing the
> > command when point is *not* on a parent heading, (non-global)
> > org-cycle would instead fold the subtree that point is in, i. e. do
> > 'outline-up-heading' and 'hide-subtree' on the parent heading.
>
> You could always bind TAB to your own command that does this.  As an
> illustration, I have TAB bound to my own function that invokes
> completion instead unless I'm on an org heading!
>
> --8<---------------cut here---------------start------------->8---
> (defun esf/complete-or-indent ()
>   (interactive)
>   (cond
>    ;; ((eq 'message-mode major-mode)
>    ;;  (message-tab))
>    ((and (eq 'message-mode major-mode)
>          (message-point-in-header-p)
>          (looking-back "^\\(To\\|B?[Cc]c\\): *.*"
> (line-beginning-position)))
>     (if (looking-back " ")
>         (progn
>           (message "try inserting alias abbrev")
>           (insert (symbol-value (intern-soft (completing-read "Expand
> alias: " mail-abbrevs nil t) mail-abbrevs))))
>       (progn
>         (message "try eudc")
>         (eudc-expand-try-all))))
>    ((eq 'message-mode major-mode)
>     (completion-at-point))
>    ((org-table-p)
>     (org-cycle))
>    ((looking-back "[ \t\n]")
>     (if (eq 'org-mode major-mode)
>         (if (looking-back "^\\(\\*+ \\| *|\\)[^\\n]*")     ;a heading or
> table line
>             (org-cycle)
>           (indent-for-tab-command)
>           )
>       (indent-for-tab-command))
>     )
>    (t
>     ;;(consult-company)
>     (completion-at-point)
>     )))
> --8<---------------cut here---------------end--------------->8---
>
> You could use a similar (and much simpler) approach to get what you
> want.
>
> HTH,
> eric
>
> --
> : Eric S Fraga, with org release_9.6.4-335-ge065b5 in Emacs 30.0.50

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

  reply	other threads:[~2023-04-28 15:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28  8:49 Suggestion to increase usefulness of TAB key / 'org-cycle' function Philipp Kiefer
2023-04-28  9:45 ` Fraga, Eric
2023-04-28 15:17   ` Philipp Kiefer [this message]
2023-04-28 17:41     ` Dr. Arne Babenhauserheide
2023-04-28 22:28       ` Esteban Ordóñez
2023-04-28 23:19         ` Dr. Arne Babenhauserheide
2023-04-30 17:17       ` Philipp Kiefer
2023-05-01 18:45         ` Ihor Radchenko
2023-05-01 20:31           ` Philipp Kiefer

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='CAEGK9xmhNHRRszra1_YSTc9K5MjZ1VMKWgq=-m=UYoG77GgSEQ@mail.gmail.com' \
    --to=phil.kiefer@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).