From d7a3bb022cdd7d63b6af679a08d4570304d8f28e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 9 Sep 2014 14:09:54 -0400 Subject: [PATCH] * calendar/diary-lib.el (diary-list-entries): Restore 24.3 display behavior. Fixes: debbugs:18381 --- lisp/ChangeLog | 5 +++++ lisp/calendar/diary-lib.el | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f31741a1c5..7018d3c8abb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-09 Glenn Morris + + * calendar/diary-lib.el (diary-list-entries): + Restore 24.3 display behavior. (Bug#18381) + 2014-09-09 Eli Zaretskii * mouse.el (mouse-drag-line): On text-mode frames, count the mode diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index c609cee7d6f..7b07f4f6814 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1,7 +1,6 @@ ;;; diary-lib.el --- diary functions -;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software Foundation, Inc. ;; Author: Edward M. Reingold ;; Maintainer: Glenn Morris @@ -901,12 +900,20 @@ LIST-ONLY is non-nil, in which case it just returns the list." ;;; (diary-include-other-diary-files) ; recurse ;;; (run-hooks 'diary-list-entries-hook)) (unless list-only - (if (and diary-display-function - (listp diary-display-function)) - ;; Backwards compatibility. - (run-hooks 'diary-display-function) - (funcall (or diary-display-function - 'diary-simple-display)))) + ;; Avoid M-x diary; M-x calendar; M-x diary + ;; clobbering the calendar window. + ;; FIXME this is not the right solution. + (let ((display-buffer-fallback-action + (list (delq + 'display-buffer-in-previous-window + (copy-sequence + (car display-buffer-fallback-action)))))) + (if (and diary-display-function + (listp diary-display-function)) + ;; Backwards compatibility. + (run-hooks 'diary-display-function) + (funcall (or diary-display-function + 'diary-simple-display))))) (run-hooks 'diary-hook))))) (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) (or d-incp (message "Preparing diary...done")) -- 2.39.5