diff options
| author | Sam Steingold | 2012-06-05 13:33:10 -0400 |
|---|---|---|
| committer | Sam Steingold | 2012-06-05 13:33:10 -0400 |
| commit | 48c455c7016ca1a2197c0e80d6dc5d90a951e277 (patch) | |
| tree | 859bf0a2ede4b4fb7847c073959a454966552699 | |
| parent | d32926ffaadd1d194557add72ccbff239feff26e (diff) | |
| download | emacs-48c455c7016ca1a2197c0e80d6dc5d90a951e277.tar.gz emacs-48c455c7016ca1a2197c0e80d6dc5d90a951e277.zip | |
* lisp/calendar/calendar.el (calendar-exit): reinstate the 2012-03-28 patch.
Fixes: debbugs:11140
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calendar/calendar.el | 63 |
2 files changed, 24 insertions, 44 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87c9844247f..fe4f4e4e449 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-06-05 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * calendar/calendar.el (calendar-exit): reinstate the 2012-03-28 | ||
| 4 | patch (Bug#11140). | ||
| 5 | |||
| 1 | 2012-06-05 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-06-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-list/cust-print.el: Move to obsolete. | 8 | * emacs-list/cust-print.el: Move to obsolete. |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 4d4f7e14187..62d09c6b62c 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1793,19 +1793,6 @@ the STRINGS are just concatenated and the result truncated." | |||
| 1793 | ?\s (- calendar-right-margin (1- start)))))) | 1793 | ?\s (- calendar-right-margin (1- start)))))) |
| 1794 | (force-mode-line-update)))) | 1794 | (force-mode-line-update)))) |
| 1795 | 1795 | ||
| 1796 | (defun calendar-window-list () | ||
| 1797 | "List of all calendar-related windows." | ||
| 1798 | (let ((calendar-buffers (calendar-buffer-list)) | ||
| 1799 | list) | ||
| 1800 | ;; Using 0 rather than t for last argument - see bug#2199. | ||
| 1801 | ;; This is only used with calendar-hide-window, which ignores | ||
| 1802 | ;; iconified frames anyway, so could use 'visible rather than 0. | ||
| 1803 | (walk-windows (lambda (w) | ||
| 1804 | (if (memq (window-buffer w) calendar-buffers) | ||
| 1805 | (push w list))) | ||
| 1806 | nil 0) | ||
| 1807 | list)) | ||
| 1808 | |||
| 1809 | (defun calendar-buffer-list () | 1796 | (defun calendar-buffer-list () |
| 1810 | "List of all calendar-related buffers (as buffers, not strings)." | 1797 | "List of all calendar-related buffers (as buffers, not strings)." |
| 1811 | (let (buffs) | 1798 | (let (buffs) |
| @@ -1817,41 +1804,29 @@ the STRINGS are just concatenated and the result truncated." | |||
| 1817 | (push b buffs))) | 1804 | (push b buffs))) |
| 1818 | buffs)) | 1805 | buffs)) |
| 1819 | 1806 | ||
| 1820 | (defun calendar-exit () | 1807 | (defun calendar-exit (&optional kill) |
| 1821 | "Get out of the calendar window and hide it and related buffers." | 1808 | "Get out of the calendar window and hide it and related buffers." |
| 1822 | (interactive) | 1809 | (interactive "P") |
| 1823 | (let ((diary-buffer (get-file-buffer diary-file))) | 1810 | (let ((diary-buffer (get-file-buffer diary-file)) |
| 1824 | (if (or (not diary-buffer) | 1811 | (calendar-buffers (calendar-buffer-list))) |
| 1825 | (not (buffer-modified-p diary-buffer)) | 1812 | (when (or (not diary-buffer) |
| 1826 | (yes-or-no-p | 1813 | (not (buffer-modified-p diary-buffer)) |
| 1827 | "Diary modified; do you really want to exit the calendar? ")) | 1814 | (yes-or-no-p |
| 1828 | ;; Need to do this multiple times because one time can replace some | 1815 | "Diary modified; do you really want to exit the calendar? ")) |
| 1829 | ;; calendar-related buffers with other calendar-related buffers. | 1816 | (if (and calendar-setup (display-multi-frame-p)) |
| 1830 | (mapc (lambda (x) | 1817 | ;; FIXME: replace this cruft with the `quit-restore' window property |
| 1831 | (mapc 'calendar-hide-window (calendar-window-list))) | 1818 | (dolist (w (window-list-1 nil nil t)) |
| 1832 | (calendar-window-list))))) | 1819 | (if (and (memq (window-buffer w) calendar-buffers) |
| 1820 | (window-dedicated-p w)) | ||
| 1821 | (if calendar-remove-frame-by-deleting | ||
| 1822 | (delete-frame (window-frame w)) | ||
| 1823 | (iconify-frame (window-frame w))) | ||
| 1824 | (quit-window kill w))) | ||
| 1825 | (dolist (b calendar-buffers) | ||
| 1826 | (quit-windows-on b kill)))))) | ||
| 1833 | 1827 | ||
| 1834 | (define-obsolete-function-alias 'exit-calendar 'calendar-exit "23.1") | 1828 | (define-obsolete-function-alias 'exit-calendar 'calendar-exit "23.1") |
| 1835 | 1829 | ||
| 1836 | (defun calendar-hide-window (window) | ||
| 1837 | "Hide WINDOW if it is calendar-related." | ||
| 1838 | (let ((buffer (if (window-live-p window) (window-buffer window)))) | ||
| 1839 | (if (memq buffer (calendar-buffer-list)) | ||
| 1840 | (cond | ||
| 1841 | ((and (display-multi-frame-p) | ||
| 1842 | (eq 'icon (cdr (assoc 'visibility | ||
| 1843 | (frame-parameters | ||
| 1844 | (window-frame window)))))) | ||
| 1845 | nil) | ||
| 1846 | ((and (display-multi-frame-p) (window-dedicated-p window)) | ||
| 1847 | (if calendar-remove-frame-by-deleting | ||
| 1848 | (delete-frame (window-frame window)) | ||
| 1849 | (iconify-frame (window-frame window)))) | ||
| 1850 | ((not (and (select-window window) (one-window-p window))) | ||
| 1851 | (delete-window window)) | ||
| 1852 | (t (set-buffer buffer) | ||
| 1853 | (bury-buffer)))))) | ||
| 1854 | |||
| 1855 | (defun calendar-current-date (&optional offset) | 1830 | (defun calendar-current-date (&optional offset) |
| 1856 | "Return the current date in a list (month day year). | 1831 | "Return the current date in a list (month day year). |
| 1857 | Optional integer OFFSET is a number of days from the current date." | 1832 | Optional integer OFFSET is a number of days from the current date." |