all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: emacs-devel <emacs-devel@gnu.org>
Cc: Tassilo Horn <tsdh@gnu.org>
Subject: Re: fill-paragraph ill designed
Date: Tue, 25 Aug 2015 11:50:03 +0200	[thread overview]
Message-ID: <55DC3A4B.6040708@online.de> (raw)
In-Reply-To: <87bndvivq6.fsf@gnu.org>


Am 25.08.2015 um 11:05 schrieb Tassilo Horn:
> Andreas Röhler <andreas.roehler@online.de> writes:
>
>> There are many issues, uncertain/unsound decisions inside this piece
>> of code.
>>
>> Let's start with fill-paragraph-function.
>>
>> If fill-paragraph-function is set, it must be assumed a valid function
>> and be used.
> That's not what the documentation says:
>
> ,----[ C-h f fill-paragraph RET ]
> | fill-paragraph is an interactive compiled Lisp function in ‘fill.el’.
> |
> | [...]
> |
> | The REGION argument is non-nil if called interactively; in that
> | case, if Transient Mark mode is enabled and the mark is active,
> | call ‘fill-region’ to fill each of the paragraphs in the active
> | region, instead of just filling the current paragraph.
> `----
>
> So if there is an active region, `fill-paragraph' just calls
> `fill-region', and then the `fill-paragraph-function' is irrelevant.

Yeah, but that's unhappy. Where the global fill-paragraph should know 
from, what's needed in a special mode, what special modes want to do 
with strings?

Other way around: any fill-paragraph-function is free to check for 
region as done here.

>> So it must precede that clause:
>>
>> (and region transient-mark-mode mark-active
> If `fill-paragraph' would call `fill-paragraph-function' also in this
> case, then there are two options:
>
>    (1) `fill-paragraph's documentation stays what it is, and then every
>        `fill-paragraph-function' ever going to be defined has to handle
>        the active region case and call `fill-region'.

That's completely up to the mode how to proceed then. There too many 
unforseen cases - just keep the way free, keep Emacs expandable.



>    (2) `fill-paragraph' can't specify any special behavior for the case
>        where the region is active.

If it's all up to fill-paragraph-function, global fill-paragraph would 
be out of the way.


>   It might just say that it itself
>        behaves differently with an active region when f-p-f is nil.
>
> Option (1) is useless, and option (2) is confusing and might lead to
> inconsistent behavior, e.g., in some modes `M-q' with an active region
> fills the region (because f-p-f is nil or a function which considers the
> active region case) and in some other modes it just fills the current
> paragraph (because f-p-f is set to some function which doesn't consider
> the active region case).
>
> Bye,
> Tassilo
>

Cheers,

Andreas



  reply	other threads:[~2015-08-25  9:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25  8:24 fill-paragraph ill designed Andreas Röhler
2015-08-25  9:05 ` Tassilo Horn
2015-08-25  9:50   ` Andreas Röhler [this message]
2015-08-25 12:18     ` Tassilo Horn
2015-08-25 14:53       ` Stefan Monnier
2015-08-26  7:15         ` Tassilo Horn
2015-08-25 14:51 ` Stefan Monnier
2015-08-25 22:14   ` Richard Stallman
2015-08-26  6:30     ` Andreas Röhler
2015-08-26  7:08       ` Tassilo Horn
2015-08-26 12:22         ` Andreas Röhler
2015-08-26 12:40           ` Tassilo Horn
2015-08-26 16:45             ` Andreas Röhler
2015-08-26 17:03               ` Tassilo Horn
2015-08-27 16:35               ` Stefan Monnier
2015-08-27 17:48                 ` Andreas Röhler
2015-08-28  6:30                 ` Tassilo Horn
2015-08-28  6:41                   ` Andreas Röhler
2015-08-28  8:26                     ` Tassilo Horn
2015-08-29 19:47                       ` Andreas Röhler
2015-08-30  7:30                         ` Andreas Röhler
2015-08-31  1:21                           ` Stefan Monnier
2015-08-28 16:27                   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=55DC3A4B.6040708@online.de \
    --to=andreas.roehler@online.de \
    --cc=emacs-devel@gnu.org \
    --cc=tsdh@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.