Commit Graph

126 Commits

Author SHA1 Message Date
Alex Vallee
8c18cf97ff Fix indent in pull request #1042. 2015-11-11 22:48:39 -05:00
Alex Vallée
8f658d6329 Fix wrapping file paths in Writer.comment
Long file names, especially with hyphens will get incorrectly wrapped by
the comment method. Pass has_path=True to prevent this type of wrapping.

This is mainly so that longer path names can show up in comments on
their on line without breaking them up.
2015-10-23 16:36:28 -04:00
Nico Weber
5560e2e26b Add notes on using afl-fuzz to HACKING. 2015-03-19 10:41:28 -07:00
Fraser Cormack
d130968ecd zsh-completion: remove use of 'head' with negative offset
Some systems - like OSX - don't come with a version of head that
supports a negative value for the -n flag. Such systems get a message
such as this when tab-completing ninja's -d flag:

    ninja -dhead: illegal line count -- -1

Using sed instead should be more universally supported.
2014-12-20 00:12:52 +00:00
Fanael Linithien
f5f4b3ba7c Remove unneeded save-excursion.
syntax-propertize-function is allowed to move the point and mark.
2014-11-24 19:09:33 +01:00
Fanael Linithien
40a76d8cd5 Use lexical-binding.
There's no reason not to use lexical-binding when supporting only
Emacs 24+. Its semantics are just that much saner.
2014-11-23 22:29:49 +01:00
Fanael Linithien
f15faca3c3 Add a Emacs 24 requirement.
Only Emacs >= 24 has prog-mode.
2014-11-23 22:26:54 +01:00
Fanael Linithien
11377a46d1 Correctly recognize a comment if the previous line is a comment ending in $. 2014-11-23 22:25:27 +01:00
Fanael Linithien
73f934e886 Avoid putting properties past the end of the buffer. 2014-11-23 22:25:27 +01:00
Fanael Linithien
14d161080c Don't use dotted list syntax unless necessary. 2014-11-23 22:25:27 +01:00
Fanael Linithien
310532c0b0 Remove unnecessary regexp group. 2014-11-23 22:25:27 +01:00
Fanael Linithien
931db561cf Correctly recognize comments. 2014-11-23 22:25:27 +01:00
Fanael Linithien
327c094596 Set up a proper syntax table for ninja-mode.
Since quotes are not meant to be treated as string delimiters,
the syntax table is the place to tell Emacs so.

This also means syntactic fontification can be reenabled and the
font-lock keyword entry for comments removed.
2014-11-23 22:25:27 +01:00
Fanael Linithien
c600a82589 Set comment-start buffer-locally, not globally. 2014-11-23 22:23:35 +01:00
Fanael Linithien
2f7f4ae945 Use quasi-quoting instead of list+cons. 2014-11-23 22:23:35 +01:00
Fanael Linithien
a13b647460 Reindent ninja-mode.el using Emacs.
Emacs knows best how to indent Emacs Lisp.
2014-11-23 22:23:30 +01:00
Fanael Linithien
6091cfefcd Use double semicolon comments. 2014-11-23 22:23:28 +01:00
Fanael Linithien
77d5c3a67a Don't leave lone closing parens. 2014-11-23 22:18:24 +01:00
Elan Ruusamäe
6fc15c47a0 no subshell
don't need subshell to send stderr to /dev/null
2014-11-23 12:35:03 -08:00
Evan Martin
2ab60038b6 Merge pull request #772 from drbo/syntax_bugfix
Added highlighting in Emacs for ${...} variables
2014-11-23 12:14:02 -08:00
Evan Martin
1e21e5f441 drop leftover references to bootstrap.py 2014-11-18 09:58:45 -08:00
Evan Martin
62c10b9969 Merge pull request #813 from cdlm/emacs-mode-require-newline
Emacs mode: inherit from prog-mode
2014-11-18 09:44:38 -08:00
Evan Martin
dcd41dcef3 add a --bootstrap mode for configure.py
Instead of bootstrapping through a separate script, instead make
configure.py able to either generate a build.ninja *or* just execute
all the computed commands to build a ninja binary.
2014-11-18 08:15:37 -08:00
Evan Martin
76a95e45bb add an "expand" function to ninja_syntax
Implements basic variable expansion for use in configure.py.
2014-11-18 08:15:36 -08:00
Nico Weber
2cfb99985d emacs: Remove an empty line, wrap a comment. 2014-11-17 15:15:19 -08:00
Scott Graham
65151e7eef CanonicalizePath handles \ on Windows 2014-10-30 15:34:25 -07:00
Fraser Cormack
a73e6931ae Add zsh completion for targets in conjunction with -C
zsh can now list completions for targets in the directory specified by
the -C option
2014-10-24 20:34:06 +01:00
Damien Pollet
fb9f17f48c Emacs mode: inherit from prog-mode
`prog-mode` ensures a final newline when saving files, which is useful
since ninja fails otherwise.

