all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to teach emacs that ' + c = ç
@ 2017-07-05  1:25 Filipe Silva
  2017-07-05  1:57 ` Óscar Fuentes
  2017-07-05  6:14 ` Héctor Lahoz
  0 siblings, 2 replies; 8+ messages in thread
From: Filipe Silva @ 2017-07-05  1:25 UTC (permalink / raw
  To: Help Gnu Emacs mailing list

I've set up my keyboard layout in arch with localectl set-x11-keymap us
pc104 intl

By default, in this layout, the ' is a dead character. It is called a dead
acute. In portuguese, we are used to compose the ç char with ' + c = ç when
using international us-keyboard layouts.

I don't know why, but by default linux distros come configured so that when
you type this combination ' + c= ć, which is an invalid char in Brazilian
portuguese, and so I'm screwed.

So I did this:

   -

   Editing the files:

   sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache sudo vim
   /usr/lib/gtk-2.0/2.10.0/immodules.cache

   changing the line

   "cedilla" "Cedilla" "gtk20" "/usr/share/locale"
   "az:ca:co:fr:gv:oc:pt:sq:tr:wa" to "cedilla" "Cedilla" "gtk20"
   "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"
   -

   replaced "ć" to "ç" and "Ć" to "Ç" on
   /usr/share/X11/locale/en_US.UTF-8/Compose

   sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose
   /usr/share/X11/locale/en_US.UTF-8/Compose.bak sed 's/ć/ç/g' <
   /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose sudo mv
   Compose /usr/share/X11/locale/en_US.UTF-8/Compose
   -

      add two lines on /etc/environment

      GTK_IM_MODULE=cedilla QT_IM_MODULE=cedilla
      -

      restart my computer.

And all is working fine in firefox, chromium, scite, gvim or any other gui
tool, but no emacs. on emacs, ' + cinsist on producing ć, despite my
efforts.


So I ask you, how can I teach emacs to produce ç and not ć in this scenario?


thanks in advance.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05  1:25 how to teach emacs that ' + c = ç Filipe Silva
@ 2017-07-05  1:57 ` Óscar Fuentes
  2017-07-05 15:55   ` Filipe Silva
  2017-07-05  6:14 ` Héctor Lahoz
  1 sibling, 1 reply; 8+ messages in thread
From: Óscar Fuentes @ 2017-07-05  1:57 UTC (permalink / raw
  To: help-gnu-emacs

Filipe Silva <filipe.silva@gmail.com> writes:

> I've set up my keyboard layout in arch with localectl set-x11-keymap us
> pc104 intl
>
> By default, in this layout, the ' is a dead character. It is called a dead
> acute. In portuguese, we are used to compose the ç char with ' + c = ç when
> using international us-keyboard layouts.
>
> I don't know why, but by default linux distros come configured so that when
> you type this combination ' + c= ć, which is an invalid char in Brazilian
> portuguese, and so I'm screwed.
>
> So I did this:
>
>    -
>
>    Editing the files:
>
>    sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache sudo vim
>    /usr/lib/gtk-2.0/2.10.0/immodules.cache
>
>    changing the line
>
>    "cedilla" "Cedilla" "gtk20" "/usr/share/locale"
>    "az:ca:co:fr:gv:oc:pt:sq:tr:wa" to "cedilla" "Cedilla" "gtk20"
>    "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"
>    -
>
>    replaced "ć" to "ç" and "Ć" to "Ç" on
>    /usr/share/X11/locale/en_US.UTF-8/Compose
>
>    sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose
>    /usr/share/X11/locale/en_US.UTF-8/Compose.bak sed 's/ć/ç/g' <
>    /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose sudo mv
>    Compose /usr/share/X11/locale/en_US.UTF-8/Compose
>    -
>
>       add two lines on /etc/environment
>
>       GTK_IM_MODULE=cedilla QT_IM_MODULE=cedilla
>       -
>
>       restart my computer.
>
> And all is working fine in firefox, chromium, scite, gvim or any other gui
> tool, but no emacs. on emacs, ' + cinsist on producing ć, despite my
> efforts.
>
>
> So I ask you, how can I teach emacs to produce ç and not ć in this scenario?
>
>
> thanks in advance.

Curious. I have

setxkbmap us_intl

in my init scripts and have the opposite problem (not actually a problem
for me since in my languages ç is not used).

' + c produces ç in Emacs but ć elsewhere.

BUT...

if I start Emacs with -Q, then ' + c indeed produces as the other
applications ć.

After looking at my customizations, tried

LANG=C emacs -Q

and now ' + c gives ç.

Hope this gives you some clues.

Ubuntu 17.04 here.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05  1:25 how to teach emacs that ' + c = ç Filipe Silva
  2017-07-05  1:57 ` Óscar Fuentes
@ 2017-07-05  6:14 ` Héctor Lahoz
  1 sibling, 0 replies; 8+ messages in thread
From: Héctor Lahoz @ 2017-07-05  6:14 UTC (permalink / raw
  To: help-gnu-emacs

Filipe Silva wrote:
> I've set up my keyboard layout in arch with localectl set-x11-keymap us
> pc104 intl

If you usually write Portuguese I don't think it is a good idea.
Use a layout that produces characters for your language.
I use a Spanish layout and then we have a key for 'ç', just one
keystroke. This character is also used in French and Catalonian.

> I don't know why, but by default linux distros come configured so that when
> you type this combination ' + c= ć, which is an invalid char in Brazilian
> portuguese, and so I'm screwed.

Some European languages use it.

Another option is, if you definitely want an English keyboard layout,
to use input method for portuguese:

M-x use-input-method RET portuguese-prefix RET

Then either ", c" or "' c" give "ç".



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05  1:57 ` Óscar Fuentes
@ 2017-07-05 15:55   ` Filipe Silva
  2017-07-05 16:11     ` Filipe Silva
  2017-07-05 20:38     ` tomas
  0 siblings, 2 replies; 8+ messages in thread
From: Filipe Silva @ 2017-07-05 15:55 UTC (permalink / raw
  To: Óscar Fuentes; +Cc: Help Gnu Emacs mailing list

very interesting. LANC=C emacs really fix the problem. What is happening
here?

maybe this is a bug.

On Tue, Jul 4, 2017 at 10:57 PM, Óscar Fuentes <ofv@wanadoo.es> wrote:

> Filipe Silva <filipe.silva@gmail.com> writes:
>
> > I've set up my keyboard layout in arch with localectl set-x11-keymap us
> > pc104 intl
> >
> > By default, in this layout, the ' is a dead character. It is called a
> dead
> > acute. In portuguese, we are used to compose the ç char with ' + c = ç
> when
> > using international us-keyboard layouts.
> >
> > I don't know why, but by default linux distros come configured so that
> when
> > you type this combination ' + c= ć, which is an invalid char in Brazilian
> > portuguese, and so I'm screwed.
> >
> > So I did this:
> >
> >    -
> >
> >    Editing the files:
> >
> >    sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache sudo vim
> >    /usr/lib/gtk-2.0/2.10.0/immodules.cache
> >
> >    changing the line
> >
> >    "cedilla" "Cedilla" "gtk20" "/usr/share/locale"
> >    "az:ca:co:fr:gv:oc:pt:sq:tr:wa" to "cedilla" "Cedilla" "gtk20"
> >    "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"
> >    -
> >
> >    replaced "ć" to "ç" and "Ć" to "Ç" on
> >    /usr/share/X11/locale/en_US.UTF-8/Compose
> >
> >    sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose
> >    /usr/share/X11/locale/en_US.UTF-8/Compose.bak sed 's/ć/ç/g' <
> >    /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose
> sudo mv
> >    Compose /usr/share/X11/locale/en_US.UTF-8/Compose
> >    -
> >
> >       add two lines on /etc/environment
> >
> >       GTK_IM_MODULE=cedilla QT_IM_MODULE=cedilla
> >       -
> >
> >       restart my computer.
> >
> > And all is working fine in firefox, chromium, scite, gvim or any other
> gui
> > tool, but no emacs. on emacs, ' + cinsist on producing ć, despite my
> > efforts.
> >
> >
> > So I ask you, how can I teach emacs to produce ç and not ć in this
> scenario?
> >
> >
> > thanks in advance.
>
> Curious. I have
>
> setxkbmap us_intl
>
> in my init scripts and have the opposite problem (not actually a problem
> for me since in my languages ç is not used).
>
> ' + c produces ç in Emacs but ć elsewhere.
>
> BUT...
>
> if I start Emacs with -Q, then ' + c indeed produces as the other
> applications ć.
>
> After looking at my customizations, tried
>
> LANG=C emacs -Q
>
> and now ' + c gives ç.
>
> Hope this gives you some clues.
>
> Ubuntu 17.04 here.
>
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05 15:55   ` Filipe Silva
@ 2017-07-05 16:11     ` Filipe Silva
  2017-07-05 20:38     ` tomas
  1 sibling, 0 replies; 8+ messages in thread
From: Filipe Silva @ 2017-07-05 16:11 UTC (permalink / raw
  To: Óscar Fuentes; +Cc: Help Gnu Emacs mailing list

Ok, so I implemented a your LANG=C hack in my emacs daemon script:



unamestr=$(uname -a)
if [[ "$unamestr" == *"Linux"* ]] && [[ $unamestr == *"ARCH"* ]]; then
  # fix cedila | ç  in emacs under arch linux
  # hack found here:
http://lists.gnu.org/archive/html/help-gnu-emacs/2017-07/msg00070.html
  LANG=C
fi

emacs.sh --daemon; rc=$?
if [[ ! $rc = 0 ]]; then
  echo -e "there was a ${Red}problem${Rst} starting emacs daemon: $rc"
  exit $rc
else
  echo -e "emacs daemon ${Blue}started${Rst}. success."
fi

boostrap_time=$(emacsclient.sh -e "(emacs-init-time)")
echo -e "emacs daemon boostrap time: ${Cyan}${boostrap_time}${Rst}"


And it works. But why does it works? It feels so fragile.


On Wed, Jul 5, 2017 at 12:55 PM, Filipe Silva <filipe.silva@gmail.com>
wrote:

> very interesting. LANC=C emacs really fix the problem. What is happening
> here?
>
> maybe this is a bug.
>
> On Tue, Jul 4, 2017 at 10:57 PM, Óscar Fuentes <ofv@wanadoo.es> wrote:
>
>> Filipe Silva <filipe.silva@gmail.com> writes:
>>
>> > I've set up my keyboard layout in arch with localectl set-x11-keymap us
>> > pc104 intl
>> >
>> > By default, in this layout, the ' is a dead character. It is called a
>> dead
>> > acute. In portuguese, we are used to compose the ç char with ' + c = ç
>> when
>> > using international us-keyboard layouts.
>> >
>> > I don't know why, but by default linux distros come configured so that
>> when
>> > you type this combination ' + c= ć, which is an invalid char in
>> Brazilian
>> > portuguese, and so I'm screwed.
>> >
>> > So I did this:
>> >
>> >    -
>> >
>> >    Editing the files:
>> >
>> >    sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache sudo vim
>> >    /usr/lib/gtk-2.0/2.10.0/immodules.cache
>> >
>> >    changing the line
>> >
>> >    "cedilla" "Cedilla" "gtk20" "/usr/share/locale"
>> >    "az:ca:co:fr:gv:oc:pt:sq:tr:wa" to "cedilla" "Cedilla" "gtk20"
>> >    "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"
>> >    -
>> >
>> >    replaced "ć" to "ç" and "Ć" to "Ç" on
>> >    /usr/share/X11/locale/en_US.UTF-8/Compose
>> >
>> >    sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose
>> >    /usr/share/X11/locale/en_US.UTF-8/Compose.bak sed 's/ć/ç/g' <
>> >    /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose
>> sudo mv
>> >    Compose /usr/share/X11/locale/en_US.UTF-8/Compose
>> >    -
>> >
>> >       add two lines on /etc/environment
>> >
>> >       GTK_IM_MODULE=cedilla QT_IM_MODULE=cedilla
>> >       -
>> >
>> >       restart my computer.
>> >
>> > And all is working fine in firefox, chromium, scite, gvim or any other
>> gui
>> > tool, but no emacs. on emacs, ' + cinsist on producing ć, despite my
>> > efforts.
>> >
>> >
>> > So I ask you, how can I teach emacs to produce ç and not ć in this
>> scenario?
>> >
>> >
>> > thanks in advance.
>>
>> Curious. I have
>>
>> setxkbmap us_intl
>>
>> in my init scripts and have the opposite problem (not actually a problem
>> for me since in my languages ç is not used).
>>
>> ' + c produces ç in Emacs but ć elsewhere.
>>
>> BUT...
>>
>> if I start Emacs with -Q, then ' + c indeed produces as the other
>> applications ć.
>>
>> After looking at my customizations, tried
>>
>> LANG=C emacs -Q
>>
>> and now ' + c gives ç.
>>
>> Hope this gives you some clues.
>>
>> Ubuntu 17.04 here.
>>
>>
>>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05 15:55   ` Filipe Silva
  2017-07-05 16:11     ` Filipe Silva
@ 2017-07-05 20:38     ` tomas
  2017-07-05 21:26       ` Filipe Silva
  1 sibling, 1 reply; 8+ messages in thread
From: tomas @ 2017-07-05 20:38 UTC (permalink / raw
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Jul 05, 2017 at 12:55:08PM -0300, Filipe Silva wrote:
> very interesting. LANC=C emacs really fix the problem. What is happening
> here?
> 
> maybe this is a bug.

There's mention on that in the doc (22.2 Language Environments):

#+BEGIN_QUOTE
   To display information about the effects of a certain language
environment LANG-ENV, use the command `C-h L LANG-ENV <RET>'
(`describe-language-environment').  This tells you which languages this
language environment is useful for, and lists the character sets,
coding systems, and input methods that go with it.  It also shows some
sample text to illustrate scripts used in this language environment.
If you give an empty input for LANG-ENV, this command describes the
chosen language environment.
#+END_QUOTE

So it's probably intentional

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlldTjIACgkQBcgs9XrR2kZtVgCfb/nfP+0tadgvJq/7oYJD1wOc
1AUAnjYlvXWPxwcbmq4pM9qrOvRqcmDR
=zadJ
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05 20:38     ` tomas
@ 2017-07-05 21:26       ` Filipe Silva
  2017-07-05 23:28         ` Filipe Silva
  0 siblings, 1 reply; 8+ messages in thread
From: Filipe Silva @ 2017-07-05 21:26 UTC (permalink / raw
  To: tomas; +Cc: Help Gnu Emacs mailing list

Ok but there's No `C` Language environment on that list.

What exactly does LANG=C do to emacs?

On Wed, Jul 5, 2017 at 5:38 PM, <tomas@tuxteam.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, Jul 05, 2017 at 12:55:08PM -0300, Filipe Silva wrote:
> > very interesting. LANC=C emacs really fix the problem. What is happening
> > here?
> >
> > maybe this is a bug.
>
> There's mention on that in the doc (22.2 Language Environments):
>
> #+BEGIN_QUOTE
>    To display information about the effects of a certain language
> environment LANG-ENV, use the command `C-h L LANG-ENV <RET>'
> (`describe-language-environment').  This tells you which languages this
> language environment is useful for, and lists the character sets,
> coding systems, and input methods that go with it.  It also shows some
> sample text to illustrate scripts used in this language environment.
> If you give an empty input for LANG-ENV, this command describes the
> chosen language environment.
> #+END_QUOTE
>
> So it's probably intentional
>
> Cheers
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlldTjIACgkQBcgs9XrR2kZtVgCfb/nfP+0tadgvJq/7oYJD1wOc
> 1AUAnjYlvXWPxwcbmq4pM9qrOvRqcmDR
> =zadJ
> -----END PGP SIGNATURE-----
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to teach emacs that ' + c = ç
  2017-07-05 21:26       ` Filipe Silva
@ 2017-07-05 23:28         ` Filipe Silva
  0 siblings, 0 replies; 8+ messages in thread
From: Filipe Silva @ 2017-07-05 23:28 UTC (permalink / raw
  To: tomas; +Cc: Help Gnu Emacs mailing list

Ok so this line:

$ LANG=pt_BR.UTF-8 emacs -Q

works fine.

so the portuguese user has really to set pt_BR properly in his system for
this to work.

Problem solved!

Thanks everyone.



On Wed, Jul 5, 2017 at 6:26 PM, Filipe Silva <filipe.silva@gmail.com> wrote:

> Ok but there's No `C` Language environment on that list.
>
> What exactly does LANG=C do to emacs?
>
> On Wed, Jul 5, 2017 at 5:38 PM, <tomas@tuxteam.de> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Wed, Jul 05, 2017 at 12:55:08PM -0300, Filipe Silva wrote:
>> > very interesting. LANC=C emacs really fix the problem. What is happening
>> > here?
>> >
>> > maybe this is a bug.
>>
>> There's mention on that in the doc (22.2 Language Environments):
>>
>> #+BEGIN_QUOTE
>>    To display information about the effects of a certain language
>> environment LANG-ENV, use the command `C-h L LANG-ENV <RET>'
>> (`describe-language-environment').  This tells you which languages this
>> language environment is useful for, and lists the character sets,
>> coding systems, and input methods that go with it.  It also shows some
>> sample text to illustrate scripts used in this language environment.
>> If you give an empty input for LANG-ENV, this command describes the
>> chosen language environment.
>> #+END_QUOTE
>>
>> So it's probably intentional
>>
>> Cheers
>> - -- tomás
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.12 (GNU/Linux)
>>
>> iEYEARECAAYFAlldTjIACgkQBcgs9XrR2kZtVgCfb/nfP+0tadgvJq/7oYJD1wOc
>> 1AUAnjYlvXWPxwcbmq4pM9qrOvRqcmDR
>> =zadJ
>> -----END PGP SIGNATURE-----
>>
>>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-05 23:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-05  1:25 how to teach emacs that ' + c = ç Filipe Silva
2017-07-05  1:57 ` Óscar Fuentes
2017-07-05 15:55   ` Filipe Silva
2017-07-05 16:11     ` Filipe Silva
2017-07-05 20:38     ` tomas
2017-07-05 21:26       ` Filipe Silva
2017-07-05 23:28         ` Filipe Silva
2017-07-05  6:14 ` Héctor Lahoz

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.