From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xavier Maillard Subject: [SOLVED] (was: [Q] Remove empty drawers ?) Date: Thu, 09 Apr 2015 07:04:10 +0200 Message-ID: <86h9sp51v9.fsf@kcals2.maillard.im> References: <86iod552ni.fsf@kcals2.maillard.im> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yg4dT-0000p6-Nw for emacs-orgmode@gnu.org; Thu, 09 Apr 2015 01:04:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yg4dQ-00048h-GZ for emacs-orgmode@gnu.org; Thu, 09 Apr 2015 01:04:15 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yg4dQ-000483-DB for emacs-orgmode@gnu.org; Thu, 09 Apr 2015 01:04:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AF3352042F for ; Thu, 9 Apr 2015 01:04:07 -0400 (EDT) Received: from kcals2.maillard.im (unknown [90.18.57.237]) by mail.messagingengine.com (Postfix) with ESMTPA id 24FC56800D5 for ; Thu, 9 Apr 2015 01:04:11 -0400 (EDT) In-reply-to: <86iod552ni.fsf@kcals2.maillard.im> 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" Xavier Maillard 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.