From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche , Newsgroups: gmane.emacs.help Subject: [emacs-lisp newbie] print-something() -> clipboard? Date: Fri, 18 May 2012 15:46:35 -0400 Message-ID: <87r4uhxof8.fsf@pobox.com> Reply-To: help-gnu-emacs@gnu.org, Tom Roche NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1337370042 10565 80.91.229.3 (18 May 2012 19:40:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 May 2012 19:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org, Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 18 21:40:41 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SVT2W-0002ee-Rp for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2012 21:40:40 +0200 Original-Received: from localhost ([::1]:35336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVT2W-0000YZ-30 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2012 15:40:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVT2Q-0000YU-9P for help-gnu-emacs@gnu.org; Fri, 18 May 2012 15:40:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVT2O-00059u-GA for help-gnu-emacs@gnu.org; Fri, 18 May 2012 15:40:33 -0400 Original-Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:52215 helo=smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVT2O-00059K-7i for help-gnu-emacs@gnu.org; Fri, 18 May 2012 15:40:32 -0400 Original-Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 10C768616; Fri, 18 May 2012 15:40:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:reply-to:date:message-id:mime-version:content-type; s= sasl; bh=Z/WYvzjMAwECNACLQcjRUPMCcIY=; b=tvF8VK0Ajxq3tFY0rgAY1mD b1v25zLnNQBddqeAwmPkSdrnLk4bsPMwLaiDogDcpHlzrSj9cDNbg1r7PDz+LVCy c/ZTtyNy3xj0qtyQ9niAEyuG8De3wGkrqujg4DVID2hNF2wR/jbHqigBQDOiTmoK DkSRni7gGGKbx2hdVVPU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :reply-to:date:message-id:mime-version:content-type; q=dns; s= sasl; b=B1uNiiXUtT9lSU6PiI7RYaDamKP2wJUAarJd419yCyJ+AUmG/ak2ffoR IbC9Suf39vPTNE1dvFeEHHJw/ydWKSO/VgmfUpzUNgOxsHgv610WcQl+G9kNL4xX cPgCHzOgVnVFM3+7EzVZc/WspTDWddIowyjj32yJQDIAJvhXP2E= Original-Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 067338615; Fri, 18 May 2012 15:40:24 -0400 (EDT) Original-Received: from tlrPanP5.pobox.com (unknown [50.52.137.242]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 69E038612; Fri, 18 May 2012 15:40:22 -0400 (EDT) User-Agent: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) X-Pobox-Relay-ID: 4ED4DCBE-A121-11E1-8ABB-FC762E706CDE-07218935!b-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 208.72.237.35 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84879 Archived-At: >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