unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* devanagari diacritics
@ 2013-10-23  3:12 Rustom Mody
  2013-10-23 12:22 ` David De La Harpe Golden
  2013-10-23 13:42 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Rustom Mody @ 2013-10-23  3:12 UTC (permalink / raw)
  To: emacs-devel

There have been a couple of independent questions on help.gnu.emacs
for typing devanagari-as-diacritics in the last couple of weeks.
Emacs as of now comes with a couple of devanagari modes for typing
devanagari but not romanized diacritics for devanagari.

Firstly, does something like this exist?

In any case, I came up with the following:
There is one thing I dont know how to do -- how do you make an rule
that expands to more than one character. For example we may want "c"
to expand to "ch"
-----------------------
(require 'quail)

(quail-define-package
 "devanagari-diacritic" "UTF-8" "अ" t
 "Example diacritic

" nil t t nil t nil nil nil nil nil t)
;; no much idea what all these nil/t's are
;; just copied it from something David de la Harpe Golden wrote

(defvar devanagari-map
  '(("A"  ?ā)
    ("I"  ?ī)
    ("U"  ?ū)
    ("~N" ?ṅ)
    ("~n" ?ñ)
    ("N"  ?ṇ)
    ("T"  ?ṭ)
    ("D"  ?ḍ)
    ("sh" ?ś)
    ("Sh" ?ṣ)
))

(defun quail-block-defrules (kb quail-package)
  (dolist (key-trans devanagari-map)
    (let ((key (car key-trans))
      (trans (cadr key-trans)))
      (quail-defrule key trans quail-package))))

(quail-block-defrules devanagari-map "devanagari-diacritic")

-----------

Rusi


-- 
http://www.the-magus.in
http://blog.languager.org



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

* Re: devanagari diacritics
  2013-10-23  3:12 devanagari diacritics Rustom Mody
@ 2013-10-23 12:22 ` David De La Harpe Golden
  2013-10-23 13:42 ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: David De La Harpe Golden @ 2013-10-23 12:22 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-devel

On 23/10/13 04:12, Rustom Mody wrote:

> There is one thing I dont know how to do -- how do you make an rule
> that expands to more than one character. For example we may want "c"
> to expand to "ch"

apl-kb.el actually already included things expanding into more than one 
character in the apl-kb-postfix variant, as it's how the way e.g. x/ -> 
⊃ but x// -> x/

(Aaand I just spotted a typo/bug in the version I sent, "?//" should go 
to "?/" obviously)

Which was just lifted from latin-post.el which works the same way.

 > no much idea what all these nil/t's are

They are described in relevant docstring after all, just hit
C-h f quail-define-package






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

* Re: devanagari diacritics
  2013-10-23  3:12 devanagari diacritics Rustom Mody
  2013-10-23 12:22 ` David De La Harpe Golden
@ 2013-10-23 13:42 ` Stefan Monnier
  2013-10-23 14:05   ` Rustom Mody
  2013-10-28 13:21   ` Rustom Mody
  1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-10-23 13:42 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-devel

>   '(("A"  ?ā)

C-u C-\ TeX RET, then put cursor on the ā character, then C-u C-x =
will tell you that \=a lets you input this char.


        Stefan



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

* Re: devanagari diacritics
  2013-10-23 13:42 ` Stefan Monnier
@ 2013-10-23 14:05   ` Rustom Mody
  2013-10-23 18:27     ` Stefan Monnier
  2013-10-28 13:21   ` Rustom Mody
  1 sibling, 1 reply; 9+ messages in thread
From: Rustom Mody @ 2013-10-23 14:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Wed, Oct 23, 2013 at 7:12 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>   '(("A"  ?ā)
>
> C-u C-\ TeX RET,

Yeah I know about the tex input method

> then put cursor on the ā character, then C-u C-x =

So I learn the keyboard version of M-x describe-char -- thanks :-)

> will tell you that \=a lets you input this char.

Ok... but I am not sure what point you are making.
This input method is for someone who needs to type out a significant
amount of devanagari.
In particular I am attempting to replicate the emacs input method
devanagari-itrans
see http://en.wikipedia.org/wiki/ITRANS

The current devanagari-itrans converts itrans input into devanagari proper
This input method would convert itrans into romanized diacritics.

