diff options
| author | jao <jao@gnu.org> | 2026-12-01 12:04:14 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-12-01 12:04:14 +0000 |
| commit | 855db2c9c439e9be1c66520f44615369b648a914 (patch) | |
| tree | ce8623ffc3896fbf2acf6b4502ab7aa76c299ff1 /lib | |
| parent | bca51e1655d5a305745b7826cf5134f37f6a960a (diff) | |
| download | elibs-855db2c9c439e9be1c66520f44615369b648a914.tar.gz elibs-855db2c9c439e9be1c66520f44615369b648a914.tar.bz2 | |
nits
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/eos/jao-buffers.el | 21 | ||||
| -rw-r--r-- | lib/eos/jao-shell.el | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/eos/jao-buffers.el b/lib/eos/jao-buffers.el index 800b264..5665117 100644 --- a/lib/eos/jao-buffers.el +++ b/lib/eos/jao-buffers.el @@ -21,7 +21,28 @@ ;;; deps (require 'eldoc) +(require 'dired) +;;; copy buffer file name +;; https://stackoverflow.com/questions/18812938/copy-full-file-path-into-copy-paste-clipboard +;;;###autoload +(defun copy-buffer-file-name-as-kill (choice) + "Copy the buffer-file-name to the kill-ring" + (interactive "cCopy buffer name: (f)ull, (d)irectory, (n)ame") + (let ((new-kill-string) + (name (if (eq major-mode 'dired-mode) + (dired-get-filename) + (or (buffer-file-name) "")))) + (cond ((eq choice ?f) + (setq new-kill-string name)) + ((eq choice ?d) + (setq new-kill-string (file-name-directory name))) + ((eq choice ?n) + (setq new-kill-string (file-name-nondirectory name))) + (t (message "Quit"))) + (when new-kill-string + (message "%s copied" new-kill-string) + (kill-new new-kill-string)))) ;;; lines ;;;###autoload diff --git a/lib/eos/jao-shell.el b/lib/eos/jao-shell.el index 8745492..4d35e4c 100644 --- a/lib/eos/jao-shell.el +++ b/lib/eos/jao-shell.el @@ -68,7 +68,7 @@ (lambda (process event) (when (string= event "finished\n") (kill-buffer (process-buffer process)))))) - (setq-local jao-term--cmd cmd) + (setq-local jao-term--cmd cmd scroll-margin 0) (term-send-string nil (format "%s%s\n" cmd (if no-kill "" ";exit")))))) ;;;###autoload |
