Mike Frysinger | 3 Jan 2009 13:57
Picon
Favicon
Gravatar

[PATCH] rcfile.c: always keep entire list of valid keywords

I like to use one .nanorc file on all my systems, but many may have
different compile time settings.  This means that the same .nanorc file
cannot be easily used without encountering:

Error in /home/vapier/.nanorc on line 17: Unknown flag "speller"
Press Enter to continue starting nano.

I think it makes more sense to have the valid keyword list always be the
same and only control whether the keyword actually results in behavior
change via ifdefs.

Signed-off-by: Mike Frysinger <vapier <at> gentoo.org>
---
 src/rcfile.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c
index bd04169..5ac61cd 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
 <at>  <at>  -34,47 +34,28  <at>  <at> 

 static const rcoption rcopts[] = {
     {"boldtext", BOLD_TEXT},
-#ifndef DISABLE_JUSTIFY
     {"brackets", 0},
-#endif
     {"const", CONST_UPDATE},
-#ifndef DISABLE_WRAPJUSTIFY
     {"fill", 0},
(Continue reading)

Eitan Adler | 4 Jan 2009 04:31
Picon

Re: [PATCH] rcfile.c: always keep entire list of valid keywords

Mike Frysinger wrote:
> I like to use one .nanorc file on all my systems, but many may have
> different compile time settings.  This means that the same .nanorc file
> cannot be easily used without encountering:
> 
> Error in /home/vapier/.nanorc on line 17: Unknown flag "speller"
> Press Enter to continue starting nano.
> 
> I think it makes more sense to have the valid keyword list always be the
> same and only control whether the keyword actually results in behavior
> change via ifdefs.
> 
> Signed-off-by: Mike Frysinger <vapier <at> gentoo.org>
> ---
>  src/rcfile.c |   20 --------------------
>  1 files changed, 0 insertions(+), 20 deletions(-)
> 
Perhaps we should instead have nano issue a "warning" instead of an
error.  If I use the keyword speller when I don't have speller installed
it might be an error (perhaps I mistyped something).

--

-- 
Eitan Adler
"Security is increased by designing for the way humans actually behave."
-Jakob Nielsen
Mike Frysinger | 4 Jan 2009 17:27
Picon
Favicon
Gravatar

Re: [PATCH] rcfile.c: always keep entire list of valid keywords

On Saturday 03 January 2009 22:31:53 Eitan Adler wrote:
> Mike Frysinger wrote:
> > I like to use one .nanorc file on all my systems, but many may have
> > different compile time settings.  This means that the same .nanorc file
> > cannot be easily used without encountering:
> >
> > Error in /home/vapier/.nanorc on line 17: Unknown flag "speller"
> > Press Enter to continue starting nano.
> >
> > I think it makes more sense to have the valid keyword list always be the
> > same and only control whether the keyword actually results in behavior
> > change via ifdefs.
>
> Perhaps we should instead have nano issue a "warning" instead of an
> error.  If I use the keyword speller when I don't have speller installed
> it might be an error (perhaps I mistyped something).

i'm not sure how you could mistype "speller" when you meant something else.  i 
dont mind the output from nano, i mind having to hit enter once for every 
keyword the active nano doesnt support.
-mike
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Eitan Adler | 4 Jan 2009 18:45
Picon

Re: [PATCH] rcfile.c: always keep entire list of valid keywords

> i'm not sure how you could mistype "speller" when you meant something else.  
I meant this as a joke.  At some point in the future however there might
be keywords that you might misspell. Or more likely you used the
"speller" keyword expecting it to work but you accidentally compiled
without spelling support or such.
i
> dont mind the output from nano, i mind having to hit enter once for every 
> keyword the active nano doesnt support.
Hence the /warning/ output instead of an /error/.
> -mike

--

-- 
Eitan Adler
"Security is increased by designing for the way humans actually behave."
-Jakob Nielsen
Mike Frysinger | 4 Jan 2009 18:57
Picon
Favicon
Gravatar

Re: [PATCH] rcfile.c: always keep entire list of valid keywords

On Sunday 04 January 2009 12:45:00 Eitan Adler wrote:
> > i'm not sure how you could mistype "speller" when you meant something
> > else.
>
> I meant this as a joke.  At some point in the future however there might
> be keywords that you might misspell.

the patch i posted doesnt change this behavior.  unknown (typod) keywords are 
still errors.

> Or more likely you used the
> "speller" keyword expecting it to work but you accidentally compiled
> without spelling support or such.

i think such things would become apparent at runtime.  i.e. you attempt to 
launch the speller and nano tells you spelling has been disabled.  i dont 
think the nanorc config file has any sort of useful bearing in this regard.

> > dont mind the output from nano, i mind having to hit enter once for every
> > keyword the active nano doesnt support.
>
> Hence the /warning/ output instead of an /error/.

detecting enabled/disabled keywords and making it a warning vs error is beyond 
me atm ... i'm not that familiar with the current code.
-mike
_______________________________________________
Nano-devel mailing list
(Continue reading)

Chris Allegretta | 13 Jan 2009 20:27

Re: nano fails to build cleanly with -pedantic

I have been thinking about this on and off and have been browsing the web for a good answer to this issue.  I emailed Aitan (forgetting to CC the list) to ask if anyone knew the way to pass around the address of a function in ISO C in order to execute different functions with a pointer, but I haven't been able to find anything which answers the question except for that apparently passing around function addresses is some sort of crime in ISO C, which considering what insane things C lets you do strikes me as strange place to draw the line.

Anyway, if anyone knows how this can be done given what we are trying to do in nano with key bindings, please let me know.  Otherwise I can put on my list to create a series of compiler macros for each function to be bound (and change scfunc in struct sc to a short) and pass those around instead , but that will be a lower priority in the short term compared to getting the editor actually stable.

On Sun, Dec 28, 2008 at 9:57 PM, Eitan Adler <eitanadlerlist <at> gmail.com> wrote:
Hey I just wanted to point out that nano from revision 4347 (and
probably earlier) don't build cleanly with -pedantic. Is ISO compliance
a goal of this project?


--
Eitan Adler
"Security is increased by designing for the way humans actually behave."
-Jakob Nielsen


_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel

_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Jordi Mallach | 14 Jan 2009 14:00
Picon

Re: trivial message inconsistencies

Hi,

On Fri, Sep 26, 2008 at 11:09:15AM +0100, Marco Colombo wrote:
> yo!!!
> I'm translating nano's messages, and I noticed the following messages:
> 
> #: src/text.c:453 src/text.c:577
> #, c-format
> msgid "Internal error: can't match line %d.  Please save your work"
> #: src/text.c:541 src/text.c:653
> msgid "Internal error: unknown type.  Please save your work"
> #: src/text.c:566
> msgid "Internal error: Redo setup failed.  Please save your work"
> #: src/text.c:914
> msgid "Internal error: can't setup uncut.  Please save your work."
> #: src/text.c:917
> msgid "Internal error: unknown type.  Please save your work."
> 
> issues:
> - in the first 3 cases there's no final ".", while the last two have it
> - "Redo setup failed" is the only one with capital letter
> - "Redo setup failed" and "can't setup uncut" should probably be more similar
> (but I find both versions quite cryptic to translate).

I just checked SVN and found these issues haven't been addressed. Chris, could you take a look? I also
noticed them when I translated these strings.

Thanks and happy new year everyone!
Jordi

--

-- 
Jordi Mallach Pérez  --  Debian developer     http://www.debian.org/
jordi <at> sindominio.net     jordi <at> debian.org     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/
Chris Allegretta | 19 Jan 2009 20:12

Re: nano fails to build cleanly with -pedantic

Ahh, where would we be without Obsessive Compulsive Disorder.  I rewrote the function mapping to use shorts, so -pedantic should be happy.   Hopefully no bugs were introduced but time will tell.  Committed and credited in r4349. 

On Tue, Jan 13, 2009 at 2:27 PM, Chris Allegretta <chrisa <at> asty.org> wrote:
I have been thinking about this on and off and have been browsing the web for a good answer to this issue.  I emailed Aitan (forgetting to CC the list) to ask if anyone knew the way to pass around the address of a function in ISO C in order to execute different functions with a pointer, but I haven't been able to find anything which answers the question except for that apparently passing around function addresses is some sort of crime in ISO C, which considering what insane things C lets you do strikes me as strange place to draw the line.

Anyway, if anyone knows how this can be done given what we are trying to do in nano with key bindings, please let me know.  Otherwise I can put on my list to create a series of compiler macros for each function to be bound (and change scfunc in struct sc to a short) and pass those around instead , but that will be a lower priority in the short term compared to getting the editor actually stable.

On Sun, Dec 28, 2008 at 9:57 PM, Eitan Adler <eitanadlerlist <at> gmail.com> wrote:
Hey I just wanted to point out that nano from revision 4347 (and
probably earlier) don't build cleanly with -pedantic. Is ISO compliance
a goal of this project?


--
Eitan Adler
"Security is increased by designing for the way humans actually behave."
-Jakob Nielsen


_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel


_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Davide Pesavento | 24 Jan 2009 18:57
Picon

[PATCH] Update gentoo.nanorc

Hi,
please consider the attached patch for inclusion.
It expands the Gentoo syntax highlighting file with many new definitions.

Regards,
Davide Pesavento
Davide Pesavento | 25 Jan 2009 12:23
Picon

Re: [PATCH] Update gentoo.nanorc

On Sat, Jan 24, 2009 at 18:57, Davide Pesavento <davidepesa <at> gmail.com> wrote:
> Hi,
> please consider the attached patch for inclusion.
> It expands the Gentoo syntax highlighting file with many new definitions.
>
> Regards,
> Davide Pesavento
>

Sorry, I forgot to attach the patch... :P
Attachment (gentoo.nanorc.patch): application/octet-stream, 4329 bytes
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel

Gmane