From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D6F661381F3 for ; Fri, 5 Jul 2013 13:37:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85F87E0AD0; Fri, 5 Jul 2013 13:37:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A6D4E0AD0 for ; Fri, 5 Jul 2013 13:37:48 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E260C33E8E2 for ; Fri, 5 Jul 2013 13:37:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3DCA8E468F for ; Fri, 5 Jul 2013 13:37:46 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1372974023.70500045344b0cc9481a481fc026cb43f95d082b.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: /, misc/ X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog misc/Makefile.am misc/eselect-mode.el X-VCS-Directories: / misc/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: 70500045344b0cc9481a481fc026cb43f95d082b X-VCS-Branch: master Date: Fri, 5 Jul 2013 13:37:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2082a00d-f48f-4c2e-9022-18d79149ce25 X-Archives-Hash: 88cf07447f7f36a5347318f028cb2206 commit: 70500045344b0cc9481a481fc026cb43f95d082b Author: Ulrich Müller gentoo org> AuthorDate: Thu Jul 4 21:40:23 2013 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Thu Jul 4 21:40:23 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=70500045 Add editing mode for Emacs, moved from emacs-tools repository to here. * misc/eselect-mode.el: New file, editing mode for Emacs, split off from app-emacs/gentoo-syntax. * misc/Makefile.am (EXTRA_DIST): Add eselect-mode.el. --- ChangeLog | 6 +++ misc/Makefile.am | 2 +- misc/eselect-mode.el | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d877459..1809cfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-07-04 Ulrich Müller + + * misc/eselect-mode.el: New file, editing mode for Emacs, + split off from app-emacs/gentoo-syntax. + * misc/Makefile.am (EXTRA_DIST): Add eselect-mode.el. + 2013-06-22 Ulrich Müller * configure.ac: Update version to 1.3.5. diff --git a/misc/Makefile.am b/misc/Makefile.am index 626fe95..1933dee 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -1,2 +1,2 @@ -EXTRA_DIST = eselect.bashcomp +EXTRA_DIST = eselect.bashcomp eselect-mode.el MAINTAINERCLEANFILES = *~ Makefile.in diff --git a/misc/eselect-mode.el b/misc/eselect-mode.el new file mode 100644 index 0000000..065ee15 --- /dev/null +++ b/misc/eselect-mode.el @@ -0,0 +1,129 @@ +;;; eselect-mode.el --- edit eselect files + +;; Copyright 2006-2013 Gentoo Foundation + +;; Author: Matthew Kennedy +;; Diego Pettenò +;; Christian Faulhammer +;; Ulrich Müller +;; Maintainer: +;; Keywords: languages + +;; This file 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 file 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 GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'sh-script) +(require 'font-lock) + +;;; Font-lock. + +(defvar eselect-mode-keywords-warn + '(("eval") + font-lock-warning-face)) + +(defvar eselect-mode-keywords-core + '(("die" "check_do" "do_action" "inherit" "sed") + font-lock-type-face)) + +(defvar eselect-mode-keywords-output + '(("write_error_msg" "write_warning_msg" "write_list_start" + "write_numbered_list_entry" "write_kv_list_entry" + "write_numbered_list" "highlight" "highlight_warning" + "highlight_marker" "is_output_mode" "space") + font-lock-type-face)) + +(defvar eselect-mode-keywords-tests + '(("has" "is_function" "is_number") + font-lock-type-face)) + +(defvar eselect-mode-keywords-path-manipulation + '(("basename" "dirname" "canonicalise" "relative_name") + font-lock-type-face)) + +(defvar eselect-mode-keywords-config + '(("store_config" "load_config" "append_config") + font-lock-type-face)) + +(defvar eselect-mode-keywords-multilib + '(("list_libdirs") + font-lock-type-face)) + +(defvar eselect-mode-keywords-package-manager + '(("arch" "envvar" "best_version" "has_version" "get_repositories" + "get_repo_news_dir") + font-lock-type-face)) + +(defun eselect-mode-make-keywords-list (keywords-list face + &optional prefix suffix) + ;; based on `generic-make-keywords-list' from generic.el + ;; Note: XEmacs doesn't have generic.el + (unless (listp keywords-list) + (error "Keywords argument must be a list of strings")) + (cons (concat prefix "\\<" + (regexp-opt keywords-list t) + "\\>" suffix) + face)) + +(defvar eselect-mode-font-lock-keywords + (mapcar + (lambda (x) (apply 'eselect-mode-make-keywords-list x)) + (list + eselect-mode-keywords-warn + eselect-mode-keywords-core + eselect-mode-keywords-output + eselect-mode-keywords-tests + eselect-mode-keywords-path-manipulation + eselect-mode-keywords-config + eselect-mode-keywords-multilib + eselect-mode-keywords-package-manager))) + +;;; Mode definitions. + +(defun eselect-mode-before-save () + ;;(delete-trailing-whitespace) ; doesn't exist in XEmacs + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "[ \t]+$" nil t) + (delete-region (match-beginning 0) (point)))) + ;; return nil, otherwise the file is presumed to be written + nil) + +;;;###autoload +(define-derived-mode eselect-mode shell-script-mode "Eselect" + "Major mode for .eselect files." + (if (featurep 'xemacs) + (make-local-hook 'write-contents-hooks)) + (add-hook 'write-contents-hooks 'eselect-mode-before-save t t) + (sh-set-shell "bash") + (setq tab-width 4) + (setq indent-tabs-mode t)) + +(add-hook 'eselect-mode-hook + (lambda () (font-lock-add-keywords + nil eselect-mode-font-lock-keywords))) + + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.eselect\\'" . eselect-mode)) + +(provide 'eselect-mode) + +;; Local Variables: +;; coding: utf-8 +;; End: + +;;; eselect-mode.el ends here