From 32068d98936815142955490366dd54d954b08685 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 22 Sep 2026 22:04:51 +0200 Subject: Delete legacy snippets. Disable terminal mouse by default --- .emacs.d/lisp/yaml-mode.el | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to '.emacs.d/lisp/yaml-mode.el') diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el index dad0380..3add6b7 100644 --- a/.emacs.d/lisp/yaml-mode.el +++ b/.emacs.d/lisp/yaml-mode.el @@ -6,7 +6,7 @@ ;; Marshall T. Vandegrift ;; Maintainer: Vasilij Schneidermann ;; URL: https://github.com/yoshiki/yaml-mode -;; Package-Requires: ((emacs "24.1")) +;; Package-Requires: ((emacs "24.3")) ;; Keywords: data yaml ;; Version: 0.0.16 @@ -109,7 +109,7 @@ that key is pressed to begin a block literal." :group 'yaml) (defcustom yaml-imenu-generic-expression - '((nil "^\\(:?[a-zA-Z_-]+\\):" 1)) + '((nil "^\\(:?[a-zA-Z_][-a-zA-Z0-9_.]*\\):" 1)) "The imenu regex to parse an outline of the yaml file." :type 'string :group 'yaml) @@ -218,17 +218,17 @@ that key is pressed to begin a block literal." (define-derived-mode yaml-mode text-mode "YAML" "Simple mode to edit YAML." (setq-local electric-indent-inhibit t) ;We can't *re*indent reliably. - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-start-skip) "#+ *") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'indent-line-function) #'yaml-indent-line) - (set (make-local-variable 'indent-tabs-mode) nil) - (set (make-local-variable 'fill-paragraph-function) #'yaml-fill-paragraph) - (set (make-local-variable 'page-delimiter) "^---\\([ \t].*\\)*\n") - - (set (make-local-variable 'syntax-propertize-function) - #'yaml-mode-syntax-propertize-function) - (setq font-lock-defaults '(yaml-font-lock-keywords))) + (setq-local comment-start "# ") + (setq-local comment-start-skip "#+ *") + (setq-local comment-end "") + (setq-local indent-line-function #'yaml-indent-line) + (setq-local indent-tabs-mode nil) + (setq-local fill-paragraph-function #'yaml-fill-paragraph) + (setq-local page-delimiter "^---\\([ \t].*\\)*\n") + + (setq-local syntax-propertize-function #'yaml-mode-syntax-propertize-function) + (setq-local imenu-generic-expression yaml-imenu-generic-expression) + (setq-local font-lock-defaults '(yaml-font-lock-keywords))) ;; Font-lock support @@ -464,16 +464,6 @@ this will do usual adaptive fill behaviors." (or (fill-comment-paragraph justify) (fill-paragraph justify region))))) -(defun yaml-set-imenu-generic-expression () - ;; FIXME: Why set this var to its default value? - (setq-local imenu-create-index-function #'imenu-default-create-index-function) - (setq-local imenu-generic-expression yaml-imenu-generic-expression)) - -;; FIXME: Why not inline `yaml-set-imenu-generic-expression' into the -;; major mode function? -(add-hook 'yaml-mode-hook #'yaml-set-imenu-generic-expression) - - (defun yaml-mode-version () "Display version of `yaml-mode'." (interactive) -- cgit v1.3