diff --git a/configuration.org b/configuration.org index c080feb..131b685 100644 --- a/configuration.org +++ b/configuration.org @@ -290,31 +290,6 @@ Taken from [[http://ergoemacs.org/emacs/emacs_set_backup_into_a_directory.html][ (insert (funcall func text))))) #+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 file’s 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 file’s -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 #+begin_src emacs-lisp