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,

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

2013-02-05 Thread markus schnalke
[2013-02-05 00:54] v4hn m...@v4hn.de On Mon, Feb 04, 2013 at 10:09:25PM +0100, markus schnalke wrote: [2013-02-04 20:57] v4hn m...@v4hn.de 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

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

2013-02-05 Thread markus schnalke
[2013-02-04 17:09] Charlie Kester corky1...@comcast.net 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

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 m...@v4hn.de 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

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

2013-02-05 Thread markus schnalke
[2013-02-05 13:16] v4hn m...@v4hn.de On Tue, Feb 05, 2013 at 12:10:12PM +0100, markus schnalke wrote: [2013-02-05 00:54] v4hn m...@v4hn.de 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

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 m...@v4hn.de SNOTES_EDITOR=${VISUAL:-${EDITOR:-vi}} SNOTES_EDITOR=xterm -e $SNOTES_EDITOR cat $HOME/.snotes/config EOF SNOTES_EDITOR=$SNOTES_EDITOR [...] You may choose. The first two of

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

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

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

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 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 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 find any

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 con...@redhat.com 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

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 raphla...@gmail.com wrote: On Mon, Feb 4, 2013 at 9:47 AM, Petr Šabata con...@redhat.com wrote: On Mon, Feb 04, 2013 at 04:22:51AM +0100, v4hn wrote: […] I'm not sure how many people have graphical vim

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 work

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

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 singpol...@singpolyma.netwrote: 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

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

2013-02-04 Thread markus schnalke
[2013-02-04 22:54] Chris Down ch...@chrisdown.name 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
Disappointing, I was waiting for SNOTES_EDITOR=${VISUAL:-${EDITOR:-acme}} ;-) On 4 February 2013 23:09, markus schnalke mei...@marmaro.de wrote: [2013-02-04 22:54] Chris Down ch...@chrisdown.name Something like this should work: SNOTES_EDITOR=${VISUAL:-$EDITOR} Better:

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
SNOTES_EDITOR=${VISUAL:+xterm -e $VISUAL} : ${SNOTES_EDITOR:=${EDITOR:-vim}} On 4 February 2013 23:40, Petr Šabata con...@redhat.com 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

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

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

2013-02-04 Thread markus schnalke
[2013-02-04 20:57] v4hn m...@v4hn.de 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

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 m...@v4hn.de 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 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

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

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