emacs-pretest-bug
[Top][All Lists]
Advanced

[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 15:08:59 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

On Sat, 07 Apr 2007 12:49:07 +0200 Stephen Berman
<address@hidden> wrote: 

> Since this bug seems similar to the others involving "too late"
> customization that I have reported recently and Glenn Morris fixed, I
> tried similar fixes to diary-date-forms, using the :initial and :set
> keywords and calling (unload-feature 'diary-lib) and (load
> "diary-lib"), but these attempts had no effect.  I could only get the
> customization activated by doing the steps in the preceding paragraph.

I've come up with a hack that fixes the problem, at least for my
usage, but it's seems quite ugly and may well miss a generalization:

*** diary-lib.el~1.122~         2007-03-27 13:06:07.000000000 +0200
--- diary-lib.el                2007-04-07 14:58:04.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,871 ----
  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))))
!     (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,1745 ****
    "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)
--- 1744,1755 ----
    "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)))))
!     (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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]