From: Stephen Berman <Stephen.Berman@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Diary font-lock problem
Date: Thu, 05 Apr 2007 17:50:54 +0200 [thread overview]
Message-ID: <873b3ees69.fsf@escher.local.home> (raw)
[-- Attachment #1: Type: text/plain, Size: 486 bytes --]
I would like to have diary entries of the form
Thu, Apr 5, 2007 Today's entry
in which the string "Thu, Apr 5, 2007" has diary face. This
fontification is not provided by the default diary setup, but I had
hoped and expected to get it by customizing diary-date-forms
appropriately. However, after making what I think is the necessary
customization, I still don't get the fontification I want. I can
reproduce the problem with emacs -Q:
1. Let ~/.emacs consist only of this sexp:
[-- Attachment #2: ~/.emacs --]
[-- Type: text/plain, Size: 257 bytes --]
(custom-set-variables
'(diary-date-forms (quote ((month "/" day "[^/0-9]") (month "/" day "/" year "[^0-9]") (monthname " *" day "[^,0-9]") (monthname " *" day ", *" year "[^0-9]") (dayname "\\W") (dayname ", *" monthname " *" day ", *" year "[^0-9]")))))
[-- Attachment #3: Type: text/plain, Size: 209 bytes --]
2. emacs -Q
3. M-x calendar
4. In the calendar type `s' to show the whole diary, then in the diary
buffer type the above entry. Only "Thu," has diary face.
If I eval diary-font-lock-keywords I get this:
[-- Attachment #4: diary-font-lock-keywords --]
[-- Type: text/plain, Size: 1698 bytes --]
(("^&?\\(\\([0-9]+\\|\\*\\)/\\([0-9]+\\|\\*\\)[^/0-9]\\)" 1 diary-face) ("^&?\\(\\([0-9]+\\|\\*\\)/\\([0-9]+\\|\\*\\)/-?\\([0-9]+\\|\\*\\)[^0-9]\\)" 1 diary-face) ("^&?\\(\\(A\\(?:pr\\(?:\\.\\|il\\)?\\|ug\\(?:\\.\\|ust\\)?\\)\\|Dec\\(?:\\.\\|ember\\)?\\|Feb\\(?:\\.\\|ruary\\)?\\|J\\(?:an\\(?:\\.\\|uary\\)?\\|u\\(?:l[.y]\\|n[.e]\\|[ln]\\)\\)\\|Ma\\(?:r\\(?:\\.\\|ch\\)\\|y\\.\\|[ry]\\)\\|Nov\\(?:\\.\\|ember\\)?\\|Oct\\(?:\\.\\|ober\\)?\\|Sep\\(?:\\.\\|tember\\)?\\|\\*\\) *\\([0-9]+\\|\\*\\)[^,0-9]\\)" 1 diary-face) ("^&?\\(\\(A\\(?:pr\\(?:\\.\\|il\\)?\\|ug\\(?:\\.\\|ust\\)?\\)\\|Dec\\(?:\\.\\|ember\\)?\\|Feb\\(?:\\.\\|ruary\\)?\\|J\\(?:an\\(?:\\.\\|uary\\)?\\|u\\(?:l[.y]\\|n[.e]\\|[ln]\\)\\)\\|Ma\\(?:r\\(?:\\.\\|ch\\)\\|y\\.\\|[ry]\\)\\|Nov\\(?:\\.\\|ember\\)?\\|Oct\\(?:\\.\\|ober\\)?\\|Sep\\(?:\\.\\|tember\\)?\\|\\*\\) *\\([0-9]+\\|\\*\\), *-?\\([0-9]+\\|\\*\\)[^0-9]\\)" 1 diary-face) ("^&?\\(\\(Fri\\(?:\\.\\|day\\)?\\|Mon\\(?:\\.\\|day\\)?\\|S\\(?:at\\(?:\\.\\|urday\\)?\\|un\\(?:\\.\\|day\\)?\\)\\|T\\(?:hu\\(?:\\.\\|rsday\\)?\\|ue\\(?:\\.\\|sday\\)?\\)\\|Wed\\(?:\\.\\|nesday\\)?\\)\\W\\)" 1 diary-face) ("^&?\\(\\(Fri\\(?:\\.\\|day\\)?\\|Mon\\(?:\\.\\|day\\)?\\|S\\(?:at\\(?:\\.\\|urday\\)?\\|un\\(?:\\.\\|day\\)?\\)\\|T\\(?:hu\\(?:\\.\\|rsday\\)?\\|ue\\(?:\\.\\|sday\\)?\\)\\|Wed\\(?:\\.\\|nesday\\)?\\), *\\(A\\(?:pr\\(?:\\.\\|il\\)?\\|ug\\(?:\\.\\|ust\\)?\\)\\|Dec\\(?:\\.\\|ember\\)?\\|Feb\\(?:\\.\\|ruary\\)?\\|J\\(?:an\\(?:\\.\\|uary\\)?\\|u\\(?:l[.y]\\|n[.e]\\|[ln]\\)\\)\\|Ma\\(?:r\\(?:\\.\\|ch\\)\\|y\\.\\|[ry]\\)\\|Nov\\(?:\\.\\|ember\\)?\\|Oct\\(?:\\.\\|ober\\)?\\|Sep\\(?:\\.\\|tember\\)?\\|\\*\\) *\\([0-9]+\\|\\*\\), *-?\\([0-9]+\\|\\*\\)[^0-9]\\)" 1 diary-face) ...)
[-- Attachment #5: Type: text/plain, Size: 172 bytes --]
The sexp immediately preceding `...' contains the result of the
customization I made above, and the regexp it contains is
string-match'd by the above diary entry string:
[-- Attachment #6: string-match --]
[-- Type: text/plain, Size: 613 bytes --]
(string-match "^&?\\(\\(Fri\\(?:\\.\\|day\\)?\\|Mon\\(?:\\.\\|day\\)?\\|S\\(?:at\\(?:\\.\\|urday\\)?\\|un\\(?:\\.\\|day\\)?\\)\\|T\\(?:hu\\(?:\\.\\|rsday\\)?\\|ue\\(?:\\.\\|sday\\)?\\)\\|Wed\\(?:\\.\\|nesday\\)?\\), *\\(A\\(?:pr\\(?:\\.\\|il\\)?\\|ug\\(?:\\.\\|ust\\)?\\)\\|Dec\\(?:\\.\\|ember\\)?\\|Feb\\(?:\\.\\|ruary\\)?\\|J\\(?:an\\(?:\\.\\|uary\\)?\\|u\\(?:l[.y]\\|n[.e]\\|[ln]\\)\\)\\|Ma\\(?:r\\(?:\\.\\|ch\\)\\|y\\.\\|[ry]\\)\\|Nov\\(?:\\.\\|ember\\)?\\|Oct\\(?:\\.\\|ober\\)?\\|Sep\\(?:\\.\\|tember\\)?\\|\\*\\) *\\([0-9]+\\|\\*\\), *-?\\([0-9]+\\|\\*\\)[^0-9]\\)" "Thu, Apr 5, 2007 Today's entry")
=> 0
[-- Attachment #7: Type: text/plain, Size: 237 bytes --]
Therefore, I assume my customization is what I want and I would expect
the entire date string to have diary face. Should I be doing
something else to get the fontification I want (and if so, what) or is
there a bug here?
Steve Berman
[-- Attachment #8: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
next reply other threads:[~2007-04-05 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 15:50 Stephen Berman [this message]
[not found] <mailman.1789.1175788495.7795.help-gnu-emacs@gnu.org>
2007-04-06 3:28 ` Diary font-lock problem Glenn Morris
2007-04-06 4:15 ` Glenn Morris
2007-04-06 16:00 ` Stephen Berman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873b3ees69.fsf@escher.local.home \
--to=stephen.berman@gmx.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.