[PATCH 2/8] lib: private string map (associative array) API
Bijan Chokoufe Nejad
bijan.chokoufe at gmail.com
Mon Jun 13 08:18:07 PDT 2016
On 16-06-13, David Bremner wrote:
> Tomi Ollila <tomi.ollila at iki.fi> writes:
>
> > On Mon, Jun 13 2016, David Bremner <david at tethera.net> wrote:
> >
> >> The choice of array implementation is deliberate, for future iterator support
> >> ---
> >> lib/Makefile.local | 1 +
> >> lib/notmuch-private.h | 11 ++++
> >> lib/string-map.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >> 3 files changed, 165 insertions(+)
> >> create mode 100644 lib/string-map.c
> >>
> >> diff --git a/lib/Makefile.local b/lib/Makefile.local
> >> index beb9635..9280880 100644
> >> --- a/lib/Makefile.local
> >> +++ b/lib/Makefile.local
> >> @@ -40,6 +40,7 @@ libnotmuch_c_srcs = \
> >> $(dir)/messages.c \
> >> $(dir)/sha1.c \
> >> $(dir)/built-with.c \
> >> + $(dir)/string-map.c \
> >> $(dir)/tags.c
> >
> > I suggest everyone to install editor which supports showing tabs & spaces
> > e.g. in different color and also visualizes trailing whitespace & trailing
> > empty lines...
> >
>
> Heh. If only such a thing existed. What about a pre-commit hook?
> The default (that I have) uses git diff --index --check --cached, but
> that seems not to be enough.
>
> d
> _______________________________________________
I know you guys are more in the emacs camp but just for reference/inspiration:
in VIM I have a mapping to strip trailing spaces from a file
noremap <leader>st :%s/\s\+$/<CR>
This could of course go as a sed/grep command in the pre-commit hook. Concerning
the tabs, I have
" Tabs. Note: Use :retab to clean up mixed indentation
set expandtab " Always uses spaces instead of tab characters
set tabstop=2 " Size of insterted spaces if tab is pressed
set list " Highlight tab characters in files
set listchars=tab:▸\ ,extends:#,nbsp:.,trail:⋅
For the pre-commit hook one could `grep -P '\t' *`. Maybe even better would be
the use of a linter but I am not sure what is most flexible for C code.
Cheers,
Bijan
More information about the notmuch
mailing list