emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Remember templates and time stamp rounding.
@ 2006-03-17  7:28 Carsten Dominik
  2006-03-17  8:02 ` Alex Bochannek
  2006-03-19 22:23 ` Philip Rooke
  0 siblings, 2 replies; 5+ messages in thread
From: Carsten Dominik @ 2006-03-17  7:28 UTC (permalink / raw)
  To: emacs-orgmode

I have put a new test version of org.el onto my site, version 4.11a:

    http://www.astro.uva.nl/~dominik/Tools/org/org-test.zip

This contains only org.el, no further documentation.

In this test version, I have incorporates Alex' time rounding patch
(in a modified version).  Also there is support for templates for
remember.

Time-stamp rounding
-------------------

The default is no rounding of time stamps.

I originally thought that every place in the code using times should
honor the rounding variable, but with some more thinking I now agree
with Alex that it is enough to do that in the few commands that
actually insert a time corresponding to the current time.  That means
that you can still modify times either by entering them at the
time/date prompt, or by using the S-cursor keys, and these
modifications will not be modified by the rounding setting.  One
change I added is that if you use a double C-u for a time stamp
command, then the default time is exact, not rounded.  In this way you
can use rounded times most of the time, but still get an exact time if
you need it.  Thanks to Alex for the patch (and also for the bug fix
in org-read-date, in the string-replacement...).


Remember templates
------------------

To activate the templates you need, in addition to the other remember
configuration, this line in .emacs:

     (add-hook 'remember-mode-hook 'org-remember-apply-template)

If you don't set any templates, then the only change you will notice
with the new code is that the remember buffer is now in org-mode, so
that you can use all the org-mode commands.  You need to exit with C-c
C-c.  Normally remember also allows C-x C-s, but this is not possible
anymore in my version, for technical reasons.

There is a new variable, org-remember-templates, which can be set to a
list of templates to use.  If you only specify a single template, it
will always be used.  If you specify several templates, then each time
you use remember you need to hit one additional character to select a
template.  That is why you need to specify a selection character for
each template.

In the template you can use several % escape sequences to insert
information like a time stamp, this annotation link to the original
file etc, please check the documentation string of
`org-remember-templates' for the full list.

Following the discussion here, I am providing 2 examples:

;; Template for Charles Cave's journal file.
(setq org-remember-templates
       '((?j . "* Topic: %T %?\n")))

;; Templates for Philip Rooke, journal and TODO with a deadline of today
(setq org-remember-templates
       '((?j . "* %U %?\n  %i\n\n  %a")
	(?t . "* TODO %?\n  DEADLINE: %T\n   %i\n\n   %a")))

I think this might be a flexible way to set things up.  Give it a try
and let us know what additional % escapes and/or other
changes you think would be useful.

- Carsten


--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: Remember templates and time stamp rounding.
  2006-03-17  7:28 Remember templates and time stamp rounding Carsten Dominik
@ 2006-03-17  8:02 ` Alex Bochannek
       [not found]   ` <ff7823fe9c92fcb41c9a3b45b6949ecd@science.uva.nl>
  2006-03-19 22:23 ` Philip Rooke
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Bochannek @ 2006-03-17  8:02 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

> Time-stamp rounding
> -------------------

Thanks for including it!


Couple other quick ones:

(defcustom org-popup-calendar-for-date-prompt t
  ...
  :group 'org-time
  :type 'number)

That should really be a :type 'boolean


For the emphasis font-locks, these regexps work well for me:

(if em '("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:space:]]+\\)\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold))
(if em '("\\([[:punct:][:space:]]\\|^\\)\\(/\\([^/[:space:]]+\\)/\\)\\([[:space:][:punct:]]\\|$\\)" 0 'italic))
(if em '("\\([[:punct:][:space:]]\\|^\\)\\(_\\([^_[:space:]]+\\)_\\)\\([[:space:][:punct:]]\\|$\\)" 0 'underline))


Alex.

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

* Re: Remember templates and time stamp rounding.
       [not found]   ` <ff7823fe9c92fcb41c9a3b45b6949ecd@science.uva.nl>
@ 2006-03-17 18:40     ` Alex Bochannek
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Bochannek @ 2006-03-17 18:40 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

