Re: [dev] snotes v0.9 - a simple notes system

2013-02-06 Thread Sam Watkins
Apparently the BSD way to specify editor ($EDITOR / $VISUAL / mailcap) sucks pretty bad. I reckon mailcap is basically a good idea, but doesn't work very well, and could use some occam's razor. I hazard to guess that the freedesktop people have reimplemented it rather than fixed it :/ Anyway, as

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread markus schnalke
[2013-02-05 15:22] v4hn > On Tue, Feb 05, 2013 at 02:18:18PM +0100, markus schnalke wrote: >> [2013-02-05 13:16] v4hn >>> SNOTES_EDITOR=${VISUAL:-${EDITOR:-vi}} >>> SNOTES_EDITOR="xterm -e $SNOTES_EDITOR" >>> cat > $HOME/.snotes/config <>> SNOTES_EDITOR="$SNOTES_EDITOR" >>> [...] >>> >>> You m

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread v4hn
On Tue, Feb 05, 2013 at 02:18:18PM +0100, markus schnalke wrote: > [2013-02-05 13:16] v4hn > > SNOTES_EDITOR=${VISUAL:-${EDITOR:-vi}} > > SNOTES_EDITOR="xterm -e $SNOTES_EDITOR" > > cat > $HOME/.snotes/config < > SNOTES_EDITOR="$SNOTES_EDITOR" > > [...] > > > > You may choose. > > The first tw

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread markus schnalke
[2013-02-05 13:16] v4hn > On Tue, Feb 05, 2013 at 12:10:12PM +0100, markus schnalke wrote: >> [2013-02-05 00:54] v4hn >>> I see. Thanks for note. I've changed it to the following now, >>> which should work for all reasonable setups. >>> If this doesn't work for someone, honestly, I couldn't care

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread v4hn
On Tue, Feb 05, 2013 at 12:10:12PM +0100, markus schnalke wrote: > [2013-02-05 00:54] v4hn > > I see. Thanks for note. I've changed it to the following now, > > which should work for all reasonable setups. > > If this doesn't work for someone, honestly, I couldn't care less. > > It's a default, no

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread markus schnalke
[2013-02-04 17:09] Charlie Kester > On 02/04/2013 13:09, markus schnalke wrote: > > > > On my system VISUAL is set to `vi', which is a common situation. > > Your code assumes that VISUAL contains a graphical editor. > > I'm not sure, but I think the semantics when this variable > first began to b

Re: [dev] snotes v0.9 - a simple notes system

2013-02-05 Thread markus schnalke
[2013-02-05 00:54] v4hn > On Mon, Feb 04, 2013 at 10:09:25PM +0100, markus schnalke wrote: >> [2013-02-04 20:57] v4hn >>> On Mon, Feb 04, 2013 at 11:46:51PM +0800, Chris Down wrote: SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} : "${SNOTES_EDITOR:=${EDITOR:-vim}}" >>> >>> That would make th

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
I also believe these were the original semantics, but they are difficult to get around in a modern environment. Also of course this assumes that the user is even using xterm. Perhaps there should be something like SNOTES_TERMINAL="xterm -e" And, if SNOTES_TERMINAL is defined, it is put under word

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Charlie Kester
On 02/04/2013 13:09, markus schnalke wrote: On my system VISUAL is set to `vi', which is a common situation. Your code assumes that VISUAL contains a graphical editor. I'm not sure, but I think the semantics when this variable first began to be used was to distinguish a full-screen editor like

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread v4hn
On Mon, Feb 04, 2013 at 10:09:25PM +0100, markus schnalke wrote: > [2013-02-04 20:57] v4hn > > On Mon, Feb 04, 2013 at 11:46:51PM +0800, Chris Down wrote: > >> SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} > >> : "${SNOTES_EDITOR:=${EDITOR:-vim}}" > > > > That would make the config do more than it is

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread markus schnalke
[2013-02-04 20:57] v4hn > On Mon, Feb 04, 2013 at 11:46:51PM +0800, Chris Down wrote: >> SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} >> : "${SNOTES_EDITOR:=${EDITOR:-vim}}" > > That would make the config do more than it is supposed to. > I agree that it makes sense to respect $VISUAL though. > I now

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread v4hn
On Mon, Feb 04, 2013 at 11:46:51PM +0800, Chris Down wrote: > SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} > : "${SNOTES_EDITOR:=${EDITOR:-vim}}" That would make the config do more than it is supposed to. I agree that it makes sense to respect $VISUAL though. I now changed the line to SNOTES_EDITOR

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} : "${SNOTES_EDITOR:=${EDITOR:-vim}}" On 4 February 2013 23:40, Petr Šabata wrote: > On Mon, Feb 04, 2013 at 10:54:17PM +0800, Chris Down wrote: > > Something like this should work: > > > > SNOTES_EDITOR=${VISUAL:-$EDITOR} > > Only if you run snotes from

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Petr Šabata
On Mon, Feb 04, 2013 at 10:54:17PM +0800, Chris Down wrote: > Something like this should work: > > SNOTES_EDITOR=${VISUAL:-$EDITOR} Only if you run snotes from a terminal. P pgpvujpAFyEo7.pgp Description: PGP signature

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
Disappointing, I was waiting for SNOTES_EDITOR=${VISUAL:-${EDITOR:-acme}} ;-) On 4 February 2013 23:09, markus schnalke wrote: > [2013-02-04 22:54] Chris Down > > > > Something like this should work: > > > > SNOTES_EDITOR=${VISUAL:-$EDITOR} > > Better: > > SNOTES_EDITOR=${VISUAL:-${EDI

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread markus schnalke
[2013-02-04 22:54] Chris Down > > Something like this should work: > > SNOTES_EDITOR=${VISUAL:-$EDITOR} Better: SNOTES_EDITOR=${VISUAL:-${EDITOR:-vi}} meillo

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
Something like this should work: SNOTES_EDITOR=${VISUAL:-$EDITOR} On 4 February 2013 22:49, Stephen Paul Weber wrote: > Somebody claiming to be Daniel Bryan wrote: > >> On Mon, Feb 04, 2013 at 10:47:34AM +0100, Petr Šabata wrote: >> +1, though in case you hadn't noticed, you can set SNOTES_EDITO

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Stephen Paul Weber
Somebody claiming to be Daniel Bryan wrote: On Mon, Feb 04, 2013 at 10:47:34AM +0100, Petr Šabata wrote: +1, though in case you hadn't noticed, you can set SNOTES_EDITOR in ~/.snotes/config. Why not just use $VISUAL or $EDITOR ? Why would someone want to use a different editor than their defa

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread v4hn
On Mon, Feb 04, 2013 at 10:47:34AM +0100, Petr Šabata wrote: > That looks quite usable. I can assure you, it is. I've been using it for years, literally. Sorry for not publishing it earlier. > I'm not sure how many people have graphical vim installed, > though. Perhaps you could switch to 'xterm

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread v4hn
Hey everyone, thanks for the suggestions, I've just included all of them. On Mon, Feb 04, 2013 at 05:09:48PM +0800, Chris Down wrote: > Since this issue cropped up I figured I might as well take a quick look at > the script. There are two other things that might be worth changing after a > quick

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Petr Šabata
On Mon, Feb 04, 2013 at 09:41:03PM +1100, Daniel Bryan wrote: > On Mon, Feb 04, 2013 at 10:47:34AM +0100, Petr Šabata wrote: > > I'm not sure how many people have graphical vim installed, > > though. Perhaps you could switch to 'xterm -e vi' or something > > like that. Of course, no default will

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
You almost definitely want "$@", not $*. On 4 February 2013 18:45, Raphael Proust wrote: > On Mon, Feb 4, 2013 at 9:47 AM, Petr Šabata wrote: > > On Mon, Feb 04, 2013 at 04:22:51AM +0100, v4hn wrote: > > […] > > I'm not sure how many people have graphical vim installed, > > though. Perhaps you

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Raphael Proust
On Mon, Feb 4, 2013 at 9:47 AM, Petr Šabata wrote: > On Mon, Feb 04, 2013 at 04:22:51AM +0100, v4hn wrote: > […] > I'm not sure how many people have graphical vim installed, > though. Perhaps you could switch to 'xterm -e vi' or something > like that. Of course, no default will work for everybod

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Daniel Bryan
On Mon, Feb 04, 2013 at 10:47:34AM +0100, Petr Šabata wrote: > I'm not sure how many people have graphical vim installed, > though. Perhaps you could switch to 'xterm -e vi' or something > like that. Of course, no default will work for everybody but > this one might cover somewhat more users. +1

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Petr Šabata
On Mon, Feb 04, 2013 at 04:22:51AM +0100, v4hn wrote: > Hey everyone, > > I mentioned some days ago in a private conversation > that I've written a small notes organizer using dmenu > and git. People got curious and so I cleaned it up > a bit and hereby publish > > snotes version 0.9 > > If you

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
Since this issue cropped up I figured I might as well take a quick look at the script. There are two other things that might be worth changing after a quick skim: - Not sure what's up with all the ''[ -n "`which foo`" ]'' idioms. Use ''type'' and just check the exit code. - Instead of escaping in

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Chris Down
Use ''.'' instead of ''source'', it's POSIX. Chris On 4 February 2013 16:56, Thomas Dean <78...@web.de> wrote: > Great tool, thank you! > > One thing to mention: sh links to dash in my case, which has no built-in > "source" command. Is there a standalone substitute? > > TD > > >

Re: [dev] snotes v0.9 - a simple notes system

2013-02-04 Thread Thomas Dean
Great tool, thank you! One thing to mention: sh links to dash in my case, which has no built-in "source" command. Is there a standalone substitute? TD

[dev] snotes v0.9 - a simple notes system

2013-02-03 Thread v4hn
Hey everyone, I mentioned some days ago in a private conversation that I've written a small notes organizer using dmenu and git. People got curious and so I cleaned it up a bit and hereby publish snotes version 0.9 If you find any flaws or like to propose improvements, please write me a mail.