all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ami Fischman <usenet@fischman.org>
Cc: emacs-devel@gnu.org
Subject: Re: specific coloring of diary calendar entries
Date: Thu, 12 Dec 2002 10:24:53 -0800	[thread overview]
Message-ID: <m3vg1zhz7u.fsf@fischman.org> (raw)
In-Reply-To: 873cp4vylm.fsf@wesley.springies.com

[-- Attachment #1: Type: text/plain, Size: 3147 bytes --]

[missive contains replies to Alan Shutko, Ed Reingold; quotes are
attributed by initials]

Alan Shutko <ats@acm.org> writes:

AS> First, some general comments.  Your diff is reversed.  Next time,

Doh!  Sorry :)

AS> Second, those files have changes a bit since the version you're

True.  For some reason I was under the impression that the calendar mode
was frozen for a long time.  Not sure why I thought that.

AS> specification of colors for sexp diary entries (currently, only in the
AS> calendar display), and font-lock has been enabled.

Perty!

AS> The way the sexp entry coloration works is that you specify a face in
AS> the sexp.  This lets you specify not only foreground color, but also
AS> slants, under or overline, inverse video, background, etc.

Interesting.  I don't like this approach, because it forces the user of
calendar mode to define faces himself.  I know that for me, at least, it is
much more useful to just say "[color:green]" than to create a face dedicated
to having a green fg.  My new patches keep my approach (of just specifying a
fg color), but still use the sexp face marking if it is specified by the
user.

AS> You added arguments to a number of functions, but you didn't change
AS> other files that use them.  

Guilty as charged.  Meant to make the args &optional, but apparently
forgot.  Fixed now.

AS> I don't think it's very helpful to have the file glob color in the
AS> diary-entries-list.  

Hmm.  The reason I did it as I did, was that I wanted to keep a notion of
which file an entry came from.  I agree that re-parsing for the colors is
silly, so made the change you suggest.  

AS> I'd disagree that sexps are necessarily less important than regular
AS> entries, btw.  If you don't see your anniversary on the calendar because
AS> the color to pick your kid up after school overrode it, you're in for
AS> a heap of trouble....

I disagree.  An irritated spouse is much better than a kid stranded for
8 hours after school ;)  I refer you to one of the early episodes of
_Malcolm in the Middle_ for proof.
However, even if I wanted to change this, I don't think it would be an easy
change to make.  sexp's get parsed for completely separately from
non-sexp's, so it would require a priority system that I just don't think
is worth it.

Then Ed Reingold <reingold@emr.cs.iit.edu> wrote:

ER> I like the idea, but the characters used to set off the colors (square
ER> brackets and the colon) should be user-definable, just like the non-marking
ER> symbol, sexp-expression symbol, etc.  I often use square brackets and colons
ER> in my diary entries!

Good point.  Added defcustoms for diary-color-regexp and
diary-glob-file-color-regexp.

One other feature I added (at the request of Kai Grossjohann) is the
prefixing of diary entries with the filename from which they came.  This is
controlled by the defcustom diary-file-name-prefix which defaults to nil
since I don't like it :)

Please check out the attached patches (against current CVS, and in the
right order this time :)) and let me know of any comments, suggestions,
questions, or flames.

Cheers,
-- 
  Ami Fischman
  usenet@fischman.org


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: col-cal.patch --]
[-- Type: text/x-patch, Size: 3455 bytes --]