>> For the emphasis font-locks, these regexps work well for me:
>>
>> (if em  '("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:
>> space:]]+\\)\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold))
>> (if em
>> ("\\([[:punct:][:space:]]\\|^\\)\\(/\\([^/[:space:]]+\\)/\\)\\([[:
>> space:][:punct:]]\\|$\\)" 0 'italic))
>> (if em
>> ("\\([[:punct:][:space:]]\\|^\\)\\(_\\([^_[:space:]]+\\)_\\)\\([[:
>> space:][:punct:]]\\|$\\)" 0 'underline))
>
> Hi Alex, what is wrong with the expressions I have in org.el?

The issue was that there would be no emphasis added when there was
punctuation before or after it. Punctuation inside would also break
it. Finally, I think the :space: character class is a bit more
inclusive than what you used, but I don't recall for sure.

Basically, the regexp above says:

punctuation or white space or beginning of line
 followed by the emphasis character
  at least one non-emphasis or space character
 followed by the emphasis character
punctuation or white space or end of line

I seem to recall that I ran into an issue when I did something like:
*foo-bar* and it wouldn't emphasize.

By the way, I am also leaning towards allowing multiple tokens that
are separated by one space since I sometimes would use it to emphasize
commands like: *ls -l*.

Maybe this would be better:

'("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:space:]]+\\)\\( \\([^*[:space:]]+\\)\\)*\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold)

Alex.

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

* Re: Remember templates and time stamp rounding.
  2006-03-17  7:28 Remember templates and time stamp rounding Carsten Dominik
  2006-03-17  8:02 ` Alex Bochannek
@ 2006-03-19 22:23 ` Philip Rooke
  2006-03-20 13:24   ` Jason F. McBrayer
  1 sibling, 1 reply; 5+ messages in thread
From: Philip Rooke @ 2006-03-19 22:23 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:

> I have put a new test version of org.el onto my site, version 4.11a:

[...]

> Remember templates 
> ------------------

[...]

> ;; Templates for Philip Rooke, journal and TODO with a deadline of today
> (setq org-remember-templates
>       '((?j . "* %U %?\n  %i\n\n  %a")
> 	(?t . "* TODO %?\n  DEADLINE: %T\n   %i\n\n   %a")))
>
> I think this might be a flexible way to set things up.  Give it a try
> and let us know what additional % escapes and/or other
> changes you think would be useful.

I've had the chance to check these examples and they are working
fantastically well for me.  Thank you very much.

Regards,

Phil

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

* Re: Remember templates and time stamp rounding.
  2006-03-19 22:23 ` Philip Rooke
@ 2006-03-20 13:24   ` Jason F. McBrayer
  0 siblings, 0 replies; 5+ messages in thread
From: Jason F. McBrayer @ 2006-03-20 13:24 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Philip Rooke <phil@yax.org.uk> writes:

> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> I have put a new test version of org.el onto my site, version 4.11a:
>
> [...]
>
>> Remember templates 
>> ------------------
>
> [...]
>
> I've had the chance to check these examples and they are working
> fantastically well for me.  Thank you very much.

I'd like to add a "me too" here.  These patches are working well for
me.  The templates I am using are:

(setq org-remember-templates
     '((?j . "* %?\n  %U\n  %i\n\n  %a")
       (?n . "* NEXTACTION %?\n  %T\n   %i\n\n   %a")
       (?d . "* NEXTACTION %?\n  DEADLINE: %T\n   %i\n\n   %a")  
       (?s . "* NEXTACTION %?\n  SCHEDULED: %T\n  %i\n\n   %a")))


-- 
+----------------------------------------------------------------+
| Jason F. McBrayer                         jmcbray@carcosa.net  |
|  "If you wish to make Pythocles wealthy, don't give him more   |
|   money; rather, reduce his desires."            -- Epicurus   |

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

end of thread, other threads:[~2006-03-20 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-17  7:28 Remember templates and time stamp rounding Carsten Dominik
2006-03-17  8:02 ` Alex Bochannek
     [not found]   ` <ff7823fe9c92fcb41c9a3b45b6949ecd@science.uva.nl>
2006-03-17 18:40     ` Alex Bochannek
2006-03-19 22:23 ` Philip Rooke
2006-03-20 13:24   ` Jason F. McBrayer

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).