From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kan-Ru Chen Newsgroups: gmane.emacs.devel Subject: [PATCH] nroff-mode.el (nroff-view): Kill old buffer before refresh the preview buffer. Date: Tue, 14 Sep 2010 01:09:45 +0800 Message-ID: <1284397785-16631-1-git-send-email-kanru@kanru.info> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1284397829 30702 80.91.229.12 (13 Sep 2010 17:10:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Sep 2010 17:10:29 +0000 (UTC) Cc: Kan-Ru Chen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 13 19:10:28 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OvCY0-00077Y-Bo for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 19:10:28 +0200 Original-Received: from localhost ([127.0.0.1]:37591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvCXz-0007gZ-Oc for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 13:10:27 -0400 Original-Received: from [140.186.70.92] (port=33418 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvCXs-0007fK-Kl for emacs-devel@gnu.org; Mon, 13 Sep 2010 13:10:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvCXr-0005Oh-2o for emacs-devel@gnu.org; Mon, 13 Sep 2010 13:10:20 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:58605) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvCXr-0005Ob-0X for emacs-devel@gnu.org; Mon, 13 Sep 2010 13:10:19 -0400 Original-Received: by qwf7 with SMTP id 7so4033431qwf.0 for ; Mon, 13 Sep 2010 10:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:from:to:cc :subject:date:message-id:x-mailer; bh=fMrJ2K58V1y6ImwauvFjOWJrTkuoy+9HJFgokUewjbc=; b=vw5wdd3nXoT7zQ2Cb0uJBKLibxKc4ASRMIeQHblXTOuXhmq34RPoI+WeFARXytz7o0 riGH15DQgF6QFDiu2168OxSbXXIc/cHfXRSXv1V4CgaK71eWUuP7zAsALILKGOHjKTLu hUStvZEZeYYlnR/a6jLTqKPTafkVzBfjvgDZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=KH7RuLA1jgOT12hl+IoyNOx4KeHG5+E2klqxAiRBsqutUCpyBc5w5og9h7DMs7piI9 heQJia8rH8ceeMU07ylbr2mZZK91iSRBY66vBUz+9TSOVTE6mh49iCTPry8Q3lAblQ9s Pre8ysU/kRaCIUpdGHPq1//SEIBR/sZAJ44TI= Original-Received: by 10.224.3.6 with SMTP id 6mr3048164qal.31.1284397817764; Mon, 13 Sep 2010 10:10:17 -0700 (PDT) Original-Received: from anar.kanru.info (118-160-163-217.dynamic.hinet.net [118.160.163.217]) by mx.google.com with ESMTPS id e6sm6586624qcr.41.2010.09.13.10.10.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Sep 2010 10:10:16 -0700 (PDT) Original-Received: from kanru by anar.kanru.info with local (Exim 4.72) (envelope-from ) id 1OvCXj-0004Km-He; Tue, 14 Sep 2010 01:10:11 +0800 X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130071 Archived-At: Currently calling nroff-view always return the previous generated buffer. Kill the old buffer first so it can be updated. Signed-off-by: Kan-Ru Chen --- lisp/ChangeLog | 5 +++++ lisp/textmodes/nroff-mode.el | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c3ce90..c46c7f1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-09-14 Kan-Ru Chen + + * textmodes/nroff-mode.el (nroff-view): Kill old buffer before + refresh the preview buffer. + 2010-09-13 Michael Albinus Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el. diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index 14b0b10..c84699c 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el @@ -311,9 +311,14 @@ turns it on if arg is positive, otherwise off." "Run man on this file." (interactive) (require 'man) - (let* ((file (buffer-file-name))) + (let* ((file (buffer-file-name)) + (bufname (concat "*Man " file "*")) + (buffer (get-buffer bufname))) (if file - (Man-getpage-in-background file) + (progn + (if buffer + (kill-buffer buffer)) + (Man-getpage-in-background file)) (error "No associated file for the current buffer")))) ;; Old names that were not namespace clean. -- 1.7.1