ishideo
11/1/2017 - 8:19 AM

copy-num.el

;; -*- coding: utf-8; lexical-binding: t -*-

(defun copy-num (file words)
  (with-temp-buffer
    (insert-file-contents-literally file)
    (goto-char (point-min))
    (catch 'e
      (mapcar #'(lambda (x)
                  (unless (search-forward x nil t)
                    (throw 'e "")))
              words)
      (end-of-line)
      (thing-at-point 'filename))))

(let ((file (car argv))
      (words (cdr argv)))
  (princ (concat (copy-num file words) "\n")))