summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2019-06-01 15:30:49 +0200
committerSimen Heggestøyl <simenheg@gmail.com>2019-06-01 15:33:37 +0200
commitf2a7acdde7207f92de53352f17dd7f506e15a851 (patch)
tree28518a15023db14c9b29f9d0871f57bab60c8d30 /lisp/textmodes
parentb6c628a16b52ce964f6526f9770d2f7d52ce8747 (diff)
downloademacs-f2a7acdde7207f92de53352f17dd7f506e15a851.tar.gz
Use lexical-binding in page.el and add tests
* lisp/textmodes/page.el: Use lexical-binding. (forward-page): Replace `(if x nil y)' with `(unless x y)'. * test/lisp/textmodes/page-tests.el: New file with tests for page.el.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/page.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index 220ef2d7fd6..2b0cea4c643 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -1,4 +1,4 @@
-;;; page.el --- page motion commands for Emacs
+;;; page.el --- page motion commands for Emacs -*- lexical-binding: t; -*-
;; Copyright (C) 1985, 2001-2019 Free Software Foundation, Inc.
@@ -38,8 +38,7 @@ A page boundary is any line whose beginning matches the regexp
;; In case the page-delimiter matches the null string,
;; don't find a match without moving.
(if (bolp) (forward-char 1))
- (if (re-search-forward page-delimiter nil t)
- nil
+ (unless (re-search-forward page-delimiter nil t)
(goto-char (point-max)))
(setq count (1- count)))
(while (and (< count 0) (not (bobp)))