From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: org-read-date with pop-up-frames set to t Date: Thu, 11 Dec 2014 19:13:53 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz8Fb-0006FP-C8 for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:14:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz8FV-00017Q-4y for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:14:07 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:56499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz8FU-00017G-PF for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:14:01 -0500 Received: from top.local (cbg35-2-78-242-14-140.fbx.proxad.net [78.242.14.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 7B4D2140E17E2 for ; Thu, 11 Dec 2014 19:13:58 +0100 (CET) In-Reply-To: (Alan Schmitt's message of "Wed, 03 Dec 2014 14:37:21 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello, Here is a patch that honors the setting for `calendar-setup' when it's 'calendar-only: is now correctly creates a new frame for the calendar, and removes is and restores the focus when the date is selected. As a side effect, is also fixes the bug I reported in this thread. I have signed the FSF papers. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org.el-Allow-calendars-to-be-in-their-own-frame.patch Content-Transfer-Encoding: quoted-printable From=2040c1905f77d706c52cc964449c88c16b64b5a449 Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Thu, 11 Dec 2014 19:01:45 +0100 Subject: [PATCH] org.el: Allow calendars to be in their own frame * lisp/org.el (org-read-date): Create and delete frames if `calendar-setup' is set to 'calendar-only. =2D-- lisp/org.el | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bed5cb9..144d038 100755 =2D-- a/lisp/org.el +++ b/lisp/org.el @@ -16728,9 +16728,10 @@ user." (setcar (nthcdr 1 org-defdecode) 59) (setq org-def (apply 'encode-time org-defdecode) org-defdecode (decode-time org-def))))) + (cur-frame (selected-frame)) (mouse-autoselect-window nil) ; Don't let the mouse jump (calendar-frame-setup nil) =2D (calendar-setup nil) + (calendar-setup (when (eq calendar-setup 'calendar-only) 'calendar-only)) (calendar-move-hook nil) (calendar-view-diary-initially-flag nil) (calendar-view-holidays-initially-flag nil) @@ -16738,7 +16739,7 @@ user." (if org-with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") org-def)) (prompt (concat (if prompt (concat prompt " ") "") (format "Date+time [%s]: " timestr))) =2D ans (org-ans0 "") org-ans1 org-ans2 final) + ans (org-ans0 "") org-ans1 org-ans2 final cal-frame) =20 (cond (from-string (setq ans from-string)) @@ -16746,9 +16747,13 @@ user." (save-excursion (save-window-excursion (calendar) + (when (eq calendar-setup 'calendar-only) + (setq cal-frame + (window-frame (get-buffer-window "*Calendar*" 'visible))) + (select-frame cal-frame)) (org-eval-in-calendar '(setq cursor-type nil) t) =2D (unwind-protect =2D (progn + (unwind-protect + (progn (calendar-forward-day (- (time-to-days org-def) (calendar-absolute-from-gregorian (calendar-current-date)))) @@ -16775,8 +16780,11 @@ user." (use-local-map old-map) (when org-read-date-overlay (delete-overlay org-read-date-overlay) =2D (setq org-read-date-overlay nil))))) =2D (bury-buffer "*Calendar*"))))) + (setq org-read-date-overlay nil))))) + (bury-buffer "*Calendar*") + (when cal-frame + (delete-frame cal-frame) + (select-frame-set-input-focus cur-frame)))))) =20 (t ; Naked prompt only (unwind-protect =2D-=20 2.2.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Best, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJUid7mAAoJEAQNCjtO0uXHgswIAKWa4p1mUrzbRsPV6wu/KJcG NM47rgWVCBt2SITFas0uJeUV+MjiQCoIJVXANxU7Cf1IcVDfgsYGslQmiyKeoy6q Y9f9aPDlQuRj9r7P/GnnzCjtTSX8LroVCXYbYHxXHhGE/Lkuri5Ehj34e+mhwK4h 07AN6XhfjqOBB7y1ZH0oPWIoPEvMjVrdoQwbFRDveKDk0z4SOCYejITAnfWFOJMF 9k33B7yVfmqplh0BjKltuzhbFDT9bWj4V83H5xZRwaHFPsvD9xWhakkjwvdQQPFq AmW8f5HaVKi5+Urx58En4/c1UzF6yebhwsCvJF+B5k4XyI6MLfQ8uTZSI6lCCC8= =ak5D -----END PGP SIGNATURE----- --==-=-=--