79204572

Date: 2024-11-19 18:07:28
Score: 0.5
Natty:
Report link

It sounds like you're asking for auto-completion of file path in the current buffer. You could just do M-x find-file RET <tab> and then C-space C-a M-w C-g C-w (1). The next level of automation is to write a function for it:

# Ctrl-c Ctrl-c
#+begin_src emacs-lisp
  (defun insert-file-path ()
  "Insert the file path of a file into the current buffer."
  (interactive)
  (let ((file-path (read-file-name "Insert file path: ")))
    (insert file-path)))
#+end_src

invoking the created function the result

(1) whose long form is : set-mark-command, org-beginning-of-line, kill-ring-save, keyboard-quit, and org-yank

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Erwann