emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug (regression) in org-replace-disputed-keys. Bisected.
@ 2014-09-09 11:42 Teika Kazura
  2014-09-28 20:07 ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Teika Kazura @ 2014-09-09 11:42 UTC (permalink / raw)
  To: emacs-orgmode

Hello, org-world. I experience a regression in org-replace-disputed-keys, and I git-bisected it.

* Symptom: org-replace-disputed-keys doesn't work for me.
Emacs version: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.0.12)

* How to reproduce it:
1. Put the org to "/tmp/org-mode"
2. Save the following lisp to "foo.el"
-----------------------------------------------------------------------
(progn
  (setq org-replace-disputed-keys t)
  (setq org-disputed-keys
	'(([(shift up)] . [(ctrl up)])
	  ([(shift down)] . [(ctrl down)])
	  ([(shift left)] . [(ctrl left)])
	  ([(shift right)] . [(ctrl right)])
	  ([(shift meta right)] . [(shift control right)])
	  ([(shift meta left)] . [(shift control left)])
	  ([(shift meta up)] . [(shift control up)])
	  ([(shift meta down)] . [(shift control down)])
	  ([(shift control right)] . [(shift meta right)])
	  ([(shift control left)] . [(shift meta left)]))
	)
  (add-to-list 'load-path (expand-file-name "/tmp/org-mode/lisp"))
  (pop-to-buffer "*scratch*")
  (insert "* " (org-version) " (" (org-git-version) ")\n ")
  (require 'org)
  (org-mode))
------------------------------------------------------------------------
3. Run emacs with 
  $ emacs -Q -l foo.el
4. M-x org-schedule, and press ctrl+<cursor>.

It should replace shift+<cursor>, but it doesn't. `describe-key' for C-down says:

"<C-down> runs the command forward-paragraph, which is an interactive
compiled Lisp function in `paragraphs.el'"

* The bad commit
The exact bad commit can't be tracked (org fails to initialize), but I narrowed it down to 6 commits. It was done between 9a0e84fbd7b0e25cf49613e787d572f3c71723dc and 8ad6f534f9b24f273b7699199df34c0f44f9059f .
I here show the diff for "org.el" in that period. The last 2 hunks looks relevant:
------------------------------------------------------------------------
diff --git a/lisp/org.el b/lisp/org.el
index aebf58f..7f0717e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6897,7 +6897,7 @@ of the first headline in the buffer.  This is important, because if the
 first headline is not level one, then (hide-sublevels 1) gives confusing
 results."
   (interactive)
-  (let ((l (org-current-line))
+  (let ((pos (point))
 	(level (save-excursion
 		 (goto-char (point-min))
 		 (if (re-search-forward (concat "^" outline-regexp) nil t)
@@ -6906,7 +6906,7 @@ results."
 		       (funcall outline-level))))))
     (and level (hide-sublevels level))
     (recenter '(4))
-    (org-goto-line l)))
+    (goto-char pos)))
 
 (defun org-content (&optional arg)
   "Show all headlines in the buffer, like a table of contents.
@@ -14050,10 +14050,19 @@ See also `org-scan-tags'.
 	minus tag mm
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	orterms term orlist re-p str-p level-p level-op time-p
-	prop-p pn pv po gv rest)
+	prop-p pn pv po gv rest (start 0) (ss 0))
     ;; Expand group tags
     (setq match (org-tags-expand match))
