This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))))) |