Created
December 3, 2010 06:58
-
-
Save noqisofon/726666 to your computer and use it in GitHub Desktop.
クリップボードに貼り付ける系関数(xyzzy lisp 的な意味で)。
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 clipboard-to-datetime() | |
"現在時刻をクリップボードに貼り付けます。" | |
(interactive) | |
(copy-to-clipboard (format-date-string "%Y-%m-%dT%H:%M:%S%Z"))) | |
(defun get-basename-from-fullpath (fullpath) | |
"フルパスから最後のスラッシュまで削除した部分を返します。" | |
(let ((parts (split-string fullpath "/"))) | |
(car (last parts)))) | |
(defun clipboard-to-selection-buffer-name () | |
"現在選択しているバッファのファイル名または、バッファ名をクリップボードに貼り付けます。" | |
(interactive) | |
(copy-to-clipboard (let ((file-name (get-buffer-file-name))) | |
(if file-name | |
(get-basename-from-fullpath file-name) | |
;; else | |
(buffer-name (selected-buffer)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment