From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get the ~ functionality of vi
Date: Fri, 27 May 2016 03:15:48 +0200 [thread overview]
Message-ID: <86h9dkfghn.fsf@student.uu.se> (raw)
In-Reply-To: 87shx44fbk.fsf@Equus.decebal.nl
Cecil Westerhof <Cecil@decebal.nl> writes:
> In vi you can use ~ to flip the case of
> a character. Does Emacs has something
> like that?
Try this:
(defun flip-case ()
(interactive)
(let ((c (string-to-char (thing-at-point 'char t))))
(delete-char 1)
(cond ((and (>= c ?A) (<= c ?Z)) (insert-char (downcase c)))
((and (>= c ?a) (<= c ?z)) (insert-char (upcase c)))
(t (insert-char c)))) )
(global-set-key "\C-cf" #'flip-case)
--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 42 Blogomatic articles -
next prev parent reply other threads:[~2016-05-27 1:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 22:36 How to get the ~ functionality of vi Cecil Westerhof
2016-05-27 1:15 ` Emanuel Berg [this message]
2016-05-27 4:28 ` Jean-Jacques Rétorré
2016-05-27 8:54 ` Cecil Westerhof
2016-05-27 11:33 ` Thorsten Bonow
2016-05-27 19:41 ` Emanuel Berg
2016-06-02 16:14 ` Kaushal Modi
[not found] ` <mailman.703.1464884068.1216.help-gnu-emacs@gnu.org>
2016-06-02 17:15 ` Emanuel Berg
2016-06-02 17:28 ` Kaushal Modi
[not found] ` <mailman.715.1464888555.1216.help-gnu-emacs@gnu.org>
2016-06-02 20:39 ` Emanuel Berg
2016-06-02 21:00 ` Kaushal Modi
2016-06-03 5:07 ` Marcin Borkowski
[not found] ` <mailman.730.1464901264.1216.help-gnu-emacs@gnu.org>
2016-06-02 21:07 ` Emanuel Berg
2016-06-03 9:21 ` Joost Kremers
2016-06-03 10:51 ` Emanuel Berg
2016-05-27 19:37 ` Emanuel Berg
2016-05-27 19:37 ` Emanuel Berg
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=86h9dkfghn.fsf@student.uu.se \
--to=embe8573@student.uu.se \
--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).