emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Color entries according to assigned priority
@ 2014-05-03  3:33 Uwe Ziegenhagen
  2014-05-03  7:01 ` Sebastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Ziegenhagen @ 2014-05-03  3:33 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

is it possible to color the different entries in an org file according to
the priority assigned to them?

I'd like to have #a items in black and #b, #c and non-prioritized items in
gray tones.

Uwe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Color entries according to assigned priority
  2014-05-03  3:33 Color entries according to assigned priority Uwe Ziegenhagen
@ 2014-05-03  7:01 ` Sebastien Vauban
  2014-05-03 20:07   ` Uwe Ziegenhagen
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2014-05-03  7:01 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Uwe Ziegenhagen wrote:
> is it possible to color the different entries in an org file according to
> the priority assigned to them?

See "color header based on priority/tags rather than level" on
http://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00625.html.

> I'd like to have #a items in black and #b, #c and non-prioritized items in
> gray tones.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Color entries according to assigned priority
  2014-05-03  7:01 ` Sebastien Vauban
@ 2014-05-03 20:07   ` Uwe Ziegenhagen
  2014-05-03 21:43     ` Alexander Baier
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Ziegenhagen @ 2014-05-03 20:07 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@...> writes:

> 
> Uwe Ziegenhagen wrote:
> > is it possible to color the different entries in an org file according to
> > the priority assigned to them?
> 
> See "color header based on priority/tags rather than level" on
> http://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00625.html.
> 
> > I'd like to have #a items in black and #b, #c and non-prioritized items in
> > gray tones.
> 
> Best regards,
>   Seb
> 


I copied and pasted the given code, however I do not see any change. I'll
try my luck again tomorrow and will get back to you.

Uwe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Color entries according to assigned priority
  2014-05-03 20:07   ` Uwe Ziegenhagen
@ 2014-05-03 21:43     ` Alexander Baier
  2014-05-08  4:36       ` Uwe Ziegenhagen
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Baier @ 2014-05-03 21:43 UTC (permalink / raw)
  To: Uwe Ziegenhagen; +Cc: emacs-orgmode

On 2014-05-03 22:07 Uwe Ziegenhagen wrote:
> I copied and pasted the given code, however I do not see any change. I'll
> try my luck again tomorrow and will get back to you.

Just to be sure, did you eval the pasted code? And restarting org-mode
(M-x fundamental-mode M-x org-mode) could be necessary, too?

HTH,
-- 
Alexander Baier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Color entries according to assigned priority
  2014-05-03 21:43     ` Alexander Baier
@ 2014-05-08  4:36       ` Uwe Ziegenhagen
  2014-05-09 16:40         ` Alexander Baier
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Ziegenhagen @ 2014-05-08  4:36 UTC (permalink / raw)
  To: emacs-orgmode

Alexander Baier <lexi.baier <at> gmail.com> writes:

> 
> On 2014-05-03 22:07 Uwe Ziegenhagen wrote:
> > I copied and pasted the given code, however I do not see any change. I'll
> > try my luck again tomorrow and will get back to you.
> 
> Just to be sure, did you eval the pasted code? And restarting org-mode
> (M-x fundamental-mode M-x org-mode) could be necessary, too?
> 
> HTH,


Yes, I did. I just ran some tests. Using only

;; Do not show welcome screen at startup
(setq inhibit-startup-message t)

;; just answer Emacs' question with 'y' or 'n' instead of 'yes'or 'no'
(defalias 'yes-or-no-p 'y-or-n-p)

;; Load org mode
(add-to-list 'load-path "G:/Programme/emacs-24.3/myLisp/org-8.2.4/lisp")

in my .emacs I get

http://uweziegenhagen.de/gmane/gmane1.png

If I use the code from the posting 

########################################
;; Do not show welcome screen at startup
(setq inhibit-startup-message t)

;; just answer Emacs' question with 'y' or 'n' instead of 'yes'or 'no'
(defalias 'yes-or-no-p 'y-or-n-p)

;; Load org mode
(add-to-list 'load-path "G:/Programme/emacs-24.3/myLisp/org-8.2.4/lisp")

(font-lock-add-keywords 'org-mode
  '(("^.*:write:.*$" . font-lock-keyword-face)))

(setq org-agenda-face-for-tagged-lines
   '(("write" . bold)))

(defun org-agenda-fontify-tagged-line ()
  "Use `org-agenda-face-for-tagged-lines' to fontify lines with certain tags."
  (goto-char (point-min))
  (let (tags)
    (while (progn (forward-line 1) (not (eobp)))
      (if (setq tags (get-text-property (point) 'tags))
          (mapcar
           (lambda (pair)
             (if (member (car pair) tags)
                 (add-text-properties (point-at-bol) (point-at-eol)
`(face,(cdr pair)))))
           org-agenda-face-for-tagged-lines)))))

(add-hook 'org-agenda-finalize-hook 'org-agenda-fontify-tagged-line)
#################################################

I get http://uweziegenhagen.de/gmane/gmane2.png

which is the same.

Uwe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Color entries according to assigned priority
  2014-05-08  4:36       ` Uwe Ziegenhagen
@ 2014-05-09 16:40         ` Alexander Baier
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Baier @ 2014-05-09 16:40 UTC (permalink / raw)
  To: Uwe Ziegenhagen; +Cc: emacs-orgmode

On 2014-05-08 06:36 Uwe Ziegenhagen wrote:
> ########################################
> ;; Do not show welcome screen at startup
> (setq inhibit-startup-message t)
>
> ;; just answer Emacs' question with 'y' or 'n' instead of 'yes'or 'no'
> (defalias 'yes-or-no-p 'y-or-n-p)
>
> ;; Load org mode
> (add-to-list 'load-path "G:/Programme/emacs-24.3/myLisp/org-8.2.4/lisp")
>
> (font-lock-add-keywords 'org-mode
>   '(("^.*:write:.*$" . font-lock-keyword-face)))
>
> (setq org-agenda-face-for-tagged-lines
>    '(("write" . bold)))

None of the tags in the screenshots is :write:. I do not understand,
what you expect to happen here.

> (defun org-agenda-fontify-tagged-line ()
>   "Use `org-agenda-face-for-tagged-lines' to fontify lines with certain tags."
>   (goto-char (point-min))
>   (let (tags)
>     (while (progn (forward-line 1) (not (eobp)))
>       (if (setq tags (get-text-property (point) 'tags))
>           (mapcar
>            (lambda (pair)
>              (if (member (car pair) tags)
>                  (add-text-properties (point-at-bol) (point-at-eol)
> `(face,(cdr pair)))))
>            org-agenda-face-for-tagged-lines)))))
>
> (add-hook 'org-agenda-finalize-hook 'org-agenda-fontify-tagged-line)

To me this looks like something that applies to the agenda only.

Tagging a headline with the :write: tag and generating an agenda view
(e.g. C-c a t) should make those headlines bold.

HTH,
-- 
Alexander Baier

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-09 16:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-03  3:33 Color entries according to assigned priority Uwe Ziegenhagen
2014-05-03  7:01 ` Sebastien Vauban
2014-05-03 20:07   ` Uwe Ziegenhagen
2014-05-03 21:43     ` Alexander Baier
2014-05-08  4:36       ` Uwe Ziegenhagen
2014-05-09 16:40         ` Alexander Baier

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