Comments (4)
Hello @hpgisler!
Coincidentally, we are having a discussion about the same topic on the mailing list: https://lists.sr.ht/~protesilaos/denote/%3C2273b3b1-344c-6c6e-3ab6-a227b6bc3721%40eh-is.de%3E
Copying the relevant part of what I wrote:
We basically need to tweak the 'denote-faces--file-name-regexp', specifically groups 4 and 6. Though I am not sure exactly which character class we should include.
Read the Elisp manual by evaluating:
(info "(elisp) Char Classes")
My guess is either [:alpha:] or a combination of [:ascii:] and [:nonascii:] plus the numbers.
Do you think that is the right approach or we should simplify it as you suggest? Also, we technically downcase the title so the current regexp is not correct anyway.
from denote.
This works for me:
(defvar denote-faces--file-name-regexp
(concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
"\\(?:\\(?3:--\\)\\(?4:[[:alnum:]-]*\\)\\)?"
"\\(?:\\(?5:__\\)\\(?6:[[:alnum:]_-]*\\)\\)?"
"\\(?7:\\..*\\)?$")
"Regexp of file names for fontification.")
(defconst denote-faces-file-name-keywords
`((,(concat " " denote-faces--file-name-regexp)
(1 'denote-faces-date)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-title nil t)
(5 'denote-faces-delimiter nil t)
(6 'denote-faces-keywords nil t)
(7 'denote-faces-extension nil t )))
"Keywords for fontification of file names.")
Kill the dired buffer and open it again.
from denote.
Yes, your solution works; thank you.
I've tried the following, which also seems to work;
however, your's more readable, I think
and perhaps it is better to not 'open up' the number of
allowed characters to much...
(defvar denote-faces--file-name-regexp
(concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
"\\(?:\\(?3:--\\)\\(?4:[^_]*\\)\\)?"
"\\(?:\\(?5:__\\)\\(?6:[^.]*\\)\\)?"
"\\(?7:\\..*\\)?$")
"Regexp of file names for fontification.")
from denote.
Thank you for the feedback! Based on it, I pushed my change. Also tweaked some other variables to make them compatible with this.
I will prepare a new release in the coming days. Maybe tomorrow or the day after, depending on how things go.
Closing this issue now.
from denote.
Related Issues (20)
- Hacking `denote-rename-file` to allow changing the ID HOT 9
- Enhancing `denote-rename-file` to handle not-yet-saved visiting buffer HOT 2
- Denote file names... without ID (cue ominous music) HOT 6
- Path in `denote-backlinks` buffer is wrong (extra directory in the link) HOT 5
- A `denote-filetype-heuristics` variant to help other code HOT 5
- sort by title outside of denote-directory HOT 5
- I use `denote-rename-file` as my main file renaming UI HOT 6
- `denote--edit-front-matter-p` docstring vs behavior HOT 1
- Possible to create a denote file outside denote-directory? HOT 5
- markdown links HOT 3
- Commit 232bd90 does not only apply to signatures HOT 13
- is it possible to create single tag with multiple words seperated by delimter? HOT 3
- Backlink buffer aware of org heading HOT 2
- Can't add link to file from within org-capture: "The current file type is not recognized by Denote" HOT 8
- Problem due to overloading `no-confirm` for "save" HOT 7
- How can I figure out which version of denote is currently used? HOT 4
- Templates are not working in denote-org-capture-with-prompts HOT 5
- Cannot add a denote link in `org-add-log-note` HOT 2
- update the link description if the target title is changed HOT 7
- Announcement: Some upcoming features available in my fork HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denote.