From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Change property drawer syntax Date: Thu, 27 Nov 2014 00:37:20 +0100 Message-ID: <87ppc9o7nz.fsf@nicolasgoaziou.fr> References: <87oatek909.fsf@nicolasgoaziou.fr> <86zjbwlm31.fsf@example.com> <86r3x8lllg.fsf@example.com> <86389659lx.fsf@example.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtm8n-0006hN-QX for emacs-orgmode@gnu.org; Wed, 26 Nov 2014 18:37:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtm8f-0000qy-1n for emacs-orgmode@gnu.org; Wed, 26 Nov 2014 18:36:57 -0500 Received: from plane.gmane.org ([80.91.229.3]:39544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtm8e-0000qs-Rq for emacs-orgmode@gnu.org; Wed, 26 Nov 2014 18:36:49 -0500 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xtm8d-0005gp-TJ for emacs-orgmode@gnu.org; Thu, 27 Nov 2014 00:36:47 +0100 In-Reply-To: <86389659lx.fsf@example.com> (Sebastien Vauban's message of "Wed, 26 Nov 2014 15:18:02 +0100") 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: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org Sebastien Vauban writes: >> ** Sectionnement >> >> Exemple de section avec un titre court pour LaTeX : >> >> #+begin_src org >> ,* Ceci est un titre de section assez long >> :PROPERTIES: >> :ALT_TITLE: Ceci est un titre court >> :END: >> #+end_src >> >> Upon execution of the repair function, that entry will be wrongly >> converted. > > Do you experience the same problem as me? I do. I even sent you an updated revision of the repair function a few days ago, but, apparently, it never reached its destination. This is not the first time. Here it is again (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 (and (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")))))))))))) Regards, -- Nicolas Goaziou