[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/yaml-mode 20d12a2 001/124: init
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/yaml-mode 20d12a2 001/124: init |
Date: |
Sun, 29 Aug 2021 11:36:01 -0400 (EDT) |
branch: elpa/yaml-mode
commit 20d12a2aff0bc9b21428f1421eaf097f4a355ad7
Author: root <root@c9fe89ab-c918-0410-b9be-faebe9bd2962>
Commit: root <root@c9fe89ab-c918-0410-b9be-faebe9bd2962>
init
git-svn-id: http://svn.clouder.jp/repos/public/yaml-mode/trunk@1
c9fe89ab-c918-0410-b9be-faebe9bd2962
---
Makefile | 30 +++++++++++++++++++++
README | 44 +++++++++++++++++++++++++++++++
yaml-mode.el | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 159 insertions(+)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..86c91d0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+VERSION=0.01
+EMACS = emacs
+PREFIX = /usr/local
+INSTALLLIBDIR = $(PREFIX)/share/emacs/site-lisp
+FLAGS = -batch -L $(INSTALLLIBDIR) -q -f batch-byte-compile
+SRC = yaml-mode.el
+INSTALL = /usr/bin/install -c -m 444
+
+all: bytecompile
+
+bytecompile:
+ $(EMACS) $(FLAGS) $(SRC)
+
+install: bytecompile
+ $(INSTALL) yaml-mode.elc $(INSTALLLIBDIR)
+ $(INSTALL) yaml-mode.el $(INSTALLLIBDIR)
+
+uninstall:
+ rm $(INSTALLLIBDIR)/yaml-mode.elc
+ rm $(INSTALLLIBDIR)/yaml-mode.el
+
+tardist:
+ mkdir yaml-mode-$(VERSION)
+ cp yaml-mode.el Makefile README yaml-mode-$(VERSION)
+ tar zcvf yaml-mode-$(VERSION).tar.gz yaml-mode-$(VERSION)
+ rm -fr yaml-mode-$(VERSION)
+
+clean:
+ rm -fr \#*\# *.elc *~ *.tar.gz
+
diff --git a/README b/README
new file mode 100644
index 0000000..cb426c7
--- /dev/null
+++ b/README
@@ -0,0 +1,44 @@
+NAME
+ yaml-mode - Simple major mode to edit YAML file for emacs
+
+SYNOPSIS
+ # You must add path installed yaml-mode.el to load-path.
+ (autoload 'yaml-mode "yaml-mode" "YAML" t)
+ (setq auto-mode-alist
+ (append '(("\\.yml$" . yaml-mode)) auto-mode-alist))
+
+DESCRIPTION
+ yaml-mode is major mode for emacs.
+
+INSTALL
+ You can install yaml-mode typing below.
+
+ % make
+ % make install
+
+ or
+
+ % make PREFIX=/your/home/dir
+ % make install PREFIX=/your/home/dir
+
+SETTING
+ see SYNOPSIS.
+
+AUTHOR
+ Yoshiki Kurihara <kurihara@cpan.org> Copyright (C) 2002 by Free Software
+ Foundation, Inc.
+
+ 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, 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; see the file COPYING. If not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA.
diff --git a/yaml-mode.el b/yaml-mode.el
new file mode 100644
index 0000000..a53283a
--- /dev/null
+++ b/yaml-mode.el
@@ -0,0 +1,85 @@
+;;; yaml-mode.el ---
+;; $Id$
+
+;; Copyright (C) 2006 Free Software Foundation, Inc.
+
+;; Author: Yoshiki Kurihara <kurihara@livedoor.jp>
+;; Keywords:
+
+;; 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, 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; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; To handle files included with do 'filename.yml';, add something like
+;; (setq auto-mode-alist (append (list (cons "\\.yml\\'" 'yaml-mode))
+;; auto-mode-alist))
+;; to your .emacs file; otherwise the .pl suffix defaults to prolog-mode.
+
+;;; Code:
+
+(defcustom yaml-indent-offset 2
+ ""
+ :type 'integer
+ :group 'yaml-mode)
+
+(defun yaml-indent-line ()
+ (interactive)
+ (let ((pos (point)) ; position from the end of the buffer
+ (cur (current-indentation)) ; indentation of current line
+ (before (current-column))
+ (indentation 0)
+ new-column)
+ (save-excursion
+ (forward-line -1)
+ (if (and (not (bobp))
+ (looking-at "^[ \t]*\\(.+\\)[ \t]*:[ \r\n]"))
+ (if (< cur (+ (current-indentation) yaml-indent-offset))
+ (setq indentation (+ (current-indentation) yaml-indent-offset)))
+ (if (< cur (current-indentation))
+ (setq indentation (current-indentation))))
+ (if (and (not (bobp))
+ (looking-at "^[ \t]*\\(.+\\)[ \t]*: [^\r\n]+"))
+ (if (< cur (+ (current-indentation) yaml-indent-offset))
+ (setq indentation (current-indentation))))
+ )
+ (if (> indentation 0)
+ (indent-line-to indentation))
+ ))
+
+(defvar yaml-font-lock-keywords
+ (list
+ '("^[ \t]*\\(.+\\)[ \t]*:[ \r\n]" 0 font-lock-variable-name-face)
+ '("\\(%YAML\\|# \\(.*\\)\\|\\(---\\|\\.\\.\\.\\)\\(.*\\)\\)" 0
font-lock-comment-face)
+ '("\\(\\*\\|\\&\\)\\(.*\\)" 0 (cons font-lock-variable-name-face
'(underline)))
+ '("\\!\\!\\sw+[ \r\n]" 0 font-lock-function-name-face)
+ ))
+
+(define-derived-mode yaml-mode fundamental-mode "YAML"
+ "Simple mode to edit yaml
+
+\\{yaml-mode-map}"
+
+ ;; font-lock
+ (set (make-local-variable 'comment-start) "# ")
+ (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
+ (set (make-local-variable 'font-lock-defaults) '(yaml-font-lock-keywords))
+
+ ;; indent-line
+ (set (make-local-variable 'indent-line-function) 'yaml-indent-line)
+ )
+
+(provide 'yaml-mode)
+;;; yaml-mode.el ends here
- [nongnu] elpa/yaml-mode a817e46 045/124: Bumping version to 0.0.12, (continued)
- [nongnu] elpa/yaml-mode a817e46 045/124: Bumping version to 0.0.12, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 93dd95c 051/124: remove regexp details from test-file, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode e9937d2 063/124: Backquote FTW, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 3dc2212 065/124: Remove obsolete `font-lock-syntactic-keywords` use, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 8d1f218 071/124: Spelling fix, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 5abb2f4 078/124: update yaml-mode-version, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 10dddc5 080/124: Fix typo in yaml-mode-version docstring, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 162f7e4 082/124: Treat alias nodes as punctuation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 756e64b 084/124: Don't consider a line a document delimiter if it has leading whitespace, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 78b3ba5 095/124: fill while in a comment should behave as in text modes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 20d12a2 001/124: init,
ELPA Syncer <=
- [nongnu] elpa/yaml-mode 00ac9e5 116/124: Merge pull request #67 from HParker/fix-comment-indent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 6694896 002/124: change e-mail, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 67348f3 014/124: dash (-) is a word character, see YAML spec 1.2 section 5.6, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 37469ca 015/124: Changed versions., ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode c7624d4 018/124: added *.elc to .gitignore, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 52d6d57 019/124: Merge pull request #3 from arthuraa/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 5eae0c1 031/124: Changed version to 0.0.9, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 5f92179 035/124: Merge pull request #15 from barrkel/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode bc66879 038/124: Use the syntax table for highlighting comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 210b075 040/124: Bumping version to 0.0.11, ELPA Syncer, 2021/08/29