From: Bijan Chokoufe Nejad <bijan.chokoufe@gmail.com>
To: David Bremner <david@tethera.net>
Cc: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [PATCH 2/8] lib: private string map (associative array) API
Date: Mon, 13 Jun 2016 17:18:07 +0200 [thread overview]
Message-ID: <20160613151807.GA2109@bijan-TPX1Yoga> (raw)
In-Reply-To: <871t41utqi.fsf@zancas.localnet>
On 16-06-13, David Bremner wrote:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
> > On Mon, Jun 13 2016, David Bremner <david@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
next prev parent reply other threads:[~2016-06-13 15:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 1:05 message properties patches, v1.0 David Bremner
2016-06-13 1:05 ` [PATCH 1/8] lib: read "property" terms from messages David Bremner
2016-06-13 1:05 ` [PATCH 2/8] lib: private string map (associative array) API David Bremner
2016-06-13 8:10 ` Tomi Ollila
2016-06-13 13:02 ` David Bremner
2016-06-13 15:18 ` Bijan Chokoufe Nejad [this message]
2016-06-13 1:05 ` [PATCH 3/8] lib: basic message-property API David Bremner
2016-07-08 4:36 ` [PATCH] n_m_remove_property(msg, key, NULL) should removes all properties with key Daniel Kahn Gillmor
2016-07-16 10:32 ` [PATCH] RFC: all deleting all properties with a given key David Bremner
2016-07-17 23:33 ` Daniel Kahn Gillmor
2016-06-13 1:05 ` [PATCH 4/8] lib: extend private string map API with iterators David Bremner
2016-06-13 1:05 ` [PATCH 5/8] lib: iterator API for message properties David Bremner
2016-06-13 1:05 ` [PATCH 6/8] CLI: refactor dumping of tags David Bremner
2016-06-13 1:05 ` [PATCH 7/8] CLI: add properties to dump output David Bremner
2016-06-13 1:05 ` [PATCH 8/8] cli: optionally restore message properties from dump file David Bremner
2016-07-08 9:15 ` [PATCH] add has: query prefix to search for specific properties Daniel Kahn Gillmor
2016-07-17 0:39 ` David Bremner
2016-07-17 10:38 ` David Bremner
2016-07-17 23:44 ` Daniel Kahn Gillmor
-- strict thread matches above, loose matches on Subject: below --
2016-08-03 0:30 v2 of message properties patches David Bremner
2016-08-03 0:30 ` [PATCH 2/8] lib: private string map (associative array) API David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160613151807.GA2109@bijan-TPX1Yoga \
--to=bijan.chokoufe@gmail.com \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
--cc=tomi.ollila@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).