From 4a34f0655d814bd9358a6b0a010dbfa9a3f3e8b8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 5 Oct 2009 05:39:48 +0000 Subject: [PATCH] (diary-show-all-entries): Re-fit the calendar window if necessary. --- lisp/ChangeLog | 62 +++++++++++++++++++------------------- lisp/calendar/diary-lib.el | 14 ++++++--- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf5bb68f4d8..f5b6633bf08 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-10-05 Stefan Monnier + * calendar/diary-lib.el (diary-show-all-entries): Re-fit the calendar + window if necessary. + * calendar/calendar.el (calendar-basic-setup): Don't call switch-to-buffer in a dedicated window. @@ -30,25 +33,25 @@ 2009-10-04 Karl Fogel - * bookmark.el (bookmark-get-bookmark, bookmark-get-bookmark-record, - bookmark-set-name, bookmark-prop-get, bookmark-prop-set, - bookmark-get-annotation, bookmark-set-annotation, - bookmark-get-filename, bookmark-set-filename, bookmark-get-position, - bookmark-set-position, bookmark-get-front-context-string, - bookmark-set-front-context-string, bookmark-get-rear-context-string, - bookmark-set-rear-context-string, bookmark-location, bookmark-jump, - bookmark-jump-other-window, bookmark-handle-bookmark, - bookmark-relocate, bookmark-insert-location, bookmark-rename, - bookmark-insert, bookmark-delete, bookmark-time-to-save-p, - bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve - doc strings to say whether bookmark can be a string or a record - or both, and make other consistency and clarity fixes. - (bookmark-get-handler, bookmark--jump-via, bookmark-write-file - bookmark-default-annotation-text, bookmark-yank-word, - bookmark-maybe-load-default-file, bookmark-maybe-sort-alist, - bookmark-import-new-list, bookmark-maybe-rename, - bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames, - bookmark-bmenu-bookmark): Give these doc strings. + * bookmark.el (bookmark-get-bookmark, bookmark-get-bookmark-record) + (bookmark-set-name, bookmark-prop-get, bookmark-prop-set) + (bookmark-get-annotation, bookmark-set-annotation) + (bookmark-get-filename, bookmark-set-filename, bookmark-get-position) + (bookmark-set-position, bookmark-get-front-context-string) + (bookmark-set-front-context-string, bookmark-get-rear-context-string) + (bookmark-set-rear-context-string, bookmark-location, bookmark-jump) + (bookmark-jump-other-window, bookmark-handle-bookmark) + (bookmark-relocate, bookmark-insert-location, bookmark-rename) + (bookmark-insert, bookmark-delete, bookmark-time-to-save-p) + (bookmark-edit-annotation-mode, bookmark-edit-annotation): + Improve doc strings to say whether bookmark can be a string or + a record or both, and make other consistency and clarity fixes. + (bookmark-get-handler, bookmark--jump-via, bookmark-write-file) + (bookmark-default-annotation-text, bookmark-yank-word) + (bookmark-maybe-load-default-file, bookmark-maybe-sort-alist) + (bookmark-import-new-list, bookmark-maybe-rename) + (bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames) + (bookmark-bmenu-bookmark): Give these doc strings. (bookmark-bmenu-check-position): Give this a doc string, but also add a FIXME comment about how the function may be pointless. (bookmark-default-handler): Rework doc string and change a @@ -73,15 +76,14 @@ 2009-10-04 Chong Yidong - * cedet/semantic.el (semantic-new-buffer-setup-functions): New - option. + * cedet/semantic.el (semantic-new-buffer-setup-functions): New option. (semantic-new-buffer-fcn): Call parser setup functions here. (semantic-mode): Don't call parser setup functions here, it's done in semantic-new-buffer-fcn now. (semantic-mode): Parse all existing buffers when enabled. - * cedet/srecode/compile.el (srecode-compile-file): Call - semantic-new-buffer-fcn if the buffer has not been parsed. + * cedet/srecode/compile.el (srecode-compile-file): + Call semantic-new-buffer-fcn if the buffer has not been parsed. 2009-10-04 Chong Yidong @@ -148,8 +150,8 @@ * files.el (auto-mode-alist): Add .srt and Project.ede. - * cedet/semantic.el (semantic-mode): Handle - srecode-template-mode-hook as well. + * cedet/semantic.el (semantic-mode): + Handle srecode-template-mode-hook as well. (semantic-mode): Use js-mode-hook for Javascript hook. * cedet/srecode/template.el: Remove hook variable. @@ -163,8 +165,7 @@ * cedet/srecode/map.el (srecode-map-base-template-dir): Look for templates in data-directory. - (srecode-map-save-file): Default to a file in - user-emacs-directory. + (srecode-map-save-file): Default to a file in user-emacs-directory. * cedet/ede/srecode.el (ede-srecode-setup): Use default templates directory. @@ -191,8 +192,8 @@ 2009-10-03 Michael Albinus - * net/tramp-ftp.el (tramp-ftp-file-name-handler): Disable - `file-name-handler-alist' when loading 'ange-ftp. Otherwise, + * net/tramp-ftp.el (tramp-ftp-file-name-handler): + Disable `file-name-handler-alist' when loading 'ange-ftp. Otherwise, there could be recursive loading when `default-directory' is a remote file name. (Bug#4614) @@ -211,8 +212,7 @@ 2009-10-02 Eli Zaretskii - * makefile.w32-in (update-subdirs-CMD): Add cedet to - $(WINS_SUBDIR). + * makefile.w32-in (update-subdirs-CMD): Add cedet to $(WINS_SUBDIR). (WINS_CEDET_SUBDIRS): List of subdirectories of cedet. (bootstrap-clean-CMD, bootstrap-clean-SH): Remove *.elc files in subdirs of cedet as well. diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 9ed28c403a9..1da6e85de82 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1084,14 +1084,20 @@ This function gets rid of the selective display of the diary file so that 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 (or pop-up-frames - (window-dedicated-p (selected-window))))) + (let* ((d-file (diary-check-diary-file)) + (pop-up-frames (or pop-up-frames + (window-dedicated-p (selected-window)))) + (win (selected-window)) + (height (window-height))) (with-current-buffer (or (find-buffer-visiting d-file) (find-file-noselect d-file t)) (when (eq major-mode (default-value 'major-mode)) (diary-mode)) (diary-unhide-everything) - (display-buffer (current-buffer))))) + (display-buffer (current-buffer)) + (when (and (/= height (window-height win)) + (with-current-buffer (window-buffer win) + (derived-mode-p 'calendar-mode))) + (fit-window-to-buffer win))))) (define-obsolete-function-alias 'show-all-diary-entries 'diary-show-all-entries "22.1") -- 2.39.5