From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Kanfer Subject: [PATCH] org-read-date-overlay shown in other buffers, point in calendar window defaults to end of line Date: Mon, 6 Feb 2012 11:22:16 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8f3bafd508405a04b84e1228 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuRL1-0005C6-N0 for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 11:22:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuRKv-0001NX-IR for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 11:22:43 -0500 Received: from mail-gx0-f169.google.com ([209.85.161.169]:55599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuRKv-0001NT-Bi for emacs-orgmode@gnu.org; Mon, 06 Feb 2012 11:22:37 -0500 Received: by ggnu2 with SMTP id u2so3489676ggn.0 for ; Mon, 06 Feb 2012 08:22:36 -0800 (PST) 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@gnu.org --e89a8f3bafd508405a04b84e1228 Content-Type: multipart/alternative; boundary=e89a8f3bafd508405304b84e1226 --e89a8f3bafd508405304b84e1226 Content-Type: text/plain; charset=ISO-8859-1 This patch fixes two bugs in the same section of code: Bug 1: While running org-time-stamp, org-read-date-overlay is shown in the current buffer, even when that buffer isn't the minibuffer. You can see this by entering a file in org-mode, then pressing to run org-time-stamp. The overlay is the yellow highlighted line showing the date that will be entered into the org-mode window. For example, "=> <2012-01-23 Mon>". Move into another window with , and the overlay is displayed there. I don't think this is desired behavior. To fix this, I added a line that inserts org-read-date-overlay only if the current buffer is a minibuffer. Bug 2: While running org-time-stamp, when moving point into the calendar window, there is an error: error in post-command hook (buffer-read-only *Calendar*). Additionally, point is put at the end of the line containing the current day. To reproduce this behavior, press to run org-time-stamp, then press repeatedly until you move point into the window with the Calendar. You will see the aformentioned error, and the cursor will be at the end of the line containing the current day. To fix this, I removed the process of explicitly saving point in the minibuffer and restoring it after inserting org-read-date-overlay, and replaced it with save-excursion. -Zachary Kanfer --e89a8f3bafd508405304b84e1226 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This patch fixes two bugs in the same section of code:

Bug 1: While = running org-time-stamp, org-read-date-overlay is shown in the current buffe= r, even when that buffer isn't the minibuffer. You can see this by ente= ring a file in org-mode, then pressing <C-c .> to run org-time-stamp.= The overlay is the yellow highlighted line showing the date that will be e= ntered into the org-mode window. For example, "=3D> <2012-01-23 = Mon>". Move into another window with <C-x o>, and the overlay= is displayed there. I don't think this is desired behavior.

To fix this, I added a line that inserts org-read-date-overlay only if = the current buffer is a minibuffer.

Bug 2: While running org-time-st= amp, when moving point into the calendar window, there is an error: error i= n post-command hook (buffer-read-only *Calendar*). Additionally, point is p= ut at the end of the line containing the current day. To reproduce this beh= avior, press <C-c .> to run org-time-stamp, then press <C-x o> = repeatedly until you move point into the window with the Calendar.

You will see the aformentioned error, and the cursor will be at the end= of the line containing the current day. To fix this, I removed the process= of explicitly saving point in the minibuffer and restoring it after insert= ing org-read-date-overlay, and replaced it with save-excursion.

-Zachary Kanfer
--e89a8f3bafd508405304b84e1226-- --e89a8f3bafd508405a04b84e1228 Content-Type: text/x-patch; charset=US-ASCII; name="org-time-stamp-2012-02-06.diff" Content-Disposition: attachment; filename="org-time-stamp-2012-02-06.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gybpjs650 ZGlmZiAtLWdpdCBhL2xpc3Avb3JnLmVsIGIvbGlzcC9vcmcuZWwKaW5kZXggYzkzYjdiMi4uM2M5 M2RmZiAxMDA2NDQKLS0tIGEvbGlzcC9vcmcuZWwKKysrIGIvbGlzcC9vcmcuZWwKQEAgLTE1MDUx LDM1ICsxNTA1MSwzNSBAQCB1c2VyLiIKICAgKHdoZW4gb3JnLXJlYWQtZGF0ZS1kaXNwbGF5LWxp dmUKICAgICAod2hlbiBvcmctcmVhZC1kYXRlLW92ZXJsYXkKICAgICAgIChkZWxldGUtb3Zlcmxh eSBvcmctcmVhZC1kYXRlLW92ZXJsYXkpKQotICAgIChsZXQgKChwIChwb2ludCkpKQotICAgICAg KGVuZC1vZi1saW5lIDEpCi0gICAgICAod2hpbGUgKG5vdCAoZXF1YWwgKGJ1ZmZlci1zdWJzdHJp bmcKLQkJCSAgKG1heCAocG9pbnQtbWluKSAoLSAocG9pbnQpIDQpKSAocG9pbnQpKQotCQkJICIg ICAgIikpCi0JKGluc2VydCAiICIpKQotICAgICAgKGdvdG8tY2hhciBwKSkKLSAgICAobGV0KiAo KGFucyAoY29uY2F0IChidWZmZXItc3Vic3RyaW5nIChwb2ludC1hdC1ib2wpIChwb2ludC1tYXgp KQotCQkJIiAiIChvciBvcmctYW5zMSBvcmctYW5zMikpKQotCSAgIChvcmctZW5kLXRpbWUtd2Fz LWdpdmVuIG5pbCkKLQkgICAoZiAob3JnLXJlYWQtZGF0ZS1hbmFseXplIGFucyBkZWYgZGVmZGVj b2RlKSkKLQkgICAoZm10cyAoaWYgb3JnLWRjc3QKLQkJICAgICBvcmctdGltZS1zdGFtcC1jdXN0 b20tZm9ybWF0cwotCQkgICBvcmctdGltZS1zdGFtcC1mb3JtYXRzKSkKLQkgICAoZm10IChpZiAo b3Igd2l0aC10aW1lCi0JCQkoYW5kIChib3VuZHAgJ29yZy10aW1lLXdhcy1naXZlbikgb3JnLXRp bWUtd2FzLWdpdmVuKSkKLQkJICAgIChjZHIgZm10cykKLQkJICAoY2FyIGZtdHMpKSkKLQkgICAo dHh0IChjb25jYXQgIj0+ICIgKGZvcm1hdC10aW1lLXN0cmluZyBmbXQgKGFwcGx5ICdlbmNvZGUt dGltZSBmKSkp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