Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7920b6e8
Commit
7920b6e8
authored
Sep 25, 2007
by
Glenn Morris
Browse files
(view-search-no-match-lines): Fix previous change (went wrong if
regexp to not be matched matched last thing in the buffer).
parent
dab2d343
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
lisp/view.el
lisp/view.el
+10
-13
No files found.
lisp/view.el
View file @
7920b6e8
...
...
@@ -998,22 +998,19 @@ for highlighting the match that is found."
"
Search
for
the
TIMESth
occurrence
of
a
line
with
no
match
for
REGEXP.
If
such
a
line
is
found,
return
non-nil
and
set
the
match-data
to
that
line.
If
TIMES
is
negative,
search
backwards.
"
(let ((step 1)
(noerror 'move))
(when (< times 0)
(setq times (- times)
step -1
noerror t))
(let ((step (if (>= times 0) 1
(setq times (- times))
-1)))
;; Note that we do not check the current line.
(while (and (> times 0)
(zerop (forward-line step)))
;;
Move only to handle eob in the forward case: on
last line
,
;; (forward-line 1) returns 0 before the end of line.
(or (re-search-forward regexp (line-end-position) noerror
)
(setq times (1- times))))
)
(when (zerop
times)
(
forward-line 0
)
(looking-at "
.
*
"
)
))
;;
(forward-line 1) returns 0 on moving within the
last line
.
(if (eobp)
(setq times -1
)
(or (re-search-forward regexp (line-end-position) t
)
(setq times (1-
times)
)))))
(
and (zerop times
)
(looking-at "
.
*
"
)
))
(
provide
'view
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment