gitattributes-mode: Major mode for editing .gitattributes files.

Initial release.  So far it supports some basic syntax highlighting.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Updated README.md: Add gitattributes-mode.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Support XDG_CONFIG_HOME for ignore/config mode.

From git-config(1)

    $XDG_CONFIG_HOME/git/config
       Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty,
       $HOME/.config/git/config will be used. Any single-valued variable set in this file
       will be overwritten by whatever is in ~/.gitconfig. It is a good idea not to
       create this file if you sometimes use older versions of Git, as support for this
       file was added fairly recently.

And gitignore(5)

    [...] Its default value is
    $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty,
    $HOME/.config/git/ignore is used instead.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Remove use of `rx'.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Add forward-field operation.

Sets `forward-sexp-function' to `gitattributes-mode-forward-field' to
treat fields as "sexps".  Also add a menu.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Add function to open manpage.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Add ElDoc support.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Highlight macro keyword.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
don't mark first comment as error, and rx cleanup

  The previous version of `git-commit-summary-regexp' highlighted the
  first comment line as a git commit style error.  This was because it
  did not check if bad non-empty second lines were actually comments.
  In addition this commit removes some messy line-start and grouping
  constructs which were not necessary.
customizable max summary length and remove `rx'

No longer using the `rx' package.  Introducing a new defcustom named
`git-commit-max-summary-line-length' to control the max summary line
length.  When this variable is set, an initialization function re-builds
the `git-commit-summary-regexp'.
`git-rebase-show-commit': run `magit-show-commit' in correct `default-directory'

To find out the correct `default-directory' in which to initialize
`magit-commit-mode', `magit-show-commit' uses `magit-get-top-dir',
which uses "git rev-parse --show-cdup".

Unfortunately, that command doesn't return anything when run from
within (a subdir of) $GIT_DIR like e.g. "<repo>/.git/rebase-merge/",
causing subsequent commands in `magit-refresh-commit-buffer' to fail.

Fix it by setting `default-directory' to the current dir's grandparent
before invoking `magit-show-commit'.

Fixes #44.

Signed-off-by: Pieter Praet <pieter@praet.org>
gitattributes: Improve highlight.

Add highlight for pattern similar to `gitignore-mode'.  Highlight for
/ is missing (TODO).  Highlight for variables fixed (includes - now,
e.g., for "export-ignore").  Highlight for "[attr]" changed to
`font-lock-function-name-face'.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
gitattributes: Provide easy way (default) to enable eldoc.

* gitattributes-mode.el (gitattributes-mode-enable-eldoc):  New
  Variable.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Merge pull request #34 from ruediger/gitattributes-mode

gitattributes-mode: Major mode for editing .gitattributes files.
Merge pull request #36 from ruediger/xdg-config

Support XDG_CONFIG_HOME for ignore/config mode.
Merge pull request #45 from praet/rebase-show-commit-fix

`git-rebase-show-commit': run `magit-show-commit' in correct `default-directory'
Merge pull request #38 from eschulte/master

don't mark first comment as error, and rx cleanup
Remove confusing message on mode activation

The call to 'toggle-save-place' evokes the message
'No place will be saved in this file', which is just annoying
and confusing.

Directly setting 'save-place' is safe – it's part of saveplace.el's API.
Fix highlighting of non-empty second line

The last group must be capturing. Its value is used later on for
highlighting.
Plus: Match second lines that have only one char.
Fix highlighting of summary lines without trailing newlines

This restores instant highlighting while the user is entering the summary
line.