-    (if (string-match "/+" match)
+
+    ;; Check if there is a TODO part of this match, which would be the
+    ;; part after a "/".  TO make sure that this slash is not part of
+    ;; a property value to be matched against, we also check that there
+    ;; is no " after that slash.
+    ;; First, find the last slash
+    (while (string-match "/+" match ss)
+      (setq start (match-beginning 0) ss (match-end 0)))
+    (if (and (string-match "/+" match start)
+	     (not (save-match-data (string-match "\"" match start))))
 	;; match contains also a todo-matching request
 	(progn
 	  (setq tagsmatch (substring match 0 (match-beginning 0))
@@ -16126,7 +16135,8 @@ So these are more for recording a certain time/date."
 (defvar org-read-date-inactive)
 
 (defvar org-read-date-minibuffer-local-map
-  (let ((map (make-sparse-keymap)))
+  (let* ((org-replace-disputed-keys nil)
+	 (map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (org-defkey map (kbd ".")
                 (lambda () (interactive)
@@ -16286,7 +16296,6 @@ user."
 					  (calendar-current-date))))
 		(org-eval-in-calendar nil t)
 		(let* ((old-map (current-local-map))
-		       (org-replace-disputed-keys nil)
 		       (map (copy-keymap calendar-mode-map))
 		       (minibuffer-local-map
 			(copy-keymap org-read-date-minibuffer-local-map)))
------------------------------------------------------------------------

Thank you very much for developing org-mode.

Kind regards,
Teika (Teika kazura)

# Hey, it was almost exacly a year ago. Only few use this feature? ;]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Bug (regression) in org-replace-disputed-keys. Bisected.
@ 2014-09-17  8:42 Teika Kazura
  0 siblings, 0 replies; 10+ messages in thread
From: Teika Kazura @ 2014-09-17  8:42 UTC (permalink / raw)
  To: emacs-orgmode

Hello, org-list. I experience a regression in org-replace-disputed-keys, and I git-bisect'ed it.

* Symptom: org-replace-disputed-keys doesn't work for me.
Emacs version: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.0.12)

* How to reproduce it:
1. Put the org to "/tmp/org-mode"
2. Save the following lisp to "minimal-org.el"
-----------------------------------------------------------------------
(progn
  (setq org-replace-disputed-keys t)
  (setq org-disputed-keys
	'(([(shift up)] . [(ctrl up)])
	  ([(shift down)] . [(ctrl down)])
	  ([(shift left)] . [(ctrl left)])
	  ([(shift right)] . [(ctrl right)])
	  ([(shift meta right)] . [(shift control right)])
	  ([(shift meta left)] . [(shift control left)])
	  ([(shift meta up)] . [(shift control up)])
	  ([(shift meta down)] . [(shift control down)])
	  ([(shift control right)] . [(shift meta right)])
	  ([(shift control left)] . [(shift meta left)]))
	)
  (add-to-list 'load-path (expand-file-name "/tmp/org-mode/lisp"))
  (pop-to-buffer "*scratch*")
  (insert "* " (org-version) " (" (org-git-version) ")\n ")
  (require 'org)
  (org-mode))
------------------------------------------------------------------------
3. Run emacs with 
  $ emacs -Q -l minimal-org.el
4. M-x org-schedule, and press ctrl+<cursor>.

Shift+<cursor> should be replaced with ctrl+<cursor>, but they aren't. For example `describe-key' for C-down says:

"<C-down> runs the command forward-paragraph, which is an interactive
compiled Lisp function in `paragraphs.el'"

* The bad commit
The exact bad commit can't be tracked (org fails to initialize), but I narrowed it down to 6 commits. It was done between 9a0e84fbd7b0e25cf49613e787d572f3c71723dc and 8ad6f534f9b24f273b7699199df34c0f44f9059f .
I here show the diff for "org.el" in that period. The last 2 hunks looks relevant:
------------------------------------------------------------------------
diff --git a/lisp/org.el b/lisp/org.el
index aebf58f..7f0717e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6897,7 +6897,7 @@ of the first headline in the buffer.  This is important, because if the
 first headline is not level one, then (hide-sublevels 1) gives confusing
 results."
   (interactive)
-  (let ((l (org-current-line))
+  (let ((pos (point))
 	(level (save-excursion
 		 (goto-char (point-min))
 		 (if (re-search-forward (concat "^" outline-regexp) nil t)
@@ -6906,7 +6906,7 @@ results."
 		       (funcall outline-level))))))
     (and level (hide-sublevels level))
     (recenter '(4))
-    (org-goto-line l)))
+    (goto-char pos)))
 
 (defun org-content (&optional arg)
   "Show all headlines in the buffer, like a table of contents.
@@ -14050,10 +14050,19 @@ See also `org-scan-tags'.
 	minus tag mm
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	orterms term orlist re-p str-p level-p level-op time-p
-	prop-p pn pv po gv rest)
+	prop-p pn pv po gv rest (start 0) (ss 0))
     ;; Expand group tags
     (setq match (org-tags-expand match))
-    (if (string-match "/+" match)
+
+    ;; Check if there is a TODO part of this match, which would be the
+    ;; part after a "/".  TO make sure that this slash is not part of
+    ;; a property value to be matched against, we also check that there
+    ;; is no " after that slash.
+    ;; First, find the last slash
+    (while (string-match "/+" match ss)
+      (setq start (match-beginning 0) ss (match-end 0)))
+    (if (and (string-match "/+" match start)
+	     (not (save-match-data (string-match "\"" match start))))
 	;; match contains also a todo-matching request
 	(progn
 	  (setq tagsmatch (substring match 0 (match-beginning 0))
@@ -16126,7 +16135,8 @@ So these are more for recording a certain time/date."
 (defvar org-read-date-inactive)
 
 (defvar org-read-date-minibuffer-local-map
-  (let ((map (make-sparse-keymap)))
+  (let* ((org-replace-disputed-keys nil)
+	 (map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (org-defkey map (kbd ".")
                 (lambda () (interactive)
@@ -16286,7 +16296,6 @@ user."
 					  (calendar-current-date))))
 		(org-eval-in-calendar nil t)
 		(let* ((old-map (current-local-map))
-		       (org-replace-disputed-keys nil)
 		       (map (copy-keymap calendar-mode-map))
 		       (minibuffer-local-map
 			(copy-keymap org-read-date-minibuffer-local-map)))
------------------------------------------------------------------------

Thank you very much for developing org-mode.

Kind regards,
Teika (Teika kazura)

# Hey, it was almost exacly a year ago. Only few use this feature? ;]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-09-09 11:42 Bug (regression) in org-replace-disputed-keys. Bisected Teika Kazura
@ 2014-09-28 20:07 ` Nicolas Goaziou
  2014-10-01  1:22   ` Teika Kazura
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2014-09-28 20:07 UTC (permalink / raw)
  To: Teika Kazura; +Cc: emacs-orgmode

Hello,

Teika Kazura <teika@gmx.com> writes:

> Hello, org-world. I experience a regression in org-replace-disputed-keys, and I git-bisected it.
>
> * Symptom: org-replace-disputed-keys doesn't work for me.
> Emacs version: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.0.12)
>
> * How to reproduce it:
> 1. Put the org to "/tmp/org-mode"
> 2. Save the following lisp to "foo.el"
> -----------------------------------------------------------------------
> (progn
>   (setq org-replace-disputed-keys t)
>   (setq org-disputed-keys
> 	'(([(shift up)] . [(ctrl up)])
> 	  ([(shift down)] . [(ctrl down)])
> 	  ([(shift left)] . [(ctrl left)])
> 	  ([(shift right)] . [(ctrl right)])
> 	  ([(shift meta right)] . [(shift control right)])
> 	  ([(shift meta left)] . [(shift control left)])
> 	  ([(shift meta up)] . [(shift control up)])
> 	  ([(shift meta down)] . [(shift control down)])
> 	  ([(shift control right)] . [(shift meta right)])
> 	  ([(shift control left)] . [(shift meta left)]))
> 	)
>   (add-to-list 'load-path (expand-file-name "/tmp/org-mode/lisp"))
>   (pop-to-buffer "*scratch*")
>   (insert "* " (org-version) " (" (org-git-version) ")\n ")
>   (require 'org)
>   (org-mode))
> ------------------------------------------------------------------------
> 3. Run emacs with 
>   $ emacs -Q -l foo.el
> 4. M-x org-schedule, and press ctrl+<cursor>.

AFAICT, this is partly working. Combinations like [(shift control left)]
are properly translated, but not [(shift up)]. Wouldn't this be related
to some shift-translation Emacs does?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-09-28 20:07 ` Nicolas Goaziou
@ 2014-10-01  1:22   ` Teika Kazura
  2014-11-03 20:54     ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Teika Kazura @ 2014-10-01  1:22 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: bezjak.miro

(The entire thread can be viewed at: http://thread.gmane.org/gmane.emacs.orgmode/90626 . cc: Miro Bezjak.)

I propose fixes, but first I explain the whole picture.

TOC
1. Backgrounds
2. Fixes I propose

1. Backgrounds

In fact, beginning from org-8.1 `org-replace-disputed-keys' is intentionally ignored, but ** only in ** org-read-date. To be blunt, it was wrong. At least, such an exceptional behavior is hard to expect, or incoherence in short.

Why this change was done? One single user asked [1] how to disable org-replace-disputed-keys in org-read-date in org-8.0 for his/her **personal configuration**. Somehow Carsten Dominik, one of our respectable org developers, decided it to be the hard-coded default [1][2] without stating the reason.

[1] http://comments.gmane.org/gmane.emacs.orgmode/72180

[2]
* http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=a6986494a0c4fc5d3363c2bebe48215e7138e4f1
* http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e8023dde58f267a525b63184ec07d371b5a4c8b5

But since (defvar org-read-date-minibuffer-local-map) was introduced in org-8.0.3, s/he can simply customize it. It's the norm in Emacs, rather than forcing an exception. (If it were a common request, then we could accept it, but it's not.)

2. Fixes

Basically, I'll do what I can, sending patches for both codes and texinfo, if you want.

Anyway 
(a) the info file lacks the description on org-read-date-minibuffer-local-map. 

(b) The fact that org-replace-disputed-keys is ignored in org-read-date is written in the changelog http://orgmode.org/Changes.html for ver 8.1, under the section "Important bugfixes", but it should have been in "Incompatible changes". Moreover, the wording is unsearchable, by lacking the relevant variable names. (If it gets reverted as I propose below, an annotation must accompany, like "But this was reverted later in 8.2.x".)

Now a real fix. There're two candidates:

(i) Revert the wrong commit. Since it was in fact done in two separate commits[2], you need another patch, not git-revert. Here it is:
------------------------------------------------------------------------
diff -u -r org-8.2.7c-orig/lisp/org.el org-8.2.7c/lisp/org.el
--- org-8.2.7c-orig/lisp/org.el	2014-09-30 18:10:54.485977061 +0900
+++ org-8.2.7c/lisp/org.el	2014-09-30 18:11:24.293602328 +0900
@@ -16220,8 +16220,7 @@
 (defvar org-read-date-inactive)
 
 (defvar org-read-date-minibuffer-local-map
-  (let* ((org-replace-disputed-keys nil)
-	 (map (make-sparse-keymap)))
+  (let* ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (org-defkey map (kbd ".")
                 (lambda () (interactive)
------------------------------------------------------------------------

(ii) Leave the code as-is, and be satisfied by doc fixes only. Then you have to fix
* Texinfo, the `org-replace-disputed-keys' part, adding "Exception: it's ignored in ...",
* `org-read-date' w/ "Exception..."
* and also the changelog in 8.2 (or later): "org-replace-disputed-keys is ignored in org-read-date. In fact it has been so since 8.1, but has not been described adequately."

Thanks to Nicolas Goaziou for reading, and all other org developers.
(Sorry for posting my original message twice.)

Regards,
Teika (Teika kazura)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-10-01  1:22   ` Teika Kazura
@ 2014-11-03 20:54     ` Nicolas Goaziou
  2014-11-12 11:49       ` [patch] " Teika Kazura
  2014-11-14 22:29       ` Miro Bezjak
  0 siblings, 2 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2014-11-03 20:54 UTC (permalink / raw)
  To: Teika Kazura; +Cc: emacs-orgmode, bezjak.miro

Hello,

Teika Kazura <teika@gmx.com> writes:

> Now a real fix. There're two candidates:
>
> (i) Revert the wrong commit. Since it was in fact done in two separate commits[2], you need another patch, not git-revert. Here it is:
> ------------------------------------------------------------------------
> diff -u -r org-8.2.7c-orig/lisp/org.el org-8.2.7c/lisp/org.el
> --- org-8.2.7c-orig/lisp/org.el	2014-09-30 18:10:54.485977061 +0900
> +++ org-8.2.7c/lisp/org.el	2014-09-30 18:11:24.293602328 +0900
> @@ -16220,8 +16220,7 @@
>  (defvar org-read-date-inactive)
>  
>  (defvar org-read-date-minibuffer-local-map
> -  (let* ((org-replace-disputed-keys nil)
> -	 (map (make-sparse-keymap)))
> +  (let* ((map (make-sparse-keymap)))
>      (set-keymap-parent map minibuffer-local-map)
>      (org-defkey map (kbd ".")
>                  (lambda () (interactive)
> ------------------------------------------------------------------------

I think this change is appropriate. Could you provide a patch with git
format-patch?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-11-03 20:54     ` Nicolas Goaziou
@ 2014-11-12 11:49       ` Teika Kazura
  2014-11-13 22:32         ` Nicolas Goaziou
  2014-11-14 22:29       ` Miro Bezjak
  1 sibling, 1 reply; 10+ messages in thread
From: Teika Kazura @ 2014-11-12 11:49 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: bezjak.miro

[-- Attachment #1: Type: Text/Plain, Size: 1838 bytes --]

From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Could you provide a patch with git format-patch?

Glad to contribute. I attached two patches, the first for the lisp fix, and the second for org.texi. The code is confirmed to work, and the info correctly compiles. More is described later.

Now, release notes (http://orgmode.org/Changes.html) fix proposal. I here write "the full version". (Sorry. I know concise is better.)

1. Version 8.1, "Important bugfixes" section

The following sentence should be moved to "Incompatible changes" section:
"The replacement of disputed keys is now turned of when reading a date"

Furthermore, the following should be added: "N.B. This is reverted in Version 8.3."

2. Please add this to the next version "Incompatible changes" section:
"`org-replace-disputed-keys' has been ignored when reading date since version 8.1, but the former behavior is restored again."

Perhaps to "New features" can be added: "Keybinding for reading date can be customized with a new variable `org-read-date-minibuffer-local-map'. (In fact, it was introduced in version 8.0, but it was not announced.)"


Some comments on my org.texi patch. I renamed the section "Creating timestamps" to "Timestamp commands," since not all commands don't create. (Links are updated.) I rewrote some explanations. I think it's better, but I'm not sure if my tone of voice (e.g. "Date/time prompt is ``smart enough''") is acceptable. Some whitespace cleanup accompanies, so you may want to use "git show -b".

I added the description of key "!" in timestamp creation. But I don't know what "diary" in Emacs is, so you may want to improve it.

Regards,
Teika (Teika kazura)

PS I may send a patch to fix hardcoded C-x (following C-c), by introducing "org-mode-ctrl-x-map" and so on. I rebind C-x, and some are screwed up by hardcoding. ;-)

[-- Attachment #2: 0001-Let-org-read-date-respect-org-replace-disputed-keys-.patch --]
[-- Type: Text/X-Patch, Size: 1245 bytes --]

From 1ef556a1eae75045b560c65d8a4ba2e71da71a11 Mon Sep 17 00:00:00 2001
From: Teika kazura <teika@gmx.com>
Date: Sat, 8 Nov 2014 16:48:36 +0900
Subject: [PATCH 1/2] Let `org-read-date' respect `org-replace-disputed-keys'
 again.

Beginning from org-8.1, org-read-date ignores org-replace-disputed-keys. This commit restores the original behavior. Users who want the org-8.1 behavior should customize `org-read-date-minibuffer-local-map' instead.

See http://thread.gmane.org/gmane.emacs.orgmode/90626/focus=91318 for the discussion on this issue.

This commit in effect reverts a6986494a0c4fc5d3363c2bebe48215e7138e4f1 and e8023dde58f267a525b63184ec07d371b5a4c8b5.
---
 lisp/org.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 87f1725..8146eb5 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16600,8 +16600,7 @@ So these are more for recording a certain time/date."
 (defvar org-read-date-inactive)
 
 (defvar org-read-date-minibuffer-local-map
-  (let* ((org-replace-disputed-keys nil)
-	 (map (make-sparse-keymap)))
+  (let* ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (org-defkey map (kbd ".")
                 (lambda () (interactive)
-- 
2.0.4


[-- Attachment #3: 0002-org.texi-Timestamp-sections.patch --]
[-- Type: Text/X-Patch, Size: 11358 bytes --]

From 9c6ed406d5add908aac5b73cdfacc2272f2cf89e Mon Sep 17 00:00:00 2001
From: Teika kazura <teika@gmx.com>
Date: Wed, 12 Nov 2014 17:08:00 +0900
Subject: [PATCH 2/2] org.texi: Timestamp sections.

Section "Creating timestamp" is renamed to "Timestamp commands". `org-read-date-minibuffer-local-map' is described. Other contents improvement in that section.

Minor whitespace cleanups.
---
 doc/org.texi | 99 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 49 insertions(+), 50 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index b01db2c..bfb5b4f 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -458,14 +458,14 @@ Defining columns
 Dates and times
 
 * Timestamps::                  Assigning a time to a tree entry
-* Creating timestamps::         Commands which insert timestamps
+* Timestamp commands::          Commands which insert timestamps
 * Deadlines and scheduling::    Planning your work
 * Clocking work time::          Tracking how long you spend on a task
 * Effort estimates::            Planning work effort in advance
 * Relative timer::              Notes with a running timer
 * Countdown timer::             Starting a countdown timer for a task
 
-Creating timestamps
+Timestamp commands
 
 * The date/time prompt::        How Org mode helps you entering date and time
 * Custom time format::          Making dates look different
@@ -4646,7 +4646,7 @@ and agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
 @vindex org-priority-start-cycle-with-default
 Increase/decrease priority of current headline@footnote{See also the option
 @code{org-priority-start-cycle-with-default}.}.  Note that these keys are
-also used to modify timestamps (@pxref{Creating timestamps}).  See also
+also used to modify timestamps (@pxref{Timestamp commands}).  See also
 @ref{Conflicts}, for a discussion of the interaction with
 @code{shift-selection-mode}.
 @end table
@@ -5771,7 +5771,7 @@ is used in a much wider sense.
 
 @menu
 * Timestamps::                  Assigning a time to a tree entry
-* Creating timestamps::         Commands which insert timestamps
+* Timestamp commands::          Commands which insert timestamps
 * Deadlines and scheduling::    Planning your work
 * Clocking work time::          Tracking how long you spend on a task
 * Effort estimates::            Planning work effort in advance
@@ -5874,14 +5874,18 @@ angular ones.  These timestamps are inactive in the sense that they do
 
 @end table
 
-@node Creating timestamps
-@section Creating timestamps
+@node Timestamp commands
+@section Timestamp commands
 @cindex creating timestamps
 @cindex timestamps, creating
+@cindex timestamp commands
+
+Below are commands to create and handle timestamps.
 
 For Org mode to recognize timestamps, they need to be in the specific
-format.  All commands listed below produce timestamps in the correct
-format.
+format. All commands listed below automatically fix incomplete existing timestamps.
+
+Many commands prompt for a date. Details for timestamp prompt will be explained in a later subsection. (@pxref{The date/time prompt})
 
 @table @kbd
 @orgcmd{C-c .,org-time-stamp}
@@ -5919,7 +5923,7 @@ Access the agenda for the date given by the timestamp or -range at
 point (@pxref{Weekly/daily agenda}).
 @c
 @orgcmdkkcc{S-@key{left},S-@key{right},org-timestamp-down-day,org-timestamp-up-day}
-Change date at cursor by one day.  These key bindings conflict with
+Change date at cursor by one day. These key bindings conflict with
 shift-selection and related modes (@pxref{Conflicts}).
 @c
 @orgcmdkkcc{S-@key{up},S-@key{down},org-timestamp-up,org-timestamp-down-down}
@@ -5934,12 +5938,11 @@ related modes (@pxref{Conflicts}).
 @c
 @orgcmd{C-c C-y,org-evaluate-time-range}
 @cindex evaluate time range
-Evaluate a time range by computing the difference between start and end.
+Calculate and show the time range span, e.g. ``1 days 2 hours 34 minutes''.
 With a prefix argument, insert result after the time range (in a table: into
 the following column).
 @end table
 
-
 @menu
 * The date/time prompt::        How Org mode helps you entering date and time
 * Custom time format::          Making dates look different
@@ -5951,22 +5954,19 @@ the following column).
 @cindex time, reading in minibuffer
 
 @vindex org-read-date-prefer-future
-When Org mode prompts for a date/time, the default is shown in default
-date/time format, and the prompt therefore seems to ask for a specific
-format.  But it will in fact accept date/time information in a variety of
-formats.  Generally, the information should start at the beginning of the
-string.  Org mode will find whatever information is in
-there and derive anything you have not specified from the @emph{default date
-and time}.  The default is usually the current date and time, but when
+Date/time prompt is ``smart enough'', accepting shorthand notations, visual input while viewing the calendar, etc.
+
+The default is usually the current date and time, but when
 modifying an existing timestamp, or when entering the second stamp of a
-range, it is taken from the stamp in the buffer.  When filling in
-information, Org mode assumes that most of the time you will want to enter a
-date in the future: if you omit the month/year and the given day/month is
-@i{before} today, it will assume that you mean a future date@footnote{See the
-variable @code{org-read-date-prefer-future}.  You may set that variable to
-the symbol @code{time} to even make a time before now shift the date to
-tomorrow.}.  If the date has been automatically shifted into the future, the
-time prompt will show this with @samp{(=>F).}
+range, it is taken from the stamp in the buffer.
+
+When filling in lacking information, Org mode assumes that most of the time
+you will want to enter a date in the future: if you omit the month/year and
+the given day/month is @i{before} today, it will assume that you mean a
+future date@footnote{See the variable @code{org-read-date-prefer-future}.
+You may set that variable to the symbol @code{time} to even make a time
+before now shift the date to tomorrow.}.  If the date has been automatically
+shifted into the future, the time prompt will show this with @samp{(=>F).}
 
 For example, let's assume that today is @b{June 13, 2006}.  Here is how
 various inputs will be interpreted, the items filled in by Org mode are
@@ -5989,12 +5989,11 @@ w4            @result{} ISO week for of the current year @b{2006}
 2012-w04-5    @result{} Same as above
 @end example
 
-Furthermore you can specify a relative date by giving, as the @emph{first}
-thing in the input: a plus/minus sign, a number and a letter ([hdwmy]) to
-indicate change in hours, days, weeks, months, or years.  With a single plus
-or minus, the date is always relative to today.  With a double plus or minus,
-it is relative to the default date.  If instead of a single letter, you use
-the abbreviation of day name, the date will be the Nth such day, e.g.:
+Furthermore you can specify a @emph{relative} date: put a plus/minus sign,
+followed by a number and a letter [hdwmy] (hour, day, week, month, year). With a single plus or minus, the
+date is always relative to today.  With a double plus or minus, it is
+relative to the default date.  If instead of a single letter, you use the
+abbreviation of day name, the date will be the Nth such day, e.g.:
 
 @example
 +0            @result{} today
@@ -6033,17 +6032,16 @@ case, e.g.:
 
 @cindex calendar, for selecting date
 @vindex org-popup-calendar-for-date-prompt
-Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
-you don't need/want the calendar, configure the variable
-@code{org-popup-calendar-for-date-prompt}.}.  When you exit the date
-prompt, either by clicking on a date in the calendar, or by pressing
-@key{RET}, the date selected in the calendar will be combined with the
-information entered at the prompt.  You can control the calendar fully
-from the minibuffer:
+Parallel to the minibuffer prompt, a calendar is popped up@footnote{If you
+don't need/want the calendar, configure the variable
+@code{org-popup-calendar-for-date-prompt}.}. Calendar-based visual input is
+possible, too, and it will be combined with the information entered at the
+prompt. You can control the calendar fully from the minibuffer:
 
 @kindex <
 @kindex >
 @kindex M-v
+@kindex C-.
 @kindex C-v
 @kindex mouse-1
 @kindex S-@key{right}
@@ -6054,22 +6052,23 @@ from the minibuffer:
 @kindex M-S-@key{left}
 @kindex @key{RET}
 @example
-@key{RET}           @r{Choose date at cursor in calendar.}
+@key{RET}          @r{Choose date at cursor in calendar.}
 mouse-1        @r{Select date by clicking on it.}
 S-@key{right}/@key{left}     @r{One day forward/backward.}
-S-@key{down}/@key{up}     @r{One week forward/backward.}
+S-@key{down}/@key{up}        @r{One week forward/backward.}
 M-S-@key{right}/@key{left}   @r{One month forward/backward.}
 > / <          @r{Scroll calendar forward/backward by one month.}
 M-v / C-v      @r{Scroll calendar forward/backward by 3 months.}
+C-.            @r{Go to today.}
+!              @r{Show diary entries. @ref{Displaying the Diary, , Displaying the Diary, emacs, The Emacs Editor}}
 @end example
 
+@vindex org-read-date-minibuffer-local-map
+S-<cursor> keys conflict with other modes. For the details see @xref{Conflicts}. You can fully customize the key binding with the variable @code{org-read-date-minibuffer-local-map}.
+
 @vindex org-read-date-display-live
-The actions of the date/time prompt may seem complex, but I assure you they
-will grow on you, and you will start getting annoyed by pretty much any other
-way of entering a date/time out there.  To help you understand what is going
-on, the current interpretation of your input will be displayed live in the
-minibuffer@footnote{If you find this distracting, turn the display off with
-@code{org-read-date-display-live}.}.
+The interpretation of your input will be shown on-the-fly in the
+minibuffer. You can turn it off with the variable @code{org-read-date-display-live}.
 
 @node Custom time format
 @subsection Custom time format
@@ -8557,7 +8556,7 @@ be accumulated.  You can add a filter preset through the option
 @orgcmd{_,org-agenda-filter-by-effort}
 @vindex org-agenda-effort-filter-preset
 @vindex org-sort-agenda-noeffort-is-high
-Filter the agenda view with respect to effort estimates.  
+Filter the agenda view with respect to effort estimates.
 You first need to set up allowed efforts globally, for example
 @lisp
 (setq org-global-properties
@@ -13282,7 +13281,7 @@ equivalent Texinfo code.
 #+TEXINFO_PRINTED_TITLE: GNU Sample
 #+SUBTITLE: for version 2.0, last updated 4 March 2014
 
-* Copying 
+* Copying
   :PROPERTIES:
   :COPYING:  t
   :END:
@@ -13938,7 +13937,7 @@ however, override everything.
 
 @subsubheading @LaTeX{} specific properties
 
-@multitable {@code{:latex-link-with-unknown-path-format}} {@code{org-latex-link-with-unknown-path-format}} 
+@multitable {@code{:latex-link-with-unknown-path-format}} {@code{org-latex-link-with-unknown-path-format}}
 @item @code{:latex-active-timestamp-format}    @tab @code{org-latex-active-timestamp-format}
 @item @code{:latex-caption-above}              @tab @code{org-latex-caption-above}
 @item @code{:latex-classes}                    @tab @code{org-latex-classes}
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [patch] Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-11-12 11:49       ` [patch] " Teika Kazura
@ 2014-11-13 22:32         ` Nicolas Goaziou
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2014-11-13 22:32 UTC (permalink / raw)
  To: Teika Kazura; +Cc: emacs-orgmode, bezjak.miro

Hello,

Teika Kazura <teika@gmx.com> writes:

> Glad to contribute. I attached two patches, the first for the lisp
> fix,

Thank you. I applied it, with corrections to the commit message. In
particular, you need to add "TINYCHANGE" at its end, unless you sign FSF
papers.

> and the second for org.texi.

Thanks. Some comments follow.

> Now, release notes (http://orgmode.org/Changes.html) fix proposal. I here write "the full version". (Sorry. I know concise is better.)
>
> 1. Version 8.1, "Important bugfixes" section
>
> The following sentence should be moved to "Incompatible changes" section:
> "The replacement of disputed keys is now turned of when reading a date"
>
> Furthermore, the following should be added: "N.B. This is reverted in Version 8.3."
>
> 2. Please add this to the next version "Incompatible changes" section:
> "`org-replace-disputed-keys' has been ignored when reading date since version 8.1, but the former behavior is restored again."
>
> Perhaps to "New features" can be added: "Keybinding for reading date
> can be customized with a new variable
> `org-read-date-minibuffer-local-map'. (In fact, it was introduced in
> version 8.0, but it was not announced.)"

Done, with some tiny change.

> Some comments on my org.texi patch. I renamed the section "Creating
> timestamps" to "Timestamp commands," since not all commands don't
> create. (Links are updated.) I rewrote some explanations. I think it's
> better, but I'm not sure if my tone of voice (e.g. "Date/time prompt
> is ``smart enough''") is acceptable. Some whitespace cleanup
> accompanies, so you may want to use "git show -b".
>
> I added the description of key "!" in timestamp creation. But I don't
> know what "diary" in Emacs is, so you may want to improve it.

> Subject: [PATCH 2/2] org.texi: Timestamp sections.
>
> Section "Creating timestamp" is renamed to "Timestamp commands". `org-read-date-minibuffer-local-map' is described. Other contents improvement in that section.

Please fill your paragraphs.

You need to document what parts are changed.

Also, commit messages, as Texinfo, require sentences to be separated
with two spaces.

>  For Org mode to recognize timestamps, they need to be in the specific
> -format.  All commands listed below produce timestamps in the correct
> -format.
> +format. All commands listed below automatically fix incomplete
> existing timestamps.

Two spaces.

Also, I don't get the "fix incomplete existing timestamps" part.

> +Many commands prompt for a date. Details for timestamp prompt will be
> explained in a later subsection. (@pxref{The date/time prompt})

Two spaces.

> -Change date at cursor by one day.  These key bindings conflict with
> +Change date at cursor by one day. These key bindings conflict with

This change is incorrect.

>  @vindex org-read-date-prefer-future
> -When Org mode prompts for a date/time, the default is shown in default
> -date/time format, and the prompt therefore seems to ask for a specific
> -format.  But it will in fact accept date/time information in a variety of
> -formats.  Generally, the information should start at the beginning of the
> -string.  Org mode will find whatever information is in
> -there and derive anything you have not specified from the @emph{default date
> -and time}.  The default is usually the current date and time, but when
> +Date/time prompt is ``smart enough'', accepting shorthand notations,
> visual input while viewing the calendar, etc.

I don't think this is better: "smart enough" doesn't explain much.

However, splitting the paragraph in three parts and reordering them
a bit is a good idea.

>  @cindex calendar, for selecting date
>  @vindex org-popup-calendar-for-date-prompt
> -Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
> -you don't need/want the calendar, configure the variable
> -@code{org-popup-calendar-for-date-prompt}.}.  When you exit the date
> -prompt, either by clicking on a date in the calendar, or by pressing
> -@key{RET}, the date selected in the calendar will be combined with the
> -information entered at the prompt.  You can control the calendar fully
> -from the minibuffer:
> +Parallel to the minibuffer prompt, a calendar is popped up@footnote{If you
> +don't need/want the calendar, configure the variable
> +@code{org-popup-calendar-for-date-prompt}.}. Calendar-based visual input is
> +possible, too, and it will be combined with the information entered at the
> +prompt. You can control the calendar fully from the minibuffer:

Two spaces (twice).

> +C-.            @r{Go to today.}
> +!              @r{Show diary entries. @ref{Displaying the Diary, ,
> Displaying the Diary, emacs, The Emacs Editor}}

Two spaces.

> +@vindex org-read-date-minibuffer-local-map
> +S-<cursor> keys conflict with other modes. For the details see
> @xref{Conflicts}. You can fully customize the key binding with the
> variable @code{org-read-date-minibuffer-local-map}.

I don't think it deserves to appear in the manual. Moreover, this has
nothing to do with the calendar. Eventually,
`org-read-date-minibuffer-local-map' is not specifically associated to
binding conflicts.

>  @vindex org-read-date-display-live
> -The actions of the date/time prompt may seem complex, but I assure you they
> -will grow on you, and you will start getting annoyed by pretty much any other
> -way of entering a date/time out there.  To help you understand what is going
> -on, the current interpretation of your input will be displayed live in the
> -minibuffer@footnote{If you find this distracting, turn the display off with
> -@code{org-read-date-display-live}.}.
> +The interpretation of your input will be shown on-the-fly in the
> +minibuffer. You can turn it off with the variable
> @code{org-read-date-display-live}.

This is more neutral, for sure. I don't mind either way, but, in any
case: two spaces.

> -Filter the agenda view with respect to effort estimates.  
> +Filter the agenda view with respect to effort estimates.

?

> -* Copying 
> +* Copying

?

> -@multitable {@code{:latex-link-with-unknown-path-format}} {@code{org-latex-link-with-unknown-path-format}} 
> +@multitable {@code{:latex-link-with-unknown-path-format}}
> {@code{org-latex-link-with-unknown-path-format}}

?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-11-03 20:54     ` Nicolas Goaziou
  2014-11-12 11:49       ` [patch] " Teika Kazura
@ 2014-11-14 22:29       ` Miro Bezjak
  2014-11-18 21:32         ` Nicolas Goaziou
  1 sibling, 1 reply; 10+ messages in thread
From: Miro Bezjak @ 2014-11-14 22:29 UTC (permalink / raw)
  To: Teika Kazura, emacs-orgmode, me

Hi all,

I rather like that `org-read-date` takes over windmove keys during the
second or two that I'm using it. By reverting this, I guess I'll have
to copy and paste the whole `defvar` just to add
`(org-replace-disputed-keys nil)`.

May I make a compromise here? Can we make a new defcustom
(org-disable-disputed-keys-during-read-date?) that will disable
`org-replace-disputed-keys` when setting up
`org-read-date-minibuffer-local-map`?

Regards,
Miro


On Mon, Nov 3, 2014 at 9:54 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Teika Kazura <teika@gmx.com> writes:
>
>> Now a real fix. There're two candidates:
>>
>> (i) Revert the wrong commit. Since it was in fact done in two separate commits[2], you need another patch, not git-revert. Here it is:
>> ------------------------------------------------------------------------
>> diff -u -r org-8.2.7c-orig/lisp/org.el org-8.2.7c/lisp/org.el
>> --- org-8.2.7c-orig/lisp/org.el       2014-09-30 18:10:54.485977061 +0900
>> +++ org-8.2.7c/lisp/org.el    2014-09-30 18:11:24.293602328 +0900
>> @@ -16220,8 +16220,7 @@
>>  (defvar org-read-date-inactive)
>>
>>  (defvar org-read-date-minibuffer-local-map
>> -  (let* ((org-replace-disputed-keys nil)
>> -      (map (make-sparse-keymap)))
>> +  (let* ((map (make-sparse-keymap)))
>>      (set-keymap-parent map minibuffer-local-map)
>>      (org-defkey map (kbd ".")
>>                  (lambda () (interactive)
>> ------------------------------------------------------------------------
>
> I think this change is appropriate. Could you provide a patch with git
> format-patch?
>
>
> Regards,
>
> --
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-11-14 22:29       ` Miro Bezjak
@ 2014-11-18 21:32         ` Nicolas Goaziou
  2014-11-19  9:50           ` Miro Bezjak
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2014-11-18 21:32 UTC (permalink / raw)
  To: Miro Bezjak; +Cc: Teika Kazura, emacs-orgmode

Hello,

Miro Bezjak <bezjak.miro@gmail.com> writes:

> I rather like that `org-read-date` takes over windmove keys during the
> second or two that I'm using it. By reverting this, I guess I'll have
> to copy and paste the whole `defvar` just to add
> `(org-replace-disputed-keys nil)`.

I fail to see why you would need to copy the whole defvar. Just override
the bindings you need with 

  (define-key org-read-date-minibuffer-local-map ...)


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug (regression) in org-replace-disputed-keys. Bisected.
  2014-11-18 21:32         ` Nicolas Goaziou
@ 2014-11-19  9:50           ` Miro Bezjak
  0 siblings, 0 replies; 10+ messages in thread
From: Miro Bezjak @ 2014-11-19  9:50 UTC (permalink / raw)
  To: Miro Bezjak, Teika Kazura, emacs-orgmode

Ahh, hadn't thought of that. Thanks for the suggestion.

Regards,
Miro

On Tue, Nov 18, 2014 at 10:32 PM, Nicolas Goaziou
<mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Miro Bezjak <bezjak.miro@gmail.com> writes:
>
>> I rather like that `org-read-date` takes over windmove keys during the
>> second or two that I'm using it. By reverting this, I guess I'll have
>> to copy and paste the whole `defvar` just to add
>> `(org-replace-disputed-keys nil)`.
>
> I fail to see why you would need to copy the whole defvar. Just override
> the bindings you need with
>
>   (define-key org-read-date-minibuffer-local-map ...)
>
>
> Regards,
>
> --
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-19  9:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09 11:42 Bug (regression) in org-replace-disputed-keys. Bisected Teika Kazura
2014-09-28 20:07 ` Nicolas Goaziou
2014-10-01  1:22   ` Teika Kazura
2014-11-03 20:54     ` Nicolas Goaziou
2014-11-12 11:49       ` [patch] " Teika Kazura
2014-11-13 22:32         ` Nicolas Goaziou
2014-11-14 22:29       ` Miro Bezjak
2014-11-18 21:32         ` Nicolas Goaziou
2014-11-19  9:50           ` Miro Bezjak
  -- strict thread matches above, loose matches on Subject: below --
2014-09-17  8:42 Teika Kazura

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).