diff --git a/autoload/xolox/notes.vim b/autoload/xolox/notes.vim index 5835820..33c8d41 100644 --- a/autoload/xolox/notes.vim +++ b/autoload/xolox/notes.vim @@ -6,7 +6,7 @@ " Note: This file is encoded in UTF-8 including a byte order mark so " that Vim loads the script using the right encoding transparently. -let g:xolox#notes#version = '0.17' +let g:xolox#notes#version = '0.17.1' let s:scriptdir = expand(':p:h') function! xolox#notes#init() " {{{1 diff --git a/misc/notes/search-notes.py b/misc/notes/search-notes.py index 654ee74..d286267 100755 --- a/misc/notes/search-notes.py +++ b/misc/notes/search-notes.py @@ -3,7 +3,7 @@ # Python script for fast text file searching using keyword index on disk. # # Author: Peter Odding -# Last Change: January 18, 2012 +# Last Change: April 18, 2013 # URL: http://peterodding.com/code/vim/notes/ # License: MIT # @@ -16,6 +16,24 @@ # # For more information about the Vim plug-in see http://peterodding.com/code/vim/notes/. +""" +Usage: search-notes.py [OPTIONS] KEYWORD... + +Search a directory of plain text files using a full text index, +updated automatically during each invocation of the program. + +Valid options include: + + -l, --list=SUBSTR list keywords matching substring + -d, --database=FILE set path to keywords index file + -n, --notes=DIR set directory with user notes + -e, --encoding=NAME set character encoding of notes + -v, --verbose make more noise + -h, --help show this message and exit + +For more information see http://peterodding.com/code/vim/notes/ +""" + # Standard library modules. import fnmatch import getopt @@ -156,7 +174,7 @@ def delete_note(self, filename): self.message("Forgetting %s ..", filename) del self.index['files'][filename] for kw in self.index['keywords']: - filter(lambda x: x != filename, self.index['keywords'][kw]) + self.index['keywords'][kw] = [x for x in self.index['keywords'][kw] if x != filename] self.dirty = True def search_index(self, keywords): @@ -217,23 +235,7 @@ def message(self, msg, *args): sys.stderr.write((msg + "\n") % args) def usage(self): - print ''' -search-notes [OPTIONS] KEYWORD... - -Search a directory of plain text files using a full text index, -updated automatically during each invocation of the program. - -Valid options include: - - -l, --list=SUBSTR list keywords matching substring - -d, --database=FILE set path to keywords index file - -n, --notes=DIR set directory with user notes - -e, --encoding=NAME set character encoding of notes - -v, --verbose make more noise - -h, --help show this message and exit - -For more information see http://peterodding.com/code/vim/notes/ -'''.strip() + print __doc__.strip() if __name__ == '__main__': NotesIndex()