*** /home/fischman/cvs/emacs/lisp/calendar/calendar.el	2002-12-07 13:30:57.000000000 -0800
--- calendar.el	2002-12-12 09:57:10.000000000 -0800
***************
*** 496,503 ****
--- 496,520 ----
  See the documentation for the function `include-other-diary-files'."
    :type 'string
    :group 'diary)
  
+ (defcustom diary-glob-file-color-regexp "^#[ \t]*\\[color:\\([a-z]+\\)\\]$"
+   "*The regular expression that picks off the global file color for 
+ colored diary/calendar displays."
+   :type 'string
+   :group 'diary)
+ 
+ (defcustom diary-color-regexp "\\[color:\\([a-z]+\\)\\]$"
+   "*The regular expression that picks off the entry's color for 
+ colored diary/calendar displays."
+   :type 'string
+   :group 'diary)
+ 
+ (defcustom diary-file-name-prefix nil
+   "If non-nil then each entry in the diary list will be prefixed with the name of the file in which it was defined."
+   :type 'boolean
+   :group 'diary)
+ 
  ;;;###autoload
  (defcustom sexp-diary-entry-symbol "%%"
    "*The string used to indicate a sexp diary entry in `diary-file'.
  See the documentation for the function `list-sexp-diary-entries'."
***************
*** 2552,2574 ****
     (= (extract-calendar-year date1) (extract-calendar-year date2))))
  
  (defun mark-visible-calendar-date (date &optional mark)
    "Mark DATE in the calendar window with MARK.
! MARK is either a single-character string or a face.
  MARK defaults to `diary-entry-marker'."
    (if (calendar-date-is-legal-p date)
        (save-excursion
          (set-buffer calendar-buffer)
          (calendar-cursor-to-visible-date date)
!         (let ((mark (or mark diary-entry-marker)))
!           (if (stringp mark)
!               (let ((buffer-read-only nil))
!                 (forward-char 1)
!                 (delete-char 1)
!                 (insert mark)
!                 (forward-char -2))
! 	    (overlay-put
!              (make-overlay (1- (point)) (1+ (point))) 'face mark))))))
  
  (defun calendar-star-date ()
    "Replace the date under the cursor in the calendar window with asterisks.
  This function can be used with the `today-visible-calendar-hook' run after the
--- 2569,2600 ----
     (= (extract-calendar-year date1) (extract-calendar-year date2))))
  
  (defun mark-visible-calendar-date (date &optional mark)
    "Mark DATE in the calendar window with MARK.
! MARK is a single-character string, an x-color-name string, or a face.
  MARK defaults to `diary-entry-marker'."
    (if (calendar-date-is-legal-p date)
        (save-excursion
          (set-buffer calendar-buffer)
          (calendar-cursor-to-visible-date date)
! 	(let ((mark (or (and (stringp mark) (> (length mark) 0) mark)
! 			(and (not (stringp mark)) mark)
! 			diary-entry-marker)))
! 	  (if (stringp mark)
! 	      (if (= (length mark) 1)
! 		  (let ((buffer-read-only nil))
! 		    (forward-char 1)
! 		    (delete-char 1)
! 		    (insert mark)
! 		    (forward-char -2))
! 		(progn
! 		  (setq temp-face (make-symbol (concat "cal-col-face-" mark)))
! 		  (make-face temp-face)
! 		  (set-face-foreground temp-face mark)
! 		  (overlay-put
! 		   (make-overlay (1- (point)) (1+ (point))) 'face temp-face)))
!             (overlay-put
! 	     (make-overlay (1- (point)) (1+ (point))) 'face mark))))))
  
  (defun calendar-star-date ()
    "Replace the date under the cursor in the calendar window with asterisks.
  This function can be used with the `today-visible-calendar-hook' run after the

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: col-dia.patch --]
[-- Type: text/x-patch, Size: 19946 bytes --]

*** /home/fischman/cvs/emacs/lisp/calendar/diary-lib.el	2002-11-18 01:05:22.000000000 -0800
--- diary-lib.el	2002-12-12 09:58:25.000000000 -0800
***************
*** 232,239 ****
--- 232,247 ----
  		(set-buffer (find-file-noselect d-file t))
  	      (set-buffer diary-buffer)
  	      (or (verify-visited-file-modtime diary-buffer)
  		  (revert-buffer t t))))
+ 	  ;; AMI -- Figure out the file-glob-color
+ 	  (setq file-glob-color "")
+ 	  (save-excursion
+ 	    (goto-char (point-min))
+ 	    (if (re-search-forward diary-glob-file-color-regexp (point-max) t)
+ 		(setq file-glob-color (buffer-substring-no-properties
+ 				       (match-beginning 1)
+ 				       (match-end 1)))))
            (setq selective-display t)
            (setq selective-display-ellipses nil)
            (setq old-diary-syntax-table (syntax-table))
            (set-syntax-table diary-syntax-table)
***************
*** 307,327 ****
                                 (re-search-forward "\^M\\|\n" nil t))
                               (backward-char 1)
                               (subst-char-in-region date-start
                                  (point) ?\^M ?\n t)
                               (add-to-diary-list
                                date
!                               (buffer-substring
!                                entry-start (point))
                                (buffer-substring
                                 (1+ date-start) (1- entry-start))
! 			      (copy-marker entry-start))))))
                       (setq d (cdr d)))
                     (or entry-found
                         (not diary-list-include-blanks)
                         (setq diary-entries-list
                               (append diary-entries-list
!                                      (list (list date "" "")))))
                     (setq date
                           (calendar-gregorian-from-absolute
                             (1+ (calendar-absolute-from-gregorian date))))
                     (setq entry-found nil)))
--- 315,341 ----
                                 (re-search-forward "\^M\\|\n" nil t))
                               (backward-char 1)
                               (subst-char-in-region date-start
                                  (point) ?\^M ?\n t)
+ 			     (setq color file-glob-color)
+ 			     (setq entry (buffer-substring entry-start (point)))
+ 			     (save-excursion
+ 			       (if (string-match diary-color-regexp entry)
+ 				   (setq color (substring-no-properties entry
+ 									(match-beginning 1)
+ 									(match-end 1)))))
                               (add-to-diary-list
                                date
! 			      entry
                                (buffer-substring
                                 (1+ date-start) (1- entry-start))
! 			      (copy-marker entry-start) color)))))
                       (setq d (cdr d)))
                     (or entry-found
                         (not diary-list-include-blanks)
                         (setq diary-entries-list
                               (append diary-entries-list
!                                      (list (list date "" "" "" "")))))
                     (setq date
                           (calendar-gregorian-from-absolute
                             (1+ (calendar-absolute-from-gregorian date))))
                     (setq entry-found nil)))
***************
*** 512,526 ****
  					 x)
                                         date-holiday-list
                                         (concat "\n" (make-string l ? ))))
                      (insert ?\n (make-string (+ l longest) ?=) ?\n)))))
!           (if (< 0 (length (car (cdr (car entry-list)))))
! 	      (if (nth 3 (car entry-list))
! 		  (insert-button (concat (car (cdr (car entry-list))) "\n")
! 				 'marker (nth 3 (car entry-list))
! 				 :type 'diary-entry)
! 		(insert (car (cdr (car entry-list))) ?\n)))
!           (setq entry-list (cdr entry-list))))
        (set-buffer-modified-p nil)
        (goto-char (point-min))
        (setq buffer-read-only t)
        (display-buffer fancy-diary-buffer)
--- 526,558 ----
  					 x)
                                         date-holiday-list
                                         (concat "\n" (make-string l ? ))))
                      (insert ?\n (make-string (+ l longest) ?=) ?\n)))))
! 
! 	  (setq entry (car (cdr (car entry-list))))
! 	  (if (< 0 (length entry))
! 	      (progn
! 		(if (nth 3 (car entry-list))
! 		    (insert-button (concat entry "\n")
! 				   'marker (nth 3 (car entry-list))
! 				   :type 'diary-entry)
! 		  (insert entry ?\n))
! 		;; AMI -- pick off the color that was the global file 
! 		;;        color for this entry when it was read in
! ;		(setq file-glob-color (fifth (car entry-list)))
! 		;; AMI - find color for this diary entry if one is present
! 		(setq color (fifth (car entry-list)))
! 		(save-excursion
! 		  (if (not (string= color ""))
! 		      (progn
!                        (search-backward entry)
!                        (setq temp-face (make-symbol (concat "cal-col-face-" color)))
!                        (make-face temp-face)
!                        (set-face-foreground temp-face color)
!                        (overlay-put
!                         (make-overlay (match-beginning 0) (match-end 0)) 'face temp-face)))
! 		  )))
! 	  (setq entry-list (cdr entry-list))))
        (set-buffer-modified-p nil)
        (goto-char (point-min))
        (setq buffer-read-only t)
        (display-buffer fancy-diary-buffer)
***************
*** 696,703 ****
--- 728,743 ----
          (if (file-readable-p d-file)
              (save-excursion
                (message "Marking diary entries...")
                (set-buffer (find-file-noselect d-file t))
+ 	      ;; AMI - find global color for this file
+ 	      (setq file-glob-color "")
+ 	      (save-excursion
+ 		(goto-char (point-min))
+ 		(if (re-search-forward diary-glob-file-color-regexp (point-max) t)
+ 		    (setq file-glob-color (buffer-substring-no-properties
+ 					   (match-beginning 1)
+ 					   (match-end 1)))))
                (let ((d diary-date-forms)
                      (old-diary-syntax-table))
                  (setq old-diary-syntax-table (syntax-table))
                  (set-syntax-table diary-syntax-table)
***************
*** 774,789 ****
                                             (if (> (- current-y y) 50)
                                                 (+ y 100)
                                               y)))
                                       (string-to-int y-str)))))
                          (if dd-name
                              (mark-calendar-days-named
                               (cdr (assoc-ignore-case
                                     (substring dd-name 0 3)
                                     (calendar-make-alist
                                      calendar-day-name-array
                                      0
!                                     (lambda (x) (substring x 0 3))))))
                            (if mm-name
                                (if (string-equal mm-name "*")
                                    (setq mm 0)
                                  (setq mm
--- 814,836 ----
                                             (if (> (- current-y y) 50)
                                                 (+ y 100)
                                               y)))
                                       (string-to-int y-str)))))
+ 			;; AMI - find color for this diary entry
+  			(setq color file-glob-color)
+  			(save-excursion
+ 			  (if (re-search-forward diary-color-regexp (line-end-position) t)
+  			      (setq color (buffer-substring-no-properties
+ 					   (match-beginning 1)
+  					   (match-end 1)))))
                          (if dd-name
                              (mark-calendar-days-named
                               (cdr (assoc-ignore-case
                                     (substring dd-name 0 3)
                                     (calendar-make-alist
                                      calendar-day-name-array
                                      0
!                                     (lambda (x) (substring x 0 3))))) color)
                            (if mm-name
                                (if (string-equal mm-name "*")
                                    (setq mm 0)
                                  (setq mm
***************
*** 793,801 ****
                                               calendar-month-name-array
                                               1
                                               (lambda (x) (substring x 0 3)))
                                              )))))
!                           (mark-calendar-date-pattern mm dd yy))))
                      (setq d (cdr d))))
                  (mark-sexp-diary-entries)
                  (run-hooks 'nongregorian-diary-marking-hook
                             'mark-diary-entries-hook)
--- 840,848 ----
                                               calendar-month-name-array
                                               1
                                               (lambda (x) (substring x 0 3)))
                                              )))))
!                           (mark-calendar-date-pattern mm dd yy color))))
                      (setq d (cdr d))))
                  (mark-sexp-diary-entries)
                  (run-hooks 'nongregorian-diary-marking-hook
                             'mark-diary-entries-hook)
***************
*** 850,858 ****
                       (char-equal (preceding-char) ?\n))
                   (not (looking-at " \\|\^I")))
              (progn;; Diary entry consists only of the sexp
                (backward-char 1)
!               (setq entry ""))
            (setq entry-start (point))
            ;; Find end of entry
            (re-search-forward "\^M\\|\n" nil t)
            (while (looking-at " \\|\^I")
--- 897,905 ----
                       (char-equal (preceding-char) ?\n))
                   (not (looking-at " \\|\^I")))
              (progn;; Diary entry consists only of the sexp
                (backward-char 1)
!               (setq entry ""  color nil))
            (setq entry-start (point))
            ;; Find end of entry
            (re-search-forward "\^M\\|\n" nil t)
            (while (looking-at " \\|\^I")
***************
*** 866,877 ****
              (aset entry (match-beginning 0) ?\n )))
          (calendar-for-loop date from first-date to last-date do
            (if (setq mark (diary-sexp-entry sexp entry
                                  (calendar-gregorian-from-absolute date)))
!               (mark-visible-calendar-date
!                (calendar-gregorian-from-absolute date)
!                (if (consp mark)
!                    (car mark)))))))))
  
  (defun mark-included-diary-files ()
    "Mark the diary entries from other diary files with those of the diary file.
  This function is suitable for use as the `mark-diary-entries-hook'; it enables
--- 913,934 ----
              (aset entry (match-beginning 0) ?\n )))
          (calendar-for-loop date from first-date to last-date do
            (if (setq mark (diary-sexp-entry sexp entry
                                  (calendar-gregorian-from-absolute date)))
! 	      ;; AMI - find color for this diary entry
! 	      (progn
! 		(setq color "")
! 		(save-excursion
! 		  (if (string-match diary-color-regexp entry)
! 		      (setq color (substring-no-properties entry
! 							   (match-beginning 1)
! 							   (match-end 1)))))
! 		(mark-visible-calendar-date
! 		 (calendar-gregorian-from-absolute date) 
! 		 (if (< 0 (length color))
! 		     color
! 		   (if (consp mark)
! 		     (car mark)))))))))))
  
  (defun mark-included-diary-files ()
    "Mark the diary entries from other diary files with those of the diary file.
  This function is suitable for use as the `mark-diary-entries-hook'; it enables
***************
*** 904,912 ****
          (message "Can't find included diary file %s" diary-file)
          (sleep-for 2))))
    (goto-char (point-min)))
  
! (defun mark-calendar-days-named (dayname)
    "Mark all dates in the calendar window that are day DAYNAME of the week.
  0 means all Sundays, 1 means all Mondays, and so on."
    (save-excursion
      (set-buffer calendar-buffer)
--- 961,969 ----
          (message "Can't find included diary file %s" diary-file)
          (sleep-for 2))))
    (goto-char (point-min)))
  
! (defun mark-calendar-days-named (dayname &optional color)
    "Mark all dates in the calendar window that are day DAYNAME of the week.
  0 means all Sundays, 1 means all Mondays, and so on."
    (save-excursion
      (set-buffer calendar-buffer)
***************
*** 922,945 ****
                   (calendar-nth-named-day 1 dayname prev-month prev-year)))
        (setq last-day (calendar-absolute-from-gregorian
                   (calendar-nth-named-day -1 dayname succ-month succ-year)))
        (while (<= day last-day)
!         (mark-visible-calendar-date (calendar-gregorian-from-absolute day))
          (setq day (+ day 7))))))
  
! (defun mark-calendar-date-pattern (month day year)
    "Mark all dates in the calendar window that conform to MONTH/DAY/YEAR.
  A value of 0 in any position is a wildcard."
    (save-excursion
      (set-buffer calendar-buffer)
      (let ((m displayed-month)
            (y displayed-year))
        (increment-calendar-month m y -1)
        (calendar-for-loop i from 0 to 2 do
!           (mark-calendar-month m y month day year)
            (increment-calendar-month m y 1)))))
  
! (defun mark-calendar-month (month year p-month p-day p-year)
    "Mark dates in the MONTH/YEAR that conform to pattern P-MONTH/P_DAY/P-YEAR.
  A value of 0 in any position of the pattern is a wildcard."
    (if (or (and (= month p-month)
                 (or (= p-year 0) (= year p-year)))
--- 979,1002 ----
                   (calendar-nth-named-day 1 dayname prev-month prev-year)))
        (setq last-day (calendar-absolute-from-gregorian
                   (calendar-nth-named-day -1 dayname succ-month succ-year)))
        (while (<= day last-day)
!         (mark-visible-calendar-date (calendar-gregorian-from-absolute day) color)
          (setq day (+ day 7))))))
  
! (defun mark-calendar-date-pattern (month day year &optional color)
    "Mark all dates in the calendar window that conform to MONTH/DAY/YEAR.
  A value of 0 in any position is a wildcard."
    (save-excursion
      (set-buffer calendar-buffer)
      (let ((m displayed-month)
            (y displayed-year))
        (increment-calendar-month m y -1)
        (calendar-for-loop i from 0 to 2 do
!           (mark-calendar-month m y month day year color)
            (increment-calendar-month m y 1)))))
  
! (defun mark-calendar-month (month year p-month p-day p-year &optional color)
    "Mark dates in the MONTH/YEAR that conform to pattern P-MONTH/P_DAY/P-YEAR.
  A value of 0 in any position of the pattern is a wildcard."
    (if (or (and (= month p-month)
                 (or (= p-year 0) (= year p-year)))
***************
*** 947,956 ****
                 (or (= p-year 0) (= year p-year))))
        (if (= p-day 0)
            (calendar-for-loop
                i from 1 to (calendar-last-day-of-month month year) do
!             (mark-visible-calendar-date (list month i year)))
!         (mark-visible-calendar-date (list month p-day year)))))
  
  (defun sort-diary-entries ()
    "Sort the list of diary entries by time of day."
    (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare)))
--- 1004,1013 ----
                 (or (= p-year 0) (= year p-year))))
        (if (= p-day 0)
            (calendar-for-loop
                i from 1 to (calendar-last-day-of-month month year) do
!             (mark-visible-calendar-date (list month i year) color))
!         (mark-visible-calendar-date (list month p-day year) color))))
  
  (defun sort-diary-entries ()
    "Sort the list of diary entries by time of day."
    (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare)))
***************
*** 1171,1178 ****
--- 1228,1240 ----
           (sexp-mark (regexp-quote sexp-diary-entry-symbol))
           (s-entry (concat "\\(\\`\\|\^M\\|\n\\)" mark "?" sexp-mark "("))
           (entry-found))
      (goto-char (point-min))
+     (save-excursion
+       (if (re-search-forward diary-glob-file-color-regexp (point-max) t)
+ 	  (setq file-glob-color (buffer-substring-no-properties
+ 				 (match-beginning 1)
+ 				 (match-end 1)))))
      (while (re-search-forward s-entry nil t)
        (backward-char 1)
        (let ((sexp-start (point))
              (sexp)
***************
*** 1203,1219 ****
            (setq entry (buffer-substring-no-properties entry-start (point)))
            (while (string-match "[\^M]" entry)
              (aset entry (match-beginning 0) ?\n )))
          (let ((diary-entry (diary-sexp-entry sexp entry date)))
            (if diary-entry
!               (subst-char-in-region line-start (point) ?\^M ?\n t))
!           (add-to-diary-list date
! 			     (if (consp diary-entry)
! 				 (cdr diary-entry)
! 			       diary-entry)
  			     specifier
  			     (if entry-start (copy-marker entry-start)
! 			       nil))
  	  (setq entry-found (or entry-found diary-entry)))))
      entry-found))
  
  (defun diary-sexp-entry (sexp entry date)
--- 1265,1291 ----
            (setq entry (buffer-substring-no-properties entry-start (point)))
            (while (string-match "[\^M]" entry)
              (aset entry (match-beginning 0) ?\n )))
          (let ((diary-entry (diary-sexp-entry sexp entry date)))
+ 	  (setq entry (if (consp diary-entry)
+ 			  (cdr diary-entry)
+ 			diary-entry))
            (if diary-entry
! 	      (progn
! 		(subst-char-in-region line-start (point) ?\^M ?\n t)
! 		(setq color file-glob-color)
! 		(if (< 0 (length entry))
! 		    (save-excursion
! 		      (if (string-match diary-color-regexp entry) 
! 			  (setq color (substring-no-properties entry
! 				       (match-beginning 1)
! 				       (match-end 1))))))))
! 	  (add-to-diary-list date
! 			     entry
  			     specifier
  			     (if entry-start (copy-marker entry-start)
! 			       nil) 
! 			     color)
  	  (setq entry-found (or entry-found diary-entry)))))
      entry-found))
  
  (defun diary-sexp-entry (sexp entry date)
***************
*** 1469,1483 ****
       ((and (listp days) days)
        (or (diary-remind sexp (car days) marking)
            (diary-remind sexp (cdr days) marking))))))
  
! (defun add-to-diary-list (date string specifier marker)
!   "Add the entry (DATE STRING SPECIFIER) to `diary-entries-list'.
  Do nothing if DATE or STRING is nil."
    (and date string
         (setq diary-entries-list
               (append diary-entries-list
! 		     (list (list date string specifier marker))))))
  
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
  If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."
--- 1541,1558 ----
       ((and (listp days) days)
        (or (diary-remind sexp (car days) marking)
            (diary-remind sexp (cdr days) marking))))))
  
