comparison lisp/view.el @ 21678:acaff8b34667

(view-really-at-end): Return true when at end and not reverting.
author Andreas Schwab <schwab@suse.de>
date Mon, 20 Apr 1998 09:37:18 +0000
parents f072dd90378d
children 95df64150c8a
comparison
equal deleted inserted replaced
21677:f42b78e033db 21678:acaff8b34667
720 ;; Return true if buffer end visible. Maybe revert buffer and test. 720 ;; Return true if buffer end visible. Maybe revert buffer and test.
721 (and (pos-visible-in-window-p (point-max)) 721 (and (pos-visible-in-window-p (point-max))
722 (let ((buf (current-buffer)) 722 (let ((buf (current-buffer))
723 (bufname (buffer-name)) 723 (bufname (buffer-name))
724 (file (buffer-file-name))) 724 (file (buffer-file-name)))
725 (when (and view-try-extend-at-buffer-end 725 (or (not view-try-extend-at-buffer-end)
726 file 726 (null file)
727 (not (verify-visited-file-modtime buf)) 727 (verify-visited-file-modtime buf)
728 (file-exists-p file) 728 (not (file-exists-p file))
729 (or (not (buffer-modified-p buf)) 729 (when (buffer-modified-p buf)
730 (progn 730 (setq file (file-name-nondirectory file))
731 (setq file (file-name-nondirectory file)) 731 (not (yes-or-no-p
732 (yes-or-no-p 732 (format
733 (format 733 "File %s changed on disk. Discard your edits%s? "
734 "File %s changed on disk. Discard your edits%s? " 734 file
735 file 735 (if (string= bufname file) ""
736 (if (string= bufname file) "" 736 (concat " in " bufname))))))
737 (concat " in " bufname))))))) 737 (progn
738 (revert-buffer t t t) 738 (revert-buffer t t t)
739 (pos-visible-in-window-p (point-max)))))) 739 (pos-visible-in-window-p (point-max)))))))
740 740
741 (defun view-end-message () 741 (defun view-end-message ()
742 ;; Tell that we are at end of buffer. 742 ;; Tell that we are at end of buffer.
743 (goto-char (point-max)) 743 (goto-char (point-max))
744 (if view-return-to-alist 744 (if view-return-to-alist