add function to get filename of buffer
This commit is contained in:
@@ -282,6 +282,22 @@ Examples:
|
|||||||
(my-interpolate (nth 2 (car rgbsteps)) (nth 2 (cadr rgbsteps)) position (caar rgbsteps) (caadr rgbsteps))
|
(my-interpolate (nth 2 (car rgbsteps)) (nth 2 (cadr rgbsteps)) position (caar rgbsteps) (caadr rgbsteps))
|
||||||
(my-interpolate (nth 3 (car rgbsteps)) (nth 3 (cadr rgbsteps)) position (caar rgbsteps) (caadr rgbsteps))))))
|
(my-interpolate (nth 3 (car rgbsteps)) (nth 3 (cadr rgbsteps)) position (caar rgbsteps) (caadr rgbsteps))))))
|
||||||
|
|
||||||
|
(defun my-filename ()
|
||||||
|
"Copy the full path of the current buffer into the `kill-ring' and
|
||||||
|
print it in the message buffer."
|
||||||
|
(interactive)
|
||||||
|
(let ((fn (buffer-file-name (window-buffer (minibuffer-selected-window)))))
|
||||||
|
(kill-new fn)
|
||||||
|
(message fn)))
|
||||||
|
|
||||||
|
(defun my-filename-basename ()
|
||||||
|
"Copy the basename of the current buffer into the `kill-ring' and
|
||||||
|
print it in the message buffer."
|
||||||
|
(interactive)
|
||||||
|
(let ((fn (file-name-nondirectory (my-filename))))
|
||||||
|
(kill-new fn)
|
||||||
|
(message fn)))
|
||||||
|
|
||||||
(defun my-gui-elements-toggle ()
|
(defun my-gui-elements-toggle ()
|
||||||
"Function to toggle gui elements on/off."
|
"Function to toggle gui elements on/off."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|||||||
Reference in New Issue
Block a user