all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dan Espen <despen@verizon.net>, help-gnu-emacs@gnu.org
Subject: RE: if vs. when vs. and: style question
Date: Wed, 25 Mar 2015 11:23:54 -0700 (PDT)	[thread overview]
Message-ID: <2e26e6c1-af36-40a5-88b3-ab7d0984bf2c@default> (raw)
In-Reply-To: <meupl4$g2o$1@dont-email.me>

> > If you use a particular Unicode character often, just give its
> > insertion a command and bind that to a key.  If you have 30 such
> > chars, put them all on a prefix key.  Or use completion on their
> > command names (names you created, so easy for you to type, remember,
> > complete to,...).
> >
> > IOW, it's not a big deal to insert Unicode characters, especially
> > if you insert the same ones over and over.  You do not need to use
> > `C-x 8 RET' each time.
> 
> Sorry, that scales up for more than 1 or 2 characters how?

Well, I doubt that I can convince you.  I can only repeat what I
suggested.

There is a big difference, I think, between (1) using `C-x 8 RET'
to complete against zillions of character names (or code points) that
you might not be familiar with and (2) completing against a relative
few (5? 10? 50? 150?) char-command names that you yourself came up with.

My point is that if someone uses relatively few - which, depending on
the person, could be 5 or 500 (or 5000?) chars, then it can make sense
to put their insertion on keys (commands).

> I already have a little piece of oak tag paper that I've cut out
> to surround the 6-key pad above the arrow keys.
> The paper has the legend:
> 
>            UNDO
> FRONT OPEN AGAIN
>     -keys-
>            COPY
> 
> Yep, even for 5 specially assigned keys, my mind sometimes goes
> blank and I look at the paper.

Hey, my mind goes blank too.  But instead of paper I use completion.
IOW, I ask Emacs for help.

> A normal keyboard just isn't designed for a bunch of strange
> characters.

Maybe so.  But if you use the euro character a *lot*, for example,
then you might just consider assigning it a key.  Rather than using
`C-x 8 RET euro sign RET' each time to insert it.

It's also possible to have a command that, in effect, switches to
a keymap that treats your American keyboard as a French one or
whatever, just by changing the relevant key bindings.  Is that
useful for someone?  Maybe; dunno.

> Another poster described the issue well.
> If we used some other kind of input device, those characters
> might be a good idea.  Until then, not so much.

Given a particular physical keyboard, it's a tradeoff (i.e. choice)
wrt which keys do what.  Certainly it is true that the keys of a
typical American keyboard are used a lot in programming languages,
so someone who programs is likely to want to keep those keys bound
to the self-inserting chars they default to.  Such a programmer
probably needs `$' on a key, and isn't about to replace it with a
euro symbol.

But beyond that, it can make sense for someone to assign relatively
easy key sequences to insertion of frequently used Unicode chars.
It all depends on what you need, what you use Emacs for.

If you use lots of Greek chars, but mixed in with mostly ASCII or
Latin 1 chars, then it might make sense for you to assign simple
key sequences to Greek chars.  If you write *mostly* Greek then you
might want to use a Greek keyboard or remap the keys of a non-Greek
keyboard to Greek chars.

