Lint region.el

Business as usual...
This commit is contained in:
William Carroll 2020-08-31 14:49:05 +01:00
parent 8d02e5a5ef
commit c78b2339f9
2 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,9 @@
;;; region.el --- Functions for working with Emacs's regions -*- lexical-binding: t -*- ;;; region.el --- Functions for working with regions -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com> ;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; Package-Requires: ((emacs "24"))
;; Homepage: https://user.git.corp.google.com/wpcarro/briefcase
;;; Commentary: ;;; Commentary:
;; Sometimes Emacs's function names and argument ordering is great; other times, ;; Sometimes Emacs's function names and argument ordering is great; other times,
@ -11,7 +15,7 @@
;; Library ;; Library
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun region/to-string () (defun region-to-string ()
"Returns the string in the active region." "Returns the string in the active region."
(buffer-substring-no-properties (region-beginning) (buffer-substring-no-properties (region-beginning)
(region-end))) (region-end)))

View file

@ -14,6 +14,7 @@
(require 'f) (require 'f)
(require 'dash) (require 'dash)
(require 'constants) (require 'constants)
(require 'region)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Configuration ;; Configuration
@ -231,7 +232,7 @@
(defun wpc-misc-deadgrep-region () (defun wpc-misc-deadgrep-region ()
"Run a ripgrep search on the active region." "Run a ripgrep search on the active region."
(interactive) (interactive)
(deadgrep (region/to-string))) (deadgrep (region-to-string)))
(defun wpc-misc-deadgrep-dwim () (defun wpc-misc-deadgrep-dwim ()
"If a region is active, use that as the search, otherwise don't." "If a region is active, use that as the search, otherwise don't."
(interactive) (interactive)