[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] Some linters and syntax

From: Mark Oteiza
Subject: Re: [Nano-devel] Some linters and syntax
Date: Tue, 31 Mar 2015 16:21:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Benno Schulenberg <address@hidden> writes:
>>   extendsyntax c linter gcc -fshow-column
> When I run that on nano's src/color.c, it says (among many other things):
>   [ src/color.c:82:2: error: ‘colortype’ has no member named ‘next’ ].
> But it does.  What's up with that?  (You may not; I just wonder.)

I get taken to src/nano.h:
  [ src/nano.h:126:10: fatal error: 'glib.h' file not found ]

Odd. I only tested on small c snippets, so I suppose this linter
definition isn't very good.

>>   extendsyntax python linter pyflakes
> When I run that, without pyflakes even being installed:
>   [ Got 0 parsable lines from command: pyflakes ]
> So we need a better message when a command does not exist.

Yes, that would be good

>> * For Emacs lisp I don't know how to highlight multiline strings
>>   (docstrings)
> After a quick google for elisp docstring, it seems such a string
> starts with some whitespace at the start of the line followed
> by a doublequote.  And it ends with a double quote at the end
> of a line, with nothing after it.  So... does this work:
> color yellow  start="^[[:blank:]]+\""  end="\"$"

Ahh, great!  There can be things like

(defconst foo nil
  "This is a docstring.")

so the following seems to work better (also trying to not end if it's an
escaped double quote).

color yellow start="^[[:blank:]]+\"" end="[^\]\""

>> * In both lisps, if we want to highlight the `foo` function, there is
>>   nothing stopping a function like `foo-bar` having just `foo`
>>   highlighted, which looks weird.
> I don't follow.  Where in your elisp file is there a regex that
> colours function names?

Oh, all the regexen at the top: let, if, when, defun, etc.  Take `map` for
example. In elisp there is also cl-map, so something like

  (cl-map 'vector #'append list1 list2)

will have "map" highlighted when it shouldn't.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]