emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xavier Maillard <xavier@maillard.im>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: [SOLVED] (was:  [Q] Remove empty drawers ?)
Date: Thu, 09 Apr 2015 07:04:10 +0200	[thread overview]
Message-ID: <86h9sp51v9.fsf@kcals2.maillard.im> (raw)
In-Reply-To: <86iod552ni.fsf@kcals2.maillard.im>


Xavier Maillard <xavier@maillard.im> 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.

      reply	other threads:[~2015-04-09  5:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  4:47 [Q] Remove empty drawers ? Xavier Maillard
2015-04-09  5:04 ` Xavier Maillard [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=86h9sp51v9.fsf@kcals2.maillard.im \
    --to=xavier@maillard.im \
    --cc=emacs-orgmode@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 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).