unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window
@ 2014-09-01 14:59 Stephen Berman
  2014-09-01 17:37 ` Glenn Morris
  2014-09-04 12:27 ` martin rudalics
  0 siblings, 2 replies; 21+ messages in thread
From: Stephen Berman @ 2014-09-01 14:59 UTC (permalink / raw)
  To: 18381

0. emacs -Q
1. Type `M-x calendar' and then `i d' to create a diary file with an
   entry for today.
2. M-x customize-option RET calendar-view-diary-initially-flag RET,
   toggle the value to `On' and save for current session.
3. M-x diary => The diary entry made in step 1 is displayed (in the
   Fancy Diary) in the lower window (which is not the selected window).
4. M-x calendar => The lower window resizes to fit the Calendar, which
   is fleetingly displayed in it but then replaced by the Fancy Diary
   display (in the same resized window).

The same problem happens if the simple diary display is used (e.g. by
customizing diary-display-function).

A real (i.e. my) use case which exposes this problem is to add
`(appt-activate 1)' to your init-file (cf. the commentary in appt.el) so
you see e.g. today's diary entries as in step 3 on starting Emacs, and
then you open the Calendar as in step 4.

The patch below fixes the problem for me, for both types of diary
display, though I haven't yet checked whether the change to
calendar-in-read-only-buffer adversely affects the other users of this
macro, since those are functions I don't use.

This problem does not happen in 24.3 (at least not in the one packaged
with openSUSE 13.1, for which I don't have the Lisp sources at hand), so
the fix should be committed to emacs-24.


In GNU Emacs 24.3.93.7 (x86_64-suse-linux-gnu, GTK+ Version 3.10.4)
 of 2014-08-31 on rosalinde
Repository revision: 117464 rgm@gnu.org-20140828191824-o5hn2x503w527yhn
Windowing system distributor `The X.Org Foundation', version 11.0.11403901
System Description:	openSUSE 13.1 (Bottle) (x86_64)

Configured using:
 `configure --without-toolkit-scroll-bars 'CFLAGS=-g3 -O0''


=== modified file 'lisp/calendar/calendar.el'
*** lisp/calendar/calendar.el	2014-03-17 16:04:32 +0000
--- lisp/calendar/calendar.el	2014-09-01 13:02:00 +0000
***************
*** 1208,1214 ****
       (goto-char (point-min))
       (set-buffer-modified-p nil)
       (setq buffer-read-only t)
!      (display-buffer ,buffer)))
  
  ;; The following are in-line for speed; they can be called thousands of times
  ;; when looking up holidays or processing the diary.  Here, for example, are
--- 1208,1214 ----
       (goto-char (point-min))
       (set-buffer-modified-p nil)
       (setq buffer-read-only t)
!      (display-buffer ,buffer t)))
  
  ;; The following are in-line for speed; they can be called thousands of times
  ;; when looking up holidays or processing the diary.  Here, for example, are

=== modified file 'lisp/calendar/diary-lib.el'
*** lisp/calendar/diary-lib.el	2014-01-01 07:43:34 +0000
--- lisp/calendar/diary-lib.el	2014-09-01 12:28:23 +0000
***************
*** 1023,1029 ****
        (calendar-set-mode-line (format "Diary for %s" (cdr empty))))
      (unless (car empty)                 ; no entries
        (with-current-buffer dbuff
!         (let ((window (display-buffer (current-buffer))))
            ;; d-s-p is passed from diary-list-entries.
            (set-window-point window diary-saved-point)
            (set-window-start window (point-min)))))))
--- 1023,1029 ----
        (calendar-set-mode-line (format "Diary for %s" (cdr empty))))
      (unless (car empty)                 ; no entries
        (with-current-buffer dbuff
!         (let ((window (display-buffer (current-buffer) t)))
            ;; d-s-p is passed from diary-list-entries.
            (set-window-point window diary-saved-point)
            (set-window-start window (point-min)))))))






^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-09-09 18:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-01 14:59 bug#18381: 24.3.93; Diary can wrongly be displayed in Calendar's window Stephen Berman
2014-09-01 17:37 ` Glenn Morris
2014-09-01 18:38   ` Stephen Berman
2014-09-04  0:34     ` Glenn Morris
2014-09-04 12:27 ` martin rudalics
2014-09-04 18:04   ` Glenn Morris
2014-09-04 19:48     ` Glenn Morris
2014-09-04 22:39       ` Glenn Morris
2014-09-04 23:40         ` Glenn Morris
2014-09-05 10:46         ` martin rudalics
2014-09-05 16:14           ` Glenn Morris
2014-09-06  8:52             ` martin rudalics
2014-09-08  6:04               ` Glenn Morris
2014-09-08 20:32                 ` Stephen Berman
2014-09-09  1:26                   ` Glenn Morris
2014-09-09  6:58                     ` martin rudalics
2014-09-09  7:44                       ` Glenn Morris
2014-09-09  9:18                         ` martin rudalics
2014-09-09 18:13                           ` Glenn Morris
2014-09-09 13:00                         ` Stefan Monnier
2014-09-05 10:46     ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).