From 5683530e98a45dcc3163b4ddea038868efdb466a Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sun, 26 Jan 2020 13:24:51 +0100 Subject: Remove "-mode" suffix from filenames --- lisp/init-go-mode.el | 37 ------------------------------------- lisp/init-go.el | 37 +++++++++++++++++++++++++++++++++++++ lisp/init-markdown-mode.el | 16 ---------------- lisp/init-markdown.el | 16 ++++++++++++++++ lisp/init-python-mode.el | 18 ------------------ lisp/init-python.el | 18 ++++++++++++++++++ lisp/init-writegood-mode.el | 6 ------ lisp/init-writegood.el | 6 ++++++ lisp/init-yaml-mode.el | 11 ----------- lisp/init-yaml.el | 11 +++++++++++ 10 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 lisp/init-go-mode.el create mode 100644 lisp/init-go.el delete mode 100644 lisp/init-markdown-mode.el create mode 100644 lisp/init-markdown.el delete mode 100644 lisp/init-python-mode.el create mode 100644 lisp/init-python.el delete mode 100644 lisp/init-writegood-mode.el create mode 100644 lisp/init-writegood.el delete mode 100644 lisp/init-yaml-mode.el create mode 100644 lisp/init-yaml.el (limited to 'lisp') diff --git a/lisp/init-go-mode.el b/lisp/init-go-mode.el deleted file mode 100644 index 2870978..0000000 --- a/lisp/init-go-mode.el +++ /dev/null @@ -1,37 +0,0 @@ -(defun go-mode-create-imenu-index () - "Create and return an imenu index alist. Unlike the default -alist created by go-mode, this method creates an alist where -items follow a style that is consistent with other prog-modes." - (let* ((patterns '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1))) - (type-index (imenu--generic-function patterns)) - (func-index)) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward go-func-meth-regexp (point-max) t) - (let* ((var (match-string-no-properties 1)) - (func (match-string-no-properties 2)) - (name (if var - (concat (substring var 0 -1) "." func) - func)) - (beg (match-beginning 0)) - (marker (copy-marker beg)) - (item (cons name marker))) - (setq func-index (cons item func-index))))) - (nconc type-index (list (cons "func" func-index))))) - -(defun go-mode-create-flat-imenu-index () - "Return a flat imenu index alist. See `go-mode-create-imenu-index'." - (apply 'nconc (mapcar 'cdr (go-mode-create-imenu-index)))) - -(use-package go-mode - :init - :config - (add-hook 'go-mode-hook - (lambda () - ;; adjust fill-column - (setq-local fill-column 120) - ;; use flat imenu index - (setq-local imenu-create-index-function - #'go-mode-create-flat-imenu-index)))) - -(provide 'init-go-mode) diff --git a/lisp/init-go.el b/lisp/init-go.el new file mode 100644 index 0000000..07141e1 --- /dev/null +++ b/lisp/init-go.el @@ -0,0 +1,37 @@ +(defun go-mode-create-imenu-index () + "Create and return an imenu index alist. Unlike the default +alist created by go-mode, this method creates an alist where +items follow a style that is consistent with other prog-modes." + (let* ((patterns '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1))) + (type-index (imenu--generic-function patterns)) + (func-index)) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward go-func-meth-regexp (point-max) t) + (let* ((var (match-string-no-properties 1)) + (func (match-string-no-properties 2)) + (name (if var + (concat (substring var 0 -1) "." func) + func)) + (beg (match-beginning 0)) + (marker (copy-marker beg)) + (item (cons name marker))) + (setq func-index (cons item func-index))))) + (nconc type-index (list (cons "func" func-index))))) + +(defun go-mode-create-flat-imenu-index () + "Return a flat imenu index alist. See `go-mode-create-imenu-index'." + (apply 'nconc (mapcar 'cdr (go-mode-create-imenu-index)))) + +(use-package go-mode + :init + :config + (add-hook 'go-mode-hook + (lambda () + ;; adjust fill-column + (setq-local fill-column 120) + ;; use flat imenu index + (setq-local imenu-create-index-function + #'go-mode-create-flat-imenu-index)))) + +(provide 'init-go) diff --git a/lisp/init-markdown-mode.el b/lisp/init-markdown-mode.el deleted file mode 100644 index 321d272..0000000 --- a/lisp/init-markdown-mode.el +++ /dev/null @@ -1,16 +0,0 @@ -(use-package markdown-mode - :commands gfm-mode - :mode - ;; use gfm mode for .md and .markdown extensions - (("\\.\\(md\\|markdown\\)\\'" . gfm-mode) - ;; use gfm mode for pull request and issue buffers - ("PULLREQ_EDITMSG" . gfm-mode) - ("ISSUE_EDITMSG" . gfm-mode)) - - :config - (add-hook 'markdown-mode-hook - (lambda () - ;; disable electric indent - (setq-local electric-indent-mode nil)))) - -(provide 'init-markdown-mode) diff --git a/lisp/init-markdown.el b/lisp/init-markdown.el new file mode 100644 index 0000000..8e54269 --- /dev/null +++ b/lisp/init-markdown.el @@ -0,0 +1,16 @@ +(use-package markdown-mode + :commands gfm-mode + :mode + ;; use gfm mode for .md and .markdown extensions + (("\\.\\(md\\|markdown\\)\\'" . gfm-mode) + ;; use gfm mode for pull request and issue buffers + ("PULLREQ_EDITMSG" . gfm-mode) + ("ISSUE_EDITMSG" . gfm-mode)) + + :config + (add-hook 'markdown-mode-hook + (lambda () + ;; disable electric indent + (setq-local electric-indent-mode nil)))) + +(provide 'init-markdown) diff --git a/lisp/init-python-mode.el b/lisp/init-python-mode.el deleted file mode 100644 index 2bca144..0000000 --- a/lisp/init-python-mode.el +++ /dev/null @@ -1,18 +0,0 @@ -(use-package python - :ensure nil ;; package is bundled with emacs - - :config - ;; use flake8 as flymake backend - (setq python-flymake-command '("flake8" "-")) - ;; set buffer local variables - (add-hook 'python-mode-hook - (lambda () - ;; disable electric indent - (setq-local electric-indent-mode nil) - ;; highlight lines longer than 88 characters - (setq-local fill-column 88) - ;; use flat index in imenu - (setq-local imenu-create-index-function - 'python-imenu-create-flat-index)))) - -(provide 'init-python-mode) diff --git a/lisp/init-python.el b/lisp/init-python.el new file mode 100644 index 0000000..5b1e6c5 --- /dev/null +++ b/lisp/init-python.el @@ -0,0 +1,18 @@ +(use-package python + :ensure nil ;; package is bundled with emacs + + :config + ;; use flake8 as flymake backend + (setq python-flymake-command '("flake8" "-")) + ;; set buffer local variables + (add-hook 'python-mode-hook + (lambda () + ;; disable electric indent + (setq-local electric-indent-mode nil) + ;; highlight lines longer than 88 characters + (setq-local fill-column 88) + ;; use flat index in imenu + (setq-local imenu-create-index-function + 'python-imenu-create-flat-index)))) + +(provide 'init-python) diff --git a/lisp/init-writegood-mode.el b/lisp/init-writegood-mode.el deleted file mode 100644 index a96f681..0000000 --- a/lisp/init-writegood-mode.el +++ /dev/null @@ -1,6 +0,0 @@ -(use-package writegood-mode - :hook - ;; load writegood-mode automatically when flyspell is used - (flyspell-mode . writegood-mode)) - -(provide 'init-writegood-mode) diff --git a/lisp/init-writegood.el b/lisp/init-writegood.el new file mode 100644 index 0000000..c537aa6 --- /dev/null +++ b/lisp/init-writegood.el @@ -0,0 +1,6 @@ +(use-package writegood-mode + :hook + ;; load writegood-mode automatically when flyspell is used + (flyspell-mode . writegood-mode)) + +(provide 'init-writegood) diff --git a/lisp/init-yaml-mode.el b/lisp/init-yaml-mode.el deleted file mode 100644 index 4f5d88e..0000000 --- a/lisp/init-yaml-mode.el +++ /dev/null @@ -1,11 +0,0 @@ -(use-package yaml-mode - :mode - ;; ansible group_vars and host_vars - ("/\\(group\\|host\\)_vars/" . yaml-mode) - - :config - ;; disable electric indent - (add-hook 'yaml-mode-hook - (lambda () (setq-local electric-indent-mode nil)))) - -(provide 'init-yaml-mode) diff --git a/lisp/init-yaml.el b/lisp/init-yaml.el new file mode 100644 index 0000000..00acdf3 --- /dev/null +++ b/lisp/init-yaml.el @@ -0,0 +1,11 @@ +(use-package yaml-mode + :mode + ;; ansible group_vars and host_vars + ("/\\(group\\|host\\)_vars/" . yaml-mode) + + :config + ;; disable electric indent + (add-hook 'yaml-mode-hook + (lambda () (setq-local electric-indent-mode nil)))) + +(provide 'init-yaml) -- cgit v1.2.3