In any case, my current version (after David's last input) stands at this:
----------------
(require 'quail)

(quail-define-package
 "devanagari-diacritic" "UTF-8" "अ" t
 "Example diacritic
" nil t t nil t nil nil nil nil nil t)
;; that last line copied it from something David de la Harpe Golden wrote

(defvar devanagari-map
  '(("A"  ?ā)
    ("I"  ?ī)
    ("U"  ?ū)
    ;("RRi" ?ṛ)  ; or should it be the following?
    ("RRi" ["r̥"])  ; see
http://en.wikipedia.org/wiki/ISO_15919#Comparison_with_UNRSGN_and_IAST
    ("LLi" ?ḷ)
    ("c" ["ch"])
    ("~N" ?ṅ)
    ("~n" ?ñ)
    ("N"  ?ṇ)
    ("T"  ?ṭ)
    ("D"  ?ḍ)
    ("sh" ?ś)
    ("Sh" ?ṣ)
   )
"The basic sructure for converting Itrans devanagari into diacritics
Many details to be filled in after consulting experts
See http://en.wikipedia.org/wiki/ITRANS
"
)

;; an 'interpreter' for the above
;; Surely such function must exist somewhere??
(defun quail-block-defrules (quail-map quail-package)
  (dolist (key-trans quail-map)
    (let ((key (car key-trans))
      (trans (cadr key-trans)))
      (quail-defrule key trans quail-package))))

(quail-block-defrules devanagari-map "devanagari-diacritic")



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

* Re: devanagari diacritics
  2013-10-23 14:05   ` Rustom Mody
@ 2013-10-23 18:27     ` Stefan Monnier
  2013-10-24  2:36       ` Rustom Mody
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2013-10-23 18:27 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-devel

>> will tell you that \=a lets you input this char.
> Ok... but I am not sure what point you are making.

Just that there is an input method that lets you input those chars.

> This input method is for someone who needs to type out a significant
> amount of devanagari.

Of course, I had no intention to say that TeX is the best method for
those chars.


        Stefan



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

* Re: devanagari diacritics
  2013-10-23 18:27     ` Stefan Monnier
@ 2013-10-24  2:36       ` Rustom Mody
  2013-10-24  3:36         ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Rustom Mody @ 2013-10-24  2:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Wed, Oct 23, 2013 at 11:57 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> will tell you that \=a lets you input this char.
>> Ok... but I am not sure what point you are making.
>
> Just that there is an input method that lets you input those chars.
>
>> This input method is for someone who needs to type out a significant
>> amount of devanagari.
>
> Of course, I had no intention to say that TeX is the best method for
> those chars.

Thanks for the tip -- did not know of this 'backwards' way of using an
input method:
paste a char and then inquire how to input it

There's one thing I dont find -- the input method definition.
With a function or a mode or a key we can ask and be taken to the definition(s).
With an input method I cant seem to find a way



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

* Re: devanagari diacritics
  2013-10-24  2:36       ` Rustom Mody
@ 2013-10-24  3:36         ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-10-24  3:36 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-devel

> There's one thing I don't find -- the input method definition.
> With a function or a mode or a key we can ask and be taken to the
> definition(s).  With an input method I cant seem to find a way

Indeed, it's missing.  Patch very welcome,


        Stefan


PS: I believe this also applies to coding-systems.



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

* Re: devanagari diacritics
  2013-10-23 13:42 ` Stefan Monnier
  2013-10-23 14:05   ` Rustom Mody
@ 2013-10-28 13:21   ` Rustom Mody
  2013-10-28 14:47     ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Rustom Mody @ 2013-10-28 13:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Wed, Oct 23, 2013 at 7:12 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>   '(("A"  ?ā)
>
> C-u C-\ TeX RET, then put cursor on the ā character, then C-u C-x =
> will tell you that \=a lets you input this char.
>
>
>         Stefan

Heres some strange behavior
1. I type the letter ī into a buffer
2. Type C-u C-x =.
emacs tells me its LATIN SMALL LETTER I WITH MACRON
3. start tex input mode
4. C-u C-x =
Its still LATIN SMALL LETTER I WITH MACRON
And furthermore
 to input: type "\={i}" or "\={\i}" or "\=i" with TeX input method

So then I try \=i
I get ӣ
which is
 name: CYRILLIC SMALL LETTER I WITH MACRON



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

* Re: devanagari diacritics
  2013-10-28 13:21   ` Rustom Mody
@ 2013-10-28 14:47     ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-10-28 14:47 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-devel

> Heres some strange behavior
> 1. I type the letter ī into a buffer
> 2. Type C-u C-x =.
> emacs tells me its LATIN SMALL LETTER I WITH MACRON
> 3. start tex input mode
> 4. C-u C-x =
> Its still LATIN SMALL LETTER I WITH MACRON
> And furthermore
>  to input: type "\={i}" or "\={\i}" or "\=i" with TeX input method

> So then I try \=i
> I get ӣ
> which is
>  name: CYRILLIC SMALL LETTER I WITH MACRON

Sounds like a bug I fixed in ltx-latin.el a few months ago (IIRC it's
a new bug in 24.3, fixed in trunk).


        Stefan



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

end of thread, other threads:[~2013-10-28 14:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23  3:12 devanagari diacritics Rustom Mody
2013-10-23 12:22 ` David De La Harpe Golden
2013-10-23 13:42 ` Stefan Monnier
2013-10-23 14:05   ` Rustom Mody
2013-10-23 18:27     ` Stefan Monnier
2013-10-24  2:36       ` Rustom Mody
2013-10-24  3:36         ` Stefan Monnier
2013-10-28 13:21   ` Rustom Mody
2013-10-28 14:47     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).