From dbc098e028b45b405fb91324ebb59960ebba00b9 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 28 Jan 2015 16:55:24 +0100 Subject: [PATCH] Add gitignore-mode --- .../gitignore-mode-autoloads.el | 24 ++++++++ elpa/gitignore-mode-0.1/gitignore-mode-pkg.el | 1 + elpa/gitignore-mode-0.1/gitignore-mode.el | 60 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 elpa/gitignore-mode-0.1/gitignore-mode-autoloads.el create mode 100644 elpa/gitignore-mode-0.1/gitignore-mode-pkg.el create mode 100644 elpa/gitignore-mode-0.1/gitignore-mode.el diff --git a/elpa/gitignore-mode-0.1/gitignore-mode-autoloads.el b/elpa/gitignore-mode-0.1/gitignore-mode-autoloads.el new file mode 100644 index 0000000..3798024 --- /dev/null +++ b/elpa/gitignore-mode-0.1/gitignore-mode-autoloads.el @@ -0,0 +1,24 @@ +;;; gitignore-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +;;;### (autoloads nil "gitignore-mode" "gitignore-mode.el" (21633 +;;;;;; 45694 775043 851000)) +;;; Generated autoloads from gitignore-mode.el + +(autoload 'gitignore-mode "gitignore-mode" "\ +A major mode for editing .gitconfig files. + +\(fn)" t nil) + +(setq auto-mode-alist (append '(("/\\.gitignore\\'" . gitignore-mode) ("/\\.git/info/exclude\\'" . gitignore-mode)) auto-mode-alist)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; gitignore-mode-autoloads.el ends here diff --git a/elpa/gitignore-mode-0.1/gitignore-mode-pkg.el b/elpa/gitignore-mode-0.1/gitignore-mode-pkg.el new file mode 100644 index 0000000..bd8fdc4 --- /dev/null +++ b/elpa/gitignore-mode-0.1/gitignore-mode-pkg.el @@ -0,0 +1 @@ +(define-package "gitignore-mode" "0.1" "Major mode for editing .gitconfig files" 'nil) diff --git a/elpa/gitignore-mode-0.1/gitignore-mode.el b/elpa/gitignore-mode-0.1/gitignore-mode.el new file mode 100644 index 0000000..c4051be --- /dev/null +++ b/elpa/gitignore-mode-0.1/gitignore-mode.el @@ -0,0 +1,60 @@ +;;; gitignore-mode.el --- Major mode for editing .gitconfig files +;;; -*- coding: utf-8; lexical-binding: t -*- + +;; Copyright (c) 2012 Sebastian Wiesner +;; +;; Author: Sebastian Wiesner +;; URL: https://github.com/lunaryorn/git-modes +;; Version: 0.1 +;; Keywords: convenience vc git + +;; This file is not part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify it under +;; the terms of the GNU General Public License as published by the Free Software +;; Foundation; either version 2 of the License, or (at your option) any later +;; version. + +;; This program is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +;; details. + +;; You should have received a copy of the GNU General Public License along with +;; this program; if not, write to the Free Software Foundation, Inc., 51 +;; Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; A major mode for editing .gitignore files. + +;;; Code: + +(require 'conf-mode) + +(defvar gitignore-mode-font-lock-keywords + '(("^\\s<.*$" . 'font-lock-comment-face) + ("^\\(!?\\)" (1 'font-lock-negation-char-face)) ; Negated patterns + ("/" . 'font-lock-constant-face) ; Directory separators + ("\\(?:\\*\\|\\?\\)" . 'font-lock-keyword-face) ; Glob patterns + ("\\[.+?\\]" . 'font-lock-keyword-face) ; Ranged glob patterns + )) + +;;;###autoload +(define-derived-mode gitignore-mode conf-unix-mode "Gitignore" + "A major mode for editing .gitconfig files." + (conf-mode-initialize "#") + ;; Disable syntactic font locking, because comments are only valid at + ;; beginning of line. + (setq font-lock-defaults '(gitignore-mode-font-lock-keywords t t)) + (set (make-local-variable 'conf-assignment-sign) nil)) + +;;;###autoload +(setq auto-mode-alist + (append '(("/\\.gitignore\\'" . gitignore-mode) + ("/\\.git/info/exclude\\'" . gitignore-mode)) + auto-mode-alist)) + +(provide 'gitignore-mode) + +;;; gitignore-mode.el ends here