- (save-excursion
- (goto-char (point-min))
- (loop
- while (not (eobp))
- ;; We need to read also C-g from here
- ;; Because when loop is started `ioccur-read-search-input'
- ;; will read key only when loop is finished
- ;; and we have no chance to exit loop.
- when quit-flag do (setq ioccur-quit-flag t) and return nil
- for count from 0
- when (funcall ioccur-search-function regexp (point-at-eol) t)
- do (ioccur-print-line
- (buffer-substring (point-at-bol) (point-at-eol))
- count (match-string 0) regexp)
- do (forward-line 1)))))
+ (let ((case-fold-search (case ioccur-case-fold-search
+ (smart (if (string-match "[A-Z]" regexp) nil t))
+ (t ioccur-case-fold-search))))
+ (save-excursion
+ (goto-char (point-min))
+ (loop
+ while (not (eobp))
+ ;; We need to read also C-g from here
+ ;; Because when loop is started `ioccur-read-search-input'
+ ;; will read key only when loop is finished
+ ;; and we have no chance to exit loop.
+ when quit-flag do (setq ioccur-quit-flag t) and return nil
+ for count from 0
+ when (funcall ioccur-search-function regexp (point-at-eol) t)
+ do (ioccur-print-line
+ (buffer-substring (point-at-bol) (point-at-eol))
+ count (match-string 0) regexp)
+ do (forward-line 1))))))