Skip to content

Instantly share code, notes, and snippets.

@ishideo
Created November 1, 2017 08:19
Show Gist options
  • Select an option

  • Save ishideo/eae1374c8f081787c19bb04f55dbd355 to your computer and use it in GitHub Desktop.

Select an option

Save ishideo/eae1374c8f081787c19bb04f55dbd355 to your computer and use it in GitHub Desktop.
;; -*- 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")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment