* Re: Problem with org-toggle-timestamp-type
[not found] <0A7CF9F9-391A-4424-AB1A-D124293AD9A8@alexanderonline.org>
@ 2008-10-30 15:21 ` Ben Alexander
2008-10-30 15:46 ` Richard Riley
2008-11-01 13:48 ` Carsten Dominik
1 sibling, 1 reply; 3+ messages in thread
From: Ben Alexander @ 2008-10-30 15:21 UTC (permalink / raw)
To: emacs-orgmode Org-Mode
I apologize if this is a repeat. It's in my sent items, but I haven't
seen it on the list yet. I edited the message bit, and added a bit more:
>
> Hi!
>
> I cannot figure out how to use version control in general, and git
> in particular. So I can't generate a proper patch. However, I think
> there is a mistake with org-toggle-timestamp-type.
>
> Currently, the message always returns "Timestamp is now active"
> regardless of whether it is or not. I think this is because the
> message is not inside the save-excursion block, so we can't be sure
> whether point was outside the timestamp (just in front) or inside
> (at the very end). Inside save-excursion, I think it is always
> moved to the end, does the edit, and is moved outside.
>
> Also, I think the sense of the test is backwards. And for some
> reason (if (equal (char-before) ?]) "in" "") didn't work (went to
> elisp debugger). I can't read this much lisp, it's beyond me.
>
> So here's the change I made (to org-version 6.10c)
>
>
> (defun org-toggle-timestamp-type ()
> "Toggle the type (<active> or [inactive]) of a time stamp."
> (interactive)
> (when (org-at-timestamp-p t)
> (save-excursion
> (goto-char (match-beginning 0))
> (insert (if (equal (char-after) ?<) "[" "<")) (delete-char 1)
> (goto-char (1- (match-end 0)))
> (insert (if (equal (char-after) ?>) "]" ">")) (delete-char 1)
> (message "Timestamp is now %sactive"
> (if (equal (char-before) ?>) "" "in")))))
>
> There's something else, and this might very well because my git repo
> is not what emacs is actually running, and my modified Makefile
> install target might be foobar.
>
> If I have a timestamp that looks like <2009-01-29 Thu>--<2009-01-29
> Thu> and the cursor is in front of the first > symbol and then I hit
> the S-<up> twice, my timestamp no longer is a range. It now looks
> like [2009-01-30 Fri]
>
And if the cursor is in front of the the first < symbol and I hit the
S-<up> key once (or if I use M-x org-toggle-timestamp-type), I get
[2009-01-29 Thu]--<2009-01-29 Thu>
but a second time, I get
<2009-01-29 Thu]--<2009-01-29 Thu]
That suggests to me that the regular expression isn't symmetric w.r.t.
square brackets and curly brackets. I kinda know perl regex, but am
completely unfamiliar with elisp's version.
> I tried to look at the org-ts[r]?-regexp-* variables, but my eyes
> crossed. Plus, I'm very afraid that any change I'd make would add
> parentheses, and thereby screwup every (match-begin 8) in the code.
>
> TFOM*
>
> Ben
>
> ----
> footnotes
> * TFOM = Thanks for Org-Mode
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: Problem with org-toggle-timestamp-type
2008-10-30 15:21 ` Problem with org-toggle-timestamp-type Ben Alexander
@ 2008-10-30 15:46 ` Richard Riley
0 siblings, 0 replies; 3+ messages in thread
From: Richard Riley @ 2008-10-30 15:46 UTC (permalink / raw)
To: Ben Alexander; +Cc: emacs-orgmode Org-Mode
Ben Alexander <bva@alexanderonline.org> writes:
> I apologize if this is a repeat. It's in my sent items, but I haven't
> seen it on the list yet. I edited the message bit, and added a bit
> more:
>>
>> Hi!
>>
>> I cannot figure out how to use version control in general, and git
>> in particular. So I can't generate a proper patch. However, I think
>> there is a mistake with org-toggle-timestamp-type.
With regard to git:
I have been playing with git and its a bit of a muddle as there are so
many options and alternatives which cover similar command
subsets. Having just discovered dvc the waters are even muddier.
http://www.emacswiki.org/cgi-bin/wiki/Git
But if you use emacs 23 then most basic revision control commands are
there are described in the version control section of the emacs manual.
My personal favorite is here as it includes a good tutorial but, for
some reason, refuses to status my .emacs.d. But it works well with
org-mode project which you can clone. Note the use of the graphical tool
gitk too. It is also the only one which use ediff as a default and the
only one which provides graphical status bar indicators of your file's
git status.
http://tsgates.cafe24.com/git/git-emacs.html
The most promising one with regard to staging and branching is magit:
http://github.com/technomancy/magit/tree/master
And the author is generally online in the #emacs irc channel.
regards
richard.
>>
>> Currently, the message always returns "Timestamp is now active"
>> regardless of whether it is or not. I think this is because the
>> message is not inside the save-excursion block, so we can't be sure
>> whether point was outside the timestamp (just in front) or inside
>> (at the very end). Inside save-excursion, I think it is always
>> moved to the end, does the edit, and is moved outside.
>>
>> Also, I think the sense of the test is backwards. And for some
>> reason (if (equal (char-before) ?]) "in" "") didn't work (went to
>> elisp debugger). I can't read this much lisp, it's beyond me.
>>
>> So here's the change I made (to org-version 6.10c)
>>
>>
>> (defun org-toggle-timestamp-type ()
>> "Toggle the type (<active> or [inactive]) of a time stamp."
>> (interactive)
>> (when (org-at-timestamp-p t)
>> (save-excursion
>> (goto-char (match-beginning 0))
>> (insert (if (equal (char-after) ?<) "[" "<")) (delete-char 1)
>> (goto-char (1- (match-end 0)))
>> (insert (if (equal (char-after) ?>) "]" ">")) (delete-char 1)
>> (message "Timestamp is now %sactive"
>> (if (equal (char-before) ?>) "" "in")))))
>>
>> There's something else, and this might very well because my git repo
>> is not what emacs is actually running, and my modified Makefile
>> install target might be foobar.
>>
>> If I have a timestamp that looks like <2009-01-29 Thu>--<2009-01-29
>> Thu> and the cursor is in front of the first > symbol and then I hit
>> the S-<up> twice, my timestamp no longer is a range. It now looks
>> like [2009-01-30 Fri]
>>
> And if the cursor is in front of the the first < symbol and I hit the
> S-<up> key once (or if I use M-x org-toggle-timestamp-type), I get
> [2009-01-29 Thu]--<2009-01-29 Thu>
> but a second time, I get
> <2009-01-29 Thu]--<2009-01-29 Thu]
>
> That suggests to me that the regular expression isn't symmetric
> w.r.t. square brackets and curly brackets. I kinda know perl regex,
> but am completely unfamiliar with elisp's version.
>
>> I tried to look at the org-ts[r]?-regexp-* variables, but my eyes
>> crossed. Plus, I'm very afraid that any change I'd make would add
>> parentheses, and thereby screwup every (match-begin 8) in the code.
>>
>> TFOM*
>>
>> Ben
>>
>> ----
>> footnotes
>> * TFOM = Thanks for Org-Mode
>>
>>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
--
important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday. ~Dennis Gabor, Innovations: Scientific, Technological and Social, 1970
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem with org-toggle-timestamp-type
[not found] <0A7CF9F9-391A-4424-AB1A-D124293AD9A8@alexanderonline.org>
2008-10-30 15:21 ` Problem with org-toggle-timestamp-type Ben Alexander
@ 2008-11-01 13:48 ` Carsten Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2008-11-01 13:48 UTC (permalink / raw)
To: Ben Alexander; +Cc: emacs-orgmode Org-Mode
Hi Ben,
On Oct 29, 2008, at 9:46 PM, Ben Alexander wrote:
> Hi!
>
> I'm cannot figure out how to use version control in general, and git
> in particular. However, I think there is a mistake with org-toggle-
> timestamp-type.
>
> Currently, the message always returns "Timestamp is now active"
> regardless of wether it is or not. I think this is because the
> message is not inside the save-excursion block, so we can't be sure
> whether point was outside the timestamp (just in front) or inside
> (at the very end). Inside save-excursion, I think it is always
> moved to the end, does the edit, and is moved outside.
>
> Also, I think the sense of the test is backwards. And for some
> reason (if (equal (char-before) ?]) "in" "") didn't work (went to
> elisp debugger). I can't read lisp, it's beyond me.
>
> So here's the change I made (to org-version 6.10c)
>
>
> (defun org-toggle-timestamp-type ()
> "Toggle the type (<active> or [inactive]) of a time stamp."
> (interactive)
> (when (org-at-timestamp-p t)
> (save-excursion
> (goto-char (match-beginning 0))
> (insert (if (equal (char-after) ?<) "[" "<")) (delete-char 1)
> (goto-char (1- (match-end 0)))
> (insert (if (equal (char-after) ?>) "]" ">")) (delete-char 1)
> (message "Timestamp is now %sactive"
> (if (equal (char-before) ?>) "" "in")))))
I have applied a similar fix, thanks.
>
>
> There's something else, and this might very well because my git repo
> is not what emacs is actually running, and my modified Makefile
> install target might be foobar.
>
> If I have a timestamp that looks like <2009-01-29 Thu>--<2009-01-29
> Thu> and the cursor is in front of the first > symbol and then I hit
> the S-<up> twice, my timestamp no longer is a range. It now looks
> like [2009-01-30 Fri]
>
> I tried to look at the org-ts[r]?-regexp-* variables, but my eyes
> crossed. Plus, I'm very afraid that any change I'd make would add
> parentheses, and thereby screwup every (match-begin 8) in the code.
Yes, there is a problem with this regexp, and I not not know myself
how to fix it. Negated character classes do not seem to work as
advertised if there is a bracket inside.
Thanks!
- Carsten
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-01 14:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0A7CF9F9-391A-4424-AB1A-D124293AD9A8@alexanderonline.org>
2008-10-30 15:21 ` Problem with org-toggle-timestamp-type Ben Alexander
2008-10-30 15:46 ` Richard Riley
2008-11-01 13:48 ` Carsten Dominik
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).