emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andrea Rossetti <andrea.rossetti@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: problems while editing in org-columns mode
Date: Thu, 24 Apr 2014 15:12:38 +0200	[thread overview]
Message-ID: <844n1iswft.fsf@gmail.com> (raw)
In-Reply-To: <3CE9536D-6F8C-4656-A4BB-7DD6060332D8@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.el.diff --]
[-- Type: text/x-patch, Size: 621 bytes --]

*** 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))

[-- Attachment #3: Type: text/plain, Size: 1924 bytes --]


  Does it make sense for you too? Kindest regards,

  Andrea



Carsten Dominik <carsten.dominik@gmail.com> 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-<right>, 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)
>> 

  reply	other threads:[~2014-04-25  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 19:30 andrea.rossetti
2013-11-26 12:19 ` Carsten Dominik
2014-04-24 13:12   ` Andrea Rossetti [this message]
2014-05-30  7:16     ` Bastien
2014-05-31 14:35       ` Andrea Rossetti
2014-06-02 17:38         ` Bastien

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=844n1iswft.fsf@gmail.com \
    --to=andrea.rossetti@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: problems while editing in org-columns mode' \
    /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

Code repositories for project(s) associated with this 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).