summaryrefslogtreecommitdiff
path: root/text-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-02-08 23:36:26 +0800
committerJSDurand <mmemmew@gmail.com>2021-02-08 23:36:26 +0800
commit393604e5bf4ce15df7342fdc094900fd1be2b39f (patch)
treed7b1e77cfe27b3ffa347fa2e9db632d97dfe7dc1 /text-conf.el
parentc8d4224e42a710b262e8ba67d720f6eff4e89fcb (diff)
Constantly growing
A lot of improvements.
Diffstat (limited to 'text-conf.el')
-rw-r--r--text-conf.el28
1 files changed, 24 insertions, 4 deletions
diff --git a/text-conf.el b/text-conf.el
index fdecb38..6cd0d14 100644
--- a/text-conf.el
+++ b/text-conf.el
@@ -2,11 +2,11 @@
(require 'text-mode)
-(declare-function #'center-buffer-on "center-buffer" nil)
-(declare-function #'center-buffer-off "center-buffer" nil)
-(declare-function #'center-buffer-toggle "center-buffer" nil)
+;; (declare-function #'center-buffer-on "center-buffer" nil)
+;; (declare-function #'center-buffer-off "center-buffer" nil)
+;; (declare-function #'center-buffer-toggle "center-buffer" nil)
-(define-key text-mode-map (vector 'f8) #'center-buffer-toggle)
+;; (define-key text-mode-map (vector 'f8) nil)
;;;###autoload
(defvar insert-section-heading-history nil
@@ -91,5 +91,25 @@ DESCRIPTION above the block."
(newline)
(insert fill-line))))
+;;;###autoload
+(defun durand-next-page (&optional arg)
+ "Move forward ARG pages and narrow to page.
+The only differences with `narrow-to-page' are that a nil
+argument means 1, and that after narrowing this moves the cursor
+to the beginning."
+ (interactive "p")
+ (narrow-to-page arg)
+ (goto-char (point-min)))
+
+;;;###autoload
+(defun durand-previous-page (&optional arg)
+ "Move backward ARG pages and narrow to page.
+Pass (- (prefix-numeric-value arg)) to `durand-next-page'."
+ (interactive "p")
+ (durand-next-page (- (prefix-numeric-value arg))))
+
+(define-key text-mode-map (vector ?\s-m) #'durand-previous-page)
+(define-key text-mode-map (vector ?\s-รน) #'durand-next-page)
+
(provide 'text-conf)
;;; text-conf.el ends here.