-
Notifications
You must be signed in to change notification settings - Fork 0
/
mark-paragraph-0.2.el
61 lines (51 loc) · 2.06 KB
/
mark-paragraph-0.2.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;; mark-paragraph.el --- Commands for marking a paragraph -*- lexical-binding: t -*-
;; Copyright 2021 by Dave Pearson <davep@davep.org>
;; Author: Dave Pearson <davep@davep.org>
;; Version: 0.02
;; Keywords: convenience
;; URL: https://github.com/davep/mark-paragraph.el
;; Package-Requires: ((emacs "24"))
;; This program is free software: you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the
;; Free Software Foundation, either version 3 of the License, or (at your
;; option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
;; Public License for more details.
;;
;; You should have received a copy of the GNU General Public License along
;; with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; mark-paragraph.el contains some extra commands for marking a paragraph.
;; Inspired by https://twitter.com/nriley/status/1408049507775004675, I
;; checked Emacs and actually couldn't see a simple way of doing it out of
;; the box, so I quickly knocked this up for fun.
;;
;; Note that, right now, this doesn't attempt to do anything clever; I just
;; knocked this up as a reminder/placeholder to look and see if there's a
;; better way of doing this (it is something I've often found myself wanting
;; to have to hand).
;;; Code:
;;;###autoload
(defun mark-paragraph-to-start ()
"Mark from `point' to the start of the paragraph.
`start-of-paragraph-text' is used to find the start of the
paragraph."
(interactive)
(save-excursion
(start-of-paragraph-text)
(push-mark-command prefix-arg)))
;;;###autoload
(defun mark-paragraph-to-end ()
"Mark from `point' to the end of the paragraph.
`end-of-paragraph-text' is used to find the end of the
paragraph."
(interactive)
(save-excursion
(end-of-paragraph-text)
(push-mark-command prefix-arg)))
(provide 'mark-paragraph)
;;; mark-paragraph.el ends here