From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Moreau Subject: Re: Moving from org-mode 6.33/7.9.3 to 8.3.2 Date: Mon, 30 Nov 2015 08:05:03 +0100 Message-ID: References: <87two4lbw6.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113f8f0a0f4ec40525bca9a4 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3IWH-0006E5-Ul for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 02:05:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3IWG-00020n-Sv for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 02:05:05 -0500 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]:33352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3IWG-00020h-Mx for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 02:05:04 -0500 Received: by iouu10 with SMTP id u10so166478629iou.0 for ; Sun, 29 Nov 2015 23:05:04 -0800 (PST) In-Reply-To: <87two4lbw6.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a113f8f0a0f4ec40525bca9a4 Content-Type: text/plain; charset=UTF-8 Hi Nicolas, Thanks for you answer. OK, I understand. That explains why I needed to add blank lines between list items before to fill region, such as: - item1 - item2 This is a new paragraph I have 2 more questions for you please. Let say I would like to give a hand and try to improve the org-fill-region to deal with this case. - Would it be local to fill-region only, as I would suspect, or would it put a mess around because it is used in some other contexts I am not aware of, and would it be something interesting for the org-mode according to you? - If you wanted to develop it, would you surround it with a when condition so that user can disable it? Thanks, Steve 2015-11-29 22:43 GMT+01:00 Nicolas Goaziou : > Hello, > > Steve Moreau writes: > > > Indeed, the org-setup-filling was concerned. > > > > *Before:* > > > > (append fill-nobreak-predicate > > '(org-fill-paragraph-separate-nobreak-p > > ... > > > > (defvar org-element-paragraph-separate) ; org-element.el > > (defun org-fill-paragraph-separate-nobreak-p () > > "Non-nil when a new line at point would end current paragraph." > > (looking-at (substring org-element-paragraph-separate 1))) > > > > *After:* > > > > 'org-fill-paragraph-separate-nobreak-p' predicate removed and the > previous > > function has been deleted > > > > The following code has been added: > > > > (let ((paragraph-ending (substring org-element-paragraph-separate 1))) > > (org-set-local 'paragraph-start paragraph-ending) > > (org-set-local 'paragraph-separate paragraph-ending)) > > > > > > Could someone explain to me why the function has been removed? > > It was removed because `org-element-paragraph-separate' is not enough to > find the boundaries of a paragraph, e.g., > > - item1 > - item2 > This is a new paragraph > > It is usually not a problem except for `fill-region', as you noticed. > However, I do not know how to plug our own functions into `fill-region'. > > We could replace `fill-region' with `org-fill-region', tho. > > > Regards, > > -- > Nicolas Goaziou > > --001a113f8f0a0f4ec40525bca9a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

Thanks for you answer.
OK, I understand. That explains why I nee= ded to add blank lines between list items before to fill region, such as:
=C2=A0 - item1

=C2=A0 - item2

=C2=A0 This is a new paragraph

I have 2 more questions for you= please.
Let say I would like to give a hand and try to improve the org-= fill-region to deal with this case.
- Would it be local to fill-re= gion only, as I would suspect, or would it put a mess around because it is = used in some other contexts I am not aware of, and would it be something in= teresting for the org-mode according to you?
- If you wanted to de= velop it, would you surround it with a when condition so that user can disa= ble it?

Thanks,

Steve

2015-11-29 22:43 GMT+01:00 Nicolas = Goaziou <mail@nicolasgoaziou.fr>:
Hello,

Steve Moreau <moreau.steve@free.= fr> writes:

> Indeed, the org-setup-filling was concerned.
>
> *Before:*
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(append fill-nobreak-predicate
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'(org-fill-paragraph-separ= ate-nobreak-p
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0...
>
> (defvar org-element-paragraph-separate) ; org-element.el
> (defun org-fill-paragraph-separate-nobreak-p ()
>=C2=A0 =C2=A0"Non-nil when a new line at point would end current p= aragraph."
>=C2=A0 =C2=A0(looking-at (substring org-element-paragraph-separate 1)))=
>
> *After:*
>
> 'org-fill-paragraph-separate-nobreak-p' predicate removed and = the previous
> function has been deleted
>
> The following code has been added:
>
>=C2=A0 =C2=A0(let ((paragraph-ending (substring org-element-paragraph-s= eparate 1)))
>=C2=A0 =C2=A0 =C2=A0(org-set-local 'paragraph-start paragraph-endin= g)
>=C2=A0 =C2=A0 =C2=A0(org-set-local 'paragraph-separate paragraph-en= ding))
>
>
> Could someone explain to me why the function has been removed?

It was removed because `org-element-paragraph-separate' is not e= nough to
find the boundaries of a paragraph, e.g.,

=C2=A0 - item1
=C2=A0 - item2
=C2=A0 This is a new paragraph

It is usually not a problem except for `fill-region', as you noticed. However, I do not know how to plug our own functions into `fill-region'= .

We could replace `fill-region' with `org-fill-region', tho.


Regards,

--
Nicolas Goaziou


--001a113f8f0a0f4ec40525bca9a4--