all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <help-gnu-emacs@gnu.org>, "'Tom Roche'" <Tom_Roche@pobox.com>
Subject: RE: [emacs-lisp newbie] print-something() -> clipboard?
Date: Sun, 20 May 2012 12:20:09 -0700	[thread overview]
Message-ID: <BEEDF7D80DF54D7D8FAF77C2908B04EB@us.oracle.com> (raw)
In-Reply-To: <871ume7k9x.fsf@pobox.com>

> if I type [C-p b]
>   (insert bn)
> else if I type [C-u C-p b]
>   (kill-new bn)
> 
> Can that be done with one {function, keychord} definition?
> Or must I have 2, like above? If the latter, how to define
> [C-u C-p b]?

Bind `C-p b' to `foo':

(defun foo (&optional arg)
 "..."
 (interactive "P")
 (let ((bn ...))
   (if arg
       (insert bn)
     (kill-new bn))))

See the Elisp manual, node `Prefix Command Arguments'. 




  reply	other threads:[~2012-05-20 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 19:46 [emacs-lisp newbie] print-something() -> clipboard? Tom Roche
2012-05-19  7:19 ` Andreas Röhler
2012-05-20 18:57 ` Tom Roche
2012-05-20 19:20   ` Drew Adams [this message]
2012-05-20 20:27 ` Tom Roche
2012-05-21 13:24   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BEEDF7D80DF54D7D8FAF77C2908B04EB@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=Tom_Roche@pobox.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.