erlang-mode-expansions.el (1725B)
1 ;;; erlang-mode-expansions.el --- Erlang-specific expansions for expand-region -*- lexical-binding: t; -*- 2 3 ;; Copyright (C) 2012-2023 Free Software Foundation, Inc 4 5 ;; Author: Gleb Peregud 6 ;; Based on python-mode-expansions by: Ivan Andrus <darthandrus@gmail.com> 7 ;; Keywords: marking region erlang 8 9 ;; This program is free software; you can redistribute it and/or modify 10 ;; it under the terms of the GNU General Public License as published by 11 ;; the Free Software Foundation, either version 3 of the License, or 12 ;; (at your option) any later version. 13 14 ;; This program is distributed in the hope that it will be useful, 15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ;; GNU General Public License for more details. 18 19 ;; You should have received a copy of the GNU General Public License 20 ;; along with this program. If not, see <http://www.gnu.org/licenses/>. 21 22 ;;; Commentary: 23 24 ;; Feel free to contribute any other expansions for Erlang at 25 ;; 26 ;; https://github.com/magnars/expand-region.el 27 28 ;;; Bugs: 29 30 ;; Doesn't handle many Erlang syntax constructs, just the basics 31 32 ;;; Code: 33 34 (require 'expand-region-core) 35 36 (defun er/add-erlang-mode-expansions () 37 "Adds Erlang-specific expansions for buffers in erlang-mode" 38 (set (make-local-variable 'er/try-expand-list) (append 39 er/try-expand-list 40 '(erlang-mark-function 41 erlang-mark-clause)))) 42 43 (er/enable-mode-expansions 'erlang-mode #'er/add-erlang-mode-expansions) 44 45 (provide 'erlang-mode-expansions) 46 47 ;; erlang-mode-expansions.el ends here