help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-lisp newbie] print-something() -> clipboard?


From: Tom Roche
Subject: [emacs-lisp newbie] print-something() -> clipboard?
Date: Fri, 18 May 2012 15:46:35 -0400
User-agent: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)

>From my init.el I load a file that contains function definitions which
all have the form

> (defun print-path-and-filename () 
>   "Print the current buffer's file's path at point."
>   (interactive "*") ; abort if buffer is read-only
>   (if buffer-file-name (insert buffer-file-name) nil))
> (global-set-key "\C-pp" 'print-path-and-filename)
...
> (defun print-buffer-name ()
>   "Print (at point) the current buffer's name."
>   (interactive "*") ; abort if buffer is read-only
>   (insert (buffer-name (window-buffer (minibuffer-selected-window)))))
> (global-set-key "\C-pb" 'print-buffer-name)
>
> (provide 'tlr-print)

Most of the functions are buffer-independent (printing, e.g., current
time, emacs version) but some (like the above) are not. For the
latter, I'd like to have the option to "print" the datum to the
clipboard. How can I (easily :-) do that?

Examples esp appreciated. Feel free to point to doc.

TIA, Tom Roche <Tom_Roche@pobox.com>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]