[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/yaml-mode f297efe 012/124: YAML imenu outline integration
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/yaml-mode f297efe 012/124: YAML imenu outline integration |
Date: |
Sun, 29 Aug 2021 11:36:03 -0400 (EDT) |
branch: elpa/yaml-mode
commit f297efe0fc81cf0e561d0c61a025a5c91989823a
Author: Tim Harper <timcharper@gmail.com>
Commit: Tim Harper <timcharper@gmail.com>
YAML imenu outline integration
---
Changes | 2 ++
Makefile | 2 +-
yaml-mode.el | 20 ++++++++++++++++++--
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/Changes b/Changes
index 4a2b2a6..ae626f5 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+0.0.5 Mon Dec 21 2009
+ - Provide outline of yaml document via imenu (Tim Harper)
0.0.4 Mon Apr 20 16:46:13 2009 JST
- Patch from knagano and mad-p. Fixed font-lock bugs(#4)
* Move to github.com
diff --git a/Makefile b/Makefile
index b135d1b..57ccbf5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.0.4
+VERSION=0.0.5
EMACS = emacs
PREFIX = /usr/local
INSTALLLIBDIR = $(PREFIX)/share/emacs/site-lisp
diff --git a/yaml-mode.el b/yaml-mode.el
index ac9d9bb..a8534d8 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -5,7 +5,7 @@
;; Author: Yoshiki Kurihara <kurihara@cpan.org>
;; Marshall T. Vandegrift <llasram@gmail.com>
;; Keywords: data yaml
-;; Version: 0.0.4
+;; Version: 0.0.5
;; This file is not part of Emacs
@@ -104,10 +104,16 @@ that key is pressed to begin a block literal."
:group 'faces
:group 'yaml)
+(defcustom yaml-imenu-generic-expression
+ '((nil "^\\(:?[a-zA-Z_-]+\\):" 1))
+ "The imenu regex to parse an outline of the yaml file."
+ :type 'string
+ :group 'yaml)
+
;; Constants
-(defconst yaml-mode-version "0.0.4" "Version of `yaml-mode.'")
+(defconst yaml-mode-version "0.0.5" "Version of `yaml-mode.'")
(defconst yaml-blank-line-re "^ *$"
"Regexp matching a line containing only (valid) whitespace.")
@@ -381,6 +387,16 @@ margin."
(if (and (not arg) (looking-at yaml-document-delimiter-re))
(delete-horizontal-space))))
+
+(defun yaml-set-imenu-generic-expression ()
+ (make-local-variable 'imenu-generic-expression)
+ (make-local-variable 'imenu-create-index-function)
+ (setq imenu-create-index-function 'imenu-default-create-index-function)
+ (setq imenu-generic-expression yaml-imenu-generic-expression))
+
+(add-hook 'yaml-mode-hook 'yaml-set-imenu-generic-expression)
+
+
(defun yaml-mode-version ()
"Diplay version of `yaml-mode'."
(interactive)
- [nongnu] branch elpa/yaml-mode created (now 63b637f), ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode c92bfe4 007/124: fixed for release 0.0.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 45e52cb 006/124: merge TEST-JULIAN-PATCH, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f297efe 012/124: YAML imenu outline integration,
ELPA Syncer <=
- [nongnu] elpa/yaml-mode 2c0359f 004/124: change VERSION, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 18c9135 020/124: replace `last-command-char` to `last-command-event`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode ef3546b 047/124: allow spaces before '-' in yaml-scalar-context-re, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode bdc47a4 056/124: added two more test files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 236832c 068/124: Merge branch 'liangfu-master', ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f378589 079/124: Merge pull request #45 from dunn/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f991710 086/124: Support for apostrophe in words, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode b83482e 089/124: Support double quote in implicit keys, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode df66d7f 091/124: Merge pull request #59 from Kaali/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode fc7bac0 092/124: Formatting fixes, ELPA Syncer, 2021/08/29