Re: [Orgmode] Re: Agenda view Face for deadlines PATCH

2010-08-16 Thread Bastien
Hi Sébastien,

Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 after the function =org-agenda-highlight-todo=, what's proved (if you don't
 believe me ;-)) by this extract of the *Messages*:

 Loading /usr/share/emacs/23.1/lisp/emacs-lisp/edebug.elc...
 Loading edebug...
 ad-handle-definition: `eval-defun' got redefined
 Loading edebug...done
 Edebug: org-agenda-highlight-todo
 org-agenda-highlight-todo

 Then, calling =C-c a a= (=org-agenda-list=) is *not interrupted* by =edebug=,
 while I was well expecting to step through that function, and see what's done
 with every todo line.

Try this: run `edebug-defun' after `org-finalize-agenda-entries' and
after `org-agenda-highlight-todo' -- here it let me go thru the latter
one step by step...  

-- 
 Bastien

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda view Face for deadlines PATCH

2010-08-12 Thread Bastien
Hi Sébastien,

Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 Though, what I really don't understand is that I `C-u C-M-x' the function
 =org-agenda-highlight-todo=, and then call =org-agenda-list=, expecting to
 trace the function that *highlights every TODO line* of my agenda.

 And... no, *edebug is not launched*!?  I really don't understand
 that...

I'm not using elp so I cannot help on that.

What if you just go to go `org-agenda-highlight-todo' and 

 M-x edebug-defun RET

after it?

-- 
 Bastien

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda view Face for deadlines PATCH

2010-05-21 Thread Carsten Dominik


On May 21, 2010, at 9:43 AM, Sébastien Vauban wrote:


Hi all,

Sébastien Vauban wrote:

Sébastien Vauban wrote:
In the same kind of thought, trying to enhance the way we (or I)  
visualize
tasks in the agenda, I have chosen some sort of inverse video  
face for

deadlines.

(my-org-deadline-yesterday ((t (:foreground white :background  
#D8 :weight bold
(my-org-deadline-today ((t (:foreground white :background  
#E9A36A :weight bold
(my-org-deadline-tomorrow ((t (:foreground black :background  
#B4F1B3 :weight bold
(my-org-deadline-later ((t (:foreground black :background  
#AACAFC


with the following code in my .emacs file:

;; faces for showing deadlines in the agenda
(setq org-agenda-deadline-faces
 '((1.01 . my-org-deadline-yesterday)
   (0.99 . my-org-deadline-today)
   (0.49 . my-org-deadline-tomorrow)
   (0.00 . my-org-deadline-later)))

The result is the following:

Week-agenda (W20-W21):
2010-05-18 Tue  
_
 Personal:   17:15-17:20  
Sarah! :home::errands:
 refile: Sched. 2x:  TODO [#A] Update reservations  
Scorpios   :refile::
x Family: xxx In  -1 d.:  TODO [#A] Photos-reportage Andre  
 :home::computer:


where `xxx' is just some textual way to represent background color.

For the sake of clarity, I'd like the first 2 characters (in front  
of
`Family', in my example) not to be impacted by that face.  
Otherwise, when
in inverse video, they obfuscate the view of the day separators  
and of the

deadline lines.


I was so disturbed by this, and have always wanted to become (and  
still
wants) enlightened in Emacs Lisp and in Org's code that I finally  
took the

time to try and understand how all this works.

Not easy for me, I must admit. Cannot say I can follow the code,  
either,
because of lack of knowledge, on ELisp and on how to trace through  
the code.


Though, I've been able to answer my own demand, by adding a  
function (code

stolen from `org-compat.el'):

(defun org-add-props-from-2 (string plist rest props)
 Add text properties to string, from position 2 to end.
PLIST may be a list of properties, PROPS are individual properties  
and values

that will be added to PLIST.  Returns the string that was modified.
 (add-text-properties
  2 (length string) (if props (append plist props) plist) string)
 string)

and changing one line of `org-agenda.el' (L4619, function
`org-agenda-get-deadlines'):

(org-add-props txt props

to

(org-add-props-from-2 txt props

Maybe that can be factored (much, much) more smartly?

Can this be patched against the source code?


After applying my patch, and playing a bit more with the results, I  
observed

that entering RET on such lines (where the 2 first characters are not
highlighted anymore) does not work anymore: command not allowed on  
this

line.

Is there someone more knowledgeable than I am that could help?


`props' contains a text property with the marker that points to the  
origin of this entry.  Org tries to find this property at the  
beginning of the line and does not find it.


You would have to apply all properties to the full line, then remove  
the face property from the first two characters.


However, I am not sure if this will work, because when one of these  
lines changes, Org might spread the text properties again over the  
full line.  But maybe it will be OK, try it out.


- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode