(defcustom what-file-line-separator ":"
"Define the separator between file name and line number"
:type 'string
:group 'editing)
(defcustom what-file-line-yankp nil
"Toggle on/off Yank to kill ring"
:type 'boolean
:group 'editing)
;; Maybe this variable is useless, user can copy what they want in mini-buffer
(defcustom what-file-line-fullpath t
"Toggle on/off file name fullpath"
:type 'boolean
:group 'editing)
(defun what-file-line ()
"Print the current buffer's file name and line nubmer"
(interactive)
(let ((n (line-number-at-pos))
(file (buffer-file-name))
result)
(setq result (concat file what-file-line-separator (number-to-string n)))
(message "%s" result)
(if what-file-line-yankp
(kill-new result))))