Skip to content

Instantly share code, notes, and snippets.

;;; tmt-mode.el --- Major mode for editing Text::MicroTemplate syntax
;; Copyright (C) 2009 Yoshiki Kurihara
;; Author: Yoshiki Kurihara <kurihara at cpan.org>
;; Keywords: perl template mode
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
(defun perl-get-package-string ()
(interactive)
(require 'perl-completion)
(let ((lib-path (plcmp--get-lib-path)))
(when (and lib-path buffer-file-truename)
(let* ((s (replace-regexp-in-string
(rx-to-string `(and bol ,lib-path (? "/")))
""
(expand-file-name buffer-file-truename)))
(s (file-name-sans-extension (replace-regexp-in-string (rx "/") "::" (replace-regexp-in-string "^.+/lib/" "" s)))))