[macemacsjp-cvs 410] CVS update: CarbonEmacsPackage/GPL

Back to archive index

Seiji Zenitani zenit****@users*****
2006年 8月 29日 (火) 10:11:45 JST


Index: CarbonEmacsPackage/GPL/po-mode.el
diff -u CarbonEmacsPackage/GPL/po-mode.el:1.3 CarbonEmacsPackage/GPL/po-mode.el:1.4
--- CarbonEmacsPackage/GPL/po-mode.el:1.3	Mon Oct 31 23:13:51 2005
+++ CarbonEmacsPackage/GPL/po-mode.el	Tue Aug 29 10:11:45 2006
@@ -1,6 +1,6 @@
 ;;; po-mode.el -- major mode for GNU gettext PO files
 
-;; Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1999, 2000-2002, 2005-2006 Free Software Foundation, Inc.
 
 ;; Authors: François Pinard <pinar****@iro*****>
 ;;          Greg McGary <gkm****@magil*****>
@@ -50,7 +50,7 @@
 
 ;;; Code:
 
-(defconst po-mode-version-string "2.01" "\
+(defconst po-mode-version-string "2.02" "\
 Version number of this version of po-mode.el.")
 
 ;;; Emacs portability matters - part I.
@@ -233,6 +233,7 @@
     ("Hindi" . "hi")
     ("Hiri Motu" . "ho")
     ("Hungarian" . "hu")
+    ("Hyam" . "jab")
     ("Icelandic" . "is")
     ("Ido" . "io")
     ("Indonesian" . "id")
@@ -244,6 +245,8 @@
     ("Italian" . "it")
     ("Japanese" . "ja")
     ("Javanese" . "jv")
+    ("Jju" . "kaj")
+    ("Kagoma" . "kdm")
     ("Kalaallisut" . "kl")
     ("Kannada" . "kn")
     ("Kashmiri" . "ks")
@@ -264,7 +267,9 @@
     ("Letzeburgesch" . "lb")
     ("Lingala" . "ln")
     ("Lithuanian" . "lt")
+    ("Low Saxon" . "nds")
     ("Macedonian" . "mk")
+    ("Maithili" . "mai")
     ("Malagasy" . "mg")
     ("Malay" . "ms")
     ("Malayalam" . "ml")
@@ -274,21 +279,26 @@
     ("Maori" . "mi")
     ("Marathi" . "mr")
     ("Marshall" . "mh")
+    ("Mayan" . "myn")
     ("Moldavian" . "mo")
     ("Mongolian" . "mn")
+    ("Nahuatl" . "nah")
     ("Nauru" . "na")
     ("Navajo" . "nv")
     ("Ndonga" . "ng")
     ("Nepali" . "ne")
     ("North Ndebele" . "nd")
     ("Northern Sami" . "se")
+    ("Northern Sotho" . "nso")
     ("Norwegian Bokmal" . "nb")
     ("Norwegian Nynorsk" . "nn")
     ("Norwegian" . "no")
     ("Nyanja" . "ny")
     ("Occitan" . "oc")
+    ("Old English" . "ang")
     ("Oriya" . "or")
     ("Ossetian" . "os")
+    ("Páez" . "pbb")
     ("Pali" . "pi")
     ("Pashto" . "ps")
     ("Persian" . "fa")
@@ -326,6 +336,7 @@
     ("Tamil" . "ta")
     ("Tatar" . "tt")
     ("Telugu" . "te")
+    ("Tetum" . "tet")
     ("Thai" . "th")
     ("Tibetan" . "bo")
     ("Tigrinya" . "ti")
@@ -334,6 +345,7 @@
     ("Turkish" . "tr")
     ("Turkmen" . "tk")
     ("Twi" . "tw")
+    ("Tyap" . "kcg")
     ("Uighur" . "ug")
     ("Ukrainian" . "uk")
     ("Urdu" . "ur")
@@ -346,6 +358,7 @@
     ("Xhosa" . "xh")
     ("Yiddish" . "yi")
     ("Yoruba" . "yo")
+    ("Zapotec" . "zap")
     ("Zhuang" . "za")
     ("Zulu" . "zu")
     )
@@ -3096,6 +3109,11 @@
 (defun po-validate ()
   "Use 'msgfmt' for validating the current PO file contents."
   (interactive)
+  ; The 'compile' subsystem is autoloaded through a call to (compile ...).
+  ; We need to initialize it outside of any binding. Without this statement,
+  ; all defcustoms and defvars of compile.el would be undone when the let*
+  ; terminates.
+  (require 'compile)
   (let* ((dev-null
 	  (cond ((boundp 'null-device) null-device) ; since Emacs 20.3
 		((memq system-type '(windows-nt windows-95)) "NUL")
Index: CarbonEmacsPackage/GPL/psvn.el
diff -u CarbonEmacsPackage/GPL/psvn.el:1.5 CarbonEmacsPackage/GPL/psvn.el:1.6
--- CarbonEmacsPackage/GPL/psvn.el:1.5	Sat Jul 29 06:19:43 2006
+++ CarbonEmacsPackage/GPL/psvn.el	Tue Aug 29 10:11:45 2006
@@ -2,7 +2,7 @@
 ;; Copyright (C) 2002-2006 by Stefan Reichoer
 
 ;; Author: Stefan Reichoer, <stefa****@xstev*****>
-;; $Id: psvn.el 20824 2006-07-21 20:00:32Z xsteve $
+;; $Id: psvn.el 21273 2006-08-26 18:48:54Z xsteve $
 
 ;; psvn.el is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -206,7 +206,7 @@
       (require 'diff-mode))
   (error nil))
 
-(defconst svn-psvn-revision "$Id: psvn.el 20824 2006-07-21 20:00:32Z xsteve $"
+(defconst svn-psvn-revision "$Id: psvn.el 21273 2006-08-26 18:48:54Z xsteve $"
   "The revision number of psvn.")
 
 ;;; user setable variables
@@ -231,6 +231,15 @@
 This variable takes effect only when psvn.el is being loaded."
   :type 'boolean
   :group 'psvn)
+(defcustom svn-log-edit-paragraph-start
+  "$\\|[ \t]*$\\|##.*$\\|\\*.*:.*$\\|[ \t]+(.+):.*$"
+  "*Value used for `paragraph-start' in *svn-log-edit* buffer."
+  :type 'regexp
+  :group 'psvn)
+(defcustom svn-log-edit-paragraph-separate "$\\|##.*$"
+  "*Value used for `paragraph-separate' in *svn-log-edit* buffer."
+  :type 'regexp
+  :group 'psvn)
 (defcustom svn-status-hide-unknown nil
   "*Hide unknown files in `svn-status-buffer-name' buffer.
 This can be toggled with \\[svn-status-toggle-hide-unknown]."
@@ -3935,6 +3944,10 @@
 
 (defvar svn-log-edit-mode-menu) ;really defined with `easy-menu-define' below.
 
+(defun svn-log-edit-common-setup ()
+  (set (make-local-variable 'paragraph-start) svn-log-edit-paragraph-start)
+  (set (make-local-variable 'paragraph-separate) svn-log-edit-paragraph-separate))
+
 (if svn-log-edit-use-log-edit-mode
     (define-derived-mode svn-log-edit-mode log-edit-mode "svn-log-edit"
       "Wrapper around `log-edit-mode' for psvn.el"
@@ -3943,6 +3956,7 @@
       (set (make-local-variable 'log-edit-callback) 'svn-log-edit-done)
       (set (make-local-variable 'log-edit-listfun) 'svn-log-edit-files-to-commit)
       (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
+      (svn-log-edit-common-setup)
       (message "Press %s when you are done editing."
                (substitute-command-keys "\\[log-edit-done]"))
       )
@@ -3957,6 +3971,7 @@
     (setq major-mode 'svn-log-edit-mode)
     (setq mode-name "svn-log-edit")
     (setq svn-log-edit-update-log-entry nil)
+    (svn-log-edit-common-setup)
     (run-hooks 'svn-log-edit-mode-hook)))
 
 (when (not svn-log-edit-mode-map)
Index: CarbonEmacsPackage/GPL/yaml-mode.el
diff -u CarbonEmacsPackage/GPL/yaml-mode.el:1.1 CarbonEmacsPackage/GPL/yaml-mode.el:1.2
--- CarbonEmacsPackage/GPL/yaml-mode.el:1.1	Thu Aug  3 02:06:48 2006
+++ CarbonEmacsPackage/GPL/yaml-mode.el	Tue Aug 29 10:11:45 2006
@@ -1,10 +1,13 @@
-;;; yaml-mode.el ---
-;; $Id$
+;;; yaml-mode.el --- Major mode for editing YAML files
 
-;; Copyright (C) 2006  Free Software Foundation, Inc.
+;; Copyright (C) 2006  Yoshiki Kurihara
 
-;; Author: Yoshiki Kurihara <kurih****@lived*****>
-;; Keywords: 
+;; Author: Yoshiki Kurihara <kurih****@cpan*****>
+;;         Marshall T. Vandegrift <llasr****@gmail*****>
+;; Keywords: data yaml
+;; Version: 0.0.2
+
+;; This file is not part of Emacs
 
 ;; 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
@@ -23,30 +26,365 @@
 
 ;;; 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.
+;; This is a major mode for editing files in the YAML data
+;; serialization format.  It was initially developed by Yoshiki
+;; Kurihara and many features were added by Marshall Vandegrift.  As
+;; YAML and Python share the fact that indentation determines
+;; structure, this mode provides indentation and indentation command
+;; behavior very similar to that of python-mode.
+
+;;; Installation:
+
+;; To install, just drop this file into a directory in your
+;; `load-path' and (optionally) byte-compile it.  To automatically
+;; handle files ending in '.yml', add something like:
+;;
+;;    (require 'yaml-mode)
+;;    (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
+;;
+;; to your .emacs file.
+;;
+;; Unlike python-mode, this mode follows the Emacs convention of not
+;; binding the ENTER key to `newline-and-indent'.  To get this
+;; behavior, add the key definition to `yaml-mode-hook':
+;;
+;;    (add-hook 'yaml-mode-hook
+;;     '(lambda ()
+;;        (define-key yaml-mode-map "\C-m" 'newline-and-indent)))
+
+;;; Known Bugs:
+
+;; YAML is easy to write but complex to parse, and this mode doesn't
+;; even really try.  Indentation and highlighting will break on
+;; abnormally complicated structures.
 
 ;;; Code:
 
-(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)
-   ))
+
+;; User definable variables
+
+(defgroup yaml nil
+  "Support for the YAML serialization format"
+  :group 'languages
+  :prefix "yaml-")
+
+(defcustom yaml-mode-hook nil
+  "*Hook run by `yaml-mode'."
+  :type 'hook
+  :group 'yaml)
+
+(defcustom yaml-indent-offset 2
+  "*Amount of offset per level of indentation."
+  :type 'integer
+  :group 'yaml)
+
+(defcustom yaml-backspace-function 'backward-delete-char-untabify
+  "*Function called by `yaml-electric-backspace' when deleting backwards."
+  :type 'function
+  :group 'yaml)
+
+(defcustom yaml-block-literal-search-lines 100
+  "*Maximum number of lines to search for start of block literals."
+  :type 'integer
+  :group 'yaml)
+
+(defcustom yaml-block-literal-electric-alist
+  '((?| . "") (?> . "-"))
+  "*Characters for which to provide electric behavior.
+The association list key should be a key code and the associated value
+should be a string containing additional characters to insert when
+that key is pressed to begin a block literal."
+  :type 'alist
+  :group 'yaml)
+
+(defface yaml-tab-face
+   '((((class color)) (:background "red" :foreground "red" :bold t))
+     (t (:reverse-video t)))
+  "Face to use for highlighting tabs in YAML files."
+  :group 'faces
+  :group 'yaml)
+
+
+;; Constants
+
+(defconst yaml-mode-version "0.0.2" "Version of `yaml-mode.'")
+
+(defconst yaml-blank-line-re "^ *$"
+  "Regexp matching a line containing only (valid) whitespace.")
+
+(defconst yaml-comment-re "\\(?:^\\|\\s-+\\)\\(#.*\\)"
+  "Regexp matching a line containing a YAML comment or delimiter.")
+
+(defconst yaml-directive-re "^\\(?:--- \\)? *%\\(\\w+\\)"
+  "Regexp matching a line contatining a YAML directive.")
+
+(defconst yaml-document-delimiter-re "^ *\\(?:---\\|[.][.][.]\\)"
+  "Rexexp matching a YAML document delimiter line.")
+
+(defconst yaml-node-anchor-alias-re "[&*]\\w+"
+  "Regexp matching a YAML node anchor or alias.")
+
+(defconst yaml-tag-re "!!?[^ \n]+"
+  "Rexexp matching a YAML tag.")
+
+(defconst yaml-bare-scalar-re
+  "\\(?:[^-:,#!\n ]\\|[^#!\n ]\\S-\\)[^\n]*?"
+  "Rexexp matching a YAML bare scalar.")
+
+(defconst yaml-hash-key-re
+  (concat "\\(?:^\\(?:--- \\)?\\|{\\|\\(?:[-,] +\\)+\\) *"
+          "\\(?:" yaml-tag-re " +\\)?"
+          "\\(" yaml-bare-scalar-re "\\) *:"
+          "\\(?: +\\|$\\)")
+  "Regexp matching a single YAML hash key.")
+
+(defconst yaml-scalar-context-re
+  (concat "\\(?:^\\(?:--- \\)?\\|{\\|\\(?:[-,] +\\)+\\) *"
+          "\\(?:" yaml-bare-scalar-re " *: \\)?")
+  "Regexp indicating the begininng of a scalar context.")
+
+(defconst yaml-nested-map-re
+  (concat ".*: *\\(?:&.*\\|{ *\\|" yaml-tag-re " *\\)?$")
+  "Regexp matching a line beginning a YAML nested structure.")
+
+(defconst yaml-block-literal-base-re " *[>|][-+0-9]* *\n"
+  "Regexp matching the substring start of a block literal.")
+
+(defconst yaml-block-literal-re
+  (concat yaml-scalar-context-re
+          "\\(?:" yaml-tag-re "\\)?"
+          yaml-block-literal-base-re)
+  "Regexp matching a line beginning a YAML block literal")
+
+(defconst yaml-nested-sequence-re
+  (concat "^\\(?: *- +\\)+"
+          "\\(?:" yaml-bare-scalar-re " *:\\(?: +.*\\)?\\)?$")
+  "Regexp matching a line containing one or more nested YAML sequences")
+
+(defconst yaml-constant-scalars-re
+  (concat "\\(?:^\\|\\(?::\\|-\\|,\\|{\\|\\[\\) +\\) *"
+          (regexp-opt
+           '("~" "null" "Null" "NULL"
+             ".nan" ".NaN" ".NAN"
+             ".inf" ".Inf" ".INF"
+             "-.inf" "-.Inf" "-.INF"
+             "y" "Y" "yes" "Yes" "YES" "n" "N" "no" "No" "NO"
+             "true" "True" "TRUE" "false" "False" "FALSE"
+             "on" "On" "ON" "off" "Off" "OFF") t)
+          " *$")
+  "Regexp matching certain scalar constants in scalar context")
+
+
+;; Mode setup
+
+(defvar yaml-mode-map ()
+  "Keymap used in `yaml-mode' buffers.")
+(if yaml-mode-map
+    nil
+  (setq yaml-mode-map (make-sparse-keymap))
+  (define-key yaml-mode-map "|" 'yaml-electric-bar-and-angle)
+  (define-key yaml-mode-map ">" 'yaml-electric-bar-and-angle)
+  (define-key yaml-mode-map "-" 'yaml-electric-dash-and-dot)
+  (define-key yaml-mode-map "." 'yaml-electric-dash-and-dot)
+  (define-key yaml-mode-map [backspace] 'yaml-electric-backspace)
+  (define-key yaml-mode-map "\C-j" 'newline-and-indent))
+
+(defvar yaml-mode-syntax-table nil
+  "Syntax table in use in yaml-mode buffers.")
+(if yaml-mode-syntax-table
+    nil
+  (setq yaml-mode-syntax-table (make-syntax-table))
+  (modify-syntax-entry ?\' "\"" yaml-mode-syntax-table)
+  (modify-syntax-entry ?\" "\"" yaml-mode-syntax-table)
+  (modify-syntax-entry ?# "." yaml-mode-syntax-table)
+  (modify-syntax-entry ?\\ "\\" yaml-mode-syntax-table)
+  (modify-syntax-entry ?- "." yaml-mode-syntax-table)
+  (modify-syntax-entry ?_ "_" yaml-mode-syntax-table)
+  (modify-syntax-entry ?\( "." yaml-mode-syntax-table)
+  (modify-syntax-entry ?\) "." yaml-mode-syntax-table)
+  (modify-syntax-entry ?\{ "(}" yaml-mode-syntax-table)
+  (modify-syntax-entry ?\} "){" yaml-mode-syntax-table)
+  (modify-syntax-entry ?\[ "(]" yaml-mode-syntax-table)
+  (modify-syntax-entry ?\] ")[" yaml-mode-syntax-table))
 
 (define-derived-mode yaml-mode fundamental-mode "YAML"
-  "Simple mode to edit yaml
+  "Simple mode to edit YAML.
 
 \\{yaml-mode-map}"
+  (set (make-local-variable 'comment-start) "\\(?:^\\|\\s-+\\)#")
+  (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-+\\)#+ *")
+  (set (make-local-variable 'indent-line-function) 'yaml-indent-line)
+  (set (make-local-variable 'font-lock-defaults)
+       '(yaml-font-lock-keywords
+         nil nil nil nil
+         (font-lock-syntactic-keywords . yaml-font-lock-syntactic-keywords))))
+
+
+;; Font-lock support
+
+(defvar yaml-font-lock-keywords
+   (list
+    (cons yaml-comment-re '(1 font-lock-comment-face))
+    (cons yaml-constant-scalars-re '(1 font-lock-constant-face))
+    (cons yaml-tag-re '(0 font-lock-type-face))
+    (cons yaml-node-anchor-alias-re '(0 font-lock-function-name-face))
+    (cons yaml-hash-key-re '(1 font-lock-variable-name-face))
+    (cons yaml-document-delimiter-re '(0 font-lock-comment-face))
+    (cons yaml-directive-re '(1 font-lock-builtin-face))
+    '(yaml-font-lock-block-literals 0 font-lock-string-face t)
+    '("^[\t]+" 0 'yaml-tab-face t))
+   "Additional expressions to highlight in YAML mode.")
+
+(defvar yaml-font-lock-syntactic-keywords
+  (list '(yaml-syntactic-block-literals 0 "." t))
+  "Additional syntax features to highlight in YAML mode.")
+
+
+(defun yaml-font-lock-block-literals (bound)
+  "Find lines within block literals.
+Find the next line of the first (if any) block literal after point and
+prior to BOUND.  Returns the beginning and end of the block literal
+line in the match data, as consumed by `font-lock-keywords' matcher
+functions.  The function begins by searching backwards to determine
+whether or not the current line is within a block literal.  This could
+be time-consuming in large buffers, so the number of lines searched is
+artificially limitted to the value of
+`yaml-block-literal-search-lines'."
+  (if (eolp) (goto-char (1+ (point))))
+  (unless (or (eobp) (>= (point) bound))
+    (let ((begin (point))
+          (end (min (point-at-eol) bound)))
+      (beginning-of-line)
+      (while (and (looking-at yaml-blank-line-re) (not (bobp)))
+        (forward-line -1))
+      (let ((level (current-indentation))
+            (nlines yaml-block-literal-search-lines))
+        (unless  (= level 0)
+          (forward-line -1)
+          (while (and (/= nlines 0)
+                      (or (>= (current-indentation) level)
+                          (looking-at yaml-blank-line-re))
+                      (not (bobp)))
+            (set 'nlines (1- nlines))
+            (forward-line -1)))
+        (cond
+         ((and (< (current-indentation) level)
+               (looking-at yaml-block-literal-re))
+          (goto-char end) (set-match-data (list begin end)) t)
+         ((progn 
+            (goto-char begin)
+            (re-search-forward (concat yaml-block-literal-re
+                                       " *\\(.*\\)\n")
+                               bound t))
+          (set-match-data (nthcdr 2 (match-data))) t))))))
+
+(defun yaml-syntactic-block-literals (bound)
+  "Find quote characters within block literals.
+Finds the first quote character within a block literal (if any) after
+point and prior to BOUND.  Returns the position of the quote character
+in the match data, as consumed by matcher functions in
+`font-lock-syntactic-keywords'.  This allows the mode to treat ['\"]
+characters in block literals as punctuation syntax instead of string
+syntax, preventing unmatched quotes in block literals from painting
+the entire buffer in `font-lock-string-face'."
+  (let ((found nil))
+    (while (and (not found)
+                (/= (point) bound)
+                (yaml-font-lock-block-literals bound))
+      (let ((begin (match-beginning 0)) (end (match-end 0)))
+        (goto-char begin)
+        (cond
+         ((re-search-forward "['\"]" end t) (setq found t))
+         ((goto-char end)))))
+    found))
+
+
+;; Indentation and electric keys
+
+(defun yaml-compute-indentation ()
+  "Calculate the maximum sensible indentation for the current line."
+  (save-excursion
+    (beginning-of-line)
+    (if (looking-at yaml-document-delimiter-re) 0
+      (forward-line -1)
+      (while (and (looking-at yaml-blank-line-re)
+                  (> (point) (point-min)))
+        (forward-line -1))
+      (+ (current-indentation)
+         (if (looking-at yaml-nested-map-re) yaml-indent-offset 0)
+         (if (looking-at yaml-nested-sequence-re) yaml-indent-offset 0)
+         (if (looking-at yaml-block-literal-re) yaml-indent-offset 0)))))
+
+(defun yaml-indent-line ()
+  "Indent the current line.
+The first time this command is used, the line will be indented to the
+maximum sensible indentation.  Each immediately subsequent usage will
+back-dent the line by `yaml-indent-offset' spaces.  On reaching column
+0, it will cycle back to the maximum sensible indentation."
+  (interactive "*")
+  (let ((ci (current-indentation))
+        (cc (current-column))
+        (need (yaml-compute-indentation)))
+    (save-excursion
+      (beginning-of-line)
+      (delete-horizontal-space)
+      (if (and (equal last-command this-command) (/= ci 0))
+          (indent-to (* (/ (- ci 1) yaml-indent-offset) yaml-indent-offset))
+        (indent-to need)))
+      (if (< (current-column) (current-indentation))
+          (forward-to-indentation 0))))
+
+(defun yaml-electric-backspace (arg)
+  "Delete characters or back-dent the current line.
+If invoked following only whitespace on a line, will back-dent to the
+immediately previous multiple of `yaml-indent-offset' spaces."
+  (interactive "*p")
+  (if (or (/= (current-indentation) (current-column)) (bolp))
+      (funcall yaml-backspace-function arg)
+    (let ((ci (current-column)))
+      (beginning-of-line)
+      (delete-horizontal-space)
+      (indent-to (* (/ (- ci (* arg yaml-indent-offset))
+                       yaml-indent-offset)
+                    yaml-indent-offset)))))
   
-  (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))
-  )
+(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
+line to match the initial line of a block literal, then inserts the
+matching string from `yaml-block-literal-electric-alist', a newline,
+and indents appropriately."
+  (interactive "*P")
+  (self-insert-command (prefix-numeric-value arg))
+  (let ((extra-chars
+         (assoc last-command-char
+                yaml-block-literal-electric-alist)))
+    (cond
+     ((and extra-chars (not arg) (eolp)
+           (save-excursion
+             (beginning-of-line)
+             (looking-at yaml-block-literal-re)))
+      (insert (cdr extra-chars))
+      (newline-and-indent)))))
+
+(defun yaml-electric-dash-and-dot (arg)
+  "Insert the bound key and possibly de-dent line.
+Inserts the bound key.  If inserting the bound key causes the current
+line to match a document delimiter, de-dent the line to the left
+margin."
+  (interactive "*P")
+  (self-insert-command (prefix-numeric-value arg))
+  (save-excursion
+    (beginning-of-line)
+    (if (and (not arg) (looking-at yaml-document-delimiter-re))
+        (delete-horizontal-space))))
+
+(defun yaml-mode-version ()
+  "Diplay version of `yaml-mode'."
+  (interactive)
+  (message "yaml-mode %s" yaml-mode-version)
+  yaml-mode-version)
 
 (provide 'yaml-mode)
+
 ;;; yaml-mode.el ends here


macemacsjp-cvs メーリングリストの案内
Back to archive index