emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>
Cc: emacs-orgmode@gnu.org
Subject: Re: virtual-fill mode in mail buffers, with orgalist-mode, prefix is not considered when virtual-fill is on
Date: Mon, 09 Aug 2021 17:01:54 +0800	[thread overview]
Message-ID: <87im0fvvnh.fsf@localhost> (raw)
In-Reply-To: <87fsw83opg.fsf@mat.ucm.es>

Uwe Brauer <oub@mat.ucm.es> writes:

> So the prefix is not taken into account. Anybody seeing this and knows a solution?

Not sure about orgalist-mode, but you may need to define custom
adaptive-fill-function. I use the following (though for org-mode itself):

(defun org-adaptive-fill-function ()
    "Fill headlines to the beginning of headline in org."
    (save-excursion
      (cond
       ((org-at-heading-p)
	(beginning-of-line)
        (looking-at org-complex-heading-regexp)
        (goto-char (or (match-beginning 4) (match-end 0))) ;; at headline
        (make-string (current-column) ?\ ))
       ((org-at-item-p)
        (beginning-of-line)
        (looking-at org-list-full-item-re)
        (goto-char (or (match-beginning 4) (match-end 3) (match-end 2) (match-end 1)))
        (skip-chars-forward " \t")
        (make-string (current-column) ?\ )))))
  (add-hook! 'org-mode-hook (setq-local adaptive-fill-function #'org-adaptive-fill-function))

Best,
Ihor


  parent reply	other threads:[~2021-08-09  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 17:00 Uwe Brauer
2021-07-27 20:05 ` Nicolas Goaziou
2021-08-09  9:01 ` Ihor Radchenko [this message]
2021-08-10  6:30   ` Uwe Brauer

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=87im0fvvnh.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=oub@mat.ucm.es \
    /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).