;;; jman.el --- browse UNIX Japanese manual pages for XEmacs ;;; $Id: jman.el,v 1.1 1998/04/24 02:13:54 ryo2 Exp ryo2 $ ;;; a XEmacs front end to the UNIX Japanese manual pages browsing. ;;; Use this elisp accompanied with the DBCS patch for man.el . ;;; Author: Yoshishige Arai ;;; ;;; Keywords: manual page, japanese ;;; Commentary: ;;; Add this in your ~/.emacs ;;; (set-language-environment "Japanese") ;;; then ;;; M-x jman ;;; to get a Japanese manual page thru jman(1) and put it in a buffer. ;;; ;;; M-x man ;;; to get an original manual page thru man(1) and put it in a buffer. ;;; Code: (require 'man) (defcustom jman-Manual-program "jman" "\ *Name of the program to invoke in order to format the source japanese man pages." :type 'string :group 'man) (defconst jman-Manual-program-eng Manual-program "\ *Variable to backup original Manual-program to invoke man command.") ;;;###autoload (defun jman (&optional arg) "Display the Japanese Unix manual entry (or entries) for TOPIC." (interactive (list (let* ((thing (jman-manual-name-read "Japanese manual entry: "))) (setq Manual-program jman-Manual-program) (manual-entry thing) )))) (defun man (&optional arg) "Display the Unix manual entry (or entries) for TOPIC." (interactive (list (let* ((thing (jman-manual-name-read "Manual entry: "))) (setq Manual-program jman-Manual-program-eng) (manual-entry thing) )))) (defun jman-manual-name-read (prompt) "Pick up a word around the point." (interactive "d") (save-excursion (let* ((fmh "-A-Za-z0-9_.:") (default (buffer-substring (progn (re-search-backward "\\sw" nil t) (skip-chars-backward fmh) (point)) (progn (skip-chars-forward fmh) (point)))) (topic (read-string (if (equal default "") prompt (concat prompt "(default " default ") ")) nil 'Manual-page-minibuffer-history)) ) (if (equal topic "") default topic) ))) (provide 'jman) ;;; jman.el ends here