Chris Allegretta | 7 Feb 2011 15:49

Re: function database handling

Thank you for this suggestion bernd!  Looks like I was able to get
this done in less than a year after you made it :-)

Unfortunately this has the effect of increasing our binary size by
10%, at least on x86-64.  Having all those shorts instead of stub
functions to allow the key remapping may have bene ugly but it did
save memory.  Still it at least feels better to have the code this way
even if this implementation is not perfect.

On Sun, May 16, 2010 at 9:39 PM, bernd <bernd.spaeth <at> gmx.net> wrote:
> Trying to figure out the design decision for tying up function-database
> entries using short integers, preceding something like 150 (!) lines of
> preprocessor macro definitions, I stumbled across the following comment.
>
> /* Since in ISO C you can't pass around function pointers
> anymore,
>  let's make some integer macros for function names, and then
> I
>  can go cut my wrists after writing the big switch
> statement
>  that will necessitate. */
>
> As I can only guess, what you were orignially trying to do, I might be
> completely wrong with my assumption.
>
> Nevertheless as far as I know contradictory to conversion of object
> pointers to function pointer types, passing function pointers should
> still be very much compliant to ISO C.
>
> Just in case you tried to pass your function pointer like shown in the
(Continue reading)

Eitan Adler | 8 Feb 2011 18:08
Favicon

Syntax Highlighting for AT&T assembly

I wrote a nanorc file for the highlighting of AT&T format assembly
instructions. This file is licensed under a 2-clause BSD license. It
would be nice if this file could be included in the next release of
nano.

syntax "asm" "\.s$"

#instructions
icolor brightgreen		"(push(f)?|pop(f)?|add|sub|subi|mul|imul|mov|and|adc|lea)([blwq])"
icolor brightgreen		"(call|leave|ret|int)"
#directives
icolor green			"\.(section|b?align|byte|data|double|text|type|ident|size|string|globl|note)"
icolor green			"\.(dim|eject|else|elseif|end|endef|endfunc|endif|err|exitm|extern|fail|file)"
icolor green			"\.(fill|float|hidden|hword|if|incbin|include|int|irp|irpc|lcomm|lflags|ln)"
icolor green			"\.(list|long|macro|mri|nolist|octa|org|p2align|popsection|previous|protected|psize|purgem)"
icolor green			"\.(pushsection|quad|rept|sbttl|scl|set|short|single|skip|space|sleb128|stab)"
icolor green			"\.(struct|subsection|symver|tab|title|uleb128|val|version|vtable(entry|inherit)|weak|word)"

#annotations
color	brightmagenta	" <at> [a-zA-Z0-9]*"				
#strings
color blue 			"('[^']*')|(\"[^"]*\")"	
#numbers
color magenta		"\$(0x)?(-)?[0-9a-fA-F.]+"			
#labels in call
color magenta		"\$\.[a-zA-Z0-9]*"
#registers
color cyan			"%e?[abcd][hlx]?"
color cyan			"%e?[sd]i"

(Continue reading)

Mike Frysinger | 10 Feb 2011 02:53
Picon
Favicon
Gravatar

Re: Syntax Highlighting for AT&T assembly

On Tuesday, February 08, 2011 12:08:42 Eitan Adler wrote:
> I wrote a nanorc file for the highlighting of AT&T format assembly
> instructions. This file is licensed under a 2-clause BSD license. It
> would be nice if this file could be included in the next release of
> nano.

there is already an asm.nanorc that handles .s files.  you cant have more than 
one match.
-mike
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Eitan Adler | 10 Feb 2011 03:46
Favicon

Re: Syntax Highlighting for AT&T assembly

> there is already an asm.nanorc that handles .s files.  you cant have more than
> one match.
> -mike
>

Ah - I didn't even notice that file because I run with my own nanorc
file. This version has support for a different syntax of assembly.
Perhaps one could match .asm and one could match .s? If not then I'll
leave this file in public for other people to use if they so choose
:-)

Attached is a newer version btw.

--

-- 
Eitan Adler
Attachment (asm.nanorc): application/octet-stream, 1340 bytes
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Mike Frysinger | 10 Feb 2011 05:15
Picon
Favicon
Gravatar

Re: Syntax Highlighting for AT&T assembly

On Wednesday, February 09, 2011 21:46:26 Eitan Adler wrote:
> > there is already an asm.nanorc that handles .s files.  you cant have more
> > than one match.
> 
> Ah - I didn't even notice that file because I run with my own nanorc
> file. This version has support for a different syntax of assembly.

that file matches GNU assembly files.  AT&T syntax isnt really all that 
different.  you could simply add your additional directives to the existing 
file, as well as some of the general stuff (like strings/numbers/comments).

your file though isnt just AT&T syntax.  you also add random x86 insns and 
registers.  i dont think we want to go down that road as then every other arch 
will want us to add their stuff too.

> Perhaps one could match .asm and one could match .s?

