Permalink
Browse files

Fixed bug for tabified indent.

  • Loading branch information...
1 parent 37469ca commit 1fa61ecf697b64f87ba2fb3c3a453238f9aa0e41 Yoshiki Kurihara committed Aug 5, 2010
Showing with 22 additions and 20 deletions.
  1. +3 −2 Changes
  2. +1 −1 Makefile
  3. +1 −1 README
  4. +17 −16 yaml-mode.el
View
@@ -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
View
@@ -1,4 +1,4 @@
-VERSION=0.0.6
+VERSION=0.0.7
EMACS = emacs
PREFIX = /usr/local
INSTALLLIBDIR = $(PREFIX)/share/emacs/site-lisp
View
2 README
@@ -37,7 +37,7 @@ SETTING
see SYNOPSIS.
AUTHOR
- Yoshiki Kurihara <kurihara@cpan.org> Copyright (C) 2006 by Free Software
+ Yoshiki Kurihara <kurihara@cpan.org> Copyright (C) 2010 by Free Software
Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
View
@@ -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 <kurihara@cpan.org>
;; Marshall T. Vandegrift <llasram@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

0 comments on commit 1fa61ec

Please sign in to comment.