From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: how to map F5 to emacs's C-x and ignore cua-mode?
Date: Sun, 17 Apr 2011 13:37:42 -0700 (PDT) [thread overview]
Message-ID: <6d68e4fd-ad78-4979-bd2a-10f5d53a5169@f15g2000pro.googlegroups.com> (raw)
if i want to set F5 to emacs's C-x and F6 to emacs's C-c, how to do
that?
i know i can use key-translation-map or function-key-map, something
like
(define-key key-translation-map (kbd "<f5>") "<C-x>")
but i also want it so that if cua-mode is on, it unconditionally do
emacs's C-x, not cut.
i thought it's something like this
(defun f5-Cx ()
"DOCSTRING"
(interactive)
(let (cuaModeState cua-mode)
(cua-mode 0)
;; type C-x here
(if cuaModeState (cua-mode 1) (cua-mode 0))
))
)
but not sure how to do the “type C-x” there. Even so, not sure the
whole would work.
Thanks.
Xah
reply other threads:[~2011-04-17 20:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d68e4fd-ad78-4979-bd2a-10f5d53a5169@f15g2000pro.googlegroups.com \
--to=xahlee@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).