not really
-mike
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Eitan Adler | 13 Feb 2011 07:36
Favicon

add constant qualifier in do_toggle

For fun I was compiling nano with a C++ compiler instead of a C
compiler. This results in a build error. The following patch fixes it.

Index: nano.c
===================================================================
--- nano.c	(revision 4528)
+++ nano.c	(working copy)
 <at>  <at>  -1340,7 +1340,7  <at>  <at> 
 void do_toggle(int flag)
 {
     bool enabled;
-    char *desc;
+    const char *desc;

     TOGGLE(flag);

--

-- 
Eitan Adler
Kamil Dudka | 14 Feb 2011 14:29
Picon
Favicon
Gravatar

[PATCH] fix a typo in nanorc.5 man page

Hello,

attached is a patch fixing a typo in the nanorc.5 man page, contributed 
by John Bradshaw (CC'd).  Thanks in advance for considering the patch!

Kamil
Attachment (nanorc5-fix-typo.patch): text/x-patch, 565 bytes
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel
Chris Allegretta | 18 Feb 2011 08:57

Re: essential feature requests

Hi Matt,

The bug you mention with re-searching at startup and seach history
should be fixed as of r4531.
I have also implemented the saved cursor position feature you
mentioend, which will be in nano 2.3.0.

I've created a test tarball for you or anyone interested in testing
out this new feature (or
the bugfix for that matter) at
http://www.nano-editor.org/dist/test/nano-2.3.0pre1.tar.gz

Note that this version changes the location of the saved search file,
which it sounds like you
do use quite a bit, to ~/.nano/search_history.  I added a section to
the faq about this but if
you want to switch between nano versions you may want to check out that entry.

Thanks for using nano!

On Sun, Feb 13, 2011 at 7:05 AM, ML <m4il999 <at> gmail.com> wrote:
> Hi i love nano especially after tweaking nanorc so that it does syntax
> highlighting. I'd like to request 2 features because i often work with
> multiple script files, searching strings and editing functions.
>
> I've enabled 'historylog' from nanorc. But when i open a new file Alt+W does
> not work :( I explicitly have to explain to nano: ctrl+w, uparrow,
> return. Only then does alt+w work as it should. feature request #1 is
> for this to work on startup.
>
(Continue reading)

Chris Allegretta | 23 Feb 2011 04:20

Re: essential feature requests

Hey Matthieu,

Thanks for the info about the crash.  You and Ken Tyler both found
this bug which was a dumb coding mistake on my part; apologies and
thank you and Ken for finding it.  It should be fixed now.  I put up a
new pre-release at:
http://www.nano-editor.org/dist/test/nano-2.3.0pre2.tar.gz
for anyone interested in trying out the features before the next release.

Incidentally, I imagine the reason your compiled version is not
reading /etc/nanorc is by default compiled source code sets a 'prefix'
value of /usr/local/etc, so it would look for /etc/nanorc.  If you are
planning on copying the binary by hand, you would probably want to
configure with something like:
./configure --prefix=/

Anyway, thanks again and have a great night.

On Tue, Feb 22, 2011 at 8:50 PM, ML <m4il999 <at> gmail.com> wrote:
> Woow i didn't expect a response! I'm honored to be talking to directly
> to the author of one of the most widely used Linux tools.
>
> Alt+W seems to work nicely now. And ~/.nanorc/filepos_history is great!
> Did ./configure; make; cp /etc/nanorc /home/me/.nanorc; (cos for some
> reason /etc/nanorc wasn't parsed) ; alias
> nano='/home/me/nano-2.3.0pre1/src/nano'
> Did some exploit testing with filenames like `nano --poslog "test 100
> 100"`. But it seems every filename (even normal ones) say
> 'segmentation fault' when i do Ctrl+O. I'm sure you already noticed or
> i'm making a silly mistake.
(Continue reading)

Chris Allegretta | 26 Feb 2011 15:40

GNU nano 2.3.0

is released!

2011.02.26 - GNU nano 2.3.0 "Septic surprise" is released.  This first
		release in the 2.3 unstable series bring several new 
		features.  First, libmagic support for syntax highlighting
		has been added on top of the existing file extension 
		and header support already available.  Secondly, cursor 
		position can be saved between editing sessions with 
		the -P or --poslog command line flags, or via "set poslog" 
		in your .nanorc.  Also included are some fixes for 
		compilation with g++, and better handling of issues 
		writing the backup file, which should reduce the need 
		for the 'set allow_insecure_backup" nanorc option.  
		Don't stop, get it get it, don't stop, get it get it.

Chris A
--

-- 
Chris Allegretta	http://www.asty.org

v4sw7CUPYhw5ln6pr5Pck4ma7u7Lw0m6g/l7DUi5e6t5Ab6THen7g6Ma29s5r3p-4 hackerkey.com
_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
http://lists.gnu.org/mailman/listinfo/nano-devel

Gmane