Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f6ca63d7
Commit
f6ca63d7
authored
Mar 13, 2008
by
Glenn Morris
Browse files
Whitespace only.
parent
c62a71df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
73 deletions
+77
-73
lisp/calendar/diary-lib.el
lisp/calendar/diary-lib.el
+77
-73
No files found.
lisp/calendar/diary-lib.el
View file @
f6ca63d7
...
@@ -611,50 +611,50 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list."
...
@@ -611,50 +611,50 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list."
(entry-found (list-sexp-diary-entries date)))
(entry-found (list-sexp-diary-entries date)))
(dolist (date-form diary-date-forms)
(dolist (date-form diary-date-forms)
(let* ((backup (when (eq (car date-form) 'backup)
(let* ((backup (when (eq (car date-form) 'backup)
(setq date-form (cdr date-form))
(setq date-form (cdr date-form))
t))
t))
(dayname
(dayname
(format "
%s\\|%s\\.?"
(format "
%s\\|%s\\.?"
(calendar-day-name date)
(calendar-day-name date)
(calendar-day-name date 'abbrev)))
(calendar-day-name date 'abbrev)))
(monthname
(monthname
(format "\\*\\|%s\\|%s\\.?"
(format "\\*\\|%s\\|%s\\.?"
(calendar-month-name month)
(calendar-month-name month)
(calendar-month-name month 'abbrev)))
(calendar-month-name month 'abbrev)))
(month (concat "\\*\\|0*
" (int-to-string month)))
(month (concat "\\*\\|0*
" (int-to-string month)))
(day (concat "
\\*\\|0*" (int-to-string day)))
(day (concat "
\\*\\|0*" (int-to-string day)))
(year
(year
(concat
(concat
"\\*\\|0*
" (int-to-string year)
"\\*\\|0*
" (int-to-string year)
(if abbreviated-calendar-year
(if abbreviated-calendar-year
(concat "
\\|" (format "%02d" (% year 100)))
(concat "
\\|" (format "%02d" (% year 100)))
"")))
"")))
(regexp
(regexp
(concat
(concat
"^" mark "?\\("
"^" mark "?\\("
;; This must be let* so that date-form
;; This must be let* so that date-form
;; can use day etc.
;; can use day etc.
(mapconcat 'eval date-form "\\)\\(?:")
(mapconcat 'eval date-form "\\)\\(?:")
"\\)"))
"\\)"))
(case-fold-search t))
(case-fold-search t))
(goto-char (point-min))
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(while (re-search-forward regexp nil t)
(if backup (re-search-backward "\\<" nil t))
(if backup (re-search-backward "\\<" nil t))
(if (and (bolp) (not (looking-at "[ \t]")))
(if (and (bolp) (not (looking-at "[ \t]")))
;; Diary entry that consists only of date.
;; Diary entry that consists only of date.
(backward-char 1)
(backward-char 1)
;; Found a nonempty diary entry--make it
;; Found a nonempty diary entry--make it
;; visible and add it to the list.
;; visible and add it to the list.
(setq entry-found t)
(setq entry-found t)
(if (looking-at "[ \t]*\n[ \t]") (forward-line 1))
(if (looking-at "[ \t]*\n[ \t]") (forward-line 1))
(let ((entry-start (point))
(let ((entry-start (point))
date-start temp)
date-start temp)
(setq date-start
(setq date-start
(line-end-position
(line-end-position
(if (and (bolp) (> number 1)) -1 0)))
(if (and (bolp) (> number 1)) -1 0)))
(forward-line 1)
(forward-line 1)
(while (looking-at "[ \t]")
(while (looking-at "[ \t]")
(forward-line 1))
(forward-line 1))
(unless (and (eobp) (not (bolp)))
(unless (and (eobp) (not (bolp)))
(backward-char 1))
(backward-char 1))
(unless list-only
(unless list-only
...
@@ -681,8 +681,8 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list."
...
@@ -681,8 +681,8 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list."
'list-diary-entries-hook)
'list-diary-entries-hook)
(unless list-only
(unless list-only
(if diary-display-hook
(if diary-display-hook
(run-hooks 'diary-display-hook)
(run-hooks 'diary-display-hook)
(simple-diary-display)))
(simple-diary-display)))
(run-hooks 'diary-hook)
(run-hooks 'diary-hook)
diary-entries-list))))))
diary-entries-list))))))
...
@@ -1238,17 +1238,21 @@ is marked. See the documentation for the function `list-sexp-diary-entries'."
...
@@ -1238,17 +1238,21 @@ is marked. See the documentation for the function `list-sexp-diary-entries'."
(if (bolp) (backward-char 1))
(if (bolp) (backward-char 1))
(setq entry (buffer-substring-no-properties entry-start (point))))
(setq entry (buffer-substring-no-properties entry-start (point))))
(calendar-for-loop date from first-date to last-date do
(calendar-for-loop date from first-date to last-date do
(if (setq mark (diary-sexp-entry sexp entry
(if (setq mark
(calendar-gregorian-from-absolute date)))
(diary-sexp-entry sexp entry
(progn
(calendar-gregorian-from-absolute date)))
(setq marks (diary-pull-attrs entry file-glob-attrs)
(progn
marks (nth 1 (diary-pull-attrs entry file-glob-attrs)))
;; FIXME what?
(mark-visible-calendar-date
(setq marks (diary-pull-attrs
(calendar-gregorian-from-absolute date)
entry file-glob-attrs)
(if (< 0 (length marks))
marks (nth 1 (diary-pull-attrs
marks
entry file-glob-attrs)))
(if (consp mark)
(mark-visible-calendar-date
(car mark)))))))))))
(calendar-gregorian-from-absolute date)
(if (< 0 (length marks))
marks
(if (consp mark)
(car mark)))))))))))
(defun mark-included-diary-files ()
(defun mark-included-diary-files ()
"
Mark
the
diary
entries
from
other
diary
files
with
those
of
the
diary
file.
"
Mark
the
diary
entries
from
other
diary
files
with
those
of
the
diary
file.
...
@@ -1300,7 +1304,7 @@ Optional argument COLOR is passed to `mark-visible-calendar-date' as MARK."
...
@@ -1300,7 +1304,7 @@ Optional argument COLOR is passed to `mark-visible-calendar-date' as MARK."
(setq day (calendar-absolute-from-gregorian
(setq day (calendar-absolute-from-gregorian
(calendar-nth-named-day 1 dayname prev-month prev-year))
(calendar-nth-named-day 1 dayname prev-month prev-year))
last-day (calendar-absolute-from-gregorian
last-day (calendar-absolute-from-gregorian
(calendar-nth-named-day -1 dayname succ-month succ-year)))
(calendar-nth-named-day -1 dayname succ-month succ-year)))
(while (<= day last-day)
(while (<= day last-day)
(mark-visible-calendar-date (calendar-gregorian-from-absolute day)
(mark-visible-calendar-date (calendar-gregorian-from-absolute day)
color)
color)
...
@@ -1328,8 +1332,8 @@ Optional argument COLOR is passed to `mark-visible-calendar-date' as MARK."
...
@@ -1328,8 +1332,8 @@ Optional argument COLOR is passed to `mark-visible-calendar-date' as MARK."
(or (zerop p-year) (= year p-year))))
(or (zerop p-year) (= year p-year))))
(if (zerop p-day)
(if (zerop p-day)
(calendar-for-loop
(calendar-for-loop
i from 1 to (calendar-last-day-of-month month year) do
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 i year) color))
(mark-visible-calendar-date (list month p-day year) color))))
(mark-visible-calendar-date (list month p-day year) color))))
(defun sort-diary-entries ()
(defun sort-diary-entries ()
...
@@ -1365,7 +1369,7 @@ be used instead of a colon (:) to separate the hour and minute parts."
...
@@ -1365,7 +1369,7 @@ be used instead of a colon (:) to separate the hour and minute parts."
(+ (* 100 (% (string-to-number (match-string 1 s)) 12))
(+ (* 100 (% (string-to-number (match-string 1 s)) 12))
(if (equal ?a (downcase (aref s (match-beginning 2))))
(if (equal ?a (downcase (aref s (match-beginning 2))))
0 1200)))
0 1200)))
((string-match
; hour and minute (XX:XXam or XX:XXpm)
((string-match
; hour and minute (XX:XXam or XX:XXpm)
"\\`[ \t\n]*\\([0-9]?[0-9]\\)[:.]\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
"\\`[ \t\n]*\\([0-9]?[0-9]\\)[:.]\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
(+ (* 100 (% (string-to-number (match-string 1 s)) 12))
(+ (* 100 (% (string-to-number (match-string 1 s)) 12))
(string-to-number (match-string 2 s))
(string-to-number (match-string 2 s))
...
@@ -1926,21 +1930,21 @@ Prefix argument ARG makes the entry nonmarking."
...
@@ -1926,21 +1930,21 @@ Prefix argument ARG makes the entry nonmarking."
(if european-calendar-style
(if european-calendar-style
'(day " " month " " year)
'(day " " month " " year)
'(month " " day " " year)))
'(month " " day " " year)))
(cursor (calendar-cursor-to-date t))
(cursor (calendar-cursor-to-date t))
(mark (or (car calendar-mark-ring)
(mark (or (car calendar-mark-ring)
(error "No mark set in this buffer")))
(error "No mark set in this buffer")))
start end)
start end)
(if (< (calendar-absolute-from-gregorian mark)
(if (< (calendar-absolute-from-gregorian mark)
(calendar-absolute-from-gregorian cursor))
(calendar-absolute-from-gregorian cursor))
(setq start mark
(setq start mark
end cursor)
end cursor)
(setq start cursor
(setq start cursor
end mark))
end mark))
(make-diary-entry
(make-diary-entry
(format "%s(diary-block %s %s)"
(format "%s(diary-block %s %s)"
sexp-diary-entry-symbol
sexp-diary-entry-symbol
(calendar-date-string start nil t)
(calendar-date-string start nil t)
(calendar-date-string end nil t))
(calendar-date-string end nil t))
arg)))
arg)))
;;;###cal-autoload
;;;###cal-autoload
...
@@ -2088,21 +2092,21 @@ names."
...
@@ -2088,21 +2092,21 @@ names."
(day "
\\
(
[0-9]+\\|\\*\\)")
(day "
\\
(
[0-9]+\\|\\*\\)")
(year "-?\\([0-9]+\\|\\*\\
)
"))
(year "-?\\([0-9]+\\|\\*\\
)
"))
(mapcar (lambda (x)
(mapcar (lambda (x)
(cons
(cons
(concat "
^
" (regexp-quote diary-nonmarking-symbol) "
?
"
(concat "
^
" (regexp-quote diary-nonmarking-symbol) "
?
"
(if symbol (regexp-quote symbol) "") "
\\
(
"
(if symbol (regexp-quote symbol) "") "
\\
(
"
(mapconcat 'eval
(mapconcat 'eval
;; If backup, omit first item (backup)
;; If backup, omit first item (backup)
;; and last item (not part of date).
;; and last item (not part of date).
(if (equal (car x) 'backup)
(if (equal (car x) 'backup)
(nreverse (cdr (reverse (cdr x))))
(nreverse (cdr (reverse (cdr x))))
x)
x)
"")
"")
;; With backup, last item is not part of date.
;; With backup, last item is not part of date.
(if (equal (car x) 'backup)
(if (equal (car x) 'backup)
(concat "
\\
)
" (eval (car (reverse x))))
(concat "
\\
)
" (eval (car (reverse x))))
"
\\
)
"))
"
\\
)
"))
'(1 diary-face)))
'(1 diary-face)))
diary-date-forms)))
diary-date-forms)))
(defvar calendar-hebrew-month-name-array-leap-year)
(defvar calendar-hebrew-month-name-array-leap-year)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment