Skip to content

Instantly share code, notes, and snippets.

@imakado
Created August 27, 2009 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imakado/176075 to your computer and use it in GitHub Desktop.
Save imakado/176075 to your computer and use it in GitHub Desktop.
;; package を入力するやつ
(defun perl-insert-package ()
(interactive)
(require 'perl-completion)
(cond
((null buffer-file-truename) (error "no buffer-file-truename"))
(t
(let* ((s (replace-regexp-in-string
(rx-to-string `(and bol ,(plcmp--get-lib-path) (? "/")))
""
(expand-file-name buffer-file-truename)))
(s (file-name-sans-extension (replace-regexp-in-string (rx "/") "::" s))))
(insert "package " s ";")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment