unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6219: Lauching nroff command from nroff-mode
@ 2010-05-19 10:32 Masatake YAMATO
  2010-05-20 15:05 ` Chong Yidong
  2010-08-31 18:05 ` Chong Yidong
  0 siblings, 2 replies; 4+ messages in thread
From: Masatake YAMATO @ 2010-05-19 10:32 UTC (permalink / raw)
  To: 6219

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  <yamato@redhat.com>

	* 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")






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6219: Lauching nroff command from nroff-mode
  2010-05-19 10:32 bug#6219: Lauching nroff command from nroff-mode Masatake YAMATO
@ 2010-05-20 15:05 ` Chong Yidong
  2010-05-21  3:25   ` Masatake YAMATO
  2010-08-31 18:05 ` Chong Yidong
  1 sibling, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2010-05-20 15:05 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: 6219

Masatake YAMATO <yamato@redhat.com> writes:

> This patch provides the way to nroff-mode user to preview one's
> document quickly.

Thanks, it seems to work well.

I suggest making the keybinding C-c C-v instead of C-c C-c, and renaming
the command `nroff-view'.  This would make it more similar to Tex mode's
`tex-view' command.  What do you think?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6219: Lauching nroff command from nroff-mode
  2010-05-20 15:05 ` Chong Yidong
@ 2010-05-21  3:25   ` Masatake YAMATO
  0 siblings, 0 replies; 4+ messages in thread
From: Masatake YAMATO @ 2010-05-21  3:25 UTC (permalink / raw)
  To: cyd; +Cc: 6219

> Masatake YAMATO <yamato@redhat.com> writes:
> 
>> This patch provides the way to nroff-mode user to preview one's
>> document quickly.
> 
> Thanks, it seems to work well.
> 
> I suggest making the keybinding C-c C-v instead of C-c C-c, and renaming
> the command `nroff-view'.  This would make it more similar to Tex mode's
> `tex-view' command.  What do you think?

Thank you for reviewing my patch. About the key binding I agree with you.

I use nroff only for reading man page included in source codes. So I'm
not sure whether renaming the command to `nroff-view' is good or not,
but I think we should choose the name `nroff-view' now.  If someone
complains about the command is man specific, we can make it
customizable.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6219: Lauching nroff command from nroff-mode
  2010-05-19 10:32 bug#6219: Lauching nroff command from nroff-mode Masatake YAMATO
  2010-05-20 15:05 ` Chong Yidong
@ 2010-08-31 18:05 ` Chong Yidong
  1 sibling, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2010-08-31 18:05 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: 6219

Masatake YAMATO <yamato@redhat.com> writes:

> 2010-04-04  Masatake YAMATO  <yamato@redhat.com>
>
> * 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.

I've checked your patch into the repository.  Thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-31 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 10:32 bug#6219: Lauching nroff command from nroff-mode Masatake YAMATO
2010-05-20 15:05 ` Chong Yidong
2010-05-21  3:25   ` Masatake YAMATO
2010-08-31 18:05 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).