From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Rossetti Subject: Re: problems while editing in org-columns mode Date: Thu, 24 Apr 2014 15:12:38 +0200 Message-ID: <844n1iswft.fsf@gmail.com> References: <8438moi69y.fsf@gmail.com> <3CE9536D-6F8C-4656-A4BB-7DD6060332D8@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUok-0001aV-Eu for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdJSF-0006vy-0v for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 09:12:52 -0400 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:41877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdJSE-0006ue-Oz for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 09:12:42 -0400 Received: by mail-ee0-f43.google.com with SMTP id e53so1862460eek.2 for ; Thu, 24 Apr 2014 06:12:41 -0700 (PDT) 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: Carsten Dominik Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello Carsten and everyone else reading, yesterday I re-stumbled into the "problem B" described below, and had a look at the Org sources. I think the solution could be: if user sets a non-special property to "" or nil, then remove the property. An example of a possible (non-bulletproof, test-only-intended) patch for "org-entry-put" follows. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=org.el.diff *** c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140422/org.el Wed Apr 23 22:15:51 2014 --- c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140422/org.new.el Thu Apr 24 12:40:49 2014 *************** *** 15557,15562 **** --- 15557,15563 ---- ((member property org-special-properties) (error "The %s property can not yet be set with `org-entry-put'" property)) + ((equal value "") (org-delete-property property)) (t ; a non-special property (let ((buffer-invisibility-spec (org-inhibit-invisibility))) ; Emacs 21 (setq range (org-get-property-block beg end 'force)) --=-=-= Content-Type: text/plain Does it make sense for you too? Kindest regards, Andrea Carsten Dominik writes: > Hi Andrea, > > I have fixed problem A. Problem B has to do with the fact that the > property search function does not find a property with an empty value. > I need to look into this some more. > > - Carsten > On Nov 22, 2013, at 8:30 PM, andrea.rossetti@gmail.com wrote: > ....... >> >> HOW TO REPRODUCE PROBLEM A: >> >> 1) create an example Org file like this: >> >> * myproject >> ** mytask1 >> ** mytask2 >> >> 2) click on the word "myproject", C-c C-x C-c to enable >> column view >> >> 3) M-S-, then answer the wizard questions: >> property=cost, title=cost, width=8, summary=add_numbers >> >> 4) now click on the word "myproject", type q to leave >> org-columns mode >> >> 5) you will see that in the first row of the buffer >> a new line appears: >> >> #+COLUMNS: %25ITEM %8cost %TODO %3PRIORITY %TAGS >> >> I expected "%8cost{+}" instead of "%8cost". Even >> if f I change manually "%8cost" to "%8cost{+}" the >> automatic sums (cost of myproject sums cost of >> mytask1+mytask2) still don't work. >> >> The sums work properly if I remove the entire >> #+COLUMNS statement and add to the :PROPERTIES: of >> row "myproject" the following property: >> >> :COLUMNS: %25ITEM %8cost{+} %TODO %3PRIORITY %TAGS >> >> >> >> HOW TO REPRODUCE PROBLEM B: >> >> 1, 2, 3) same steps than problem A >> >> 4) go on row "mytask1" column "cost", type "e" to edit >> the value, set it to 1234, type RET >> >> 5) type "e" and change the proposed value 1234 into >> the empty string, then type RET >> >> 6) type "e" and set the value to 3456, then type RET >> >> 7) go on row "mytask1", type TAB to see the properties: >> you will see that the properties are now: >> >> :PROPERTIES: >> :cost: >> :cost: 3456 >> :END: >> >> (I did not expect that empty :cost: column) >> --=-=-=--