From: Toshiro Kuwabara Date: 2000-05-24T02:37:18+09:00 Subject: [ruby-list:22872] Re: Emacs interface of xmp (Re: (RD) Verbatim) --Multipart_Wed_May_24_02:34:13_2000-1 Content-Type: text/plain; charset=ISO-2022-JP Toshです。 In message "[ruby-list:22871] Emacs interface of xmp (Re: (RD) Verbatim)" on 00/05/24, Toshiro Kuwabara writes: >というわけで、やりました。短いのでそのまんま流しちゃいます。 すみません。ものの見事に付け忘れました。 今度こそ。 # SEMIはよくわかってないので無事できるか自信無いですが。 --Multipart_Wed_May_24_02:34:13_2000-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="xmp-cmd.rb" Content-Transfer-Encoding: 7bit #! /usr/bin/env ruby =begin = xmp-cmd.rb == SYNOPSIS use xmp from commandline. == USAGE $ xmp-cmd.rb ruby-file.rb xmp-cmd.rb process each line of through xmp. if a line ends with "\#\s*", that line is (({eval}))ed and result is printed, otherwise, (({eval}))ed only. =end require "xmp" ARGF.each do |i| next if /^\s*\#/ =~ i if /\#\s*$/ =~ i xmp($`) else xmp(i, false) end end --Multipart_Wed_May_24_02:34:13_2000-1 Content-Type: application/octet-stream; type=emacs-lisp Content-Disposition: attachment; filename="ruby-xmp.el" Content-Transfer-Encoding: 7bit ;;; ;;; ruby-xmp.el ;;; Emacs interface of Gotoken's xmp. ;;; copyright toshiro kuwabara, 2000 ;;; (defvar xmp-cmd-name "xmp-cmd.rb" "the name of command \"xmp-cmd.rb\" or its equivalent.") (defun xmp-region (beg end) (interactive "r") (call-process-region beg end xmp-cmd-name t t t)) --Multipart_Wed_May_24_02:34:13_2000-1--