-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not seeing anything when I M-x dired-rainbow ... #148
Comments
@godfrey-cw could you show the relevant part of your config pertaining to |
The functions are not interactive so you won't be able to run them with |
This is an example from my config (use-package dired-rainbow
:config
(progn
(dired-rainbow-define html "#4e9a06" ("htm" "html" "xhtml"))
(dired-rainbow-define xml "#b4fa70" ("xml" "xsd" "xsl" "xslt" "wsdl"))
(dired-rainbow-define document font-lock-function-name-face ("doc" "docx" "odt" "pdb" "pdf" "ps" "rtf" "djvu" "epub"))
(dired-rainbow-define excel "#3465a4" ("xlsx"))
(dired-rainbow-define media "#ce5c00" my-dired-media-files-extensions)
(dired-rainbow-define image "#ff4b4b" ("jpg" "png" "jpeg" "gif"))
(dired-rainbow-define log "#c17d11" ("log"))
(dired-rainbow-define sourcefile "#fcaf3e" ("py" "c" "cc" "h" "java" "pl" "rb" "R" "php"))
(dired-rainbow-define executable "#8cc4ff" ("exe" "msi"))
(dired-rainbow-define compressed "#ad7fa8" ("zip" "bz2" "tgz" "txz" "gz" "xz" "z" "Z" "jar" "war" "ear" "rar" "sar" "xpi" "apk" "xz" "tar"))
(dired-rainbow-define packaged "#e6a8df" ("deb" "rpm"))
(dired-rainbow-define encrypted "LightBlue" ("gpg" "pgp"))
(dired-rainbow-define-chmod executable-unix "Green" "-.*x.*")
)) |
Awesome, many thanks that's very helpful. I just basically copy-pasted from the readme, and was adding stuff like
But without any UPDATE: The example you just posted works great -- in my newbie fashion I'll just cautiously tweak that. Thanks for all the |
FWIW I just spent 20 minutes tweaking your example into a pseudo-port of LS_COLORS (didn't actually figure out how to turn ls colors into hex, just used inspection of my terminal and Tailwind CSS colors to find approximations. I skipped extensions I had never heard of and amalgamated where it made sense to me (e.g. grouping
Not sure if you'd consider including this (or a better version of this) as a " |
The last number of the triplet maps through this: https://jonasjacek.github.io/colors/ The This is indeed pretty cool, maybe a simple sed/awk script could turn LS_COLORS into the lisp equivalent. Either way your example can be included in the readme for sure. PR welcome! EDIT: also unrelated, but Algebraic geometry is awesome! My 3rd year thesis was on the Nullstellensatz... a pretty unusual proof through some more obscure theorems. Sadly I only really got into it my last year :/ I was more into CT nonsense due to my compsci origins :D |
I just want to remark that for me, The original value was: "\\sw\\sw\\sw....\\(?:[0-9][0-9]:[0-9][0-9]\\|.[0-9]\\{4\\}\\)" I changed it to: "\\sw\\sw\\sw.\\(?:[0-9][0-9]:[0-9][0-9]\\|[0-9]\\{4\\}\\)" Now everything works fine. So basically, I now wrap all definitions in (let ((dired-hacks-datetime-regexp
"\\sw\\sw\\sw.\\(?:[0-9][0-9]:[0-9][0-9]\\|[0-9]\\{4\\}\\)"))
(dired-rainbow-define-chmod directory "#6cb2eb" "d.*")
.... etc ....
) I have no clue why this change is necessary. Looking at the regexps, it's something with the spaces between the dates and the rights. I pass no unconventional switches to |
These outputs can also depend on the platform and versions of many other packages/commands. Maybe we can come up with a regexp that works for everything out of the box. |
I'd be happy to help if you have any idea which parameters or programs could be relevant. For a starter, maybe it would be enough to just replace the three dots "\\sw\\sw\\sw.*?\\(?:[0-9][0-9]:[0-9][0-9]\\|[0-9]\\{4\\}\\)" Works for me right now, and would also cover the case where the original regexp applied. |
Yes I think that would be reasonable. I'll try it also and we'll see. |
dired-rainbow does not work for me... Within dired the faces used are still the dired-faces when any (C-u C-x =). I tried the trick suggested above but did not work either for me. I am on w10 with Emacs 27.1. Any Idea of how to sort out the issue.... I have attached below a quick snapshot of what I can see. |
@Fuco1 I'm on Emacs 28.2 (Windows 11), I'm not able to get it to work either. Here's my configuration: (use-package dired-rainbow
:ensure t
:after dired
:config
(dired-rainbow-define markdown "#ffed4a" ("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "adoc"
"textfile" "txt"))
(dired-rainbow-define compiled "#4dc0b5" ("asm" "cl" "m" "mm" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc"
"cs" "cp" "cpp" "go" "f" "rs" "hi" "hs" "pyc" ".java"))
) I only see directories with a different colour and nothing more. Any way I can debug this? Help on (
(("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "adoc" "textfile" "txt")
dired-rainbow-markdown-face "\\.\\(?:adoc\\|etx\\|info\\|m\\(?:arkdown\\|k?d\\)\\|nfo\\|org\\|pod\\|rst\\|t\\(?:ex\\(?:tfile\\)?\\|xt\\)\\)")
(("asm" "cl" "m" "mm" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc" "cs" "cp" "cpp" "go" "f" "rs" "hi" "hs" "pyc" ".java")
dired-rainbow-compiled-face "\\.\\(?:\\.java\\|asm\\|c\\(?:\\+\\+\\|pp\\|[clps]\\)\\|el\\|go\\|h\\(?:\\+\\+\\|pp\\|xx\\|[is]\\)\\|lisp\\|mm\\|pyc\\|rs\\|[cfhm]\\)")
) |
Got it working! (setq dired-hacks-datetime-regexp "\\(?:[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]\\|[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)") works as my dired buffers show date and time as |
@purcell has a |
Yeah, extracted from |
Thanks so much !!! my config was only working on my mcbook but failed on linux and PC at work. This simple line fixed the issue. |
@Fuco1 Hi, is dired-rainbow still supposed to work with latest emacs? Faces based on file extension are actually not added, checked with (C-u C-x =). |
The datetime regexp tip helped me too! Thanks! My dired shows datetime as "8. Mär 20:06" or "27. Feb 2023" for examples, so this regexp helped me:
|
Installed dired-rainbow via MELPA with the package manager, along with most of the other dired-hacks packages. All the others are working fine but when I hit
M-x dired-rainbow-define
orM-x describe-function ENTER dired-rainbow-define
I'm not getting anything. When I usedired-rainbow
in my init it doesn't run to completion.Anyway, it seems like my
emacs
isn't finding thedired-rainbow
functions. Any help in this matter would be appreciated!The text was updated successfully, but these errors were encountered: