Skip to content

Commit

Permalink
Merge pull request #69 from DamienCassou/isearch-motion
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienCassou authored Apr 9, 2022
2 parents c746b19 + 77f6083 commit 62c7580
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ meaningful end of buffer starting from real end (i.e., ~point-max~).

** License

See [[file:COPYING][COPYING]]. Copyright (c) 2017-2021 [[mailto:[email protected]][Damien Cassou]] and [[mailto:[email protected]][Matus Goljer]].
See [[file:COPYING][COPYING]]. Copyright (c) 2017-2022 [[mailto:[email protected]][Damien Cassou]] and [[mailto:[email protected]][Matus Goljer]].
18 changes: 14 additions & 4 deletions beginend.el
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
;;; beginend.el --- Redefine M-< and M-> for some modes -*- lexical-binding: t; -*-

;; Copyright (C) 2015-2021 Damien Cassou
;; Copyright (C) 2015-2022 Damien Cassou

;; Authors: Damien Cassou <[email protected]>
;; Matus Goljer <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-Requires: ((emacs "25.3"))
;; Created: 01 Jun 2015
Expand All @@ -28,7 +28,7 @@

;; Redefine M-< and M-> for some modes. For example,
;;
;; - in dired mode, M-< (respectively M->) goes to first (respectively last)
;; - in `dired-mode', M-< (respectively M->) goes to first (respectively last)
;; file line
;;
;; - in message mode,
Expand All @@ -46,10 +46,16 @@

(require 'cl-lib) ; for (setf (point) …)

(defgroup beginend nil
"Customization group for beginend."
:group 'editing)

;;; Helper code

(defun beginend--defkey (map command-begin command-end)
"Bind \[beginning-of-buffer] and \[end-of-buffer] in MAP to COMMAND-BEGIN and COMMAND-END."
"Bind COMMAND-BEGIN and COMMAND-END in MAP to standard keys.
The keys used to bind the 2 commands are respectively
\\[beginning-of-buffer] and \\[end-of-buffer]."
(define-key map (vector 'remap 'beginning-of-buffer) command-begin)
(define-key map (vector 'remap 'end-of-buffer) command-end))

Expand Down Expand Up @@ -129,6 +135,10 @@ BEGIN-BODY and END-BODY are two `progn' expressions passed to respectively
(interactive)
(beginend--double-tap-end
,@(cdr end-body)))
(put ',endfunc-name 'isearch-motion
(get 'end-of-buffer 'isearch-motion))
(put ',beginfunc-name 'isearch-motion
(get 'beginning-of-buffer 'isearch-motion))
(defvar ,map-name
(let ((map (make-sparse-keymap)))
(beginend--defkey map #',beginfunc-name #',endfunc-name)
Expand Down
4 changes: 2 additions & 2 deletions test/beginend-dired-test.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;;; beginend-dired-test.el --- Tests for dired support in beginend -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-requires: ((emacs "25.3"))

Expand Down
4 changes: 2 additions & 2 deletions test/beginend-marks-test.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;;; beginend-marks-test.el --- Tests for mark support in beginend -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-requires: ((emacs "25.3"))

Expand Down
4 changes: 2 additions & 2 deletions test/beginend-narrowing-test.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;;; beginend-narrowing-test.el --- Tests beginend when narrowing is in effect -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-requires: ((emacs "25.3"))

Expand Down
4 changes: 2 additions & 2 deletions test/beginend-org-test.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;;; beginend-org-test.el --- Tests for org support in beginend -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-requires: ((emacs "25.3"))

Expand Down
4 changes: 2 additions & 2 deletions test/beginend-prog-test.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;;; beginend-prog-test.el --- Tests for beginend in prog-mode -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>
;; Version: 2.0.1
;; Version: 2.3.0
;; URL: https://github.com/DamienCassou/beginend
;; Package-requires: ((emacs "25.1"))

Expand Down
2 changes: 1 addition & 1 deletion test/test-helper.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; test-helper.el --- Helper code for beginend tests -*- lexical-binding: t; -*-

;; Copyright (C) 2017-2021 Damien Cassou
;; Copyright (C) 2017-2022 Damien Cassou

;; Author: Damien Cassou <[email protected]>

Expand Down

0 comments on commit 62c7580

Please sign in to comment.