comparison lisp/isearch.el @ 4512:ed1f6abba5c5

(isearch-ring-adjust1, isearch-ring-advance-edit): Replace `%' by `mod' and simplify.
author Paul Eggert <eggert@twinsun.com>
date Tue, 10 Aug 1993 04:14:17 +0000
parents 36f6f4b28dde
children 32cc537f0180
comparison
equal deleted inserted replaced
4511:db555f6edd6b 4512:ed1f6abba5c5
2 2
3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
4 4
5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
6 6
7 ;; |$Date: 1993/07/15 03:46:02 $|$Revision: 1.46 $ 7 ;; |$Date: 1993/07/31 18:39:09 $|$Revision: 1.47 $
8 8
9 ;; This file is not yet part of GNU Emacs, but it is based almost 9 ;; This file is not yet part of GNU Emacs, but it is based almost
10 ;; entirely on isearch.el which is part of GNU Emacs. 10 ;; entirely on isearch.el which is part of GNU Emacs.
11 11
12 ;; GNU Emacs is distributed in the hope that it will be useful, 12 ;; GNU Emacs is distributed in the hope that it will be useful,
1088 (yank-pointer (eval yank-pointer-name))) 1088 (yank-pointer (eval yank-pointer-name)))
1089 (if (zerop length) 1089 (if (zerop length)
1090 () 1090 ()
1091 (set yank-pointer-name 1091 (set yank-pointer-name
1092 (setq yank-pointer 1092 (setq yank-pointer
1093 (% (+ (or yank-pointer 0) 1093 (mod (+ (or yank-pointer 0)
1094 (if advance (1- length) 1)) 1094 (if advance -1 1))
1095 length))) 1095 length)))
1096 (setq isearch-string (nth yank-pointer ring) 1096 (setq isearch-string (nth yank-pointer ring)
1097 isearch-message (mapconcat 'isearch-text-char-description 1097 isearch-message (mapconcat 'isearch-text-char-description
1098 isearch-string ""))))) 1098 isearch-string "")))))
1099 1099
1100 (defun isearch-ring-adjust (advance) 1100 (defun isearch-ring-adjust (advance)
1132 (length (length ring))) 1132 (length (length ring)))
1133 (if (zerop length) 1133 (if (zerop length)
1134 () 1134 ()
1135 (set yank-pointer-name 1135 (set yank-pointer-name
1136 (setq yank-pointer 1136 (setq yank-pointer
1137 (% (+ (or yank-pointer 0) 1137 (mod (- (or yank-pointer 0) n)
1138 ;; Add LENGTH here to ensure a positive result. 1138 length)))
1139 length
1140 (% (- n) length))
1141 length)))
1142 1139
1143 (erase-buffer) 1140 (erase-buffer)
1144 (insert (nth yank-pointer ring)) 1141 (insert (nth yank-pointer ring))
1145 (goto-char (point-max))))) 1142 (goto-char (point-max)))))
1146 1143