See `require-final-newline` and `mode-require-final-newline`.
2014-09-16 14:28:46 +02:00
donkopotamus
781aa24ba5 Add highlighting of rule in build statements
Highlight the rule being used in a build statement.  Also add `.` to acceptable characters in a rule name and relax whitespace matching before the name.
2014-06-27 12:26:37 +12:00
donkopotamus
583632513c Update ninja-mode for emacs to handle hyphens in rule names 2014-06-26 16:34:35 +12:00
Nico Weber
23a88eaf4c Version 1.4 of the vim syntax file was merged.
See https://code.google.com/p/vim/source/detail?r=92751673cc37c9ef4d1ad1ac4d42d36faa67f88f
2014-06-12 13:22:35 -07:00
Demetri Obenour
4e0e6c58b4 Removed tab and added . in variable name regexp 2014-06-01 13:39:48 -04:00
Demetri Obenour
44a0d08a52 Added highlighting in Emacs for ${...} variables 2014-06-01 11:29:18 -04:00
Nico Weber
6915955e37 Merge pull request #768 from nico/vimsyn
vim syntax: Correctly highlight $$a as ($$)a instead of $($a).
2014-05-29 17:58:33 -07:00
Nico Weber
4213308cb9 vim syntax: Correctly highlight $$a as ($$)a instead of $($a). 2014-05-13 23:51:51 +02:00
Nico Weber
1a465ea6c8 Merge pull request #756 from ronnychevalier/rc/zsh_completion
improve zsh completion
2014-05-05 15:54:26 -07:00
Chris Drake
fca5ea6ece Get rid of unused import 2014-05-04 19:55:09 -07:00
Chris Drake
c5ee738460 Use consistent indentation conventions 2014-05-04 19:55:02 -07:00
Ronny Chevalier
1bea14c77c improve zsh completion 2014-05-04 04:59:51 +02:00
Taylor Braun-Jones
b1d4668260 Fix getopts barfing over the terminal when trying to complete -f and -C
Note that this is only applicable for when bash_completion is
unavailable.
2014-04-30 14:39:04 -04:00
Taylor Braun-Jones
4f9ac2aab9 Support completion of arguments to -f and -C options
Note: This is only available for bash_completion users.
2014-04-30 14:37:47 -04:00
Taylor Braun-Jones
43645ff15b Style: Fix inconsistent indentation 2014-04-25 13:59:53 -04:00
Taylor Braun-Jones
28d64afc72 Fix bash-completion support for -C option to expand tilde 2014-04-25 13:50:09 -04:00
Allan Odgaard
4835a2b195 Expand the -C argument via ‘eval’ in bash completion
Previously completion would not work for ‘ninja -C $HOME/Source/foo targ‸’.

We still do not support using tilde in the directory argument.
2014-04-15 14:28:42 +07:00
Allan Odgaard
1f38478eb9 Fix bash completion when using command options
By quoting the ‘line’ variable we are making it a single word, but ‘getopts’ wants each option as its own word.

Previously bash completion would output an error for a line like: ‘ninja -vn targ‸’.

In addition to removing the quotes (to enable word expansion) I also used it as a regular variable, as that is what it is (not an array).
2014-04-15 14:27:57 +07:00
Nico Weber
36ffb5922c Merge pull request #722 from nico/manifestgen
add a script to generate large synthetic manifests
2014-04-14 10:43:15 -07:00
Daniel Bratell
cc533ecb29 performance: Writer.build should copy less.
The build method copies the input lists several times. That
cost about 0.1s in the gyp generation for the Chromium project for
no gain.
2014-04-14 13:52:02 +02:00
Nico Weber
9ea8bdd8d4 add a script to generate large synthetic manifests
To be used by a manifest parser perf test in a follow-up.
2014-03-25 08:38:58 -07:00
Steve Purcell
2b9fefbdd4 ninja-mode: add autoload cookie for the mode itself 2014-01-22 12:01:16 +00:00
Evan Martin
8d42584c29 Merge branch 'fix-provide-form' of git://github.com/yasuyk/ninja
Conflicts:
	misc/ninja-mode.el
2014-01-21 10:57:29 -08:00