> From: Frank Ehmsen <frank@eh-is.de>> Date: Sun, 24 Jul 2022 12:05:25 +0200>> Hello Prot,
Hello Frank,
> the fontification for filenames with german umlauts are ignored in > denote 0.3.1.
Indeed! This is similar to what was reported on the GitHub mirror about
non-ascii characters.[1]
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.
Perhaps you can test this?
I guess we also need to test for ß or do you type it as double 's'?
All the best,
Prot
[1] <https://github.com/protesilaos/denote/issues/57>
--
Protesilaos Stavrou
https://protesilaos.com
Hi Frank,
I concur.
File names with special characters are not fontified due to the regex in
'denote-faces--file-name-regexp'
I tried replacing the section '[0-9A-Za-z-]' with [:nonascii:] or
[:alnum:] but that did not work.
P:)
---
Dr Peter Prevos
---------------
peterprevos.com
On 24-07-2022 20:05, Frank Ehmsen wrote:
> Hello Prot,> > the fontification for filenames with german umlauts are ignored in > denote 0.3.1.> > Best regards,> > Frank
> From: Peter Prevos <peter@prevos.net>> Date: Sun, 24 Jul 2022 20:52:47 +1000>> Hi Frank,>> I concur.>> File names with special characters are not fontified due to the regex in > 'denote-faces--file-name-regexp'>> I tried replacing the section '[0-9A-Za-z-]' with [:nonascii:] or > [:alnum:] but that did not work.
I am tinkering with it now. These seem to work 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.")
Evaluate the forms in succession, kill the Dired buffer and open it
again.
[ Coincidentally, the same issue is reported right now on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/61>. ]
--
Protesilaos Stavrou
https://protesilaos.com
> From: Protesilaos Stavrou <info@protesilaos.com>> Date: Sun, 24 Jul 2022 14:38:53 +0300>> I am tinkering with it now. These seem to work for me:>> [... 23 lines elided]
Quick update: I pushed commit 5d245df which should fix this problem.
I intend to prepare a new tagged release (version 0.4.0) in the coming
days. Maybe tomorrow or the day after, depending on how things go.
--
Protesilaos Stavrou
https://protesilaos.com
Hi all,
Am 24.07.22 um 13:38 schrieb Protesilaos Stavrou:
> > I am tinkering with it now. These seem to work 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.")> > Evaluate the forms in succession, kill the Dired buffer and open it> again.>
Confirmed. The fontification is correct after evaluating the forms.
Best regards,
Frank
Hi Frank and Prot,
This solution is almost perfect. I have a note called:
'20181211T193554--5½-reasons-to-ditch-spreadsheets__data.org'
This works for me:
(defvar denote-faces--file-name-regexp
(concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
"\\(?:\\(?3:--\\)\\(?4:[[:alnum:][:nonascii:]-]*\\)\\)?"
"\\(?:\\(?5:__\\)\\(?6:[[:alnum:][:nonascii:]_-]*\\)\\)?"
"\\(?7:\\..*\\)?$")
"Regexp of file names for fontification.")
Regards
P:)
On 25-07-2022 04:38, Frank Ehmsen wrote:
> Hi all,> > Am 24.07.22 um 13:38 schrieb Protesilaos Stavrou:> >> >> I am tinkering with it now. These seem to work 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.")>> >> Evaluate the forms in succession, kill the Dired buffer and open it>> again.>> > > Confirmed. The fontification is correct after evaluating the forms.> > Best regards,> > Frank
> From: Peter Prevos <peter@prevos.net>> Date: Mon, 25 Jul 2022 06:31:45 +1000>> Hi Frank and Prot,
Thank you Frank and Peter!
> This solution is almost perfect. I have a note called: > '20181211T193554--5½-reasons-to-ditch-spreadsheets__data.org'>> This works for me:>> (defvar denote-faces--file-name-regexp> (concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"> "\\(?:\\(?3:--\\)\\(?4:[[:alnum:][:nonascii:]-]*\\)\\)?"> "\\(?:\\(?5:__\\)\\(?6:[[:alnum:][:nonascii:]_-]*\\)\\)?"> "\\(?7:\\..*\\)?$")> "Regexp of file names for fontification.")
Peter, do you want to send a patch which updates this as well as
'denote--title-regexp' and 'denote--keywords-regexp' in denote.el?
Otherwise I can do it from here with you as the author.
All the best,
Prot
--
Protesilaos Stavrou
https://protesilaos.com