#------------------------------------------------------------ #revno: 112736 #committer: Pete Beardmore #branch nick: bzr #timestamp: Thu 2013-05-30 13:17:39 +0100 #message: # comint: ensure buffer local comint-input-ring-* variables are visible through input-read-ring logic === modified file 'lisp/comint.el' --- lisp/comint.el 2013-05-25 02:40:33 +0000 +++ lisp/comint.el 2013-05-30 12:17:39 +0000 @@ -938,33 +938,33 @@ ;; to huge numbers. Don't allocate a huge ring right ;; away; there might not be that much history. (ring-size (min 1500 comint-input-ring-size)) - (ring (make-ring ring-size))) - (with-temp-buffer - (insert-file-contents file) - ;; Save restriction in case file is already visited... - ;; Watch for those date stamps in history files! - (goto-char (point-max)) - (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))) - (setq start - (if (re-search-backward comint-input-ring-separator - nil t) - (match-end 0) - (point-min))) - (setq history (buffer-substring start end)) - (goto-char start) - (when (and (not (string-match comint-input-history-ignore - history)) - (or (null comint-input-ignoredups) - (ring-empty-p ring) - (not (string-equal (ring-ref ring 0) - history)))) + (ring-size-max (max 1500 comint-input-ring-size)) + (ring (make-ring ring-size)) + (ring-separator comint-input-ring-separator) + (ignore comint-input-history-ignore) + (ignoredups comint-input-ignoredups)) + (with-temp-buffer + (insert-file-contents file) + ;; Save restriction in case file is already visited... + ;; Watch for those date stamps in history files! + (goto-char (point-max)) + (let (start end history) + (while (and (< count ring-size-max) + (re-search-backward ring-separator nil t) + (setq end (match-beginning 0))) + (setq start + (if (re-search-backward ring-separator nil t) + (match-end 0) + (point-min))) + (setq history (buffer-substring start end)) + (goto-char start) + (when (and (not (string-match ignore history)) + (or (null ignoredups) + (ring-empty-p ring) + (not (string-equal (ring-ref ring 0) + history)))) (when (= count ring-size) - (ring-extend ring (min (- comint-input-ring-size ring-size) - ring-size)) + (ring-extend ring (min (- ring-size-max ring-size) ring-size)) (setq ring-size (ring-size ring))) (ring-insert-at-beginning ring history) (setq count (1+ count))))))