[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diary-date-forms customization too late
From: |
Stephen Berman |
Subject: |
Re: diary-date-forms customization too late |
Date: |
Sat, 07 Apr 2007 21:41:01 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) |
On Sat, 07 Apr 2007 21:06:10 +0200 Stephen Berman
<address@hidden> wrote:
> This hack is untenable. What it does must only be done the first
> time diary-show-all or make-diary-entry are invoked but not on
> subsequent invocations (don't want to kill modified buffers!). I
> think the fix must be located in diary-data-forms or somehow tied to
> its taking effect, but I still don't see how to do it.
Well, I've hacked my hack and it now avoids the above noted problem.
Still, there must be a better fix:
*** diary-lib.el~1.122~ 2007-03-27 13:06:07.000000000 +0200
--- diary-lib.el 2007-04-07 21:20:50.000000000 +0200
***************
*** 859,866 ****
all entries, not just some, are visible. If there is no diary buffer, one
is created."
(interactive)
! (let ((d-file (diary-check-diary-file))
! (pop-up-frames (window-dedicated-p (selected-window))))
(with-current-buffer (or (find-buffer-visiting d-file)
(find-file-noselect d-file t))
(when (eq major-mode default-major-mode) (diary-mode))
--- 859,872 ----
all entries, not just some, are visible. If there is no diary buffer, one
is created."
(interactive)
! (let* ((d-file (diary-check-diary-file))
! (pop-up-frames (window-dedicated-p (selected-window)))
! (dbuf (or (find-buffer-visiting d-file)
! (find-file-noselect d-file t))))
! (unless (buffer-modified-p dbuf)
! (kill-buffer dbuf)
! (unload-feature 'diary-lib)
! (load "diary-lib"))
(with-current-buffer (or (find-buffer-visiting d-file)
(find-file-noselect d-file t))
(when (eq major-mode default-major-mode) (diary-mode))
***************
*** 1739,1746 ****
"Insert a diary entry STRING which may be NONMARKING in FILE.
If omitted, NONMARKING defaults to nil and FILE defaults to
`diary-file'."
! (let ((pop-up-frames (window-dedicated-p (selected-window))))
! (find-file-other-window (substitute-in-file-name (or file diary-file))))
(when (eq major-mode default-major-mode) (diary-mode))
(widen)
(diary-unhide-everything)
--- 1745,1758 ----
"Insert a diary entry STRING which may be NONMARKING in FILE.
If omitted, NONMARKING defaults to nil and FILE defaults to
`diary-file'."
! (let ((pop-up-frames (window-dedicated-p (selected-window)))
! (dbuf (find-file-other-window
! (substitute-in-file-name (or file diary-file)))))
! (unless (buffer-modified-p)
! (kill-buffer dbuf)
! (unload-feature 'diary-lib)
! (load "diary-lib")
! (find-file-other-window (substitute-in-file-name (or file
diary-file)))))
(when (eq major-mode default-major-mode) (diary-mode))
(widen)
(diary-unhide-everything)