! (defun add-to-diary-list (date string specifier marker &optional globcolor)
!   "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to `diary-entries-list'.
  Do nothing if DATE or STRING is nil."
    (and date string
+        (if diary-file-name-prefix
+ 	   (setq string (concat "[" (buffer-file-name) "] " string))
+ 	 t)
         (setq diary-entries-list
               (append diary-entries-list
! 		     (list (list date string specifier marker globcolor))))))
  
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
  If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2002-12-12 18:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 23:58 specific coloring of diary calendar entries Ami Fischman
2002-12-12  1:02 ` Alan Shutko
2002-12-12 18:24   ` Ami Fischman [this message]
2002-12-12 18:56     ` Ami Fischman
2002-12-12 19:31     ` Alan Shutko
2002-12-13 10:14       ` Kai Großjohann
2002-12-14  1:05     ` Alan Shutko
2002-12-14  1:42       ` Miles Bader
2002-12-13 22:22 ` Richard Stallman
2002-12-13 23:37   ` Ami Fischman
2002-12-14  0:07     ` Alan Shutko
2002-12-15 23:39     ` Richard Stallman
2002-12-16  0:31       ` Alex Schroeder
2002-12-17 18:44         ` Richard Stallman
2002-12-17  6:18       ` Ami Fischman
2002-12-17  9:42         ` Alex Schroeder
2002-12-17 16:03           ` Alan Shutko
2002-12-17 11:05         ` Kai Großjohann
2002-12-17 16:02           ` Alan Shutko
2002-12-17 11:07         ` Kai Großjohann
2002-12-18  2:01         ` Richard Stallman
2002-12-18 22:27           ` Ami Fischman
2002-12-19  6:02             ` Ami Fischman
2002-12-19 18:03               ` Ami Fischman

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=m3vg1zhz7u.fsf@fischman.org \
    --to=usenet@fischman.org \
    --cc=emacs-devel@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.