* All-caps
@ 2004-09-09 16:55 Dan Boitnott
0 siblings, 0 replies; 4+ messages in thread
From: Dan Boitnott @ 2004-09-09 16:55 UTC (permalink / raw)
I'm writing a major mode for building FOCUS reports for our S/390. I'd
like to make all user input upper-case without using the caps-lock key.
Does anybody know a good way to do this short of re-mapping all of the
lowercase letters to their uppercase equivalents?
Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: All-caps
[not found] <mailman.2174.1094749269.1998.help-gnu-emacs@gnu.org>
@ 2004-09-10 17:12 ` Kevin Rodgers
2004-09-13 18:28 ` All-caps Karl Eichwalder
1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2004-09-10 17:12 UTC (permalink / raw)
Dan Boitnott wrote:
> I'm writing a major mode for building FOCUS reports for our S/390. I'd
> like to make all user input upper-case without using the caps-lock key.
> Does anybody know a good way to do this short of re-mapping all of the
> lowercase letters to their uppercase equivalents?
No, that's the best way to do it. But you can just use Joe Cornell's
caps-mode.el minor mode, posted to gnu.emacs.sources last month (and
consider using the suggestions posted by me and Kim Storm in followup
messages).
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: All-caps
@ 2004-09-12 1:59 Joe Corneli
0 siblings, 0 replies; 4+ messages in thread
From: Joe Corneli @ 2004-09-12 1:59 UTC (permalink / raw)
> I'm writing a major mode for building FOCUS reports for our S/390. I'd
> like to make all user input upper-case without using the caps-lock key.
> Does anybody know a good way to do this short of re-mapping all of the
> lowercase letters to their uppercase equivalents?
No, that's the best way to do it. But you can just use Joe
Cornell's caps-mode.el minor mode, posted to gnu.emacs.sources
last month (and consider using the suggestions posted by me and
Kim Storm in followup messages).
Thanks for the suggestions and the ping Kevin. BTW, its "CORNELI"
:). Here is a revised version of the mode, incorporating everyone's
nice suggestions and one additional fix, and giving credit to all.
Tested GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit) of 2003-10-31
on raven, modified by Debian
;;; caps-mode.el -- (minor mode) letters are inserted capitalized
;; Copyright (C) 2004 Joe Corneli <jcorneli@math.utexas.edu>,
;; Christoph Conrad <nospam@spamgourmet.com>, Kevin Rodgers
;; <ihs_4664@yahoo.com>, Kim F. Storm <no-spam@cua.dk>
;; Time-stamp: <jac -- Sat Aug 7 13:05:16 CDT 2004>
;; This file is not part of GNU Emacs, but it is distributed under
;; the same terms as GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 2, or (at your
;; option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; This is a simple minor mode in which all letters are inserted in
;; captialized form. I haven't bothered with letters outside of
;; ASCII.
;; Note that this mode has absolutely nothing to do with the toggle
;; state of your capslock.
;;; Code:
(defun caps-mode-self-insert-command (&optional n)
"Like `self-insert-command', but upcase the the typed character."
(interactive "p")
(insert-char (upcase last-command-char) n))
(defvar caps-mode-map
(let ((map (make-sparse-keymap)))
(mapc (lambda (char)
(define-key
map
(char-to-string char)
'caps-mode-self-insert-command))
"abcdefghijklmnopqrstuvwxyz")
map))
(define-minor-mode caps-mode
"Toggle caps mode.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
When caps mode is enabled, all letters are inserted in their
capitalized form."
:init-value nil
:lighter " Caps")
;;; caps-mode.el ends here
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: All-caps
[not found] <mailman.2174.1094749269.1998.help-gnu-emacs@gnu.org>
2004-09-10 17:12 ` All-caps Kevin Rodgers
@ 2004-09-13 18:28 ` Karl Eichwalder
1 sibling, 0 replies; 4+ messages in thread
From: Karl Eichwalder @ 2004-09-13 18:28 UTC (permalink / raw)
Dan Boitnott <dboitnot@fastmail.fm> writes:
> I'd like to make all user input upper-case without using the caps-lock
> key.
Enter text as usual and then call 'upcase-region' on interesting
regions; from the manual:
For example, suppose you wish to convert part of the buffer to upper
case, using the `C-x C-u' (`upcase-region') command, which operates on
the text in the region. You can first go to the beginning of the text
to be capitalized, type `C-<SPC>' to put the mark there, move to the
end, and then type `C-x C-u'. Or, you can set the mark at the end of
the text, move to the beginning, and then type `C-x C-u'.
-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
Of course, you can also proceed as follows:
Set the mark `C-<SPC>', type the input text, and then type `C-x
C-u'.
This has the additional benefit that it may or may not work for
non-ASCII characters, too.
--
| ,__o
| _-\_<,
http://www.gnu.franken.de/ke/ | (*)/'(*)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-13 18:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-09 16:55 All-caps Dan Boitnott
-- strict thread matches above, loose matches on Subject: below --
2004-09-12 1:59 All-caps Joe Corneli
[not found] <mailman.2174.1094749269.1998.help-gnu-emacs@gnu.org>
2004-09-10 17:12 ` All-caps Kevin Rodgers
2004-09-13 18:28 ` All-caps Karl Eichwalder
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).