From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: window-specific Caps Lock
Date: Sun, 08 Nov 2009 20:21:16 +0100 [thread overview]
Message-ID: <87ocncyg9f.fsf@fh-trier.de> (raw)
In-Reply-To: ce533ca7-c59f-456e-ad35-411646241761@u36g2000prn.googlegroups.com
Girish Kulkarni <geeree@gmail.com> writes:
> Hi,
>
> I spend much time programming in Fortran 90 on my system, which is
> Debian 5.0 with GNOME. I type the code in GNU Emacs and I prefer
> typing Fortran 90 ALL CAPS.
>
> This usually means that I need to toggle the `Caps Lock' switch on my
> keyboard every time I switch from the Emacs window to the terminal
> (which for me is Xterm).
>
> Is there a way I can set things up so that while I'm typing Fortran
> 90, text will automatically be entered ALL CAPS in the Emacs buffer,
> but not in any other windows? Maybe by telling Emacs?
>
> Thanks,
> Girish.
How about inverting the meaning of shift ? In case you need other
non-ascii characters you'll have to extend this.
(defvar inverse-case-mode-map
(let ((km (make-sparse-keymap))
(ch ?A))
(while (<= ch ?z)
(define-key km (vector ch) 'self-insert-inverse-case-command)
(setq ch (1+ ch))
(if (eq ch ?Z)
(setq ch ?a)))
km))
(defun self-insert-inverse-case-command (arg)
(interactive "p")
(let ((last-command-event
(+ last-command-event
(if (equal (downcase (string last-command-event))
(string last-command-event))
(- ?A ?a)
(- ?a ?A)))))
(call-interactively 'self-insert-command)))
(define-minor-mode inverse-case-mode
nil nil " InvCase")
;;;
(add-hook 'fortran-mode #'(lambda nil (inverse-case-mode 1)))
...or whatever.
-ap
prev parent reply other threads:[~2009-11-08 19:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-08 8:41 window-specific Caps Lock Girish Kulkarni
2009-11-08 11:01 ` Pascal J. Bourguignon
2009-11-13 11:29 ` Girish Kulkarni
2009-11-08 19:21 ` Andreas Politz [this message]
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=87ocncyg9f.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--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.