emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: Nicolas Goaziou <mail-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org
Subject: Re: [RFC] Change property drawer syntax
Date: Fri, 14 Nov 2014 14:58:51 +0100	[thread overview]
Message-ID: <86k32xdgtg.fsf@example.com> (raw)
In-Reply-To: <87ppcqnpq7.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org> (Nicolas Goaziou's message of "Fri, 14 Nov 2014 09:36:16 +0100")



Hello Nicolas,

Nicolas Goaziou wrote:
> Sebastien Vauban writes:
>
>> After heavy testing (on all my Org files, I mean) of the above function,
>> it works perfectly except for the following corner-case [...].
>
> Thanks for your feedback. Would the following updated function solve the
> problem?
>
>   (defun org-repair-property-drawers ()
>     "Fix properties drawers in current buffer.
>   Ignore non Org buffers."
>     (when (eq major-mode 'org-mode)
>       (org-with-wide-buffer
>        (goto-char (point-min))
>        (let ((case-fold-search t)
>              (inline-re (and (featurep 'org-inlinetask)
>                              (concat (org-inlinetask-outline-regexp)
>                                      "END[ \t]*$"))))
>          (org-map-entries
>           (lambda ()
>             (unless (and inline-re (org-looking-at-p inline-re))
>               (save-excursion
>                 (let ((end (save-excursion (outline-next-heading) (point))))
>                   (forward-line)
>                   (when (org-looking-at-p org-planning-line-re) (forward-line))
>                   (when (and (< (point) end)
>                              (not (org-looking-at-p org-property-drawer-re))
>                              (save-excursion
>                                (re-search-forward org-property-drawer-re end t)
>                                (eq (org-element-type
>                                     (save-match-data (org-element-at-point)))
>                                    'drawer)))
>                     (insert (delete-and-extract-region
>                              (match-beginning 0)
>                              (min (1+ (match-end 0)) end)))
>                     (unless (bolp) (insert "\n"))))))))))))

Nope, this one really breaks my Org file. For example:

--8<---------------cut here---------------start------------->8---
#+TITLE: Xxxxx Xxxxxx
#+AUTHOR: Xxxxxxx Xxxxxxx
#+EMAIL: xxx-XsV/KxTKYItexX8rFMpgi3AlXr9lQLeu@public.gmane.org
#+LANGUAGE: xx

#+FILETAGS: :xxxx:xxxxx:

* Xxxxxx

** Xxxx xxxx "Xxxxxxxxxxx xxx xxxxxxx xxxxxxx - Xxxxxx xx xxxxxxxxxx xxx xxxxxxxx"
   <2014-10-09 Thu 10:00>

Xxxxxxx: Xxxxxxxx xx Xxxxxx (Xxxxxx XX).

* Xxxxx

** CANX Xxxx xxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxxx Xxxxxx Xxxxxx Xxxxxxx)
   DEADLINE: <2014-10-08 Wed>
   :LOGBOOK:
   - Xxxxx "XXXX"        ->  "XXXX"       [2014-10-09 Thu 18:18]
   :END:
   [2014-09-30 Tue 11:18]

#+BEGIN_VERSE
Xxxxxx xxxxx xx xxxx xxxxx xxx xxxxxxxxxx. Xxxx xxxx x xxxxxxx:

- Xxxx x xxxx xxxx xx xxxxxxxx xxxxxxxxxx
- Xx x xxxxxxx
- Xxxxx xxxxx xxx xxxx

Xx xx xxxxxxxx, xx xxxx:

x Xxxxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxx xx xxxx xxxx)
x Xxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxx xxxxxxxxx xx xxxxx? xxxxxxxx?…)
x Xxxx xxx xx xxxx xxxx xxxx'x xxxx xxxx xx xx xxxxxxxxxxx?
x Xxxxxxxxxx "xxxxxxxxx xxxx" xx xxx

Xxxxx xxx xxxx xxxx xx (x) xxx (x)?
#+END_VERSE

Xxxx [[http://orgmode.org][Xxxxx xxxx Xxxxxx Xxxxxx Xxxxxxx: {xxx} Xxx: Xxxx x xxxx xxxxxxx]]
--8<---------------cut here---------------end--------------->8---

becomes:

--8<---------------cut here---------------start------------->8---
#+TITLE: Xxxxx Xxxxxx
#+AUTHOR: Xxxxxxx Xxxxxxx
#+EMAIL: xxx-XsV/KxTKYItexX8rFMpgi3AlXr9lQLeu@public.gmane.org
#+LANGUAGE: xx

#+FILETAGS: :xxxx:xxxxx:

* Xxxxxx

** Xxxx xxxx "Xxxxxxxxxxx xxx xxxxxxx xxxxxxx - Xxxxxx xx xxxxxxxxxx xxx xxxxxxxx"
   <2014-10-09 Thu 10:00>

Xxxxxxx: Xxxxxxxx xx Xxxxxx (Xxxxxx XX).

* Xxxxx

ANX Xxxx xxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxxx Xxxxxx Xxxxxx Xxxxxxx)
   DEADLINE: <2014-10-08 Wed>



** C
   :LOGBOOK:
   - Xxxxx "XXXX"        ->  "XXXX"       [2014-10-09 Thu 18:18]
   :END:
   [2014-09-30 Tue 11:18]

#+BEGIN_VERSE
Xxxxxx xxxxx xx xxxx xxxxx xxx xxxxxxxxxx. Xxxx xxxx x xxxxxxx:

- Xxxx x xxxx xxxx xx xxxxxxxx xxxxxxxxxx
- Xx x xxxxxxx
- Xxxxx xxxxx xxx xxxx

Xx xx xxxxxxxx, xx xxxx:

x Xxxxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxx xx xxxx xxxx)
x Xxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxx (xxx xxxxxxxxx xx xxxxx? xxxxxxxx?…)
x Xxxx xxx xx xxxx xxxx xxxx'x xxxx xxxx xx xx xxxxxxxxxxx?
x Xxxxxxxxxx "xxxxxxxxx xxxx" xx xxx

Xxxxx xxx xxxx xxxx xx (x) xxx (x)?
#+END_VERSE

Xxxx [[http://orgmode.org][Xxxxx xxxx Xxxxxx Xxxxxx Xxxxxxx: {xxx} Xxx: Xxxx x xxxx xxxxxxx]]
--8<---------------cut here---------------end--------------->8---

Observe that:
- many blank lines are added,
- the TODO keyword (CANX) is broken, and
- a new task is created.

>> PS- I did not retest (yet) the same thing in #+begin/end_src
>>     blocks... as playing with that example files makes my Emacs eat 100%
>>     of the CPU (infloop?).
>
> Could you provide an ECM for that?

It really was just editing the given example. So, this file:

--8<---------------cut here---------------start------------->8---
* Reference

Example of Custom ID:

#+begin_verse
,* Some title
  :PROPERTIES:
  :CUSTOM_ID: SomeTitle
  :END:

Lorem ipsum
#+end_verse
--8<---------------cut here---------------end--------------->8---

caused me trouble with the initial `org-repair-property-drawers' added
to the `org-mode-hook'!?

Best regards,
  Seb

-- 
Sebastien Vauban

      parent reply	other threads:[~2014-11-14 13:58 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 14:42 [RFC] Change property drawer syntax Nicolas Goaziou
2014-10-14 14:55 ` Andreas Leha
2014-10-14 15:55   ` Nicolas Goaziou
2014-10-14 16:18 ` Eric Abrahamsen
2014-10-14 19:26   ` Nicolas Goaziou
2014-10-14 16:25 ` Michael Brand
2014-10-14 19:38   ` Nicolas Goaziou
2014-10-15 17:25     ` Michael Brand
2014-10-15 20:52       ` Nicolas Goaziou
2014-10-15  2:58 ` Eric Abrahamsen
2014-10-15 10:11   ` Nicolas Goaziou
2014-10-15 11:22     ` Eric Abrahamsen
2014-10-15  7:38 ` Rainer M Krug
2014-10-15 10:14   ` Nicolas Goaziou
2014-10-15 11:27     ` Rainer M Krug
2014-10-20 22:35 ` Rasmus
2014-10-26 15:24 ` Nicolas Goaziou
2014-10-28 13:27   ` Nicolas Goaziou
2014-11-06 10:21     ` Sebastien Vauban
2014-11-08 13:46       ` Nicolas Goaziou
2014-11-10 10:19         ` Sebastien Vauban
2014-11-10 10:41           ` Nicolas Goaziou
2014-11-10 11:04             ` Sebastien Vauban
2014-11-10 11:51               ` Nicolas Goaziou
2014-11-10 12:55                 ` Sebastien Vauban
2014-11-12 10:40             ` Sebastien Vauban
2014-11-13 19:58               ` Nicolas Goaziou
     [not found]                 ` <87sihmq3dd.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2014-11-26 14:09                   ` Sebastien Vauban
2014-10-31 13:10   ` Christian Egli
2014-10-31 16:10     ` John Hendy
2014-11-03  8:27       ` Christian Egli
2014-11-03  8:33         ` Nicolas Goaziou
2014-11-01 10:57     ` Nicolas Goaziou
2014-11-03  8:38       ` Christian Egli
2014-11-03 20:14         ` Nicolas Goaziou
2014-11-12 11:01 ` Sebastien Vauban
2014-11-12 11:11   ` Sebastien Vauban
2014-11-26 14:18     ` Sebastien Vauban
2014-11-26 23:37       ` Nicolas Goaziou
2014-11-27  9:24         ` Sebastien Vauban
2014-11-28 22:16           ` Nicolas Goaziou
2014-12-05 14:33             ` Puneeth Chaganti
2014-12-05 23:31               ` Nicolas Goaziou
2014-12-06  6:42                 ` Puneeth Chaganti
2014-12-06 20:36                   ` Nicolas Goaziou
2014-11-14  8:36   ` Nicolas Goaziou
     [not found]     ` <87ppcqnpq7.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2014-11-14 13:58       ` Sebastien Vauban [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=86k32xdgtg.fsf@example.com \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=mail-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org \
    --cc=public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.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).