harrybournis / org-fancy-priorities Goto Github PK
View Code? Open in Web Editor NEWDisplay Org Mode priorities as custom strings
License: MIT License
Display Org Mode priorities as custom strings
License: MIT License
Hi,
I use doom emacs, and am having some issues with fancy-priorities. They work flawlessly in .org buffers. However, the problem is that org agenda does not show the priorities properly. There are two problems that I have noticed:
Versions: Emacs 27.1, doom 2.0.9, org mode 9.5.
By doom sync
ing the following files you will be able to generate my config (more-or-less). I have only included parts which I think might be relevant, but I can give more info if needed.
;; ~/.doom.d/packages.el
;; Followed this fantastic tutorial for the initial install: https://youtu.be/WSF4EgQqa3Q?t=185
(package! org-fancy-priorities)
;; ~/.doom.d/init.el
(doom!
:completion
(company +tng)
ivy
:ui
doom
(emoji +unicode)
fill-column
hl-todo
(ligatures +extra +hasklig)
(popup +defaults)
treemacs
unicode
workspaces
:editor
(evil +everywhere)
word-wrap
:emacs
(dired +icons)
electric
(ibuffer +icons)
:os
tty
:lang
(org +dragndrop +pretty)
:config
(default +bindings +smartparens))
;; ~/.doom.d/config.el
(after! org
(setq!
org-directory "~/agenda-dir/"
org-todo-keywords '((sequence "TODO(t)" "DONE(d!)"))
org-priority-highest '?A
org-priority-lowest '?D
org-priority-default '?D
org-priority-start-cycle-with-default t
org-priority-faces '((?A :foreground "#F54768")
(?B :foreground "#F5C747")
(?C :foreground "#62A6EB")
(?D :foreground "#A0A0A0"))
)
)
;; suggestion from @harrybournis
(add-hook! 'org-mode-hook 'org-fancy-priorities-mode)
(add-hook! 'org-agenda-mode-hook 'org-fancy-priorities-mode)
(after! org-fancy-priorities
(setq!
org-fancy-priorities-list
'("๐
" "๐
" "๐
" "๐
")
))
(after! org-agenda
(setq!
org-agenda-files (directory-files-recursively "~/agenda-dir/" "\\.org$")
))
Following the discussion in reddit, the priorities are still shown as [#A], [#B], and [#C] if the agenda is opened at the time when the file from org-agenda-files is not yet open and contains #+SETUPFILE.
The recepie for emacs -Q (Org mode 8.2.10):
#+SETUPFILE: ~/tmp/1.setup
* TODO [#A] check |- (alphapapa/org-super-agenda: Supercharge your Org daily/weekly agenda by grouping items) :BOOKMARK:
:PROPERTIES:
:CREATED: [2018-02-28 Wed 08:18]
:Source: https://github.com/alphapapa/org-super-agenda/
:END:
* TODO report clock report alignment problem when "|" is in the task name
:PROPERTIES:
:CREATED: [2018-02-28 Wed 20:28]
:END:
:LOGBOOK:
CLOCK: [2018-02-28 Wed 20:28]--[2018-02-28 Wed 20:29] => 0:01
:END:
(eval-and-compile
(require 'package)
(setq package-archives '(("MELPA" . "http://melpa.org/packages/")
("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("SC" . "http://joseito.republika.pl/sunrise-commander/")
("org" . "http://orgmode.org/elpa/")
)
load-prefer-newer t
package-user-dir "~/.emacs.d/elpa"
package--init-file-ensured t
package-enable-at-startup nil)
(unless (file-directory-p package-user-dir)
(make-directory package-user-dir t))
(setq load-path (append load-path '("~/.emacs.d/site-lisp/")))
(setq load-path (append load-path (directory-files "~/.emacs.d/site-lisp/" t "^[^.]" t)))
(setq load-path (append load-path (directory-files package-user-dir t "^[^.]" t)))
(package-initialize))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(use-package diminish :ensure t)
(require 'bind-key)
(use-package org-fancy-priorities
:ensure t
:hook
(org-mode . org-fancy-priorities-mode)
:config
(setq org-fancy-priorities-list '("โก" "โฌ" "โฌ" "โ")))
(use-package org
:mode ("\\.org$" . org-mode)
:demand t
:init
(setq org-agenda-files '("~/tmp/6.org"))
)
The priority is still shown as [#A]. Note, that everything is fine if #+SETUPFILE is not there. The recepie also works when setup file is not empty (my real case).
Hello thanks for this awesome package. Have you thought about making something like
org-fancy-tags? Perhaps you can point me in the right direction. I know you can use org-tag-faces
but I haven't figured out yet how to add emojis yet.
I'm looking to replace my tags with emojis, not sure if something already exists. I'm sure
I could tweak the code some but I read text properties were less taxing than overlays?
(defun my/org-fancy-tags ()
"Description"
(interactive)
(save-excursion
(let (ol)
(while (re-search-forward ".*:\\(someday\\):" nil t)
(setq ol (make-overlay (match-beginning 1) (- (match-end 1) 1)))
;;(message "...%s" (match-string 2))
(overlay-put ol 'display (org-fancy-priorities-get-value "โ"))
(push ol org-fancy-priorities-overlay-list)))))
(my/org-fancy-tags)
The org file:
* Emacs Package :org:someday:
Create an emacs package as awesome as org-fancy-priorities.
The output:
Create an emacs package as awesome as org-fancy-priorities.
Shiift+Up/Down in agenda cycles the priorities. The typical displayed priority display once you try cycling is, for example, โฌCโฌ. This is obviously not right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.