public inbox for howm-eng@lists.osdn.me
 help / color / mirror / Atom feed
* [Howm-eng 114]  How to bind M-RET to insert { } in howm buffers?
@ 2016-09-10 15:46 areiner
  2016-09-10 17:32 ` [Howm-eng 115] " khi
  0 siblings, 1 reply; 3+ messages in thread
From: areiner @ 2016-09-10 15:46 UTC (permalink / raw)


Hi,

hoping that this list is still functional, here is something that I
have been longing for for quite some time; but, alas!, my Emacs skills
are insufficient to implement this myself.

What I would like is to make M-RET, inside howm buffers, insert a new
item in a to do list, i.e. insert a newline, followed by "{ } "
indented by the same amount as any preceding item.  (This would be
analogous to, e.g., various TeX modes that start a new \item.)

E.g., given the following buffer contents:

________________________________________________________________

foo bar baz foo bar baz foo bar baz foo bar baz foo bar baz foo bar
baz foo bar baz foo bar baz foo bar baz foo bar baz foo bar baz foo
bar baz foo bar baz AAA foo bar baz foo bar baz BBB

{ } foo CCC bar DDD
{ } baz
    { } foo EEE bar FFF

GGG
________________________________________________________________

Hitting M-RET should have this effect:

- on AAA or BBB or CCC or DDD: insert "\n{ } " (since no indentation
  is implied by previous lines);

- on EEE or FFF: insert "\n    { } " (since we are on an item indented
  by four spaces already)

While this is not in any way urgent, any help would be very much
appreciated.

(BTW, I have been using Howm heavily for about a year, and it has
become very important to me.  Thank you so much for writing and
maintaining Howm!)

Regards,

Albert.


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

* [Howm-eng 115] Re: How to bind M-RET to insert { } in howm buffers?
  2016-09-10 15:46 [Howm-eng 114] How to bind M-RET to insert { } in howm buffers? areiner
@ 2016-09-10 17:32 ` khi
  2016-09-11 12:54   ` [Howm-eng 116] " areiner
  0 siblings, 1 reply; 3+ messages in thread
From: khi @ 2016-09-10 17:32 UTC (permalink / raw)


Hi, Albert san.

Would you try this `my-newline-with-todo'?
http://howm.osdn.jp/cgi-bin/hiki/hiki.cgi?Comment

howm.el is still alive because I'm using it every day by myself :)

-- 
khi at users.sourceforge.jp


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

* [Howm-eng 116] Re: How to bind M-RET to insert { } in howm buffers?
  2016-09-10 17:32 ` [Howm-eng 115] " khi
@ 2016-09-11 12:54   ` areiner
  0 siblings, 0 replies; 3+ messages in thread
From: areiner @ 2016-09-11 12:54 UTC (permalink / raw)


On Sun, Sep 11, 2016 at 02:32:06AM +0900, khi at users.sourceforge.jp wrote:
> Would you try this `my-newline-with-todo'?
> http://howm.osdn.jp/cgi-bin/hiki/hiki.cgi?Comment

Thanks!  This was enough to get me started; I had to make some minor
changes:

- change the pattern "^[[:blank:]]*{ } " to "^[[:blank:]]*{ }" (remove
  trailing space), or otherwise the first item would have only one,
  the second one always two spaces after "{ }".

- binding the key does not work with [(meta return)] but only with
  "\M-\r" - presumably this has to do with my emacs version: "GNU
  Emacs 24.4.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-01-12
  on babin, modified by Debian"

- and, of course, the function to bind is not, as on the wiki,
  'my-erase-header but 'my-newline-with-todo.

This does, it seems, exactly what I wanted it to do, although at the
moment I don't understand why it works even for multi-line to do
entries.  Thanks a lot!

> howm.el is still alive because I'm using it every day by myself :)

Indeed, it is an incredibly useful tool!  It took me some time to get
used to it, but now I certainly would not want to miss it any more!

Thanks, and best regards,

Albert.


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

end of thread, other threads:[~2016-09-11 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-10 15:46 [Howm-eng 114] How to bind M-RET to insert { } in howm buffers? areiner
2016-09-10 17:32 ` [Howm-eng 115] " khi
2016-09-11 12:54   ` [Howm-eng 116] " areiner

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 NNTP newsgroup(s).