Remove the mbork/copy-current-location function

This commit is contained in:
Gergely Polonkai 2023-10-22 07:16:28 +02:00
parent 71ccdfc43b
commit f46f550efb
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -290,31 +290,6 @@ Taken from [[http://ergoemacs.org/emacs/emacs_set_backup_into_a_directory.html][
(insert (funcall func text))))) (insert (funcall func text)))))
#+END_SRC #+END_SRC
*** Copy and show the current location
#+begin_src emacs-lisp
(defun mbork/copy-current-location (arg)
"Show the current location and put it into the kill ring.
Without a prefix, the filename will be relative
to `(vc-root-dir)' if the file is under version control and will
be relative to the files directory otherwise. With a single
prefix, the filename will be used with an absolute path. With at
least two prefixes the filename will be relative to the files
directory."
(interactive "p")
(let ((root (vc-root-dir)))
(if (not buffer-file-name)
(message "Not visiting a file")
(let* ((file-name (cond ((eq arg 1) (file-relative-name buffer-file-name root))
((eq arg 4) buffer-file-name)
(t (file-relative-name buffer-file-name nil))))
(line-number (line-number-at-pos nil t))
(location (format "%s:%s" file-name line-number)))
(kill-new location)
(message location)))))
#+end_src
*** Find the first number on line *** Find the first number on line
#+begin_src emacs-lisp #+begin_src emacs-lisp