unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: James Thomas <jimjoe@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Improve Malayalam language transliteration
Date: Wed, 15 Jul 2020 17:41:02 +0530	[thread overview]
Message-ID: <87365t9dwp.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <83wo4wq81f.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Please consider this new patch (to my own code) which uses strings
rather than (expensive) lists to represent constant char sequences.

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, I pushed this to the master branch.


[-- Attachment #2: 0001-indian-mlm-mozhi-update-translation-Use-strings-for-.patch --]
[-- Type: text/x-diff, Size: 2521 bytes --]

From 7e3007d5d08384e7c4c2e93d6e20ab4fc435d3fd Mon Sep 17 00:00:00 2001
From: James Thomas <jimjoe@gmx.net>
Date: Wed, 15 Jul 2020 17:29:08 +0530
Subject: [PATCH] indian-mlm-mozhi-update-translation: Use strings for constant
 sequences

* lisp/leim/quail/indian.el (indian-mlm-mozhi-update-translation):
Use strings rather than lists for constant sequences.
Copyright-paperwork-exempt: yes
---
 lisp/leim/quail/indian.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el
index 100ae63f6a..e1322ddc1e 100644
--- a/lisp/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
@@ -576,18 +576,18 @@ "X"
 
 (defun indian-mlm-mozhi-update-translation (control-flag)
   (let ((len (length quail-current-key)) chillu
-	(vowels '(?a ?e ?i ?o ?u ?A ?E ?I ?O ?U ?R)))
+	(vowels "aeiouAEIOUR"))
     (cond ((numberp control-flag)
 	   (progn (if (= control-flag 0)
 		      (setq quail-current-str quail-current-key)
 		    (cond (input-method-exit-on-first-char)
-			  ((and (memq (aref quail-current-key
-					    (1- control-flag))
-				      vowels)
+			  ((and (cl-find (aref quail-current-key
+					       (1- control-flag))
+				         vowels)
 				(setq chillu (cl-position
 					      (aref quail-current-key
 						    control-flag)
-					      '(?m ?N ?n ?r ?l ?L))))
+					      "mNnrlL")))
 			   ;; conditions for putting chillu
 			   (and (or (and (= control-flag (1- len))
 					 (not (setq control-flag nil)))
@@ -606,7 +606,7 @@ indian-mlm-mozhi-update-translation
 						  (string quail-current-str)
 						quail-current-str)
 					      (string
-					       (nth chillu '(?ം ?ൺ ?ൻ ?ർ ?ൽ ?ൾ)))))))))
+					       (aref "ംൺൻർൽൾ" chillu))))))))
 		  (and (not input-method-exit-on-first-char) control-flag
 		       (while (> len control-flag)
 			 (setq len (1- len))
@@ -619,8 +619,8 @@ indian-mlm-mozhi-update-translation
 	     (setq quail-current-str quail-current-key)
 	     ))
 	  ((equal control-flag t)
-	   (if (memq (aref quail-current-key (1- len))  ;; If vowel ending,
-		     vowels)                            ;; may have to put
+	   (if (cl-find (aref quail-current-key (1- len));; If vowel ending,
+		        vowels)                          ;; may have to put
 	       (setq control-flag nil)))))              ;; chillu. So don't
   control-flag)                                         ;; end translation
 
-- 
2.25.1


  parent reply	other threads:[~2020-07-15 12:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 13:49 [PATCH] Improve Malayalam language transliteration James Thomas
2020-04-26 15:43 ` Eli Zaretskii
     [not found]   ` <87tv161aml.fsf@gmx.net>
2020-04-26 17:12     ` Eli Zaretskii
2020-04-26 22:11       ` James Thomas
2020-04-27  1:33       ` James Thomas
2020-04-27  2:42       ` James Thomas
2020-05-28 17:33         ` Eli Zaretskii
2020-05-29 14:57           ` James Thomas
2020-06-01  8:49           ` James Thomas
2020-06-01 15:02             ` Eli Zaretskii
2020-06-02  2:27               ` James Thomas
2020-07-15 12:11           ` James Thomas [this message]
2020-07-15 14:29             ` Eli Zaretskii
2020-07-16  3:37               ` James Thomas
2020-07-16  5:20                 ` James Thomas
2020-07-16  5:44                   ` James Thomas
2020-07-16 15:07                     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87365t9dwp.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me \
    --to=jimjoe@gmx.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 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).