[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [SOLVED] (was: [Q] Remove empty drawers ?)
From: |
Xavier Maillard |
Subject: |
[O] [SOLVED] (was: [Q] Remove empty drawers ?) |
Date: |
Thu, 09 Apr 2015 07:04:10 +0200 |
User-agent: |
mu4e/0.9.11 Emacs/24.3.1 (gnu/linux) |
Xavier Maillard <address@hidden> writes:
> In fact, the fix has consisted in adding one empty PROPERTY block per
> heading element (I don't know why though). Now I am looking for a way
> to delete all of them :/
>
> How would you do that ?
Org-mode comes with the function `org-remove-empty-drawer-at', so
removing empty :PROPERTIES: becomes trivial
M-:
#+BEGIN_SRC
(with-current-buffer "monsysteme.org"
(goto-char (point-min))
(while (re-search-forward ":PROPERTIES:" nil t)
(save-excursion (org-remove-empty-drawer-at (match-beginning 0)))))
#+END_SRC
There is probably something better to do it (replacing
`with-current-buffer' comes to mind for example), but it works.
Regards
-- Xavier.