[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [emacs-lisp newbie] print-something() -> clipboard?
From: |
Drew Adams |
Subject: |
RE: [emacs-lisp newbie] print-something() -> clipboard? |
Date: |
Sun, 20 May 2012 12:20:09 -0700 |
> 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'.