From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.bugs Subject: bug#6219: Lauching nroff command from nroff-mode Date: Wed, 19 May 2010 19:32:47 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20100519.193247.174666647357430990.yamato@redhat.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1274280915 29672 80.91.229.12 (19 May 2010 14:55:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 May 2010 14:55:15 +0000 (UTC) To: 6219@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 19 16:55:14 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@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 1OEkfs-0001uL-Ex for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 May 2010 16:55:08 +0200 Original-Received: from localhost ([127.0.0.1]:43881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEkfr-0005Rs-Gs for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 May 2010 10:55:07 -0400 Original-Received: from [140.186.70.92] (port=54020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEjIX-0004OF-QS for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 09:26:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEjIV-0004CD-Tt for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 09:26:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55386) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEjIV-0004C7-S4 for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 09:26:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OEj62-0002ci-9r; Wed, 19 May 2010 09:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Masatake YAMATO Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 May 2010 13:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6219 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127427481110071 (code B ref -1); Wed, 19 May 2010 13:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 May 2010 13:13:31 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEj5V-0002cN-JH for submit@debbugs.gnu.org; Wed, 19 May 2010 09:13:30 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEi7o-0002Bk-T0 for submit@debbugs.gnu.org; Wed, 19 May 2010 08:11:50 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:56478) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OEi6D-00063g-V0 for submit@debbugs.gnu.org; Wed, 19 May 2010 08:10:10 -0400 Original-Received: from [140.186.70.92] (port=59799 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEgbY-0008FC-A8 for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 06:34:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEgbW-0007wF-C0 for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 06:34:24 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:63055) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEgbV-0007w0-WF for bug-gnu-emacs@gnu.org; Wed, 19 May 2010 06:34:22 -0400 Original-Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4JAYKuv015437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 May 2010 06:34:20 -0400 Original-Received: from localhost (beach.nrt.redhat.com [10.64.200.71]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4JAYI5N011714 for ; Wed, 19 May 2010 06:34:19 -0400 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Wed, 19 May 2010 09:13:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 19 May 2010 09:14:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Wed, 19 May 2010 10:53:47 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37046 Archived-At: This is not a bug report. This a request to review a patch to include the official emacs source tree. This patch provides the way to nroff-mode user to preview one's document quickly. 2010-04-04 Masatake YAMATO * textmodes/nroff-mode.el (nroff-preview-as-man-page): Add new function. (nroff-mode-map): Put `nroff-preview-as-man-page' to the key map and menu map. === modified file 'lisp/textmodes/nroff-mode.el' --- lisp/textmodes/nroff-mode.el 2010-01-13 08:35:10 +0000 +++ lisp/textmodes/nroff-mode.el 2010-04-04 21:14:58 +0000 @@ -55,6 +55,7 @@ (define-key map "\n" 'nroff-electric-newline) (define-key map "\en" 'nroff-forward-text-line) (define-key map "\ep" 'nroff-backward-text-line) + (define-key map "\C-c\C-c" 'nroff-preview-as-man-page) (define-key map [menu-bar nroff-mode] (cons "Nroff" menu-map)) (define-key menu-map [nn] '(menu-item "Newline" nroff-electric-newline @@ -73,6 +74,9 @@ nroff-electric-mode :help "Auto insert closing requests if necessary" :button (:toggle . nroff-electric-mode))) + (define-key menu-map [npm] + '(menu-item "Preview as man page" nroff-preview-as-man-page + :help "Run man on this file.")) map) "Major mode keymap for `nroff-mode'.") @@ -301,6 +305,15 @@ :lighter " Electric" (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode"))) +(defun nroff-preview-as-man-page () + "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")))) + ;; Old names that were not namespace clean. (define-obsolete-function-alias 'count-text-lines 'nroff-count-text-lines "22.1") (define-obsolete-function-alias 'forward-text-line 'nroff-forward-text-line "22.1")