FWIW, I think that my library `ucs-cmds.el' can help in the former
case.  You can quickly define commands that insert specific chars,
by specifying a Unicode range etc.
(http://www.emacswiki.org/emacs/download/ucs-cmds.el)

This macro call creates an insertion command for each Greek letter:
(ucsc-make-commands "^greek [a-z]+ letter")

That's 330 commands (330 chars).  Here are the commands for the
letter epsilon, for example:
                                           
greek-capital-letter-epsilon                                            
greek-capital-letter-epsilon-tonos                                      
greek-capital-letter-epsilon-with-dasia                                 
greek-capital-letter-epsilon-with-dasia-and-oxia                        
greek-capital-letter-epsilon-with-dasia-and-varia                       
greek-capital-letter-epsilon-with-oxia                                  
greek-capital-letter-epsilon-with-psili                                 
greek-capital-letter-epsilon-with-psili-and-oxia                        
greek-capital-letter-epsilon-with-psili-and-varia                       
greek-capital-letter-epsilon-with-varia                                 
            
The command names are the Unicode char names, with hyphens instead
of spaces, and lowercase instead of uppercase.

You can of course create shorter aliases, if you like, and use
completion with `M-x'.  And you can assign the 20 or 50 Greek
chars that you use most often to short key sequences.  Or you can
put a bunch of the commands (or all 330) on a prefix key, say
`C-M-g'.  (And nothing requires you to create a command for each
of the 330 Unicode Greek chars.  It's easy to define just the
commands you need.)

It's all about what you need.  If you don't need to insert Unicode
chars, then "Circulez ; il n'y a rien a voir."

As for opening the floodgates to the use of Unicode in programming
code, I don't see that as a problem, one way or the other, wrt
user-defined names.

On the other hand, if you use a language that *requires* you to use
Unicode chars that are hard for you to input, then I'd suggest that
you either try something like the above (e.g., type `=>' to get the
arrow char you want) or you change languages. ;-)




  reply	other threads:[~2015-03-25 18:23 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 22:53 if vs. when vs. and: style question Marcin Borkowski
2015-03-24  0:15 ` Pascal J. Bourguignon
2015-03-24  0:34   ` Drew Adams
2015-03-24  0:22 ` Drew Adams
     [not found] ` <mailman.2648.1427156603.31049.help-gnu-emacs@gnu.org>
2015-03-24  2:28   ` Emanuel Berg
2015-03-24  6:12     ` Rusi
2015-03-25  0:21       ` Emanuel Berg
2015-03-25  0:20         ` Pascal J. Bourguignon
2015-03-25  2:44           ` Emanuel Berg
2015-03-25  2:51             ` Rusi
2015-03-25  7:12               ` Pascal J. Bourguignon
2015-03-25 14:02                 ` Rusi
2015-03-25 14:40                   ` Stefan Monnier
2015-03-25 14:52                   ` if vs. when vs. and: style question now Unicode Dan Espen
2015-03-25 15:24                     ` Rusi
2015-03-25 15:46                       ` Dan Espen
2015-03-25 16:02                         ` Rusi
2015-03-25 17:16                           ` Dan Espen
2015-03-28 17:55                           ` Emanuel Berg
2015-03-25 17:46                         ` Rusi
2015-03-25 15:22                   ` if vs. when vs. and: style question Pascal J. Bourguignon
2015-03-25 15:37                     ` Rusi
2015-03-29  1:17                       ` Emanuel Berg
2015-03-25 15:45                     ` Rusi
2015-03-29  1:03                     ` Emanuel Berg
2015-03-29  2:41                       ` Rusi
2015-03-29  3:11                         ` Rusi
2015-03-29 14:05                         ` Óscar Fuentes
2015-03-29 16:00                           ` Drew Adams
2015-03-30  1:55                             ` Óscar Fuentes
     [not found]                             ` <mailman.2998.1427680540.31049.help-gnu-emacs@gnu.org>
2015-03-30  2:25                               ` Rusi
2015-03-29 18:27                         ` Pascal J. Bourguignon
2015-03-30  0:09                           ` Stefan Monnier
2015-03-30  1:33                             ` Óscar Fuentes
2015-03-30  1:50                               ` Stefan Monnier
2015-03-30  9:44                               ` tomas
2015-03-30 11:46                                 ` Óscar Fuentes
     [not found]                                 ` <mailman.3016.1427716011.31049.help-gnu-emacs@gnu.org>
2015-03-30 13:03                                   ` Pascal J. Bourguignon
2015-03-30 14:18                                     ` Stefan Monnier
2015-03-30 15:21                                       ` Marcin Borkowski
2015-03-30 15:31                                         ` Óscar Fuentes
     [not found]                                         ` <mailman.3031.1427729518.31049.help-gnu-emacs@gnu.org>
2015-03-30 17:15                                           ` Pascal J. Bourguignon
     [not found]                                       ` <mailman.3030.1427728904.31049.help-gnu-emacs@gnu.org>
2015-03-31  6:26                                         ` Reality and Proofs (was if vs. when vs. and: style question) Rusi
     [not found]                               ` <mailman.3010.1427708687.31049.help-gnu-emacs@gnu.org>
2015-03-30 12:59                                 ` if vs. when vs. and: style question Pascal J. Bourguignon
     [not found]                         ` <mailman.2972.1427637975.31049.help-gnu-emacs@gnu.org>
2015-03-30  1:55                           ` Rusi
     [not found]                   ` <mailman.2749.1427294481.31049.help-gnu-emacs@gnu.org>
2015-03-25 15:33                     ` Rusi
2015-03-25 15:36                       ` Pascal J. Bourguignon
2015-03-25 16:06                         ` Drew Adams
     [not found]                         ` <mailman.2751.1427299594.31049.help-gnu-emacs@gnu.org>
2015-03-25 16:19                           ` Rusi
2015-03-25 16:23                             ` Rusi
2015-03-29  1:24                             ` Emanuel Berg
2015-03-25 17:02                           ` Dan Espen
2015-03-25 18:23                             ` Drew Adams [this message]
     [not found]                             ` <mailman.2758.1427307846.31049.help-gnu-emacs@gnu.org>
2015-03-25 18:52                               ` Dan Espen
2015-03-26  9:47                                 ` Gian Uberto Lauri
     [not found]                                 ` <mailman.2799.1427363259.31049.help-gnu-emacs@gnu.org>
2015-03-26 10:24                                   ` Pascal J. Bourguignon
2015-03-26 10:28                                     ` Pascal J. Bourguignon
2015-03-26 10:47                                       ` Unicode in source (Was Re: if vs. when vs. and: style question) Gian Uberto Lauri
     [not found]                                       ` <mailman.2802.1427366873.31049.help-gnu-emacs@gnu.org>
2015-03-26 15:54                                         ` Pascal J. Bourguignon
2015-03-26 17:07                                           ` Gian Uberto Lauri
     [not found]                                           ` <mailman.2824.1427389660.31049.help-gnu-emacs@gnu.org>
2015-03-26 17:16                                             ` Pascal J. Bourguignon
2015-03-26 10:43                                     ` if vs. when vs. and: style question Gian Uberto Lauri
2015-03-26 13:02                                       ` Pascal J. Bourguignon
2015-04-01 22:03                                   ` Emanuel Berg
2015-04-01 22:24                                     ` Emanuel Berg
2015-03-29 23:06                                 ` Emanuel Berg
2015-03-25 19:17                               ` Pascal J. Bourguignon
2015-03-25 20:31                                 ` Drew Adams
2015-03-25 22:21                                   ` Richard Wordingham
2015-03-25 23:21                                     ` Drew Adams
2015-03-25 23:52                                       ` Richard Wordingham
     [not found]                                     ` <mailman.2782.1427325697.31049.help-gnu-emacs@gnu.org>
2015-03-26  3:02                                       ` Rusi
2015-03-26 10:01                                         ` Gian Uberto Lauri
     [not found]                                         ` <mailman.2800.1427364117.31049.help-gnu-emacs@gnu.org>
2015-03-26 13:00                                           ` Rusi
2015-03-26 13:28                                             ` Gian Uberto Lauri
     [not found]                                             ` <mailman.2809.1427376497.31049.help-gnu-emacs@gnu.org>
2015-03-26 15:51                                               ` Pascal J. Bourguignon
2015-03-26 16:21                                                 ` Gian Uberto Lauri
     [not found]                                   ` <mailman.2779.1427322080.31049.help-gnu-emacs@gnu.org>
2015-04-01  2:31                                     ` Emanuel Berg
2015-04-01  3:03                                       ` Rusi
2015-04-01 14:29                                         ` Pascal J. Bourguignon
2015-04-01 14:57                                           ` Rusi
     [not found]                                 ` <mailman.2771.1427315503.31049.help-gnu-emacs@gnu.org>
2015-03-26  4:23                                   ` Rusi
2015-03-25 19:20                               ` Pascal J. Bourguignon
2015-03-26 11:37                                 ` Alan Schmitt
2015-03-30  1:20                                 ` Emanuel Berg
2015-03-30  2:43                                   ` Pascal J. Bourguignon
2015-03-30  3:12                                     ` Rusi
2015-03-25 17:49                           ` Pascal J. Bourguignon
2015-03-25 18:09                             ` Eli Zaretskii
     [not found]                             ` <mailman.2756.1427307016.31049.help-gnu-emacs@gnu.org>
2015-03-25 21:27                               ` Rusi
2015-03-25 21:32                                 ` Rusi
2015-03-31 16:49                                   ` Emanuel Berg
2015-03-31 17:22                                     ` Rusi
2015-04-01 18:08                                     ` Emanuel Berg
2015-04-01 20:01                                       ` Pascal J. Bourguignon
2015-03-27  3:54                           ` Emanuel Berg
2015-03-27  7:59                             ` Gian Uberto Lauri
2015-03-27  8:06                               ` tomas
2015-03-27  8:11                                 ` Gian Uberto Lauri
2015-03-27  9:20                                   ` tomas
2015-03-27  9:31                                     ` Gian Uberto Lauri
     [not found]                               ` <mailman.2860.1427443603.31049.help-gnu-emacs@gnu.org>
2015-03-27 12:41                                 ` Pascal J. Bourguignon
2015-03-27 13:05                                   ` tomas
     [not found]                                   ` <mailman.2875.1427461540.31049.help-gnu-emacs@gnu.org>
2015-03-27 13:35                                     ` Rusi
2015-03-27 12:34                             ` Pascal J. Bourguignon
2015-03-27  0:49                   ` Emanuel Berg
2015-03-27  7:53                     ` Gian Uberto Lauri
     [not found]                     ` <mailman.2856.1427442800.31049.help-gnu-emacs@gnu.org>
2015-03-27  8:56                       ` Joost Kremers
2015-03-27 12:19                       ` Pascal J. Bourguignon
2015-03-27 14:20                     ` Rusi
2015-03-25  2:35         ` Rusi
2015-03-27  0:31           ` Emanuel Berg
2015-03-27 21:27             ` Emanuel Berg
2015-03-27 22:54               ` Pascal J. Bourguignon
2015-03-28  1:16                 ` Rusi
2015-03-28 12:47                   ` Pascal J. Bourguignon
2015-03-24 15:18     ` Pascal J. Bourguignon
2015-03-25  0:44       ` Emanuel Berg
2015-03-24  7:21 ` Thien-Thi Nguyen
     [not found] ` <mailman.2659.1427181547.31049.help-gnu-emacs@gnu.org>
2015-03-25  0:34   ` Emanuel Berg
     [not found] <mailman.2645.1427151196.31049.help-gnu-emacs@gnu.org>
2015-03-23 23:19 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e26e6c1-af36-40a5-88b3-ab7d0984bf2c@default \
    --to=drew.adams@oracle.com \
    --cc=despen@verizon.net \
    --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.