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
3e8abfd3
Commit
3e8abfd3
authored
Oct 18, 2000
by
Gerd Moellmann
Browse files
(comint-read-input-ring): Bugfix such that the first
and the last entry of the input ring file are not lost.
parent
9b5360aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
lisp/comint.el
lisp/comint.el
+15
-16
No files found.
lisp/comint.el
View file @
3e8abfd3
...
...
@@ -838,22 +838,21 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
;; Save restriction in case file is already visited...
;; Watch for those date stamps in history files!
(goto-char (point-max))
(while (and (< count size)
(re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$"
nil t))
(let (start end history)
(while (and (< count comint-input-ring-size)
(re-search-backward comint-input-ring-separator nil t)
(setq end (match-beginning 0))
(re-search-backward comint-input-ring-separator nil t)
(setq start (match-end 0))
(setq history (buffer-substring start end))
(goto-char start))
(if (or (null comint-input-ignoredups)
(ring-empty-p ring)
(not (string-equal (ring-ref ring 0) history)))
(ring-insert-at-beginning ring history)))
(setq count (1+ count)))))
(let (start end history)
(while (and (< count comint-input-ring-size)
(re-search-backward comint-input-ring-separator nil t)
(setq end (match-beginning 0)))
(if (re-search-backward comint-input-ring-separator nil t)
(setq start (match-end 0))
(setq start (point-min)))
(setq history (buffer-substring start end))
(goto-char start)
(if (or (null comint-input-ignoredups)
(ring-empty-p ring)
(not (string-equal (ring-ref ring 0) history)))
(progn
(ring-insert-at-beginning ring history)
(setq count (1+ count)))))))
(kill-buffer history-buf))
(setq comint-input-ring ring
comint-input-ring-index nil)))))
...
...
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