branch: elpa/yaml-mode commit 1fa61ecf697b64f87ba2fb3c3a453238f9aa0e41 Author: Yoshiki Kurihara <kurih...@livedoor.jp> Commit: Yoshiki Kurihara <kurih...@livedoor.jp>
Fixed bug for tabified indent. --- Changes | 5 +++-- Makefile | 2 +- README | 2 +- yaml-mode.el | 33 +++++++++++++++++---------------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Changes b/Changes index c7a8f95..3abbbcf 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +0.0.7 Thu Aug 5 14:35:14 2010 JST + * Fixed bug for 5th level's indentation becomes TAB character. + See YAML spec 1.2 section 5.5. White Space Characters (ochko) 0.0.6 Mon Mar 1 20:16:29 2009 JST * The dash (-) is a word character. See YAML spec 1.2 section 5.6 (Remco van 't Veer) @@ -17,13 +20,11 @@ yaml-bare-scalar-re yaml-block-literal-base-re * Fixed little bugs #1 - 0.0.2 Fri Aug 25 18:04:01 2006 JST - Patch from Marshall T. Vandegrift. Added lots of features. * Added face used for YAML node anchors and aliases to `font-lock-function-name-face'. * Added face used for YAML tags to `font-lock-type-face'. See http://www.yaml.org/refcard.html - 0.0.1 Fri Jan 21 03:18:00 2006 JST - original version diff --git a/Makefile b/Makefile index ace62b4..33a5589 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=0.0.6 +VERSION=0.0.7 EMACS = emacs PREFIX = /usr/local INSTALLLIBDIR = $(PREFIX)/share/emacs/site-lisp diff --git a/README b/README index eec94af..612af10 100644 --- a/README +++ b/README @@ -37,7 +37,7 @@ SETTING see SYNOPSIS. AUTHOR - Yoshiki Kurihara <kurih...@cpan.org> Copyright (C) 2006 by Free Software + Yoshiki Kurihara <kurih...@cpan.org> Copyright (C) 2010 by Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it diff --git a/yaml-mode.el b/yaml-mode.el index 1524e94..af63712 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -1,11 +1,11 @@ ;;; yaml-mode.el --- Major mode for editing YAML files -;; Copyright (C) 2006 Yoshiki Kurihara +;; Copyright (C) 2010 Yoshiki Kurihara ;; Author: Yoshiki Kurihara <kurih...@cpan.org> ;; Marshall T. Vandegrift <llas...@gmail.com> ;; Keywords: data yaml -;; Version: 0.0.6 +;; Version: 0.0.7 ;; This file is not part of Emacs @@ -113,7 +113,7 @@ that key is pressed to begin a block literal." ;; Constants -(defconst yaml-mode-version "0.0.6" "Version of `yaml-mode.'") +(defconst yaml-mode-version "0.0.7" "Version of `yaml-mode.'") (defconst yaml-blank-line-re "^ *$" "Regexp matching a line containing only (valid) whitespace.") @@ -221,6 +221,7 @@ that key is pressed to begin a block literal." (set (make-local-variable 'comment-start) "# ") (set (make-local-variable 'comment-start-skip) "#+ *") (set (make-local-variable 'indent-line-function) 'yaml-indent-line) + (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'font-lock-defaults) '(yaml-font-lock-keywords nil nil nil nil @@ -264,22 +265,22 @@ artificially limitted to the value of (goto-char (point-at-bol)) (while (and (looking-at yaml-blank-line-re) (not (bobp))) (forward-line -1)) - (let ((nlines yaml-block-literal-search-lines) - (min-level (current-indentation))) - (forward-line -1) - (while (and (/= nlines 0) - (/= min-level 0) - (not (looking-at yaml-block-literal-re)) - (not (bobp))) - (set 'nlines (1- nlines)) - (unless (looking-at yaml-blank-line-re) - (set 'min-level (min min-level (current-indentation)))) - (forward-line -1)) + (let ((nlines yaml-block-literal-search-lines) + (min-level (current-indentation))) + (forward-line -1) + (while (and (/= nlines 0) + (/= min-level 0) + (not (looking-at yaml-block-literal-re)) + (not (bobp))) + (set 'nlines (1- nlines)) + (unless (looking-at yaml-blank-line-re) + (set 'min-level (min min-level (current-indentation)))) + (forward-line -1)) (cond ((and (< (current-indentation) min-level) (looking-at yaml-block-literal-re)) (goto-char end) (set-match-data (list begin end)) t) - ((progn + ((progn (goto-char begin) (re-search-forward (concat yaml-block-literal-re " *\\(.*\\)\n") @@ -355,7 +356,7 @@ immediately previous multiple of `yaml-indent-offset' spaces." (indent-to (* (/ (- ci (* arg yaml-indent-offset)) yaml-indent-offset) yaml-indent-offset))))) - + (defun yaml-electric-bar-and-angle (arg) "Insert the bound key and possibly begin a block literal. Inserts the bound key. If inserting the bound key causes the current