Re: [O] Bug: header-args:C++ doesn't work

2014-12-05 Thread Nicolas Goaziou
Hello,

Puneeth Chaganti  writes:

> I was helping out "ablephar`" on IRC and they found that setting a
> file property `header-args:C++` does not work.
>
> After some edebug magic, I discovered that org has a feature that lets
> you append property values! (Not the best way to discover a great
> feature, I must say! :-)
>
> The fix could either be a documentation fix. (I would've tried using
> cpp instead of C++, if I knew that was supported). But, this would
> still have some users seeing things broken and then looking up docs or
> trying out the alternative.
>
> OR
>
> a "hacky" fix, (better for the users ?), could be to consider KEY+ to
> be indicating appending, but KEY++ to not.  Thoughts?

I prefer the former. Forbidding to end properties with "+" (unless we
are appending a value) is, IMO, a bearable restriction.


Regards,

-- 
Nicolas Goaziou



[O] Bug: header-args:C++ doesn't work

2014-12-04 Thread Puneeth Chaganti
Hello,

I was helping out "ablephar`" on IRC and they found that setting a
file property `header-args:C++` does not work.

After some edebug magic, I discovered that org has a feature that lets
you append property values! (Not the best way to discover a great
feature, I must say! :-)

The fix could either be a documentation fix. (I would've tried using
cpp instead of C++, if I knew that was supported). But, this would
still have some users seeing things broken and then looking up docs or
trying out the alternative.

OR

a "hacky" fix, (better for the users ?), could be to consider KEY+ to
be indicating appending, but KEY++ to not.  Thoughts?


Thanks,
Puneeth
diff --git a/lisp/org.el b/lisp/org.el
index e806440..fc850b8 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15415,7 +15415,8 @@ Being in this list makes sure that they are offered for completion.")
 (defun org--update-property-plist (key val props)
   "Associate KEY to VAL in alist PROPS.
 Modifications are made by side-effect.  Return new alist."
-  (let* ((appending (string= (substring key -1) "+"))
+  (let* ((appending (and (string= (substring key -1) "+")
+ (not (string= (substring key -2) "++"
 	 (key (if appending (substring key 0 -1) key))
 	 (old (assoc-string key props t)))
 (if (not old) (cons (cons key val) props)