+2010-09-14 Kan-Ru Chen <kanru@kanru.info> (tiny change)
+
+ * textmodes/nroff-mode.el (nroff-view): Kill old buffer before
+ refreshing the preview buffer.
+
2010-09-18 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/tex-mode.el (tex-syntax-propertize-rules)
"Run man on this file."
(interactive)
(require 'man)
- (let* ((file (buffer-file-name)))
- (if file
- (Man-getpage-in-background file)
- (error "No associated file for the current buffer"))))
+ (let* ((file (buffer-file-name))
+ (viewbuf (get-buffer (concat "*Man " file "*"))))
+ (unless file
+ (error "Buffer is not associated with any file"))
+ (and (buffer-modified-p)
+ (y-or-n-p (format "Save buffer %s first? " (buffer-name)))
+ (save-buffer))
+ (if viewbuf
+ (kill-buffer viewbuf))
+ (Man-getpage-in-background file)))
;; Old names that were not namespace clean.
(define-obsolete-function-alias 'count-text-lines 'nroff-count-text-lines "22.1")