* bug#66470: 29.1; Provide Urdu input method @ 2023-10-11 18:36 Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-11 18:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-11 18:36 UTC (permalink / raw) To: 66470 Dear Emacs developers, Emacs should provide an Urdu input method. The closet input methods available are those for Farsi. However Urdu has additional letters which can't be inputted using those and divergence between Urdu and Farsi makes some of the choices less than ideal for Urdu. I have written a simple input method for Urdu which I will attach as a patch with a followup email for review and eventual inclusion. I have questions about quail which I asked at https://lists.gnu.org/archive/html/help-gnu-emacs/2023-10/msg00082.html . If someone on this list knows the answer to those please let me know. Thanks in advance, Rahguzar In GNU Emacs 29.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-09-23 built on i02-ch2c System Description: openSUSE Tumbleweed Configured using: 'configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-pgtk --with-native-compilation=aot --with-cairo --with-libotf --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-xft --with-xml2 --with-dbus --with-sound --with-json --with-mailutils --with-gnutls --with-tree-sitter --enable-locallisppath=/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto' LDFLAGS=-Wl,-O2' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: mu4e:main Minor modes in effect: shell-dirtrack-mode: t global-evil-surround-mode: t evil-surround-mode: t eros-mode: t recentf-mode: t global-so-long-mode: t save-place-mode: t pdf-occur-global-minor-mode: t projectile-mode: t which-key-mode: t savehist-mode: t better-jumper-mode: t better-jumper-local-mode: t global-company-mode: t company-mode: t vertico-mode: t nerd-icons-completion-mode: t marginalia-mode: t evil-goggles-mode: t evil-escape-mode: t evil-snipe-override-mode: t evil-snipe-mode: t gcmh-mode: t winner-mode: t smartparens-global-mode: t ws-butler-global-mode: t undo-fu-session-global-mode: t undo-fu-mode: t satchel-mode: t mu4e-search-minor-mode: t global-hl-line-mode: t hl-line-mode: t mu4e-update-minor-mode: t mu4e-context-minor-mode: t dirvish-override-dired-mode: t server-mode: t pixel-scroll-precision-mode: t repeat-mode: t evil-mode: t evil-local-mode: t +popup-mode: t +modeline-global-mode: t +modeline-mode: t global-ligature-mode: t ligature-mode: t override-global-mode: t general-override-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t window-divider-mode: t buffer-read-only: t size-indication-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/azeem/.emacs.d/.local/straight/build-29.1/emacsql/emacsql-sqlite-builtin hides /home/azeem/.emacs.d/.local/straight/build-29.1/emacsql-sqlite-builtin/emacsql-sqlite-builtin /home/azeem/.emacs.d/.local/straight/build-29.1/citar-embark/citar-embark hides /home/azeem/.emacs.d/.local/straight/build-29.1/citar/citar-embark /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-view hides /usr/share/emacs/site-lisp/mu4e/mu4e-view /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-search hides /usr/share/emacs/site-lisp/mu4e/mu4e-search /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-org hides /usr/share/emacs/site-lisp/mu4e/mu4e-org /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-contacts hides /usr/share/emacs/site-lisp/mu4e/mu4e-contacts /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-config hides /usr/share/emacs/site-lisp/mu4e/mu4e-config /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e hides /usr/share/emacs/site-lisp/mu4e/mu4e /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-window hides /usr/share/emacs/site-lisp/mu4e/mu4e-window /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-vars hides /usr/share/emacs/site-lisp/mu4e/mu4e-vars /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-update hides /usr/share/emacs/site-lisp/mu4e/mu4e-update /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-speedbar hides /usr/share/emacs/site-lisp/mu4e/mu4e-speedbar /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-server hides /usr/share/emacs/site-lisp/mu4e/mu4e-server /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-query-items hides /usr/share/emacs/site-lisp/mu4e/mu4e-query-items /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-obsolete hides /usr/share/emacs/site-lisp/mu4e/mu4e-obsolete /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-notification hides /usr/share/emacs/site-lisp/mu4e/mu4e-notification /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-modeline hides /usr/share/emacs/site-lisp/mu4e/mu4e-modeline /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-message hides /usr/share/emacs/site-lisp/mu4e/mu4e-message /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-mark hides /usr/share/emacs/site-lisp/mu4e/mu4e-mark /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-main hides /usr/share/emacs/site-lisp/mu4e/mu4e-main /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-lists hides /usr/share/emacs/site-lisp/mu4e/mu4e-lists /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-icalendar hides /usr/share/emacs/site-lisp/mu4e/mu4e-icalendar /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-helpers hides /usr/share/emacs/site-lisp/mu4e/mu4e-helpers /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-headers hides /usr/share/emacs/site-lisp/mu4e/mu4e-headers /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-folders hides /usr/share/emacs/site-lisp/mu4e/mu4e-folders /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-draft hides /usr/share/emacs/site-lisp/mu4e/mu4e-draft /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-contrib hides /usr/share/emacs/site-lisp/mu4e/mu4e-contrib /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-context hides /usr/share/emacs/site-lisp/mu4e/mu4e-context /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-compose hides /usr/share/emacs/site-lisp/mu4e/mu4e-compose /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-bookmarks hides /usr/share/emacs/site-lisp/mu4e/mu4e-bookmarks /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-actions hides /usr/share/emacs/site-lisp/mu4e/mu4e-actions Features: (shadow emacsbug evil-collection-help url-http url-gw url-cache url-auth password-store auth-source-pass with-editor shell gts-engine-deepl gts-implements gts-faces gts-core cl-print cus-start guess-language flyspell evil-embrace evil-surround eros highlight-quoted rainbow-delimiters highlight-numbers parent-mode hl-todo evil-collection-elisp-mode elisp-mode org-eldoc embrace expand-region text-mode-expansions the-org-mode-expansions er-basic-expansions expand-region-core expand-region-custom cdlatex evil-collection-reftex reftex-toc reftex-cite reftex-ref reftex-parse reftex reftex-loaddefs reftex-vars toc-org evil-org org-indent org-element org-persist xdg org-id org-refile avl-tree generator ol-bibtex evil-collection-consult consult magit-base evil-collection-magit-section magit-section crm evil-collection-indent evil-collection-helpful helpful cc-langs cc-vars cc-defs trace evil-collection-edebug edebug evil-collection-debug debug backtrace info-look evil-collection-info info f f-shortdoc help-fns radix-tree evil-collection-elisp-refs elisp-refs s link-hint ffap goto-addr avy company-ispell company-yasnippet company-dabbrev delsel display-line-numbers adaptive-wrap jit-spell ispell face-remap recentf tree-widget evil-collection-so-long so-long vertico-directory pdf-annot facemenu pdf-outline pdf-links pdf-roll saveplace-pdf-view saveplace pdf-loader pdf-occur evil-collection-tablist tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch pdf-misc evil-collection-imenu imenu evil-collection-pdf pdf-history pdf-tools evil-collection-package-menu doom-packages package url-handlers pdf-view pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif shr-color whitespace jka-compr gnus-fun smerge-mode diff evil-collection-diff-mode diff-mode auto-minor-mode qp mm-archive sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg gnus-ml disp-table nndraft nnmh nnfolder cursor-sensor vertico-repeat epa-file network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache projectile lisp-mnt evil-collection-grep grep hide-mode-line evil-collection-which-key which-key savehist better-jumper company-capf company evil-collection-vertico vertico orderless nerd-icons-completion marginalia compat evil-goggles pulse color evil-easymotion evil-escape evil-snipe autorevert filenotify gcmh winner smartparens-config smartparens-text smartparens loadhist dash ws-butler undo-fu-session undo-fu satchel ibuf-ext evil-collection-ibuffer ibuffer ibuffer-loaddefs desktop frameset evil-collection-mu4e mu4e mu4e-org evil-collection-org smartparens-org org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc-natbib oc-csl bibtex oc-biblatex oc org-loaddefs find-func org-version org-compat org-macs mu4e-notification notifications mu4e-main mu4e-view gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win evil-collection-gnus gnus nnheader range evil-collection-calendar cal-menu calendar cal-loaddefs mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku url-file svg xml dom browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source json map url-vars flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window evil-collection-bookmark bookmark ido message sendmail mailcap yank-media puny dirvish transient format-spec eieio eieio-core evil-collection-dired dired dired-loaddefs rfc822 mml mml-sec password-cache evil-collection-epa epa epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader mu4e-obsolete server dtrt-indent ef-spring-theme ef-themes pixel-scroll cua-base repeat midnight html2text let-alist evil-collection-flymake flymake-proc flymake project evil-collection-compile evil-collection-custom cus-edit cus-load wid-edit evil-collection-comint evil-collection annalist compile text-property-search comint ansi-osc ansi-color ibuf-macs evil evil-integration evil-maps evil-commands reveal evil-jumps evil-command-window evil-types evil-search evil-macros evil-repeat evil-states evil-core byte-opt advice evil-common thingatpt rect evil-vars ring nerd-icons nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon nerd-icons-data-pomicon nerd-icons-data-ipsicon ligature derived edmacro kmacro use-package-bind-key bind-key comp comp-cstr warnings icons rx doom-editor doom-projects doom-ui easy-mmode doom-keybinds pp cl-extra help-mode use-package-core bytecomp byte-compile general tex-site doom-start doom-modules cl-seq doom doom-lib cl-macs cl-loaddefs cl-lib pcase gv harfbuzz jansson dynamic-modules subr-x rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 1093296 205022) (symbols 48 53308 119) (strings 32 240871 24675) (string-bytes 1 8170002) (vectors 16 136989) (vector-slots 8 3133020 258974) (floats 8 1833 1721) (intervals 56 28999 88) (buffers 984 58)) ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-11 18:36 bug#66470: 29.1; Provide Urdu input method Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-11 18:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 8:53 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-11 18:50 UTC (permalink / raw) To: 66470; +Cc: rahguzar [-- Attachment #1: Type: text/plain, Size: 16355 bytes --] Please find attached the patch I mentioned earlier and let me know any changes that need to be made. The input method is usable for common Urdu input, but here are some of the things I want to improve in addition to what I asked on the help-gnu-emacs: 1) Better coverage of Urdu zabta takhti http://www.unicode.org/L2/L2002/02004-uzt.pdf It is a code page developed for Urdu and supposedly was the basis of current Urdu support of Unicode. However I can't figure out exactly what is the mapping from UZT to Unicode. If anyone has pointers please share. 2) Another input method for the common Urdu keyboard support. Despite Urdu being my mother tongue I never learned to type in it which is why I prefer a phonetic keyboard. However I will like to make an input method with the layout of a physical Urdu keyboard. If a keyboard layout was standardized in Pakistan or India, I can't find the specification. If such a document exists and anyone can point me to it, I will be happy to use it as a basis for addition to the `urdu.el` in attached patch. Otherwise I will use the layout of Urdu keyboard from some free software project. But this will probably be closer to Emacs 30 than now. 3) The key for 'w' is unused in the input method for now. I am tempted to bind a version of `insert-char` but restricted to Arabic range of Unicode to cover the rare cases not covered by the input method now. Any opinions about that? Thanks, Rahguzar Rahguzar <rahguzar@zohomail.eu> writes: > Dear Emacs developers, > > Emacs should provide an Urdu input method. The closet input methods > available are those for Farsi. However Urdu has additional letters which > can't be inputted using those and divergence between Urdu and Farsi > makes some of the choices less than ideal for Urdu. > > I have written a simple input method for Urdu which I will attach as a > patch with a followup email for review and eventual inclusion. I have > questions about quail which I asked at > https://lists.gnu.org/archive/html/help-gnu-emacs/2023-10/msg00082.html > . If someone on this list knows the answer to those please let me know. > > Thanks in advance, > Rahguzar > > > > In GNU Emacs 29.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.38, > cairo version 1.17.8) of 2023-09-23 built on i02-ch2c > System Description: openSUSE Tumbleweed > > Configured using: > 'configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu > --program-prefix= --disable-dependency-tracking --prefix=/usr > --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin > --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include > --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var > --sharedstatedir=/var/lib --mandir=/usr/share/man > --infodir=/usr/share/info --with-pgtk --with-native-compilation=aot > --with-cairo --with-libotf --with-jpeg --with-tiff --with-gif > --with-png --with-rsvg --with-xft --with-xml2 --with-dbus --with-sound > --with-json --with-mailutils --with-gnutls --with-tree-sitter > --enable-locallisppath=/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp > 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 > -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables > -fstack-clash-protection -Werror=return-type -flto=auto' > LDFLAGS=-Wl,-O2' > > Configured features: > CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON > LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY > PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF > TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB > > Important settings: > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: mu4e:main > > Minor modes in effect: > shell-dirtrack-mode: t > global-evil-surround-mode: t > evil-surround-mode: t > eros-mode: t > recentf-mode: t > global-so-long-mode: t > save-place-mode: t > pdf-occur-global-minor-mode: t > projectile-mode: t > which-key-mode: t > savehist-mode: t > better-jumper-mode: t > better-jumper-local-mode: t > global-company-mode: t > company-mode: t > vertico-mode: t > nerd-icons-completion-mode: t > marginalia-mode: t > evil-goggles-mode: t > evil-escape-mode: t > evil-snipe-override-mode: t > evil-snipe-mode: t > gcmh-mode: t > winner-mode: t > smartparens-global-mode: t > ws-butler-global-mode: t > undo-fu-session-global-mode: t > undo-fu-mode: t > satchel-mode: t > mu4e-search-minor-mode: t > global-hl-line-mode: t > hl-line-mode: t > mu4e-update-minor-mode: t > mu4e-context-minor-mode: t > dirvish-override-dired-mode: t > server-mode: t > pixel-scroll-precision-mode: t > repeat-mode: t > evil-mode: t > evil-local-mode: t > +popup-mode: t > +modeline-global-mode: t > +modeline-mode: t > global-ligature-mode: t > ligature-mode: t > override-global-mode: t > general-override-mode: t > global-eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > window-divider-mode: t > buffer-read-only: t > size-indication-mode: t > line-number-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > abbrev-mode: t > > Load-path shadows: > /home/azeem/.emacs.d/.local/straight/build-29.1/emacsql/emacsql-sqlite-builtin hides /home/azeem/.emacs.d/.local/straight/build-29.1/emacsql-sqlite-builtin/emacsql-sqlite-builtin > /home/azeem/.emacs.d/.local/straight/build-29.1/citar-embark/citar-embark hides /home/azeem/.emacs.d/.local/straight/build-29.1/citar/citar-embark > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-view hides /usr/share/emacs/site-lisp/mu4e/mu4e-view > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-search hides /usr/share/emacs/site-lisp/mu4e/mu4e-search > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-org hides /usr/share/emacs/site-lisp/mu4e/mu4e-org > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-contacts hides /usr/share/emacs/site-lisp/mu4e/mu4e-contacts > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-config hides /usr/share/emacs/site-lisp/mu4e/mu4e-config > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e hides /usr/share/emacs/site-lisp/mu4e/mu4e > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-window hides /usr/share/emacs/site-lisp/mu4e/mu4e-window > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-vars hides /usr/share/emacs/site-lisp/mu4e/mu4e-vars > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-update hides /usr/share/emacs/site-lisp/mu4e/mu4e-update > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-speedbar hides /usr/share/emacs/site-lisp/mu4e/mu4e-speedbar > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-server hides /usr/share/emacs/site-lisp/mu4e/mu4e-server > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-query-items hides /usr/share/emacs/site-lisp/mu4e/mu4e-query-items > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-obsolete hides /usr/share/emacs/site-lisp/mu4e/mu4e-obsolete > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-notification hides /usr/share/emacs/site-lisp/mu4e/mu4e-notification > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-modeline hides /usr/share/emacs/site-lisp/mu4e/mu4e-modeline > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-message hides /usr/share/emacs/site-lisp/mu4e/mu4e-message > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-mark hides /usr/share/emacs/site-lisp/mu4e/mu4e-mark > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-main hides /usr/share/emacs/site-lisp/mu4e/mu4e-main > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-lists hides /usr/share/emacs/site-lisp/mu4e/mu4e-lists > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-icalendar hides /usr/share/emacs/site-lisp/mu4e/mu4e-icalendar > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-helpers hides /usr/share/emacs/site-lisp/mu4e/mu4e-helpers > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-headers hides /usr/share/emacs/site-lisp/mu4e/mu4e-headers > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-folders hides /usr/share/emacs/site-lisp/mu4e/mu4e-folders > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-draft hides /usr/share/emacs/site-lisp/mu4e/mu4e-draft > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-contrib hides /usr/share/emacs/site-lisp/mu4e/mu4e-contrib > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-context hides /usr/share/emacs/site-lisp/mu4e/mu4e-context > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-compose hides /usr/share/emacs/site-lisp/mu4e/mu4e-compose > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-bookmarks hides /usr/share/emacs/site-lisp/mu4e/mu4e-bookmarks > /home/azeem/.emacs.d/.local/straight/build-29.1/mu4e/mu4e-actions hides /usr/share/emacs/site-lisp/mu4e/mu4e-actions > > Features: > (shadow emacsbug evil-collection-help url-http url-gw url-cache url-auth > password-store auth-source-pass with-editor shell gts-engine-deepl > gts-implements gts-faces gts-core cl-print cus-start guess-language > flyspell evil-embrace evil-surround eros highlight-quoted > rainbow-delimiters highlight-numbers parent-mode hl-todo > evil-collection-elisp-mode elisp-mode org-eldoc embrace expand-region > text-mode-expansions the-org-mode-expansions er-basic-expansions > expand-region-core expand-region-custom cdlatex evil-collection-reftex > reftex-toc reftex-cite reftex-ref reftex-parse reftex reftex-loaddefs > reftex-vars toc-org evil-org org-indent org-element org-persist xdg > org-id org-refile avl-tree generator ol-bibtex evil-collection-consult > consult magit-base evil-collection-magit-section magit-section crm > evil-collection-indent evil-collection-helpful helpful cc-langs cc-vars > cc-defs trace evil-collection-edebug edebug evil-collection-debug debug > backtrace info-look evil-collection-info info f f-shortdoc help-fns > radix-tree evil-collection-elisp-refs elisp-refs s link-hint ffap > goto-addr avy company-ispell company-yasnippet company-dabbrev delsel > display-line-numbers adaptive-wrap jit-spell ispell face-remap recentf > tree-widget evil-collection-so-long so-long vertico-directory pdf-annot > facemenu pdf-outline pdf-links pdf-roll saveplace-pdf-view saveplace > pdf-loader pdf-occur evil-collection-tablist tablist tablist-filter > semantic/wisent/comp semantic/wisent semantic/wisent/wisent > semantic/util-modes semantic/util semantic semantic/tag semantic/lex > semantic/fw mode-local cedet pdf-isearch pdf-misc evil-collection-imenu > imenu evil-collection-pdf pdf-history pdf-tools > evil-collection-package-menu doom-packages package url-handlers pdf-view > pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif shr-color > whitespace jka-compr gnus-fun smerge-mode diff evil-collection-diff-mode > diff-mode auto-minor-mode qp mm-archive sort smiley gnus-cite mail-extr > textsec uni-scripts idna-mapping ucs-normalize uni-confusable > textsec-check gnus-async gnus-bcklg gnus-ml disp-table nndraft nnmh > nnfolder cursor-sensor vertico-repeat epa-file network-stream nsm > gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp > gnus-cache projectile lisp-mnt evil-collection-grep grep hide-mode-line > evil-collection-which-key which-key savehist better-jumper company-capf > company evil-collection-vertico vertico orderless nerd-icons-completion > marginalia compat evil-goggles pulse color evil-easymotion evil-escape > evil-snipe autorevert filenotify gcmh winner smartparens-config > smartparens-text smartparens loadhist dash ws-butler undo-fu-session > undo-fu satchel ibuf-ext evil-collection-ibuffer ibuffer > ibuffer-loaddefs desktop frameset evil-collection-mu4e mu4e mu4e-org > evil-collection-org smartparens-org org ob ob-tangle ob-ref ob-lob > ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete > org-list org-footnote org-faces org-entities noutline outline > ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold > org-fold-core org-keys oc-natbib oc-csl bibtex oc-biblatex oc > org-loaddefs find-func org-version org-compat org-macs mu4e-notification > notifications mu4e-main mu4e-view gnus-art mm-uu mml2015 mm-view > mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start > gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time > iso8601 gnus-spec gnus-int gnus-range gnus-win evil-collection-gnus gnus > nnheader range evil-collection-calendar cal-menu calendar cal-loaddefs > mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search > mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku > url-file svg xml dom browse-url url url-proxy url-privacy url-expand > url-methods url-history url-cookie generate-lisp-file url-domsuf > url-util url-parse auth-source json map url-vars flow-fill mule-util > hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-context > mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers > mu4e-config mu4e-window evil-collection-bookmark bookmark ido message > sendmail mailcap yank-media puny dirvish transient format-spec eieio > eieio-core evil-collection-dired dired dired-loaddefs rfc822 mml mml-sec > password-cache evil-collection-epa epa epg rfc6068 epg-config gnus-util > time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 > rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils > mailheader mu4e-obsolete server dtrt-indent ef-spring-theme ef-themes > pixel-scroll cua-base repeat midnight html2text let-alist > evil-collection-flymake flymake-proc flymake project > evil-collection-compile evil-collection-custom cus-edit cus-load > wid-edit evil-collection-comint evil-collection annalist compile > text-property-search comint ansi-osc ansi-color ibuf-macs evil > evil-integration evil-maps evil-commands reveal evil-jumps > evil-command-window evil-types evil-search evil-macros evil-repeat > evil-states evil-core byte-opt advice evil-common thingatpt rect > evil-vars ring nerd-icons nerd-icons-faces nerd-icons-data > nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon > nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon > nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon > nerd-icons-data-pomicon nerd-icons-data-ipsicon ligature derived edmacro > kmacro use-package-bind-key bind-key comp comp-cstr warnings icons rx > doom-editor doom-projects doom-ui easy-mmode doom-keybinds pp cl-extra > help-mode use-package-core bytecomp byte-compile general tex-site > doom-start doom-modules cl-seq doom doom-lib cl-macs cl-loaddefs cl-lib > pcase gv harfbuzz jansson dynamic-modules subr-x rmc iso-transl tooltip > cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type > mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd > fontset image regexp-opt fringe tabulated-list replace newcomment > text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow > isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax > font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic > indonesian philippine cham georgian utf-8-lang misc-lang vietnamese > tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek > romanian slovak czech european ethiopic indian cyrillic chinese > composite emoji-zwj charscript charprop case-table epa-hook > jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs > theme-loaddefs faces cus-face macroexp files window text-properties > overlay sha1 md5 base64 format env code-pages mule custom widget keymap > hashtable-print-readable backquote threads dbusbind inotify > dynamic-setting system-font-setting font-render-setting cairo gtk pgtk > multi-tty make-network-process native-compile emacs) > > Memory information: > ((conses 16 1093296 205022) > (symbols 48 53308 119) > (strings 32 240871 24675) > (string-bytes 1 8170002) > (vectors 16 136989) > (vector-slots 8 3133020 258974) > (floats 8 1833 1721) > (intervals 56 28999 88) > (buffers 984 58)) [-- Attachment #2: 0001-Provide-an-Urdu-input-method.patch --] [-- Type: text/x-patch, Size: 6291 bytes --] From 8c0fc53efef493e151bd5893d5b5ca7b390b4a6b Mon Sep 17 00:00:00 2001 From: Rahguzar <rahguzar@zohomail.eu> Date: Wed, 11 Oct 2023 20:45:27 +0200 Subject: [PATCH] Provide an Urdu input method --- lisp/leim/quail/urdu.el | 193 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 lisp/leim/quail/urdu.el diff --git a/lisp/leim/quail/urdu.el b/lisp/leim/quail/urdu.el new file mode 100644 index 00000000000..b5b909c4467 --- /dev/null +++ b/lisp/leim/quail/urdu.el @@ -0,0 +1,193 @@ +;;; urdu.el --- Quail package for Urdu -*- lexical-binding: t; -*- + +;; Copyright (C) 2011-2023 Free Software Foundation, Inc. + +;; Author: Rahguzar <rahguzar@zohomail.eu> +;; +;; This file is part of 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 3 of the License, 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. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: +;; Provides a semi-phonetic input method for Urdu +;; +;;; Code: +(require 'quail) + +(quail-define-package + "urdu-phonetic" "Urdu" "اردو صوتی" + `((?a . "a → ا , A → آ , ax → أ , u → ع") + (?y . "y → ی , e → ے , i → ئ") + (?r . "r → ر , R → ڑ") + (?n . "n → ن , N → ں") + (?v . "v → و , V → ؤ") + (?t . "t → ت, T → ٹ , tx → ط , Tx → ۃ") + (?k . "k → ک , q → ق, kx → خ") + (?d . "d → د , D → ڈ") + (?h . "h → ہ , H → ھ , hx → ح , Hx → ۂ") + (?s . "s → س , c → ص , sx → ش , S → ث , cx → چ") + (?g . "g → گ , gx → غ") + (?z . "z → ز , Z → ض, zx → ذ , Zx → ظ , Y → ژ") + (?u . "u → ع , a → ا , A → آ , ax → أ") + (?A . "A → آ , a → ا , ax → أ , u → ع ") + (?e . "e → ے , y → ی , i → ئ") + (?y . "i → ئ , y → ی , e → ے") + (?R . "R → ڑ , r → ر") + (?N . "N → ں , n → ن") + (?V . "V → ؤ , v → و") + (?T . "T → ٹ , Tx → ۃ , t → ت, tx → ط") + (?q . "q → ق, k → ک , kx → خ") + (?D . "D → ڈ , d → د") + (?H . "Hx → ۂ , H → ھ , h → ہ , hx → ح") + (?c . "c → ص, cx → چ , s → س , sx → ش , S → ث") + (?S . "S → ث , s → س , c → ص , sx → ش , cx → چ") + (?Z . "Z → ض, Zx → ظ , z → ز , zx → ذ , Y → ژ") + (?Y . "Y → ژ , Z → ض, Zx → ظ , z → ز , zx → ذ")) + "Intuitive transliteration keyboard layout for Urdu. +However this input method doesn't try to follow the common romanization of Urdu +very closely. The reason for this is allow for input efficiency. It works as +follows: + +1) All lower case letters on QWERTY keyboard are translated to an urdu +character. When more than one Urdu letter corresponds to the same Roman letter, +the most common Urdu letter has been chosen. The frequency analysis was done +on the basis of Urdu word list at +https://github.com/urduhack/urdu-words/blob/master/words.txt +As a result some of the translations are: +h → ہ +s → س , c → ص +z → ز + +2) For the next common letter the uppercase English letter is used, e.g. +r → ر , R → ڑ +n → ن , N → ں + +3) The letter x is used for postfix completions. There are two subcases: +3a) When more than two urdu letter map to the same roman letter, +e.g. +t → ت, T → ٹ , tx → ط , Tx → ۃ +h → ہ , H → ھ , hx → ح , Hx → ۂ +s → س , c → ص , sx → ش , S → ث , cx → چ +z → ز , Z → ض, zx → ذ , Zx → ظ +3b) The urdu letters that are commonly romanized by a English letter + h +can be obtained by the same English letter + x i.e. +gx → غ , cx → چ, kx → خ , sx → ش + +4) Y → ژ is somewhat of an abberation. All four of z, Z, zx and Zx which are +used by more common letters. Y is used for ژ because it is sometimes pronounced +close to Y for some European languages. + +5) o is used for prefix completion of diacrtics or اعر۱ب as well as some +poetic and religious symbols. The most common three diacritics are mapped to +oa → zabr (a for above) +ob → zer (b for below) +oo → peesh (o for the circle in pesh) + +6) The poetic symbols are also available under P, while religious symbols are +also available under M (for مزہب)." + + nil t t t t nil nil nil nil nil t) + +;; owx +;; BCEFGIJKLMOPQUWX +;; sckhtgzZHT + +(quail-define-rules + ("a" ?ا) + ("y" ?ی) + ("r" ?ر) + ("n" ?ن) + ("v" ?و) + ("m" ?م) + ("t" ?ت) + ("l" ?ل) + ("k" ?ک) + ("b" ?ب) + ("d" ?د) + ("h" ?ہ) + ("s" ?س) + ("H" ?ھ) + ("p" ?پ) + ("N" ?ں) + ("g" ?گ) + ("sx" ?ش) + ("j" ?ج) + ("T" ?ٹ) + ("f" ?ف) + ("cx" ?چ) + ("z" ?ز) + ("u" ?ع) + ("q" ?ق) + ("kx" ?خ) + ("e" ?ے) + ("E" ?ۓ) + ("hx" ?ح) + ("i" ?ئ) + ("R" ?ڑ) + ("tx" ?ط) + ("c" ?ص) + ("D" ?ڈ) + ("gx" ?غ) + ("A" ?آ) + ("Z" ?ض) + ("V" ?ؤ) + ("zx" ?ذ) + ("S" ?ث) + ("Zx" ?ظ) + ("Hx" ?ۂ) + ("ix" ?ء) + ("Tx" ?ۃ) + ("Y" ?ژ) + ("ax" ?أ) + ("0" ?۰) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("%" ?٪) + + ("." ?۔) + ("," ?،) + (";" ?؛) + ("?" ?؟) + + ("oa" ?َ) ;; zabar زبر + ("ob" ?ِ) ;; zer زير + ("oo" ?ُ) ;; pesh پيش + ("oj" ?ْ) ;; jazam جزم + ("oS" ?ّ) ;; tashdid تشدید + ("ok" ?ٰ) ;; khari zabar کھڑی زبر + ("ou" ?٘) ;; ulti jazm الٹی جزم + ("os" ?؎) + ("om" ?؏) + ("ot" ?ؔ) + ("Ps" ?؎) + ("Pm" ?؏) + ("Pt" ?ؔ) + ("oS" ?ؐ) + ("or" ?ؒ) + ("oR" ?ؓ) + ("oA" ?ؑ) + ("Ms" ?ؐ) + ("Mr" ?ؒ) + ("Mz" ?ؓ) + ("Ma" ?ؑ)) + +(provide 'urdu) +;;; urdu.el ends here -- 2.42.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-11 18:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-14 8:53 ` Eli Zaretskii 2023-10-14 9:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-10-14 8:53 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > Cc: rahguzar@zohomail.eu > Date: Wed, 11 Oct 2023 20:50:33 +0200 > From: Rahguzar via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> > > Please find attached the patch I mentioned earlier and let me know any changes that need to be made. > > The input method is usable for common Urdu input, but here are some of > the things I want to improve in addition to what I asked on the > help-gnu-emacs: I responded to your question on help-gnu-emacs. > 1) Better coverage of Urdu zabta takhti > http://www.unicode.org/L2/L2002/02004-uzt.pdf It is a code page > developed for Urdu and supposedly was the basis of current Urdu support > of Unicode. However I can't figure out exactly what is the mapping from > UZT to Unicode. If anyone has pointers please share. What are the specific issues you cannot figure out? Anyway, a better place to ask about Unicode mapping is on the Unicode mailing list, unicode@corp.unicode.org. > 2) Another input method for the common Urdu keyboard support. Despite > Urdu being my mother tongue I never learned to type in it which is why I > prefer a phonetic keyboard. However I will like to make an input method > with the layout of a physical Urdu keyboard. If a keyboard layout was > standardized in Pakistan or India, I can't find the specification. If > such a document exists and anyone can point me to it, I will be happy to > use it as a basis for addition to the `urdu.el` in attached patch. > Otherwise I will use the layout of Urdu keyboard from some free software > project. But this will probably be closer to Emacs 30 than now. Does https://www.branah.com/urdu help? > > 3) The key for 'w' is unused in the input method for now. I am tempted > to bind a version of `insert-char` but restricted to Arabic range of > Unicode to cover the rare cases not covered by the input method now. Any > opinions about that? That key is assigned characters in the above keyboard page. > >From 8c0fc53efef493e151bd5893d5b5ca7b390b4a6b Mon Sep 17 00:00:00 2001 > From: Rahguzar <rahguzar@zohomail.eu> > Date: Wed, 11 Oct 2023 20:45:27 +0200 > Subject: [PATCH] Provide an Urdu input method > > --- > lisp/leim/quail/urdu.el | 193 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 193 insertions(+) > create mode 100644 lisp/leim/quail/urdu.el Thanks, but I'd prefer not to create a new file. How about adding this to persian.el instead? > +(quail-define-package > + "urdu-phonetic" "Urdu" "اردو صوتی" > + `((?a . "a → ا , A → آ , ax → أ , u → ع") > + (?y . "y → ی , e → ے , i → ئ") > + (?r . "r → ر , R → ڑ") Besides the ` vs ' issue, I doubt that this kind of GUIDANCE is a good idea. Emacs input methods have a standardized way of showing candidates and the keys to select them, so I would prefer to stick to the standardized guidance format instead. In particular, showing the translations of both upper- and lower-case keys is not a good idea, I think. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-14 8:53 ` Eli Zaretskii @ 2023-10-14 9:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 10:53 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-14 9:50 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: > I responded to your question on help-gnu-emacs. Thanks a lot! But changing ` to ' doesn't seem to make a difference. >> 1) Better coverage of Urdu zabta takhti >> http://www.unicode.org/L2/L2002/02004-uzt.pdf It is a code page >> developed for Urdu and supposedly was the basis of current Urdu support >> of Unicode. However I can't figure out exactly what is the mapping from >> UZT to Unicode. If anyone has pointers please share. > > What are the specific issues you cannot figure out? The paper I referenced describes the UZT code page but it is uses hand drawn characters and I can't figure out what what Unicode code points those characters correspond to. It is hard to search for them because Unicode uses Arabic names for them which are different for Urdu ones and the characters I am still looking for are highly unusual ones, so even though Urdu is my first language I wouldn't be able to disambiguate between similar looking characters to find one most suitable for Urdu. But that is a more of a theoretical completeness issue. The letters that are provided by the input method can be used to write all normal Urdu text (i.e. one that doesn't have stretches of Farsi or Arabic in it). > Anyway, a better place to ask about Unicode mapping is on the Unicode > mailing list, unicode@corp.unicode.org. Thanks, I will ask there. >> 2) Another input method for the common Urdu keyboard support. Despite >> Urdu being my mother tongue I never learned to type in it which is why I >> prefer a phonetic keyboard. However I will like to make an input method >> with the layout of a physical Urdu keyboard. If a keyboard layout was >> standardized in Pakistan or India, I can't find the specification. If >> such a document exists and anyone can point me to it, I will be happy to >> use it as a basis for addition to the `urdu.el` in attached patch. >> Otherwise I will use the layout of Urdu keyboard from some free software >> project. But this will probably be closer to Emacs 30 than now. > > Does https://www.branah.com/urdu help? I found that keyboard, but I also wanted to see if there was some institutional standardization in Pakistan or India so as to find a canonical resource. Web searches didn't reveal anything so if nothing comes up, I will go with the one found on that page. However I don't find the phonetic keyboard there that useful since it has to put every character on one key. Using a combination of two keys which Emacs can do is more systematic and easy to remember (at least for me). >> >> 3) The key for 'w' is unused in the input method for now. I am tempted >> to bind a version of `insert-char` but restricted to Arabic range of >> Unicode to cover the rare cases not covered by the input method now. Any >> opinions about that? > > That key is assigned characters in the above keyboard page. This was for the input method in the attached file which is my attempt at building a phonetic input method for Urdu taking some inspiration from farsi-transliterate-banan in Emacs. However if you and other maintainers prefer to replicate more widely used keyboards (e.g. those on mobile devices) I will provide them instead. >> --- >> lisp/leim/quail/urdu.el | 193 ++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 193 insertions(+) >> create mode 100644 lisp/leim/quail/urdu.el > > Thanks, but I'd prefer not to create a new file. How about adding > this to persian.el instead? That is an option and another better one might be indian.el which is where input methods for languages from Indo-Pakistan subcontinent are now. Another consideration for where it should go is that other major languages in Pakistan are also not represented among input methods. These include Punjabi (which I can speak a little but not write) which has two scripts: Emacs has a input methods for gurmukhi but not shahmukhi https://en.wikipedia.org/wiki/Shahmukhi , although Wikipedia indicates that an Urdu input method should be sufficient. There are also Saraiki: https://en.wikipedia.org/wiki/Saraiki_language Sindhi: https://en.wikipedia.org/wiki/Sindhi_language Pashto: https://en.wikipedia.org/wiki/Pashto_alphabet Balochi: https://en.wikipedia.org/wiki/Balochi_Standard_Alphabet Which all use a script similar to Urdu/Farsi/Arabic one but with variation that might benefit from a different input method. Of these branah.com has keyboards for Sindhi and Pashto and I can try making input methods based on those. >> +(quail-define-package >> + "urdu-phonetic" "Urdu" "اردو صوتی" >> + `((?a . "a → ا , A → آ , ax → أ , u → ع") >> + (?y . "y → ی , e → ے , i → ئ") >> + (?r . "r → ر , R → ڑ") > > Besides the ` vs ' issue, I doubt that this kind of GUIDANCE is a good > idea. Emacs input methods have a standardized way of showing > candidates and the keys to select them, so I would prefer to stick to > the standardized guidance format instead. In particular, showing the > translations of both upper- and lower-case keys is not a good idea, I > think. I am a native Urdu speaker but I have never typed Urdu seriously until recently which is why I tried to make an input method for it. I think for a phonetic input method such disambiguation from guidance string will be very helpful for me at least while I need these training wheels. So if possible I would like to have it at least for my personal use. But as I said earlier I can't make it work with either ` or '. But once we figure out the other details mentioned above, I will send another patch with standard guidance. Thanks, Rahguzar ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-14 9:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-14 10:53 ` Eli Zaretskii 2023-10-14 11:10 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-10-14 10:53 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 14 Oct 2023 11:50:42 +0200 > > Eli Zaretskii <eliz@gnu.org> writes: > > > I responded to your question on help-gnu-emacs. > > Thanks a lot! But changing ` to ' doesn't seem to make a difference. It works in other input methods, such as chinese-array30, so maybe you should study what they do there. Or maybe there really is a bug in quail.el, because this behavior seems to be rarely if ever used. > > >> 1) Better coverage of Urdu zabta takhti > >> http://www.unicode.org/L2/L2002/02004-uzt.pdf It is a code page > >> developed for Urdu and supposedly was the basis of current Urdu support > >> of Unicode. However I can't figure out exactly what is the mapping from > >> UZT to Unicode. If anyone has pointers please share. > > > > What are the specific issues you cannot figure out? > > The paper I referenced describes the UZT code page but it is uses hand > drawn characters and I can't figure out what what Unicode code points > those characters correspond to. The shapes should tell you. But I asked about specific issues. Are you saying that you are unable to track the mapping of _all_ the characters between UZT and Unicode? > > Anyway, a better place to ask about Unicode mapping is on the Unicode > > mailing list, unicode@corp.unicode.org. > > Thanks, I will ask there. That's probably the best. > >> 2) Another input method for the common Urdu keyboard support. Despite > >> Urdu being my mother tongue I never learned to type in it which is why I > >> prefer a phonetic keyboard. However I will like to make an input method > >> with the layout of a physical Urdu keyboard. If a keyboard layout was > >> standardized in Pakistan or India, I can't find the specification. If > >> such a document exists and anyone can point me to it, I will be happy to > >> use it as a basis for addition to the `urdu.el` in attached patch. > >> Otherwise I will use the layout of Urdu keyboard from some free software > >> project. But this will probably be closer to Emacs 30 than now. > > > > Does https://www.branah.com/urdu help? > > I found that keyboard, but I also wanted to see if there was some > institutional standardization in Pakistan or India so as to find a > canonical resource. Web searches didn't reveal anything so if nothing > comes up, I will go with the one found on that page. OK. > However I don't find the phonetic keyboard there that useful since it > has to put every character on one key. Using a combination of two > keys which Emacs can do is more systematic and easy to remember (at > least for me). We could have both an input method reflected in the keyboard on that page and what you think is a better way. There are no limitations. > >> 3) The key for 'w' is unused in the input method for now. I am tempted > >> to bind a version of `insert-char` but restricted to Arabic range of > >> Unicode to cover the rare cases not covered by the input method now. Any > >> opinions about that? > > > > That key is assigned characters in the above keyboard page. > > This was for the input method in the attached file which is my attempt at > building a phonetic input method for Urdu taking some inspiration from > farsi-transliterate-banan in Emacs. > > However if you and other maintainers prefer to replicate more widely used > keyboards (e.g. those on mobile devices) I will provide them instead. I think it is best to support the layouts shown on the Internet, but we could also have alternative input methods with other layouts, to let users pick what they like best. > >> lisp/leim/quail/urdu.el | 193 ++++++++++++++++++++++++++++++++++++++++ > >> 1 file changed, 193 insertions(+) > >> create mode 100644 lisp/leim/quail/urdu.el > > > > Thanks, but I'd prefer not to create a new file. How about adding > > this to persian.el instead? > > That is an option and another better one might be indian.el which is > where input methods for languages from Indo-Pakistan subcontinent are > now. Adding to indian.el is fine by me. > Another consideration for where it should go is that other major > languages in Pakistan are also not represented among input methods. > These include Punjabi (which I can speak a little but not write) which > has two scripts: Emacs has a input methods for gurmukhi but not > shahmukhi https://en.wikipedia.org/wiki/Shahmukhi , although Wikipedia > indicates that an Urdu input method should be sufficient. There are also > > Saraiki: https://en.wikipedia.org/wiki/Saraiki_language > Sindhi: https://en.wikipedia.org/wiki/Sindhi_language > Pashto: https://en.wikipedia.org/wiki/Pashto_alphabet > Balochi: https://en.wikipedia.org/wiki/Balochi_Standard_Alphabet > > Which all use a script similar to Urdu/Farsi/Arabic one but with > variation that might benefit from a different input method. If you intend to work on these other scripts soon, we could start a new file for languages in Pakistan. What I would like to avoid is having a separate file with just one or two methods, if for some reason the rest will never materialize in Emacs. > >> +(quail-define-package > >> + "urdu-phonetic" "Urdu" "اردو صوتی" > >> + `((?a . "a → ا , A → آ , ax → أ , u → ع") > >> + (?y . "y → ی , e → ے , i → ئ") > >> + (?r . "r → ر , R → ڑ") > > > > Besides the ` vs ' issue, I doubt that this kind of GUIDANCE is a good > > idea. Emacs input methods have a standardized way of showing > > candidates and the keys to select them, so I would prefer to stick to > > the standardized guidance format instead. In particular, showing the > > translations of both upper- and lower-case keys is not a good idea, I > > think. > > I am a native Urdu speaker but I have never typed Urdu seriously until > recently which is why I tried to make an input method for it. I think > for a phonetic input method such disambiguation from guidance string > will be very helpful for me at least while I need these training wheels. > So if possible I would like to have it at least for my personal use. But > as I said earlier I can't make it work with either ` or '. I suggest to try similar input methods, for example tamil-phonetic. I find this guidance very simple to use and understand, so I think we should try to stick to it where possible. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-14 10:53 ` Eli Zaretskii @ 2023-10-14 11:10 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 12:36 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-14 11:10 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: > It works in other input methods, such as chinese-array30, so maybe you > should study what they do there. Or maybe there really is a bug in > quail.el, because this behavior seems to be rarely if ever used. > Thanks, I will experiment. > But I asked about specific issues. Are you saying that you are unable > to track the mapping of _all_ the characters between UZT and Unicode? Yes, that is that I was trying to say. I will try the Unicode mailing list as you suggested. > I think it is best to support the layouts shown on the Internet, but > we could also have alternative input methods with other layouts, to > let users pick what they like best. Ok, I will add three input methods, two from the internet and another one close to what I sent earlier. > If you intend to work on these other scripts soon, we could start a > new file for languages in Pakistan. What I would like to avoid is > having a separate file with just one or two methods, if for some > reason the rest will never materialize in Emacs. > I do want to work on adding input methods for at least Sindhi and Pashto. I don't speak them but there are keyboard available on-line so I can copy them. I think I should be able to do that within a couple of months. > I suggest to try similar input methods, for example tamil-phonetic. I > find this guidance very simple to use and understand, so I think we > should try to stick to it where possible. Thanks, I will experiment, change the file to pakistan.el and send the updated patch in a week or so. Another question: will the input methods be available in 29.2 if added in time or in Emacs 30? Thanks a lot for help, Rahguzar ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-14 11:10 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-14 12:36 ` Eli Zaretskii 2023-10-21 18:59 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-10-14 12:36 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 14 Oct 2023 13:10:36 +0200 > > Another question: will the input methods be available in 29.2 if added > in time or in Emacs 30? In general, Emacs 30 is a more practical goal, although if you succeed to do this quickly enough, we could also consider adding this to Emacs 29.2. But (barring any unforeseen problems) Emacs 29.2 should be out fairly soon-ish, so I wouldn't recommend trying to rush with these changes just to be ready in time. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-14 12:36 ` Eli Zaretskii @ 2023-10-21 18:59 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-22 4:53 ` Eli Zaretskii 2023-10-29 11:51 ` Eli Zaretskii 0 siblings, 2 replies; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-21 18:59 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 [-- Attachment #1: Type: text/plain, Size: 1999 bytes --] Hi Eli, I have attached a new patch with this email containing 5 input methods. 3 of them for Urdu and 1 each for Pashto and Sindhi. Two of Urdu input methods correspond to the two keyboards at https://www.branah.com/urdu and the Pashto and Sindhi input methods follow keyboard layouts from the same page. The remaining input method roughly corresponds to the one I sent before. The changes are: 1) Translations are customizable. 2) Numerals can be Arabic or Roman depending on a customizable variable. This is because both are routinely used in Urdu text. 3) There are a bunch of prefixes which are customizable. Some of these prefixes are for inputting characters from Balochi, Brahui, Hindko, Pashto, Saraiki and Sindhi. After including Punjabi which can be inputted using the same characters as Urdu (along with maybe one character from Saraiki) this covers all characters from all languages spoken by more than 1% of people in Pakistan according to Wikipedia https://en.wikipedia.org/wiki/Languages_of_Pakistan . In (not too distant) future I would also like to add keyboard layouts for Balochi and Saraiki. I cannot speak these languages but I can find some keyboard layouts on internet, e.g. https://keymanweb.com/#skr-arab,Keyboard_saraiki https://keymanweb.com/#bal,Keyboard_balochi_phonetic Are there any copyright issues to be aware of in using the layouts from web? Another question: For the customize types, I have opted for character as the type of a translation. I think it is the most convenient choice for someone wanting to customize. However it is not most general type quail allows. Is there any opinion on what the type should be? Lastly customizing these variables has the potential to shadow some translations. For this I would like to add a check to the setter functions that checks for that and raises a warning if such a shadowing occurs. Is there a standard customize way of raising such a warning? Please let me know of any changes to be made. Thanks, Rahguzar [-- Attachment #2: 0001-Input-methods-for-Urdu-Pashto-and-Sindhi.patch --] [-- Type: text/x-patch, Size: 17492 bytes --] From f65a94261c15eb004a522827656e157b8f9fd944 Mon Sep 17 00:00:00 2001 From: Rahguzar <rahguzar@zohomail.eu> Date: Sat, 21 Oct 2023 20:57:21 +0200 Subject: [PATCH] Input methods for Urdu, Pashto and Sindhi --- lisp/leim/quail/pakistan.el | 700 ++++++++++++++++++++++++++++++++++++ 1 file changed, 700 insertions(+) create mode 100644 lisp/leim/quail/pakistan.el diff --git a/lisp/leim/quail/pakistan.el b/lisp/leim/quail/pakistan.el new file mode 100644 index 00000000000..9f969ba6719 --- /dev/null +++ b/lisp/leim/quail/pakistan.el @@ -0,0 +1,700 @@ +;;; pakistan.el --- Input methods for some languages from Pakistan -*- lexical-binding: t; -*- +;; +;; Copyright (C) 2023 Free Software Foundation, Inc. + +;; Author: Rahguzar <rahguzar@zohomail.eu> +;; Keywords: convenience, multilingual, input method, Urdu, Balochi, Pashto, Sindhi, Hindko, Brahui +;; +;; This file is part of 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 3 of the License, 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. If not, see <https://www.gnu.org/licenses/>. +;; +;;; Commentary: +;; Provides a semi-phonetic input method for Urdu +;; +;;; Code: +(require 'quail) + +;;;; Urdu Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/urdu +(quail-define-package + "urdu-keyboard" "Urdu" "اردو تختی" t + "Input method for Urdu. +Uses keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ط) + ("w" ?ص) + ("e" ?ھ) + ("r" ?د) + ("t" ?ٹ) + ("y" ?پ) + ("u" ?ت) + ("i" ?ب) + ("o" ?ج) + ("p" ?ح) + ("a" ?م) + ("s" ?و) + ("d" ?ر) + ("f" ?ن) + ("g" ?ل) + ("h" ?ہ) + ("j" ?ا) + ("k" ?ک) + ("l" ?ی) + ("z" ?ق) + ("x" ?ف) + ("c" ?ے) + ("v" ?س) + ("b" ?ش) + ("n" ?غ) + ("m" ?ع) + ("Q" ?ظ) + ("W" ?ض) + ("E" ?ذ) + ("R" ?ڈ) + ("T" ?ث) + ("Y" ?ّ) + ("U" ?ۃ) + ("I" ?ـ) + ("O" ?چ) + ("P" ?خ) + ("A" ?ژ) + ("S" ?ز) + ("D" ?ڑ) + ("F" ?ں) + ("G" ?ۂ) + ("H" ?ء) + ("J" ?آ) + ("K" ?گ) + ("L" ?ي) + ("C" ?ۓ) + ("B" ?ؤ) + ("N" ?ئ) + ("[" ?\]) + ("]" ?\[) + ("{" ?}) + ("}" ?{) + (";" ?؛) + ("." ?۔) + ("," ?،) + ("?" ?؟)) + +;;;;; Phonetic Keyboard +(quail-define-package + "urdu-phonetic-keyboard" "Urdu" "اردو صوتی" t + "Input method for Urdu. +Uses phonetic keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?و) + ("e" ?ع) + ("r" ?ر) + ("t" ?ت) + ("y" ?ے) + ("u" ?ء) + ("i" ?ی) + ("o" ?ہ) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ح) + ("j" ?ج) + ("k" ?ک) + ("l" ?ل) + ("z" ?ز) + ("x" ?ش) + ("c" ?چ) + ("v" ?ط) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?ْ) + ("W" ?ٔ) + ("E" ?ٰ) + ("R" ?ڑ) + ("T" ?ٹ) + ("Y" ?َ) + ("U" ?ئ) + ("I" ?ِ) + ("O" ?ۃ) + ("P" ?ُ) + ("A" ?آ) + ("S" ?ص) + ("D" ?ڈ) + ("F" ?أ) + ("G" ?غ) + ("H" ?ھ) + ("J" ?ض) + ("K" ?خ) + ("L" ?ٖ) + ("Z" ?ذ) + ("X" ?ژ) + ("C" ?ث) + ("V" ?ظ) + ("B" ?ً) + ("N" ?ں) + ("M" ?ّ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?؏) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?ؑ) + ("*" ?ؐ) + ("(" ?\)) + (")" ?\() + ("=" ?+) + (";" ?؛) + ("\\" ?÷) + ("|" ?x) + ("," ?،) + ("." ?۔) + ("<" ?ٗ) + (">" ?.) + ("?" ?؟) + ("[" ?﷽) + ("]" ?ﷲ) + ("{" ?ﷺ)) + +;;;;; Customizable Input Method +;;;;;; Helper functions +(defun pakistan--define-quail-rules (rules &optional prefix package) + "Define the rules for an input method. +PACKAGE determines the input method and defaults to `urdu-custom'. +RULES is the list of rules to define, see `quail-define-rules' for details. If +non-nil PREFIX is a string that is added to prefix to each string in RULES. +PREFIX can be a symbol in which case it is looked up in `pakistan-urdu-prefixes' +to obtain the string." + (setq package (or package "urdu-custom")) + (when (and prefix (symbolp prefix)) + (setq prefix (car (alist-get prefix pakistan-urdu-prefixes)))) + (dolist (rule rules) + (quail-defrule (concat prefix (car rule)) (cadr rule) package))) + +(defun pakistan--make-setter (&optional prefix package) + "Retrun the setter function. +The function add rules to PACKAGE with PREFIX." + (lambda (var val) + (set-default-toplevel-value var val) + (pakistan--define-quail-rules val prefix package) + (when (equal current-input-method (quail-name)) + (activate-input-method current-input-method)))) + +(defun pakistan--regenerate-translations () + "Regenerate the translations for urdu-custom input method." + (quail-install-map '(nil) "urdu-custom") + (pakistan--define-quail-rules pakistan-urdu-translations) + (pakistan--define-quail-rules + pakistan-urdu-diacritics-and-other-symbols 'diacritics) + (pakistan--define-quail-rules pakistan-urdu-poetic-symbols 'poetic) + (pakistan--define-quail-rules pakistan-urdu-religious-symbols 'religious) + (pakistan--define-quail-rules pakistan-extra-balochi-translations 'balochi-brahui) + (pakistan--define-quail-rules pakistan-extra-pashto-translations 'pashto) + (pakistan--define-quail-rules pakistan-extra-saraiki-translations 'saraiki-hindko) + (pakistan--define-quail-rules pakistan-extra-sindhi-translations 'sindhi)) + +(defun pakistan--set-prefixes (var val) + "Setter function for `pakistan-urdu-prefixes'. +VAR should be `pakistan-urdu-prefixes' and VAL is value to be set." + (set-default-toplevel-value var val) + (when (boundp 'pakistan-urdu-translations) + (pakistan--regenerate-translations))) + +(defun pakistan--set-numeral-translations (var val) + "Add translations for digits. +VAR should be `pakistan-urdu-use-roman-digits' and VAL its value." + (set-default-toplevel-value var val) + (if val + (pakistan--regenerate-translations) + (pakistan--define-quail-rules + '(("0" ?۰) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("%" ?٪))))) + +;;;;;; Package definition +(quail-define-package + "urdu-custom" "Urdu" "اردو انفر۱دی" t + "Intuitive and customizable transl input method for Urdu. +By default this input method doesn't try to follow the common romanization of Urdu +very closely. The reason for this is allow to for input efficiency. It works as +follows: + +1) All lower case letters on QWERTY keyboard are translated to an urdu +character. When more than one Urdu letter corresponds to the same Roman letter, +the most common Urdu letter has been chosen. The frequency analysis was done +on the basis of Urdu word list at +https://github.com/urduhack/urdu-words/blob/master/words.txt +As a result some of the translations are: +h → ہ +s → س , c → ص +z → ز + +2) For the next common letter the uppercase English letter is used, e.g. +r → ر , R → ڑ +n → ن , N → ں + +3) The letter x is used for postfix completions. There are two subcases: +3a) When more than two urdu letter map to the same roman letter, +e.g. +t → ت, T → ٹ , tx → ط , Tx → ۃ +h → ہ , H → ھ , hx → ح , Hx → ۂ +s → س , c → ص , sx → ش , S → ث , cx → چ +z → ز , Z → ض, zx → ذ , Zx → ظ +3b) The urdu letters that are commonly romanized by a English letter + h +can be obtained by the same English letter + x i.e. +gx → غ , cx → چ, kx → خ , sx → ش + +4) Y → ژ is somewhat of an abberation. All four of z, Z, zx and Zx which are +used by more common letters. Y is used for ژ because it is sometimes pronounced +close to Y for some European languages. + +These translations can be changed by customizing `pakistan-urdu-translations'. + +5) o is used for prefix completion of diacrtics or اعر۱ب as well as some +poetic and religious symbols. The most common three diacritics are mapped to +oa → zabr (a for above) +ob → zer (b for below) +oo → pesh (o for the circle in pesh) + +6) The poetic symbols are also available under G (for غزل), while religious +symbols are also available under M (for مزہب). + +7) Characters from Balochi, Brahui Pashto, Saraiki and Sindhi which are not +part of Urdu alphabet can also be input. Each set of these sets correspond to a +different prefixes. See `pakistan-urdu-prefixes' for the prefixes. + +The translations and the prefixes described above can be customized. Various +customization options can be found under the customization group +`pakistan-urdu-input'." + nil t t t t nil nil nil nil nil t) + +;;;;;; Customizations +(defgroup pakistan-urdu-input nil + "Customization group for Urdu input methods." + :group 'quail) + +(defcustom pakistan-urdu-prefixes + '((diacritics "o") + (poetic "G") + (religious "M") + (balochi-brahui "B") + (pashto "P") + (sindhi "C") + (saraiki-hindko "X")) + "Prefixes for `urdu-custom' input method." + :set #'pakistan--set-prefixes + :type '(repeat (list symbol string)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-translations + '(("a" ?ا) + ("y" ?ی) + ("r" ?ر) + ("n" ?ن) + ("v" ?و) + ("m" ?م) + ("t" ?ت) + ("l" ?ل) + ("k" ?ک) + ("b" ?ب) + ("d" ?د) + ("h" ?ہ) + ("s" ?س) + ("H" ?ھ) + ("p" ?پ) + ("N" ?ں) + ("g" ?گ) + ("sx" ?ش) + ("j" ?ج) + ("T" ?ٹ) + ("f" ?ف) + ("cx" ?چ) + ("z" ?ز) + ("u" ?ع) + ("q" ?ق) + ("kx" ?خ) + ("e" ?ے) + ("E" ?ۓ) + ("hx" ?ح) + ("i" ?ئ) + ("R" ?ڑ) + ("tx" ?ط) + ("c" ?ص) + ("D" ?ڈ) + ("gx" ?غ) + ("A" ?آ) + ("Z" ?ض) + ("V" ?ؤ) + ("zx" ?ذ) + ("S" ?ث) + ("Zx" ?ظ) + ("Hx" ?ۂ) + ("ix" ?ء) + ("Tx" ?ۃ) + ("Y" ?ژ) + ("ax" ?أ) + ("." ?۔) + ("," ?،) + (";" ?؛) + ("?" ?؟)) + "Translations for Urdu characters, digits and common punctuations." + :set (pakistan--make-setter) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-diacritics-and-other-symbols + '(("a" ?َ) ;; zabar زبر + ("b" ?ِ) ;; zer زير + ("o" ?ُ) ;; pesh پيش + ("j" ?ْ) ;; jazam جزم + ("S" ?ّ) ;; tashdid تشدید + ("k" ?ٰ) ;; khari zabar کھڑی زبر + ("u" ?٘) ;; ulti jazm الٹی جزم + ("s" ?؎) + ("m" ?؏) + ("t" ?ؔ) + ("c" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("A" ?ؑ)) + "Translations to input Urdu diacrtics. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'diacritics) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-poetic-symbols + '(("s" ?؎) + ("m" ?؏) + ("t" ?ؔ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'poetic) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-religious-symbols + '(("s" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("a" ?ؑ) + ("A" ?ﷲ) + ("S" ?ﷺ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'religious) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +;; I don't understand how many of these letters are pronounced. +;; So better translations are welcome. +(defcustom pakistan-extra-balochi-brahui-translations + '(("v" ?ۏ) + ("y" ?ݔ) +;; Brahui + ("l" ?ڷ)) + "Translations to input Balochi and Brahui letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'balochi-brahui) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-pashto-translations + '(("t" ?ټ) + ("d" ?ډ) + ("r" ?ړ) + ("n" ?ڼ) + ("s" ?ښ) + ("R" ?ږ) + ("h" ?څ) + ("H" ?ځ)) + "Translations to input Pashto letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'pashto) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-sindhi-translations + '(("k" ?ڪ) + ("j" ?ڄ) + ("t" ?ٺ) + ("T" ?ٽ) + ("tx" ?ٿ) + ("b" ?ٻ) + ("B" ?ڀ) + ("r" ?ڙ) + ("d" ?ڌ) + ("D" ?ڏ) + ("dx" ?ڊ) + ("Dx" ?ڍ) + ("h" ?ڃ) + ("c" ?ڇ) + ("p" ?ڦ) + ("n" ?ڻ) + ("g" ?ڳ) + ("G" ?ڱ)) + "Translations to input Sindhi letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'sindhi) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-saraiki-hindko-translations + '(("b" ?ٻ) + ("h" ?ڄ) + ("g" ?ڳ) + ("d" ?ݙ) + ("n" ?ݨ) +;; Hindko + ("r" ?ݬ) + ("v" ?ڨ) + ("N" ?ݩ) + ("V" ?ٷ)) +"Translations to input Saraiki letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'" + :set (pakistan--make-setter 'saraiki-hindko) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-use-roman-digits + nil + "Whether urdu-custom input method should use roman digits." + :set #'pakistan--set-numeral-translations + :type 'boolean + :group 'pakistan-urdu-input) + +;;;; Sindhi Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/sindhi +(quail-define-package + "sindhi-keyboard" "Sindhi" "سِنڌِي" t + "Input method for Sindhi. +Uses keyboard layout from https://www.branah.com/sindhi" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?ص) + ("e" ?ي) + ("r" ?ر) + ("t" ?ت) + ("y" ?ٿ) + ("u" ?ع) + ("i" ?ڳ) + ("o" ?و) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ه) + ("j" ?ج) + ("k" ?ڪ) + ("l" ?ل) + ("z" ?ز) + ("x" ?خ) + ("c" ?ط) + ("v" ?ڀ) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?َ) + ("W" ?ض) + ("E" ?ِ) + ("R" ?ڙ) + ("T" ?ٽ) + ("Y" ?ث) + ("U" ?غ) + ("I" ?ھ) + ("O" ?ُ) + ("P" ?ڦ) + ("A" ?آ) + ("S" ?ش) + ("D" ?ڊ) + ("F" ?ڦ) + ("G" ?ً) + ("H" ?ح) + ("J" ?ٍ) + ("K" ?ۡ) + ("L" ?:) + ("Z" ?ذ) + ("X" ?ّ) + ("C" ?ظ) + ("V" ?ء) + ("B" ?ٻ) + ("N" ?ڻ) + ("M" ?۾) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?’) + ("-" ?ڏ) + ("=" ?ڌ) + ("~" ?‘) + ("@" ?ى) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?۽) + ("*" ?ؤ) + ("(" ?\)) + (")" ?\() + ("[" ?ڇ) + ("]" ?چ) + ("{" ?ڃ) + ("}" ?ڄ) + (";" ?ک) + ("'" ?ڱ) + ("\\" ?ڍ) + (":" ?؛) + ("|" ?ٺ) + ("," ?،) + ("/" ?ئ) + ("<" ?“) + (">" ?”) + ("?" ?؟)) + + +;;;; Pashto Input Methods +;;;;; Keyboard +(quail-define-package + "pashto-keyboard" "Pashto" "پښتو" t + "Input method for Pashto. +Uses keyboard layout from https://www.branah.com/pashto" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ض) + ("w" ?ص) + ("e" ?ث) + ("r" ?ق) + ("t" ?ف) + ("y" ?غ) + ("u" ?ع) + ("i" ?ه) + ("o" ?خ) + ("p" ?ح) + ("a" ?ش) + ("s" ?س) + ("d" ?ی) + ("f" ?ب) + ("g" ?ل) + ("h" ?ا) + ("j" ?ت) + ("k" ?ن) + ("l" ?م) + ("z" ?ۍ) + ("x" ?ې) + ("c" ?ز) + ("v" ?ر) + ("b" ?ذ) + ("n" ?د) + ("m" ?ړ) + ("Q" ?ْ) + ("W" ?ٌ) + ("E" ?ٍ) + ("R" ?ً) + ("T" ?ُ) + ("Y" ?ِ) + ("U" ?َ) + ("I" ?ّ) + ("O" ?څ) + ("P" ?ځ) + ("A" ?ښ) + ("S" ?ﺉ) + ("D" ?ي) + ("F" ?پ) + ("G" ?أ) + ("H" ?آ) + ("J" ?ټ) + ("K" ?ڼ) + ("L" ?ة) + ("Z" ?ظ) + ("X" ?ط) + ("C" ?ژ) + ("V" ?ء) + ("B" ?) + ("N" ?ډ) + ("M" ?ؤ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?) + ("~" ?÷) + ("@" ?٬) + ("#" ?٫) + ("%" ?٪) + ("^" ?×) + ("&" ?«) + ("*" ?») + ("_" ?ـ) + ("[" ?ج) + ("]" ?چ) + ("{" ?\[) + ("}" ?\]) + (";" ?ک) + ("'" ?ګ) + ("\"" ?؛) + ("|" ?٭) + ("," ?و) + ("." ?ږ) + ("<" ?،) + (">" ?.) + ("?" ?؟)) + +;;; End Matter +(provide 'pakistan) +;;; pakistan.el ends here -- 2.42.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-21 18:59 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-22 4:53 ` Eli Zaretskii 2023-10-29 11:51 ` Eli Zaretskii 1 sibling, 0 replies; 21+ messages in thread From: Eli Zaretskii @ 2023-10-22 4:53 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 21 Oct 2023 20:59:10 +0200 > > In (not too distant) future I would also like to add keyboard layouts > for Balochi and Saraiki. I cannot speak these languages but I can find > some keyboard layouts on internet, e.g. > https://keymanweb.com/#skr-arab,Keyboard_saraiki > https://keymanweb.com/#bal,Keyboard_balochi_phonetic > > Are there any copyright issues to be aware of in using the layouts > from web? If you only look at the layout and program it into the input method, I don't think there are any legal issues. I will review the patches soon, thanks. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-21 18:59 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-22 4:53 ` Eli Zaretskii @ 2023-10-29 11:51 ` Eli Zaretskii 2023-10-29 16:27 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 1 sibling, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-10-29 11:51 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 21 Oct 2023 20:59:10 +0200 > > I have attached a new patch with this email containing 5 input methods. > 3 of them for Urdu and 1 each for Pashto and Sindhi. Two of Urdu input > methods correspond to the two keyboards at https://www.branah.com/urdu > and the Pashto and Sindhi input methods follow keyboard layouts from the > same page. Thanks. This lacks a ChangeLog-style commit log message (see CONTRIBUTE and "git log" for how we write those). > +;; Layout taken from https://www.branah.com/urdu > +(quail-define-package > + "urdu-keyboard" "Urdu" "اردو تختی" t ^^^^^^^^ Can you come up with a shorter mode-line indicator for this and other input methods? We usually use just 1 or 2 letters for it; you used something much longer. > +(defun pakistan--define-quail-rules (rules &optional prefix package) > + "Define the rules for an input method. Our style is to have the first sentence of a doc string be a summary of what the function does and also mention all the mandatory arguments. I would suggest something like Define rules for a Pakistan input method as determined by RULES. > +(defun pakistan--make-setter (&optional prefix package) > + "Retrun the setter function. ^^^^^^ Typo. > +The function add rules to PACKAGE with PREFIX." ^^^ "adds". > +(defun pakistan--set-numeral-translations (var val) > + "Add translations for digits. This should mention the arguments. > +(quail-define-package > + "urdu-custom" "Urdu" "اردو انفر۱دی" t > + "Intuitive and customizable transl input method for Urdu. > +By default this input method doesn't try to follow the common romanization of Urdu > +very closely. The reason for this is allow to for input efficiency. It works as > +follows: Please try not to use lines longer than 79 characters in doc strings. Thanks. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-29 11:51 ` Eli Zaretskii @ 2023-10-29 16:27 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 8:39 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-29 16:27 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 [-- Attachment #1: Type: text/plain, Size: 2035 bytes --] Hi Eli, Thanks for the review. I have made the changes you asked for, please let me know of other changes need. Eli Zaretskii <eliz@gnu.org> writes: > Thanks. This lacks a ChangeLog-style commit log message (see > CONTRIBUTE and "git log" for how we write those). I have added the commit message with some help from magit. Please let me know if changes to it are needed. > Can you come up with a shorter mode-line indicator for this and other > input methods? We usually use just 1 or 2 letters for it; you used > something much longer. Done now, all of them are now 1 or 2 letters. >> +(defun pakistan--define-quail-rules (rules &optional prefix package) >> + "Define the rules for an input method. > > Our style is to have the first sentence of a doc string be a summary > of what the function does and also mention all the mandatory > arguments. I would suggest something like > > Define rules for a Pakistan input method as determined by RULES. Done, with a slight rewording. >> +(defun pakistan--make-setter (&optional prefix package) >> + "Retrun the setter function. > ^^^^^^ > Typo. Thanks, fixed now. >> +The function add rules to PACKAGE with PREFIX." > ^^^ > "adds". > >> +(defun pakistan--set-numeral-translations (var val) >> + "Add translations for digits. > > This should mention the arguments. It does now but awkwardly. Maybe instead of defining this function, the setter should be lambda? >> +(quail-define-package >> + "urdu-custom" "Urdu" "اردو انفر۱دی" t >> + "Intuitive and customizable transl input method for Urdu. >> +By default this input method doesn't try to follow the common romanization of Urdu >> +very closely. The reason for this is allow to for input efficiency. It works as >> +follows: > > Please try not to use lines longer than 79 characters in doc strings. I have filled the lines in the doc string with a fill column of 78. > Thanks. Thanks for the review, Rahguzar [-- Attachment #2: 0001-Input-methods-for-Urdu-Pashto-and-Sindhi.patch --] [-- Type: text/x-patch, Size: 18572 bytes --] From e2a5f5ce78f3fe0b0f8256f6f2b61412f137200f Mon Sep 17 00:00:00 2001 From: Rahguzar <rahguzar@zohomail.eu> Date: Sun, 29 Oct 2023 17:14:02 +0100 Subject: [PATCH] Input methods for Urdu, Pashto and Sindhi * lisp/leim/quail/pakistan.el (quail): ("urdu-keyboard"): new input method ("urdu-phonetic-keyboard"): new input method ("urdu-custom"): new input method ("sindhi-keyboard"): new input method ("pashto-keyboard"): new input method ; (pakistan--define-quail-rules): helper function ; (pakistan--make-setter): helper function ; (pakistan--regenerate-translations): helper function ; (pakistan--set-prefixes): helper function ; (pakistan--set-numeral-translations): (pakistan-urdu-input): new customization group (pakistan-urdu-prefixes): new custom variable (pakistan-urdu-translations): new custom variable (pakistan-urdu-diacritics-and-other-symbols): new custom var (pakistan-urdu-poetic-symbols): new custom var (pakistan-urdu-religious-symbols): new custom var (pakistan-extra-balochi-brahui-translations): new custom var (pakistan-extra-pashto-translations): new custom var (pakistan-extra-sindhi-translations): new custom var (pakistan-extra-saraiki-hindko-translations): new custom var (pakistan-urdu-use-roman-digits): new custom var (pakistan): new package --- lisp/leim/quail/pakistan.el | 700 ++++++++++++++++++++++++++++++++++++ 1 file changed, 700 insertions(+) create mode 100644 lisp/leim/quail/pakistan.el diff --git a/lisp/leim/quail/pakistan.el b/lisp/leim/quail/pakistan.el new file mode 100644 index 00000000000..25c1c7a08b8 --- /dev/null +++ b/lisp/leim/quail/pakistan.el @@ -0,0 +1,700 @@ +;;; pakistan.el --- Input methods for some languages from Pakistan -*- lexical-binding: t; -*- +;; +;; Copyright (C) 2023 Free Software Foundation, Inc. + +;; Author: Rahguzar <rahguzar@zohomail.eu> +;; Keywords: convenience, multilingual, input method, Urdu, Balochi, Pashto, Sindhi, Hindko, Brahui +;; +;; This file is part of 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 3 of the License, 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. If not, see <https://www.gnu.org/licenses/>. +;; +;;; Commentary: +;; Provides a semi-phonetic input method for Urdu +;; +;;; Code: +(require 'quail) + +;;;; Urdu Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/urdu +(quail-define-package + "urdu-keyboard" "Urdu" "ات" t + "Input method for Urdu. +Uses keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ط) + ("w" ?ص) + ("e" ?ھ) + ("r" ?د) + ("t" ?ٹ) + ("y" ?پ) + ("u" ?ت) + ("i" ?ب) + ("o" ?ج) + ("p" ?ح) + ("a" ?م) + ("s" ?و) + ("d" ?ر) + ("f" ?ن) + ("g" ?ل) + ("h" ?ہ) + ("j" ?ا) + ("k" ?ک) + ("l" ?ی) + ("z" ?ق) + ("x" ?ف) + ("c" ?ے) + ("v" ?س) + ("b" ?ش) + ("n" ?غ) + ("m" ?ع) + ("Q" ?ظ) + ("W" ?ض) + ("E" ?ذ) + ("R" ?ڈ) + ("T" ?ث) + ("Y" ?ّ) + ("U" ?ۃ) + ("I" ?ـ) + ("O" ?چ) + ("P" ?خ) + ("A" ?ژ) + ("S" ?ز) + ("D" ?ڑ) + ("F" ?ں) + ("G" ?ۂ) + ("H" ?ء) + ("J" ?آ) + ("K" ?گ) + ("L" ?ي) + ("C" ?ۓ) + ("B" ?ؤ) + ("N" ?ئ) + ("[" ?\]) + ("]" ?\[) + ("{" ?}) + ("}" ?{) + (";" ?؛) + ("." ?۔) + ("," ?،) + ("?" ?؟)) + +;;;;; Phonetic Keyboard +(quail-define-package + "urdu-phonetic-keyboard" "Urdu" "اص" t + "Input method for Urdu. +Uses phonetic keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?و) + ("e" ?ع) + ("r" ?ر) + ("t" ?ت) + ("y" ?ے) + ("u" ?ء) + ("i" ?ی) + ("o" ?ہ) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ح) + ("j" ?ج) + ("k" ?ک) + ("l" ?ل) + ("z" ?ز) + ("x" ?ش) + ("c" ?چ) + ("v" ?ط) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?ْ) + ("W" ?ٔ) + ("E" ?ٰ) + ("R" ?ڑ) + ("T" ?ٹ) + ("Y" ?َ) + ("U" ?ئ) + ("I" ?ِ) + ("O" ?ۃ) + ("P" ?ُ) + ("A" ?آ) + ("S" ?ص) + ("D" ?ڈ) + ("F" ?أ) + ("G" ?غ) + ("H" ?ھ) + ("J" ?ض) + ("K" ?خ) + ("L" ?ٖ) + ("Z" ?ذ) + ("X" ?ژ) + ("C" ?ث) + ("V" ?ظ) + ("B" ?ً) + ("N" ?ں) + ("M" ?ّ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?؏) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?ؑ) + ("*" ?ؐ) + ("(" ?\)) + (")" ?\() + ("=" ?+) + (";" ?؛) + ("\\" ?÷) + ("|" ?x) + ("," ?،) + ("." ?۔) + ("<" ?ٗ) + (">" ?.) + ("?" ?؟) + ("[" ?﷽) + ("]" ?ﷲ) + ("{" ?ﷺ)) + +;;;;; Customizable Input Method +;;;;;; Helper functions +(defun pakistan--define-quail-rules (rules &optional prefix package) + "Define translations for `urdu-custom' input method as determined by RULES. +PACKAGE determines the input method and defaults to `urdu-custom'. RULES is +the list of rules to define, see `quail-defrule' for details. If non-nil +PREFIX is a string that is prefixed to each string in RULES. PREFIX can be a +symbol in which case it is looked up in `pakistan-urdu-prefixes' to obtain the +string." + (setq package (or package "urdu-custom")) + (when (and prefix (symbolp prefix)) + (setq prefix (car (alist-get prefix pakistan-urdu-prefixes)))) + (dolist (rule rules) + (quail-defrule (concat prefix (car rule)) (cadr rule) package))) + +(defun pakistan--make-setter (&optional prefix package) + "Return the setter function. +The function adds rules to PACKAGE with PREFIX." + (lambda (var val) + (set-default-toplevel-value var val) + (pakistan--define-quail-rules val prefix package) + (when (equal current-input-method (quail-name)) + (activate-input-method current-input-method)))) + +(defun pakistan--regenerate-translations () + "Regenerate the translations for urdu-custom input method." + (quail-install-map '(nil) "urdu-custom") + (pakistan--define-quail-rules pakistan-urdu-translations) + (pakistan--define-quail-rules + pakistan-urdu-diacritics-and-other-symbols 'diacritics) + (pakistan--define-quail-rules pakistan-urdu-poetic-symbols 'poetic) + (pakistan--define-quail-rules pakistan-urdu-religious-symbols 'religious) + (pakistan--define-quail-rules pakistan-extra-balochi-translations 'balochi-brahui) + (pakistan--define-quail-rules pakistan-extra-pashto-translations 'pashto) + (pakistan--define-quail-rules pakistan-extra-saraiki-translations 'saraiki-hindko) + (pakistan--define-quail-rules pakistan-extra-sindhi-translations 'sindhi)) + +(defun pakistan--set-prefixes (var val) + "Setter function for `pakistan-urdu-prefixes'. +VAR should be `pakistan-urdu-prefixes' and VAL is value to be set." + (set-default-toplevel-value var val) + (when (boundp 'pakistan-urdu-translations) + (pakistan--regenerate-translations))) + +(defun pakistan--set-numeral-translations (var val) + "VAR should be `pakistan-urdu-use-roman-digits' and VAL its value. +This is a setter function for the custom-variable." + (set-default-toplevel-value var val) + (if val + (pakistan--regenerate-translations) + (pakistan--define-quail-rules + '(("0" ?۰) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("%" ?٪))))) + +;;;;;; Package definition +(quail-define-package + "urdu-custom" "Urdu" "اا" t + "Intuitive and customizable transl input method for Urdu. +By default this input method doesn't try to follow the common romanization of +Urdu very closely. The reason for this is allow to for input efficiency. It +works as follows: + +1) All lower case letters on QWERTY keyboard are translated to an urdu +character. When more than one Urdu letter corresponds to the same Roman +letter, the most common Urdu letter has been chosen. The frequency analysis +was done on the basis of Urdu word list at +https://github.com/urduhack/urdu-words/blob/master/words.txt As a result some +of the translations are: +h → ہ +s → س , c → ص +z → ز + +2) For the next common letter the uppercase English letter is used, e.g. +r → ر , R → ڑ +n → ن , N → ں + +3) The letter x is used for postfix completions. There are two subcases: +3a) When more than two urdu letter map to the same roman letter, +e.g. +t → ت, T → ٹ , tx → ط , Tx → ۃ +h → ہ , H → ھ , hx → ح , Hx → ۂ +s → س , c → ص , sx → ش , S → ث , cx → چ +z → ز , Z → ض, zx → ذ , Zx → ظ +3b) The urdu letters that are commonly romanized by a English letter + h +can be obtained by the same English letter + x i.e. +gx → غ , cx → چ, kx → خ , sx → ش + +4) Y → ژ is somewhat of an abberation. All four of z, Z, zx and Zx which are +used by more common letters. Y is used for ژ because it is sometimes +pronounced close to Y for some European languages. + +These translations can be changed by customizing `pakistan-urdu-translations'. + +5) o is used for prefix completion of diacrtics or اعر۱ب as well as some +poetic and religious symbols. The most common three diacritics are mapped to +oa → zabr (a for above) +ob → zer (b for below) +oo → pesh (o for the circle in pesh) + +6) The poetic symbols are also available under G (for غزل), while religious +symbols are also available under M (for مزہب). + +7) Characters from Balochi, Brahui Pashto, Saraiki and Sindhi which are not +part of Urdu alphabet can also be input. Each set of these sets correspond to +a different prefixes. See `pakistan-urdu-prefixes' for the prefixes. + +The translations and the prefixes described above can be customized. Various +customization options can be found under the customization group +`pakistan-urdu-input'." + nil t t t t nil nil nil nil nil t) + +;;;;;; Customizations +(defgroup pakistan-urdu-input nil + "Customization group for Urdu input methods." + :group 'quail) + +(defcustom pakistan-urdu-prefixes + '((diacritics "o") + (poetic "G") + (religious "M") + (balochi-brahui "B") + (pashto "P") + (sindhi "C") + (saraiki-hindko "X")) + "Prefixes for `urdu-custom' input method." + :set #'pakistan--set-prefixes + :type '(repeat (list symbol string)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-translations + '(("a" ?ا) + ("y" ?ی) + ("r" ?ر) + ("n" ?ن) + ("v" ?و) + ("m" ?م) + ("t" ?ت) + ("l" ?ل) + ("k" ?ک) + ("b" ?ب) + ("d" ?د) + ("h" ?ہ) + ("s" ?س) + ("H" ?ھ) + ("p" ?پ) + ("N" ?ں) + ("g" ?گ) + ("sx" ?ش) + ("j" ?ج) + ("T" ?ٹ) + ("f" ?ف) + ("cx" ?چ) + ("z" ?ز) + ("u" ?ع) + ("q" ?ق) + ("kx" ?خ) + ("e" ?ے) + ("E" ?ۓ) + ("hx" ?ح) + ("i" ?ئ) + ("R" ?ڑ) + ("tx" ?ط) + ("c" ?ص) + ("D" ?ڈ) + ("gx" ?غ) + ("A" ?آ) + ("Z" ?ض) + ("V" ?ؤ) + ("zx" ?ذ) + ("S" ?ث) + ("Zx" ?ظ) + ("Hx" ?ۂ) + ("ix" ?ء) + ("Tx" ?ۃ) + ("Y" ?ژ) + ("ax" ?أ) + ("." ?۔) + ("," ?،) + (";" ?؛) + ("?" ?؟)) + "Translations for Urdu characters and common punctuations." + :set (pakistan--make-setter) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-diacritics-and-other-symbols + '(("a" ?َ) ;; zabar زبر + ("b" ?ِ) ;; zer زير + ("o" ?ُ) ;; pesh پيش + ("j" ?ْ) ;; jazam جزم + ("S" ?ّ) ;; tashdid تشدید + ("k" ?ٰ) ;; khari zabar کھڑی زبر + ("u" ?٘) ;; ulti jazm الٹی جزم + ("s" ?؎) + ("m" ?؏) + ("t" ?ؔ) + ("c" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("A" ?ؑ)) + "Translations to input Urdu diacrtics. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'diacritics) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-poetic-symbols + '(("s" ?؎) + ("m" ?؏) + ("t" ?ؔ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'poetic) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-religious-symbols + '(("s" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("a" ?ؑ) + ("A" ?ﷲ) + ("S" ?ﷺ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'religious) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +;; I don't understand how many of these letters are pronounced. +;; So better translations are welcome. +(defcustom pakistan-extra-balochi-brahui-translations + '(("v" ?ۏ) + ("y" ?ݔ) +;; Brahui + ("l" ?ڷ)) + "Translations to input Balochi and Brahui letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'balochi-brahui) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-pashto-translations + '(("t" ?ټ) + ("d" ?ډ) + ("r" ?ړ) + ("n" ?ڼ) + ("s" ?ښ) + ("R" ?ږ) + ("h" ?څ) + ("H" ?ځ)) + "Translations to input Pashto letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'pashto) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-sindhi-translations + '(("k" ?ڪ) + ("j" ?ڄ) + ("t" ?ٺ) + ("T" ?ٽ) + ("tx" ?ٿ) + ("b" ?ٻ) + ("B" ?ڀ) + ("r" ?ڙ) + ("d" ?ڌ) + ("D" ?ڏ) + ("dx" ?ڊ) + ("Dx" ?ڍ) + ("h" ?ڃ) + ("c" ?ڇ) + ("p" ?ڦ) + ("n" ?ڻ) + ("g" ?ڳ) + ("G" ?ڱ)) + "Translations to input Sindhi letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'sindhi) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-saraiki-hindko-translations + '(("b" ?ٻ) + ("h" ?ڄ) + ("g" ?ڳ) + ("d" ?ݙ) + ("n" ?ݨ) +;; Hindko + ("r" ?ݬ) + ("v" ?ڨ) + ("N" ?ݩ) + ("V" ?ٷ)) +"Translations to input Saraiki letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'saraiki-hindko) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-use-roman-digits + nil + "Whether urdu-custom input method should use roman digits." + :set #'pakistan--set-numeral-translations + :type 'boolean + :group 'pakistan-urdu-input) + +;;;; Sindhi Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/sindhi +(quail-define-package + "sindhi-keyboard" "Sindhi" "سِ" t + "Input method for Sindhi. +Uses keyboard layout from https://www.branah.com/sindhi ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?ص) + ("e" ?ي) + ("r" ?ر) + ("t" ?ت) + ("y" ?ٿ) + ("u" ?ع) + ("i" ?ڳ) + ("o" ?و) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ه) + ("j" ?ج) + ("k" ?ڪ) + ("l" ?ل) + ("z" ?ز) + ("x" ?خ) + ("c" ?ط) + ("v" ?ڀ) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?َ) + ("W" ?ض) + ("E" ?ِ) + ("R" ?ڙ) + ("T" ?ٽ) + ("Y" ?ث) + ("U" ?غ) + ("I" ?ھ) + ("O" ?ُ) + ("P" ?ڦ) + ("A" ?آ) + ("S" ?ش) + ("D" ?ڊ) + ("F" ?ڦ) + ("G" ?ً) + ("H" ?ح) + ("J" ?ٍ) + ("K" ?ۡ) + ("L" ?:) + ("Z" ?ذ) + ("X" ?ّ) + ("C" ?ظ) + ("V" ?ء) + ("B" ?ٻ) + ("N" ?ڻ) + ("M" ?۾) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?’) + ("-" ?ڏ) + ("=" ?ڌ) + ("~" ?‘) + ("@" ?ى) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?۽) + ("*" ?ؤ) + ("(" ?\)) + (")" ?\() + ("[" ?ڇ) + ("]" ?چ) + ("{" ?ڃ) + ("}" ?ڄ) + (";" ?ک) + ("'" ?ڱ) + ("\\" ?ڍ) + (":" ?؛) + ("|" ?ٺ) + ("," ?،) + ("/" ?ئ) + ("<" ?“) + (">" ?”) + ("?" ?؟)) + + +;;;; Pashto Input Methods +;;;;; Keyboard +(quail-define-package + "pashto-keyboard" "Pashto" "پ" t + "Input method for Pashto. +Uses keyboard layout from https://www.branah.com/pashto ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ض) + ("w" ?ص) + ("e" ?ث) + ("r" ?ق) + ("t" ?ف) + ("y" ?غ) + ("u" ?ع) + ("i" ?ه) + ("o" ?خ) + ("p" ?ح) + ("a" ?ش) + ("s" ?س) + ("d" ?ی) + ("f" ?ب) + ("g" ?ل) + ("h" ?ا) + ("j" ?ت) + ("k" ?ن) + ("l" ?م) + ("z" ?ۍ) + ("x" ?ې) + ("c" ?ز) + ("v" ?ر) + ("b" ?ذ) + ("n" ?د) + ("m" ?ړ) + ("Q" ?ْ) + ("W" ?ٌ) + ("E" ?ٍ) + ("R" ?ً) + ("T" ?ُ) + ("Y" ?ِ) + ("U" ?َ) + ("I" ?ّ) + ("O" ?څ) + ("P" ?ځ) + ("A" ?ښ) + ("S" ?ﺉ) + ("D" ?ي) + ("F" ?پ) + ("G" ?أ) + ("H" ?آ) + ("J" ?ټ) + ("K" ?ڼ) + ("L" ?ة) + ("Z" ?ظ) + ("X" ?ط) + ("C" ?ژ) + ("V" ?ء) + ("B" ?) + ("N" ?ډ) + ("M" ?ؤ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?) + ("~" ?÷) + ("@" ?٬) + ("#" ?٫) + ("%" ?٪) + ("^" ?×) + ("&" ?«) + ("*" ?») + ("_" ?ـ) + ("[" ?ج) + ("]" ?چ) + ("{" ?\[) + ("}" ?\]) + (";" ?ک) + ("'" ?ګ) + ("\"" ?؛) + ("|" ?٭) + ("," ?و) + ("." ?ږ) + ("<" ?،) + (">" ?.) + ("?" ?؟)) + +;;; End Matter +(provide 'pakistan) +;;; pakistan.el ends here -- 2.42.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-10-29 16:27 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 8:39 ` Eli Zaretskii 2023-11-04 8:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-11-04 8:39 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sun, 29 Oct 2023 17:27:38 +0100 > > Thanks for the review. I have made the changes you asked for, please > let me know of other changes need. Below. > Subject: [PATCH] Input methods for Urdu, Pashto and Sindhi > > * lisp/leim/quail/pakistan.el (quail): > ("urdu-keyboard"): new input method > ("urdu-phonetic-keyboard"): new input method > ("urdu-custom"): new input method > ("sindhi-keyboard"): new input method > ("pashto-keyboard"): new input method These should be brought together, and the description should start with a capitalized letter and end with a period. Like this: * lisp/leim/quail/pakistan.el ("urdu-keyboard") ("urdu-phonetic-keyboard", "urdu-custom", "sindhi-keyboard") ("pashto-keyboard"): New input methods > ; (pakistan--define-quail-rules): helper function > ; (pakistan--make-setter): helper function > ; (pakistan--regenerate-translations): helper function > ; (pakistan--set-prefixes): helper function > ; (pakistan--set-numeral-translations): Why are there semi-colons here? > (pakistan-urdu-input): new customization group > (pakistan-urdu-prefixes): new custom variable > (pakistan-urdu-translations): new custom variable > (pakistan-urdu-diacritics-and-other-symbols): new custom var > (pakistan-urdu-poetic-symbols): new custom var > (pakistan-urdu-religious-symbols): new custom var > (pakistan-extra-balochi-brahui-translations): new custom var > (pakistan-extra-pashto-translations): new custom var > (pakistan-extra-sindhi-translations): new custom var > (pakistan-extra-saraiki-hindko-translations): new custom var > (pakistan-urdu-use-roman-digits): new custom var > (pakistan): new package This should again be a single entry about multiple variables, since they all share the same description: "New custom variable". While compiling this, I get byte-compiler warnings: In pakistan--define-quail-rules: leim/quail/pakistan.el:199:41: Warning: reference to free variable `pakistan-urdu-prefixes' In pakistan--regenerate-translations: leim/quail/pakistan.el:215:33: Warning: reference to free variable `pakistan-urdu-translations' leim/quail/pakistan.el:217:4: Warning: reference to free variable `pakistan-urdu-diacritics-and-other-symbols' leim/quail/pakistan.el:218:33: Warning: reference to free variable `pakistan-urdu-poetic-symbols' leim/quail/pakistan.el:219:33: Warning: reference to free variable `pakistan-urdu-religious-symbols' leim/quail/pakistan.el:220:33: Warning: reference to free variable `pakistan-extra-balochi-translations' leim/quail/pakistan.el:221:33: Warning: reference to free variable `pakistan-extra-pashto-translations' leim/quail/pakistan.el:222:33: Warning: reference to free variable `pakistan-extra-saraiki-translations' leim/quail/pakistan.el:223:33: Warning: reference to free variable `pakistan-extra-sindhi-translations' ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 8:39 ` Eli Zaretskii @ 2023-11-04 8:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 9:27 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 8:50 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: > These should be brought together, and the description should start > with a capitalized letter and end with a period. Like this: > > * lisp/leim/quail/pakistan.el ("urdu-keyboard") > ("urdu-phonetic-keyboard", "urdu-custom", "sindhi-keyboard") > ("pashto-keyboard"): New input methods I will fix this and the other entries of the changelog in the next version of the patch. >> ; (pakistan--define-quail-rules): helper function >> ; (pakistan--make-setter): helper function >> ; (pakistan--regenerate-translations): helper function >> ; (pakistan--set-prefixes): helper function >> ; (pakistan--set-numeral-translations): > > Why are there semi-colons here? > I thought these internal helper functions should be omitted from the generated changelog. If not I will correct this too. > While compiling this, I get byte-compiler warnings: > > In pakistan--define-quail-rules: > leim/quail/pakistan.el:199:41: Warning: reference to free variable `pakistan-urdu-prefixes' > > In pakistan--regenerate-translations: > leim/quail/pakistan.el:215:33: Warning: reference to free variable `pakistan-urdu-translations' > leim/quail/pakistan.el:217:4: Warning: reference to free variable `pakistan-urdu-diacritics-and-other-symbols' > leim/quail/pakistan.el:218:33: Warning: reference to free variable `pakistan-urdu-poetic-symbols' > leim/quail/pakistan.el:219:33: Warning: reference to free variable `pakistan-urdu-religious-symbols' > leim/quail/pakistan.el:220:33: Warning: reference to free variable `pakistan-extra-balochi-translations' > leim/quail/pakistan.el:221:33: Warning: reference to free variable `pakistan-extra-pashto-translations' > leim/quail/pakistan.el:222:33: Warning: reference to free variable `pakistan-extra-saraiki-translations' > leim/quail/pakistan.el:223:33: Warning: reference to free variable `pakistan-extra-sindhi-translations' The byte compiler warnings are harmless in that the code referencing those variables is run only after the variable is defined. The `urdu-custom` input method is generated based on these customs variables. However what the setter of one custom variable should do depends on the value of the others which makes initializing them a little complicated. The only way I see of silencing the warnings is to use `defvar` to define the variables, then define the setters which references these variables. Is this preferable to the current state? Thanks, Rahguzar ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 8:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 9:27 ` Eli Zaretskii 2023-11-04 10:56 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-11-04 9:27 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 04 Nov 2023 09:50:04 +0100 > > >> ; (pakistan--define-quail-rules): helper function > >> ; (pakistan--make-setter): helper function > >> ; (pakistan--regenerate-translations): helper function > >> ; (pakistan--set-prefixes): helper function > >> ; (pakistan--set-numeral-translations): > > > > Why are there semi-colons here? > > > > I thought these internal helper functions should be omitted from the > generated changelog. If not I will correct this too. We only omit entire commit log messages, not selected portions of them. So in this case, these semi-colons should be removed. > > While compiling this, I get byte-compiler warnings: > > > > In pakistan--define-quail-rules: > > leim/quail/pakistan.el:199:41: Warning: reference to free variable `pakistan-urdu-prefixes' > > > > In pakistan--regenerate-translations: > > leim/quail/pakistan.el:215:33: Warning: reference to free variable `pakistan-urdu-translations' > > leim/quail/pakistan.el:217:4: Warning: reference to free variable `pakistan-urdu-diacritics-and-other-symbols' > > leim/quail/pakistan.el:218:33: Warning: reference to free variable `pakistan-urdu-poetic-symbols' > > leim/quail/pakistan.el:219:33: Warning: reference to free variable `pakistan-urdu-religious-symbols' > > leim/quail/pakistan.el:220:33: Warning: reference to free variable `pakistan-extra-balochi-translations' > > leim/quail/pakistan.el:221:33: Warning: reference to free variable `pakistan-extra-pashto-translations' > > leim/quail/pakistan.el:222:33: Warning: reference to free variable `pakistan-extra-saraiki-translations' > > leim/quail/pakistan.el:223:33: Warning: reference to free variable `pakistan-extra-sindhi-translations' > > The byte compiler warnings are harmless in that the code referencing > those variables is run only after the variable is defined. The > `urdu-custom` input method is generated based on these customs > variables. However what the setter of one custom variable should do > depends on the value of the others which makes initializing them a > little complicated. > > The only way I see of silencing the warnings is to use `defvar` to > define the variables, then define the setters which references these > variables. Is this preferable to the current state? Yes, definitely. We don't want warnings while building Emacs, even if they are harmless. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 9:27 ` Eli Zaretskii @ 2023-11-04 10:56 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 11:15 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 10:56 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 [-- Attachment #1: Type: text/plain, Size: 545 bytes --] Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: >> The only way I see of silencing the warnings is to use `defvar` to >> define the variables, then define the setters which references these >> variables. Is this preferable to the current state? > > Yes, definitely. We don't want warnings while building Emacs, even if > they are harmless. I have attached an updated version of the patch which addresses and other problems indicated in your previous messages. Please let me know of further changes needed and thanks for the reviews. Rahguzar [-- Attachment #2: 0001-Input-methods-for-Urdu-Pashto-and-Sindhi.patch --] [-- Type: text/x-patch, Size: 19060 bytes --] From 01298a5fed683db16d7e6fc8108c9d781049f9d5 Mon Sep 17 00:00:00 2001 From: Rahguzar <rahguzar@zohomail.eu> Date: Sun, 29 Oct 2023 17:14:02 +0100 Subject: [PATCH] Input methods for Urdu, Pashto and Sindhi * lisp/leim/quail/pakistan.el ("urdu-keyboard") ("urdu-phonetic-keyboard", "urdu-custom", "sindhi-keyboard") ("pashto-keyboard"): New input methods. (pakistan--define-quail-rules, pakistan--make-setter) (pakistan--regenerate-translations, pakistan--set-prefixes) (pakistan--set-numeral-translations): Internal helper functions. (pakistan-urdu-input): New customization group. (pakistan-urdu-prefixes, pakistan-urdu-translations) (pakistan-urdu-diacritics-and-other-symbols) (pakistan-urdu-poetic-symbols, pakistan-urdu-religious-symbols) (pakistan-extra-balochi-brahui-translations) (pakistan-extra-pashto-translations) (pakistan-extra-sindhi-translations) (pakistan-extra-saraiki-hindko-translations) (pakistan-urdu-use-roman-digits): New custom variables. (pakistan): New package. --- lisp/leim/quail/pakistan.el | 718 ++++++++++++++++++++++++++++++++++++ 1 file changed, 718 insertions(+) create mode 100644 lisp/leim/quail/pakistan.el diff --git a/lisp/leim/quail/pakistan.el b/lisp/leim/quail/pakistan.el new file mode 100644 index 00000000000..9cfb29f61c8 --- /dev/null +++ b/lisp/leim/quail/pakistan.el @@ -0,0 +1,718 @@ +;;; pakistan.el --- Input methods for some languages from Pakistan -*- lexical-binding: t; -*- +;; +;; Copyright (C) 2023 Free Software Foundation, Inc. + +;; Author: Rahguzar <rahguzar@zohomail.eu> +;; Keywords: convenience, multilingual, input method, Urdu, Balochi, Pashto, Sindhi, Hindko, Brahui +;; +;; This file is part of 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 3 of the License, 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. If not, see <https://www.gnu.org/licenses/>. +;; +;;; Commentary: +;; Provides a semi-phonetic input method for Urdu +;; +;;; Code: +(require 'quail) + +;;;; Urdu Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/urdu +(quail-define-package + "urdu-keyboard" "Urdu" "ات" t + "Input method for Urdu. +Uses keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ط) + ("w" ?ص) + ("e" ?ھ) + ("r" ?د) + ("t" ?ٹ) + ("y" ?پ) + ("u" ?ت) + ("i" ?ب) + ("o" ?ج) + ("p" ?ح) + ("a" ?م) + ("s" ?و) + ("d" ?ر) + ("f" ?ن) + ("g" ?ل) + ("h" ?ہ) + ("j" ?ا) + ("k" ?ک) + ("l" ?ی) + ("z" ?ق) + ("x" ?ف) + ("c" ?ے) + ("v" ?س) + ("b" ?ش) + ("n" ?غ) + ("m" ?ع) + ("Q" ?ظ) + ("W" ?ض) + ("E" ?ذ) + ("R" ?ڈ) + ("T" ?ث) + ("Y" ?ّ) + ("U" ?ۃ) + ("I" ?ـ) + ("O" ?چ) + ("P" ?خ) + ("A" ?ژ) + ("S" ?ز) + ("D" ?ڑ) + ("F" ?ں) + ("G" ?ۂ) + ("H" ?ء) + ("J" ?آ) + ("K" ?گ) + ("L" ?ي) + ("C" ?ۓ) + ("B" ?ؤ) + ("N" ?ئ) + ("[" ?\]) + ("]" ?\[) + ("{" ?}) + ("}" ?{) + (";" ?؛) + ("." ?۔) + ("," ?،) + ("?" ?؟)) + +;;;;; Phonetic Keyboard +(quail-define-package + "urdu-phonetic-keyboard" "Urdu" "اص" t + "Input method for Urdu. +Uses phonetic keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?و) + ("e" ?ع) + ("r" ?ر) + ("t" ?ت) + ("y" ?ے) + ("u" ?ء) + ("i" ?ی) + ("o" ?ہ) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ح) + ("j" ?ج) + ("k" ?ک) + ("l" ?ل) + ("z" ?ز) + ("x" ?ش) + ("c" ?چ) + ("v" ?ط) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?ْ) + ("W" ?ٔ) + ("E" ?ٰ) + ("R" ?ڑ) + ("T" ?ٹ) + ("Y" ?َ) + ("U" ?ئ) + ("I" ?ِ) + ("O" ?ۃ) + ("P" ?ُ) + ("A" ?آ) + ("S" ?ص) + ("D" ?ڈ) + ("F" ?أ) + ("G" ?غ) + ("H" ?ھ) + ("J" ?ض) + ("K" ?خ) + ("L" ?ٖ) + ("Z" ?ذ) + ("X" ?ژ) + ("C" ?ث) + ("V" ?ظ) + ("B" ?ً) + ("N" ?ں) + ("M" ?ّ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?؏) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?ؑ) + ("*" ?ؐ) + ("(" ?\)) + (")" ?\() + ("=" ?+) + (";" ?؛) + ("\\" ?÷) + ("|" ?x) + ("," ?،) + ("." ?۔) + ("<" ?ٗ) + (">" ?.) + ("?" ?؟) + ("[" ?﷽) + ("]" ?ﷲ) + ("{" ?ﷺ)) + +;;;;; Customizable Input Method +;;;;;; Variable declarations +;; We define these variables now so that setter functions can access them. +;; Later they will changes to custom variables. +(defvar pakistan-urdu-prefixes nil) +(defvar pakistan-urdu-translations nil) +(defvar pakistan-urdu-diacritics-and-other-symbols nil) +(defvar pakistan-urdu-poetic-symbols nil) +(defvar pakistan-urdu-religious-symbols nil) +(defvar pakistan-urdu-use-roman-digits) +(defvar pakistan-extra-balochi-brahui-translations nil) +(defvar pakistan-extra-pashto-translations) +(defvar pakistan-extra-saraiki-hindko-translations nil) +(defvar pakistan-extra-sindhi-translations nil) + +;;;;;; Helper functions +(defun pakistan--define-quail-rules (rules &optional prefix package) + "Define translations for `urdu-custom' input method as determined by RULES. +PACKAGE determines the input method and defaults to `urdu-custom'. RULES is +the list of rules to define, see `quail-defrule' for details. If non-nil +PREFIX is a string that is prefixed to each string in RULES. PREFIX can be a +symbol in which case it is looked up in `pakistan-urdu-prefixes' to obtain the +string." + (setq package (or package "urdu-custom")) + (when (and prefix (symbolp prefix)) + (setq prefix (car (alist-get prefix pakistan-urdu-prefixes)))) + (dolist (rule rules) + (quail-defrule (concat prefix (car rule)) (cadr rule) package))) + +(defun pakistan--make-setter (&optional prefix package) + "Return the setter function. +The function adds rules to PACKAGE with PREFIX." + (lambda (var val) + (set-default-toplevel-value var val) + (pakistan--define-quail-rules val prefix package) + (when (equal current-input-method (quail-name)) + (activate-input-method current-input-method)))) + +(defun pakistan--set-numeral-translations (var val) + "VAR should be `pakistan-urdu-use-roman-digits' and VAL its value. +This is a setter function for the custom-variable." + (set-default-toplevel-value var val) + (if val + (pakistan--regenerate-translations) + (pakistan--define-quail-rules + '(("0" ?۰) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("%" ?٪))))) + +(defun pakistan--regenerate-translations () + "Regenerate the translations for urdu-custom input method." + (quail-install-map '(nil) "urdu-custom") + (pakistan--define-quail-rules pakistan-urdu-translations) + (pakistan--set-numeral-translations + 'pakistan-urdu-use-roman-digits pakistan-urdu-use-roman-digits) + (pakistan--define-quail-rules + pakistan-urdu-diacritics-and-other-symbols 'diacritics) + (pakistan--define-quail-rules pakistan-urdu-poetic-symbols 'poetic) + (pakistan--define-quail-rules pakistan-urdu-religious-symbols 'religious) + (pakistan--define-quail-rules + pakistan-extra-balochi-brahui-translations 'balochi-brahui) + (pakistan--define-quail-rules pakistan-extra-pashto-translations 'pashto) + (pakistan--define-quail-rules + pakistan-extra-saraiki-hindko-translations 'saraiki-hindko) + (pakistan--define-quail-rules pakistan-extra-sindhi-translations 'sindhi)) + +(defun pakistan--set-prefixes (var val) + "VAR should be `pakistan-urdu-prefixes' and VAL is the value to be set. +Setter function for `pakistan-urdu-prefixes'." + (set-default-toplevel-value var val) + (when (boundp 'pakistan-urdu-translations) + (pakistan--regenerate-translations))) + +;;;;;; Package definition +(quail-define-package + "urdu-custom" "Urdu" "اا" t + "Intuitive and customizable transl input method for Urdu. +By default this input method doesn't try to follow the common romanization of +Urdu very closely. The reason for this is allow to for input efficiency. It +works as follows: + +1) All lower case letters on QWERTY keyboard are translated to an urdu +character. When more than one Urdu letter corresponds to the same Roman +letter, the most common Urdu letter has been chosen. The frequency analysis +was done on the basis of Urdu word list at +https://github.com/urduhack/urdu-words/blob/master/words.txt As a result some +of the translations are: +h → ہ +s → س , c → ص +z → ز + +2) For the next common letter the uppercase English letter is used, e.g. +r → ر , R → ڑ +n → ن , N → ں + +3) The letter x is used for postfix completions. There are two subcases: +3a) When more than two urdu letter map to the same roman letter, +e.g. +t → ت, T → ٹ , tx → ط , Tx → ۃ +h → ہ , H → ھ , hx → ح , Hx → ۂ +s → س , c → ص , sx → ش , S → ث , cx → چ +z → ز , Z → ض, zx → ذ , Zx → ظ +3b) The urdu letters that are commonly romanized by a English letter + h +can be obtained by the same English letter + x i.e. +gx → غ , cx → چ, kx → خ , sx → ش + +4) Y → ژ is somewhat of an abberation. All four of z, Z, zx and Zx are +used by more common letters. Y is used for ژ because it is sometimes +pronounced close to Y for some European languages. + +These translations can be changed by customizing `pakistan-urdu-translations'. + +5) o is used for prefix completion of diacrtics or اعر۱ب as well as some +poetic and religious symbols. The most common three diacritics are mapped to +oa → zabr (a for above) +ob → zer (b for below) +oo → pesh (o for the circle in pesh) + +6) The poetic symbols are also available under G (for غزل), while religious +symbols are also available under M (for مزہب). + +7) Characters from Balochi, Brahui Pashto, Saraiki and Sindhi which are not +part of Urdu alphabet can also be input. Each set of these sets correspond to +a different prefixes. See `pakistan-urdu-prefixes' for the prefixes. + +The translations and the prefixes described above can be customized. Various +customization options can be found under the customization group +`pakistan-urdu-input'." + nil t t t t nil nil nil nil nil t) + +;;;;;; Customizations +(defgroup pakistan-urdu-input nil + "Customization group for Urdu input methods." + :group 'quail) + +(defcustom pakistan-urdu-prefixes + '((diacritics "o") + (poetic "G") + (religious "M") + (balochi-brahui "B") + (pashto "P") + (sindhi "C") + (saraiki-hindko "X")) + "Prefixes for `urdu-custom' input method." + :set #'pakistan--set-prefixes + :type '(repeat (list symbol string)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-translations + '(("a" ?ا) + ("y" ?ی) + ("r" ?ر) + ("n" ?ن) + ("v" ?و) + ("m" ?م) + ("t" ?ت) + ("l" ?ل) + ("k" ?ک) + ("b" ?ب) + ("d" ?د) + ("h" ?ہ) + ("s" ?س) + ("H" ?ھ) + ("p" ?پ) + ("N" ?ں) + ("g" ?گ) + ("sx" ?ش) + ("j" ?ج) + ("T" ?ٹ) + ("f" ?ف) + ("cx" ?چ) + ("z" ?ز) + ("u" ?ع) + ("q" ?ق) + ("kx" ?خ) + ("e" ?ے) + ("E" ?ۓ) + ("hx" ?ح) + ("i" ?ئ) + ("R" ?ڑ) + ("tx" ?ط) + ("c" ?ص) + ("D" ?ڈ) + ("gx" ?غ) + ("A" ?آ) + ("Z" ?ض) + ("V" ?ؤ) + ("zx" ?ذ) + ("S" ?ث) + ("Zx" ?ظ) + ("Hx" ?ۂ) + ("ix" ?ء) + ("Tx" ?ۃ) + ("Y" ?ژ) + ("ax" ?أ) + ("." ?۔) + ("," ?،) + (";" ?؛) + ("?" ?؟)) + "Translations for Urdu characters and common punctuations." + :set (pakistan--make-setter) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-diacritics-and-other-symbols + '(("a" ?َ) ;; zabar زبر + ("b" ?ِ) ;; zer زير + ("o" ?ُ) ;; pesh پيش + ("j" ?ْ) ;; jazam جزم + ("S" ?ّ) ;; tashdid تشدید + ("k" ?ٰ) ;; khari zabar کھڑی زبر + ("u" ?٘) ;; ulti jazm الٹی جزم + ("s" ?؎) + ("m" ?؏) + ("t" ?ؔ) + ("c" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("A" ?ؑ)) + "Translations to input Urdu diacrtics. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'diacritics) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-poetic-symbols + '(("s" ?؎) + ("m" ?؏) + ("t" ?ؔ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'poetic) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-religious-symbols + '(("s" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("a" ?ؑ) + ("A" ?ﷲ) + ("S" ?ﷺ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'religious) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +;; I don't understand how many of these letters are pronounced. +;; So better translations are welcome. +(defcustom pakistan-extra-balochi-brahui-translations + '(("v" ?ۏ) + ("y" ?ݔ) +;; Brahui + ("l" ?ڷ)) + "Translations to input Balochi and Brahui letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'balochi-brahui) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-pashto-translations + '(("t" ?ټ) + ("d" ?ډ) + ("r" ?ړ) + ("n" ?ڼ) + ("s" ?ښ) + ("R" ?ږ) + ("h" ?څ) + ("H" ?ځ)) + "Translations to input Pashto letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'pashto) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-sindhi-translations + '(("k" ?ڪ) + ("j" ?ڄ) + ("t" ?ٺ) + ("T" ?ٽ) + ("tx" ?ٿ) + ("b" ?ٻ) + ("B" ?ڀ) + ("r" ?ڙ) + ("d" ?ڌ) + ("D" ?ڏ) + ("dx" ?ڊ) + ("Dx" ?ڍ) + ("h" ?ڃ) + ("c" ?ڇ) + ("p" ?ڦ) + ("n" ?ڻ) + ("g" ?ڳ) + ("G" ?ڱ)) + "Translations to input Sindhi letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'sindhi) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-extra-saraiki-hindko-translations + '(("b" ?ٻ) + ("h" ?ڄ) + ("g" ?ڳ) + ("d" ?ݙ) + ("n" ?ݨ) +;; Hindko + ("r" ?ݬ) + ("v" ?ڨ) + ("N" ?ݩ) + ("V" ?ٷ)) +"Translations to input Saraiki letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'saraiki-hindko) + :type '(repeat (list string character)) + :group 'pakistan-urdu-input) + +(defcustom pakistan-urdu-use-roman-digits + nil + "Whether urdu-custom input method should use roman digits." + :set #'pakistan--set-numeral-translations + :type 'boolean + :group 'pakistan-urdu-input) + +;;;; Sindhi Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/sindhi +(quail-define-package + "sindhi-keyboard" "Sindhi" "سِ" t + "Input method for Sindhi. +Uses keyboard layout from https://www.branah.com/sindhi ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?ص) + ("e" ?ي) + ("r" ?ر) + ("t" ?ت) + ("y" ?ٿ) + ("u" ?ع) + ("i" ?ڳ) + ("o" ?و) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ه) + ("j" ?ج) + ("k" ?ڪ) + ("l" ?ل) + ("z" ?ز) + ("x" ?خ) + ("c" ?ط) + ("v" ?ڀ) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?َ) + ("W" ?ض) + ("E" ?ِ) + ("R" ?ڙ) + ("T" ?ٽ) + ("Y" ?ث) + ("U" ?غ) + ("I" ?ھ) + ("O" ?ُ) + ("P" ?ڦ) + ("A" ?آ) + ("S" ?ش) + ("D" ?ڊ) + ("F" ?ڦ) + ("G" ?ً) + ("H" ?ح) + ("J" ?ٍ) + ("K" ?ۡ) + ("L" ?:) + ("Z" ?ذ) + ("X" ?ّ) + ("C" ?ظ) + ("V" ?ء) + ("B" ?ٻ) + ("N" ?ڻ) + ("M" ?۾) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?’) + ("-" ?ڏ) + ("=" ?ڌ) + ("~" ?‘) + ("@" ?ى) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?۽) + ("*" ?ؤ) + ("(" ?\)) + (")" ?\() + ("[" ?ڇ) + ("]" ?چ) + ("{" ?ڃ) + ("}" ?ڄ) + (";" ?ک) + ("'" ?ڱ) + ("\\" ?ڍ) + (":" ?؛) + ("|" ?ٺ) + ("," ?،) + ("/" ?ئ) + ("<" ?“) + (">" ?”) + ("?" ?؟)) + + +;;;; Pashto Input Methods +;;;;; Keyboard +(quail-define-package + "pashto-keyboard" "Pashto" "پ" t + "Input method for Pashto. +Uses keyboard layout from https://www.branah.com/pashto ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ض) + ("w" ?ص) + ("e" ?ث) + ("r" ?ق) + ("t" ?ف) + ("y" ?غ) + ("u" ?ع) + ("i" ?ه) + ("o" ?خ) + ("p" ?ح) + ("a" ?ش) + ("s" ?س) + ("d" ?ی) + ("f" ?ب) + ("g" ?ل) + ("h" ?ا) + ("j" ?ت) + ("k" ?ن) + ("l" ?م) + ("z" ?ۍ) + ("x" ?ې) + ("c" ?ز) + ("v" ?ر) + ("b" ?ذ) + ("n" ?د) + ("m" ?ړ) + ("Q" ?ْ) + ("W" ?ٌ) + ("E" ?ٍ) + ("R" ?ً) + ("T" ?ُ) + ("Y" ?ِ) + ("U" ?َ) + ("I" ?ّ) + ("O" ?څ) + ("P" ?ځ) + ("A" ?ښ) + ("S" ?ﺉ) + ("D" ?ي) + ("F" ?پ) + ("G" ?أ) + ("H" ?آ) + ("J" ?ټ) + ("K" ?ڼ) + ("L" ?ة) + ("Z" ?ظ) + ("X" ?ط) + ("C" ?ژ) + ("V" ?ء) + ("B" ?) + ("N" ?ډ) + ("M" ?ؤ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?) + ("~" ?÷) + ("@" ?٬) + ("#" ?٫) + ("%" ?٪) + ("^" ?×) + ("&" ?«) + ("*" ?») + ("_" ?ـ) + ("[" ?ج) + ("]" ?چ) + ("{" ?\[) + ("}" ?\]) + (";" ?ک) + ("'" ?ګ) + ("\"" ?؛) + ("|" ?٭) + ("," ?و) + ("." ?ږ) + ("<" ?،) + (">" ?.) + ("?" ?؟)) + +;;; End Matter +(provide 'pakistan) +;;; pakistan.el ends here -- 2.42.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 10:56 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 11:15 ` Eli Zaretskii 2023-11-04 14:23 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-11-04 11:15 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 04 Nov 2023 11:56:50 +0100 > > I have attached an updated version of the patch which addresses and > other problems indicated in your previous messages. Please let me know > of further changes needed and thanks for the reviews. Thanks. This still has a few issues, though. First, when I try to activate the pashto-keyboard input method in "emacs -Q", Emacs signals en error: Symbol’s value as variable is void: pakistan-urdu-use-roman-digits I wonder how this worked for you. > +(defcustom pakistan-urdu-prefixes > + '((diacritics "o") > + (poetic "G") > + (religious "M") > + (balochi-brahui "B") > + (pashto "P") > + (sindhi "C") > + (saraiki-hindko "X")) > + "Prefixes for `urdu-custom' input method." > + :set #'pakistan--set-prefixes > + :type '(repeat (list symbol string)) > + :group 'pakistan-urdu-input) Each defcustom should have a :version tag stating the first version in which it will appear. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 11:15 ` Eli Zaretskii @ 2023-11-04 14:23 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-11 10:21 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-04 14:23 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: > Thanks. This still has a few issues, though. > > First, when I try to activate the pashto-keyboard input method in > "emacs -Q", Emacs signals en error: > > Symbol’s value as variable is void: pakistan-urdu-use-roman-digits > > I wonder how this worked for you. I am sorry, I didn't test in a new fresh session and just evaluated the changed code in the session I was running. I have fixed this and a more serious issue which I didn't find for the same reason: as a result of defvars custom initialized those values to nil instead of their standard value. Now they are declared with a void value so that both byte compiler and custom are happy. >> +(defcustom pakistan-urdu-prefixes >> + '((diacritics "o") >> + (poetic "G") >> + (religious "M") >> + (balochi-brahui "B") >> + (pashto "P") >> + (sindhi "C") >> + (saraiki-hindko "X")) >> + "Prefixes for `urdu-custom' input method." >> + :set #'pakistan--set-prefixes >> + :type '(repeat (list symbol string)) >> + :group 'pakistan-urdu-input) > > Each defcustom should have a :version tag stating the first version in > which it will appear. Thanks, I have added the version now and removed the group, since I remembered from another thread that there preference is not to declare the group explicitly. P.S. While testing this I also fixed another issue where `pakistan--regenerate-translations` will work the first time but not subsequent ones. The fix was to replace (quail-install-map `(nil)) (quail-install-map (list nil)) and I don't understand why that makes a difference. But while trying to debug this I noticed that `quail-install-map` ignores the optional NAME argument and always installs the map in the current quail package. Is this the intended behavior? I have now added a (quail-select-package "urdu-custom") before the call to `quail-install-map` to make sure regenerating the input method in custom doesn't trample some other input method. Sorry again for the sloppiness, Rahguzar ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-04 14:23 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-11 10:21 ` Eli Zaretskii 2023-11-11 11:54 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-11-11 10:21 UTC (permalink / raw) To: Rahguzar; +Cc: 66470 > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 04 Nov 2023 15:23:10 +0100 > > Eli Zaretskii <eliz@gnu.org> writes: > > > Thanks. This still has a few issues, though. > > > > First, when I try to activate the pashto-keyboard input method in > > "emacs -Q", Emacs signals en error: > > > > Symbol’s value as variable is void: pakistan-urdu-use-roman-digits > > > > I wonder how this worked for you. > > I am sorry, I didn't test in a new fresh session and just evaluated the > changed code in the session I was running. I have fixed this and a more > serious issue which I didn't find for the same reason: as a result of > defvars custom initialized those values to nil instead of their standard > value. Now they are declared with a void value so that both byte > compiler and custom are happy. > > >> +(defcustom pakistan-urdu-prefixes > >> + '((diacritics "o") > >> + (poetic "G") > >> + (religious "M") > >> + (balochi-brahui "B") > >> + (pashto "P") > >> + (sindhi "C") > >> + (saraiki-hindko "X")) > >> + "Prefixes for `urdu-custom' input method." > >> + :set #'pakistan--set-prefixes > >> + :type '(repeat (list symbol string)) > >> + :group 'pakistan-urdu-input) > > > > Each defcustom should have a :version tag stating the first version in > > which it will appear. > > Thanks, I have added the version now and removed the group, since I > remembered from another thread that there preference is not to declare > the group explicitly. > > P.S. While testing this I also fixed another issue where > `pakistan--regenerate-translations` will work the first time but not > subsequent ones. The fix was to replace > > (quail-install-map `(nil)) > > (quail-install-map (list nil)) > > and I don't understand why that makes a difference. But while trying to > debug this I noticed that `quail-install-map` ignores the optional NAME > argument and always installs the map in the current quail package. Is > this the intended behavior? I have now added a > > (quail-select-package "urdu-custom") > > before the call to `quail-install-map` to make sure regenerating the > input method in custom doesn't trample some other input method. Did you forget to attach the updated patch? ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-11 10:21 ` Eli Zaretskii @ 2023-11-11 11:54 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-18 9:36 ` Eli Zaretskii 0 siblings, 1 reply; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-11 11:54 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470 [-- Attachment #1: Type: text/plain, Size: 1131 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> > Each defcustom should have a :version tag stating the first version in >> > which it will appear. >> >> Thanks, I have added the version now and removed the group, since I >> remembered from another thread that there preference is not to declare >> the group explicitly. >> >> P.S. While testing this I also fixed another issue where >> `pakistan--regenerate-translations` will work the first time but not >> subsequent ones. The fix was to replace >> >> (quail-install-map `(nil)) >> >> (quail-install-map (list nil)) >> >> and I don't understand why that makes a difference. But while trying to >> debug this I noticed that `quail-install-map` ignores the optional NAME >> argument and always installs the map in the current quail package. Is >> this the intended behavior? I have now added a >> >> (quail-select-package "urdu-custom") >> >> before the call to `quail-install-map` to make sure regenerating the >> input method in custom doesn't trample some other input method. > > Did you forget to attach the updated patch? Yes, sorry about that. I have attached it now. Rahguzar [-- Attachment #2: 0001-Input-methods-for-Urdu-Pashto-and-Sindhi.patch --] [-- Type: text/x-patch, Size: 19292 bytes --] From 666dc62678841bbc32f0593160cda27d252086c3 Mon Sep 17 00:00:00 2001 From: Rahguzar <rahguzar@zohomail.eu> Date: Sun, 29 Oct 2023 17:14:02 +0100 Subject: [PATCH] Input methods for Urdu, Pashto and Sindhi * lisp/leim/quail/pakistan.el ("urdu-keyboard") ("urdu-phonetic-keyboard", "urdu-custom", "sindhi-keyboard") ("pashto-keyboard"): New input methods. (pakistan--define-quail-rules, pakistan--make-setter) (pakistan--regenerate-translations, pakistan--set-prefixes) (pakistan--define-numeral-translations) (pakistan--set-numeral-translations): Internal helper functions. (pakistan-urdu-input): New customization group. (pakistan-urdu-prefixes, pakistan-urdu-translations) (pakistan-urdu-diacritics-and-other-symbols) (pakistan-urdu-poetic-symbols, pakistan-urdu-religious-symbols) (pakistan-extra-balochi-brahui-translations) (pakistan-extra-pashto-translations) (pakistan-extra-sindhi-translations) (pakistan-extra-saraiki-hindko-translations) (pakistan-urdu-use-roman-digits): New custom variables. (pakistan): New package. --- lisp/leim/quail/pakistan.el | 726 ++++++++++++++++++++++++++++++++++++ 1 file changed, 726 insertions(+) create mode 100644 lisp/leim/quail/pakistan.el diff --git a/lisp/leim/quail/pakistan.el b/lisp/leim/quail/pakistan.el new file mode 100644 index 00000000000..ff9257722e0 --- /dev/null +++ b/lisp/leim/quail/pakistan.el @@ -0,0 +1,726 @@ +;;; pakistan.el --- Input methods for some languages from Pakistan -*- lexical-binding: t; -*- +;; +;; Copyright (C) 2023 Free Software Foundation, Inc. + +;; Author: Rahguzar <rahguzar@zohomail.eu> +;; Keywords: convenience, multilingual, input method, Urdu, Balochi, Pashto, Sindhi, Hindko, Brahui +;; +;; This file is part of 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 3 of the License, 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. If not, see <https://www.gnu.org/licenses/>. +;; +;;; Commentary: +;; Provides a semi-phonetic input method for Urdu +;; +;;; Code: +(require 'quail) + +;;;; Urdu Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/urdu +(quail-define-package + "urdu-keyboard" "Urdu" "ات" t + "Input method for Urdu. +Uses keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ط) + ("w" ?ص) + ("e" ?ھ) + ("r" ?د) + ("t" ?ٹ) + ("y" ?پ) + ("u" ?ت) + ("i" ?ب) + ("o" ?ج) + ("p" ?ح) + ("a" ?م) + ("s" ?و) + ("d" ?ر) + ("f" ?ن) + ("g" ?ل) + ("h" ?ہ) + ("j" ?ا) + ("k" ?ک) + ("l" ?ی) + ("z" ?ق) + ("x" ?ف) + ("c" ?ے) + ("v" ?س) + ("b" ?ش) + ("n" ?غ) + ("m" ?ع) + ("Q" ?ظ) + ("W" ?ض) + ("E" ?ذ) + ("R" ?ڈ) + ("T" ?ث) + ("Y" ?ّ) + ("U" ?ۃ) + ("I" ?ـ) + ("O" ?چ) + ("P" ?خ) + ("A" ?ژ) + ("S" ?ز) + ("D" ?ڑ) + ("F" ?ں) + ("G" ?ۂ) + ("H" ?ء) + ("J" ?آ) + ("K" ?گ) + ("L" ?ي) + ("C" ?ۓ) + ("B" ?ؤ) + ("N" ?ئ) + ("[" ?\]) + ("]" ?\[) + ("{" ?}) + ("}" ?{) + (";" ?؛) + ("." ?۔) + ("," ?،) + ("?" ?؟)) + +;;;;; Phonetic Keyboard +(quail-define-package + "urdu-phonetic-keyboard" "Urdu" "اص" t + "Input method for Urdu. +Uses phonetic keyboard layout from https://www.branah.com/urdu" + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?و) + ("e" ?ع) + ("r" ?ر) + ("t" ?ت) + ("y" ?ے) + ("u" ?ء) + ("i" ?ی) + ("o" ?ہ) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ح) + ("j" ?ج) + ("k" ?ک) + ("l" ?ل) + ("z" ?ز) + ("x" ?ش) + ("c" ?چ) + ("v" ?ط) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?ْ) + ("W" ?ٔ) + ("E" ?ٰ) + ("R" ?ڑ) + ("T" ?ٹ) + ("Y" ?َ) + ("U" ?ئ) + ("I" ?ِ) + ("O" ?ۃ) + ("P" ?ُ) + ("A" ?آ) + ("S" ?ص) + ("D" ?ڈ) + ("F" ?أ) + ("G" ?غ) + ("H" ?ھ) + ("J" ?ض) + ("K" ?خ) + ("L" ?ٖ) + ("Z" ?ذ) + ("X" ?ژ) + ("C" ?ث) + ("V" ?ظ) + ("B" ?ً) + ("N" ?ں) + ("M" ?ّ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?؏) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?ؑ) + ("*" ?ؐ) + ("(" ?\)) + (")" ?\() + ("=" ?+) + (";" ?؛) + ("\\" ?÷) + ("|" ?x) + ("," ?،) + ("." ?۔) + ("<" ?ٗ) + (">" ?.) + ("?" ?؟) + ("[" ?﷽) + ("]" ?ﷲ) + ("{" ?ﷺ)) + +;;;;; Customizable Input Method +;;;;;; Variable declarations +;; We define these variables now so that byte-compiler does not complain. +;; Later they will be changed to custom variables. Their value must be void +;; here as otherwise cutsom will not initialize them to their standard value. +(defvar pakistan-urdu-prefixes) +(defvar pakistan-urdu-translations) +(defvar pakistan-urdu-diacritics-and-other-symbols) +(defvar pakistan-urdu-poetic-symbols) +(defvar pakistan-urdu-religious-symbols) +(defvar pakistan-urdu-use-roman-digits) +(defvar pakistan-extra-balochi-brahui-translations) +(defvar pakistan-extra-pashto-translations) +(defvar pakistan-extra-saraiki-hindko-translations) +(defvar pakistan-extra-sindhi-translations) + +;;;;;; Helper functions +(defun pakistan--define-quail-rules (rules &optional prefix package) + "Define translations for `urdu-custom' input method as determined by RULES. +PACKAGE determines the input method and defaults to `urdu-custom'. RULES is +the list of rules to define, see `quail-defrule' for details. If non-nil +PREFIX is a string that is prefixed to each string in RULES. PREFIX can be a +symbol in which case it is looked up in `pakistan-urdu-prefixes' to obtain the +string." + (setq package (or package "urdu-custom")) + (when (and prefix (symbolp prefix)) + (setq prefix (car (alist-get prefix pakistan-urdu-prefixes)))) + (dolist (rule rules) + (quail-defrule (concat prefix (car rule)) (cadr rule) package))) + +(defun pakistan--define-numeral-translations (&optional package) + "Define translations to translate digits to arabic digits. +Translations are for PACKAGE which defaults to `urdu-custom'." + (pakistan--define-quail-rules + '(("0" ?۰) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("%" ?٪)) + nil package)) + +(defun pakistan--set-numeral-translations (var val) + "VAR should be `pakistan-urdu-use-roman-digits' and VAL its value. +This is a setter function for the custom-variable." + (set-default-toplevel-value var val) + (if val + (pakistan--regenerate-translations) + (pakistan--define-numeral-translations))) + +(defun pakistan--regenerate-translations () + "Regenerate the translations for urdu-custom input method." + (quail-select-package "urdu-custom") + (quail-install-map (list nil)) + (pakistan--define-quail-rules pakistan-urdu-translations) + (unless pakistan-urdu-use-roman-digits + (pakistan--define-numeral-translations)) + (pakistan--define-quail-rules + pakistan-urdu-diacritics-and-other-symbols 'diacritics) + (pakistan--define-quail-rules pakistan-urdu-poetic-symbols 'poetic) + (pakistan--define-quail-rules pakistan-urdu-religious-symbols 'religious) + (pakistan--define-quail-rules + pakistan-extra-balochi-brahui-translations 'balochi-brahui) + (pakistan--define-quail-rules pakistan-extra-pashto-translations 'pashto) + (pakistan--define-quail-rules + pakistan-extra-saraiki-hindko-translations 'saraiki-hindko) + (pakistan--define-quail-rules pakistan-extra-sindhi-translations 'sindhi)) + +(defun pakistan--set-prefixes (var val) + "VAR should be `pakistan-urdu-prefixes' and VAL is the value to be set. +Setter function for `pakistan-urdu-prefixes'." + (set-default-toplevel-value var val) + (when (boundp 'pakistan-urdu-use-roman-digits) + (pakistan--regenerate-translations))) + +(defun pakistan--make-setter (&optional prefix) + "Return the setter function. +The function adds rules to `urdu-custom' with PREFIX." + (lambda (var val) + (set-default-toplevel-value var val) + (if (boundp 'pakistan-urdu-use-roman-digits) + (pakistan--regenerate-translations) + (pakistan--define-quail-rules val prefix)))) + +;;;;;; Package definition +(quail-define-package + "urdu-custom" "Urdu" "اا" t + "Intuitive and customizable transl input method for Urdu. +By default this input method doesn't try to follow the common romanization of +Urdu very closely. The reason for this is allow to for input efficiency. It +works as follows: + +1) All lower case letters on QWERTY keyboard are translated to an urdu +character. When more than one Urdu letter corresponds to the same Roman +letter, the most common Urdu letter has been chosen. The frequency analysis +was done on the basis of Urdu word list at +https://github.com/urduhack/urdu-words/blob/master/words.txt As a result some +of the translations are: +h → ہ +s → س , c → ص +z → ز + +2) For the next common letter the uppercase English letter is used, e.g. +r → ر , R → ڑ +n → ن , N → ں + +3) The letter x is used for postfix completions. There are two subcases: +3a) When more than two urdu letter map to the same roman letter, +e.g. +t → ت, T → ٹ , tx → ط , Tx → ۃ +h → ہ , H → ھ , hx → ح , Hx → ۂ +s → س , c → ص , sx → ش , S → ث , cx → چ +z → ز , Z → ض, zx → ذ , Zx → ظ +3b) The urdu letters that are commonly romanized by a English letter + h +can be obtained by the same English letter + x i.e. +gx → غ , cx → چ, kx → خ , sx → ش + +4) Y → ژ is somewhat of an abberation. All four of z, Z, zx and Zx are +used by more common letters. Y is used for ژ because it is sometimes +pronounced close to Y for some European languages. + +These translations can be changed by customizing `pakistan-urdu-translations'. + +5) o is used for prefix completion of diacrtics or اعر۱ب as well as some +poetic and religious symbols. The most common three diacritics are mapped to +oa → zabr (a for above) +ob → zer (b for below) +oo → pesh (o for the circle in pesh) + +6) The poetic symbols are also available under G (for غزل), while religious +symbols are also available under M (for مزہب). + +7) Characters from Balochi, Brahui Pashto, Saraiki and Sindhi which are not +part of Urdu alphabet can also be input. Each set of these sets correspond to +a different prefixes. See `pakistan-urdu-prefixes' for the prefixes. + +The translations and the prefixes described above can be customized. Various +customization options can be found under the customization group +`pakistan-urdu-input'." + nil t t t t nil nil nil nil nil t) + +;;;;;; Customizations +(defgroup pakistan-urdu-input nil + "Customization group for Urdu input methods." + :group 'quail) + +(defcustom pakistan-urdu-prefixes + '((diacritics "o") + (poetic "G") + (religious "M") + (balochi-brahui "B") + (pashto "P") + (sindhi "C") + (saraiki-hindko "X")) + "Prefixes for `urdu-custom' input method." + :set #'pakistan--set-prefixes + :type '(repeat (list symbol string)) + :version "30.1") + +(defcustom pakistan-urdu-translations + '(("a" ?ا) + ("y" ?ی) + ("r" ?ر) + ("n" ?ن) + ("v" ?و) + ("m" ?م) + ("t" ?ت) + ("l" ?ل) + ("k" ?ک) + ("b" ?ب) + ("d" ?د) + ("h" ?ہ) + ("s" ?س) + ("H" ?ھ) + ("p" ?پ) + ("N" ?ں) + ("g" ?گ) + ("sx" ?ش) + ("j" ?ج) + ("T" ?ٹ) + ("f" ?ف) + ("cx" ?چ) + ("z" ?ز) + ("u" ?ع) + ("q" ?ق) + ("kx" ?خ) + ("e" ?ے) + ("E" ?ۓ) + ("hx" ?ح) + ("i" ?ئ) + ("R" ?ڑ) + ("tx" ?ط) + ("c" ?ص) + ("D" ?ڈ) + ("gx" ?غ) + ("A" ?آ) + ("Z" ?ض) + ("V" ?ؤ) + ("zx" ?ذ) + ("S" ?ث) + ("Zx" ?ظ) + ("Hx" ?ۂ) + ("ix" ?ء) + ("Tx" ?ۃ) + ("Y" ?ژ) + ("ax" ?أ) + ("." ?۔) + ("," ?،) + (";" ?؛) + ("?" ?؟)) + "Translations for Urdu characters and common punctuations." + :set (pakistan--make-setter) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-urdu-diacritics-and-other-symbols + '(("a" ?َ) ;; zabar زبر + ("b" ?ِ) ;; zer زير + ("o" ?ُ) ;; pesh پيش + ("j" ?ْ) ;; jazam جزم + ("S" ?ّ) ;; tashdid تشدید + ("k" ?ٰ) ;; khari zabar کھڑی زبر + ("u" ?٘) ;; ulti jazm الٹی جزم + ("s" ?؎) + ("m" ?؏) + ("t" ?ؔ) + ("c" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("A" ?ؑ)) + "Translations to input Urdu diacrtics. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'diacritics) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-urdu-poetic-symbols + '(("s" ?؎) + ("m" ?؏) + ("t" ?ؔ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'poetic) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-urdu-religious-symbols + '(("s" ?ؐ) + ("r" ?ؒ) + ("R" ?ؓ) + ("a" ?ؑ) + ("A" ?ﷲ) + ("S" ?ﷺ)) + "Translation to input Urdu peotic symbols. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'religious) + :type '(repeat (list string character)) + :version "30.1") + +;; I don't understand how many of these letters are pronounced. +;; So better translations are welcome. +(defcustom pakistan-extra-balochi-brahui-translations + '(("v" ?ۏ) + ("y" ?ݔ) +;; Brahui + ("l" ?ڷ)) + "Translations to input Balochi and Brahui letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'balochi-brahui) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-extra-pashto-translations + '(("t" ?ټ) + ("d" ?ډ) + ("r" ?ړ) + ("n" ?ڼ) + ("s" ?ښ) + ("R" ?ږ) + ("h" ?څ) + ("H" ?ځ)) + "Translations to input Pashto letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'pashto) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-extra-sindhi-translations + '(("k" ?ڪ) + ("j" ?ڄ) + ("t" ?ٺ) + ("T" ?ٽ) + ("tx" ?ٿ) + ("b" ?ٻ) + ("B" ?ڀ) + ("r" ?ڙ) + ("d" ?ڌ) + ("D" ?ڏ) + ("dx" ?ڊ) + ("Dx" ?ڍ) + ("h" ?ڃ) + ("c" ?ڇ) + ("p" ?ڦ) + ("n" ?ڻ) + ("g" ?ڳ) + ("G" ?ڱ)) + "Translations to input Sindhi letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'sindhi) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-extra-saraiki-hindko-translations + '(("b" ?ٻ) + ("h" ?ڄ) + ("g" ?ڳ) + ("d" ?ݙ) + ("n" ?ݨ) +;; Hindko + ("r" ?ݬ) + ("v" ?ڨ) + ("N" ?ݩ) + ("V" ?ٷ)) +"Translations to input Saraiki letters not found in Urdu. +These are available under the prefix specified in `pakistan-urdu-prefixes'." + :set (pakistan--make-setter 'saraiki-hindko) + :type '(repeat (list string character)) + :version "30.1") + +(defcustom pakistan-urdu-use-roman-digits + nil + "Whether urdu-custom input method should use roman digits." + :set #'pakistan--set-numeral-translations + :type 'boolean + :version "30.1") + +;;;; Sindhi Input Methods +;;;;; Keyboard +;; Layout taken from https://www.branah.com/sindhi +(quail-define-package + "sindhi-keyboard" "Sindhi" "سِ" t + "Input method for Sindhi. +Uses keyboard layout from https://www.branah.com/sindhi ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ق) + ("w" ?ص) + ("e" ?ي) + ("r" ?ر) + ("t" ?ت) + ("y" ?ٿ) + ("u" ?ع) + ("i" ?ڳ) + ("o" ?و) + ("p" ?پ) + ("a" ?ا) + ("s" ?س) + ("d" ?د) + ("f" ?ف) + ("g" ?گ) + ("h" ?ه) + ("j" ?ج) + ("k" ?ڪ) + ("l" ?ل) + ("z" ?ز) + ("x" ?خ) + ("c" ?ط) + ("v" ?ڀ) + ("b" ?ب) + ("n" ?ن) + ("m" ?م) + ("Q" ?َ) + ("W" ?ض) + ("E" ?ِ) + ("R" ?ڙ) + ("T" ?ٽ) + ("Y" ?ث) + ("U" ?غ) + ("I" ?ھ) + ("O" ?ُ) + ("P" ?ڦ) + ("A" ?آ) + ("S" ?ش) + ("D" ?ڊ) + ("F" ?ڦ) + ("G" ?ً) + ("H" ?ح) + ("J" ?ٍ) + ("K" ?ۡ) + ("L" ?:) + ("Z" ?ذ) + ("X" ?ّ) + ("C" ?ظ) + ("V" ?ء) + ("B" ?ٻ) + ("N" ?ڻ) + ("M" ?۾) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?٦) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?’) + ("-" ?ڏ) + ("=" ?ڌ) + ("~" ?‘) + ("@" ?ى) + ("#" ?ؔ) + ("$" ?ؒ) + ("%" ?٪) + ("^" ?ؓ) + ("&" ?۽) + ("*" ?ؤ) + ("(" ?\)) + (")" ?\() + ("[" ?ڇ) + ("]" ?چ) + ("{" ?ڃ) + ("}" ?ڄ) + (";" ?ک) + ("'" ?ڱ) + ("\\" ?ڍ) + (":" ?؛) + ("|" ?ٺ) + ("," ?،) + ("/" ?ئ) + ("<" ?“) + (">" ?”) + ("?" ?؟)) + + +;;;; Pashto Input Methods +;;;;; Keyboard +(quail-define-package + "pashto-keyboard" "Pashto" "پ" t + "Input method for Pashto. +Uses keyboard layout from https://www.branah.com/pashto ." + nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("q" ?ض) + ("w" ?ص) + ("e" ?ث) + ("r" ?ق) + ("t" ?ف) + ("y" ?غ) + ("u" ?ع) + ("i" ?ه) + ("o" ?خ) + ("p" ?ح) + ("a" ?ش) + ("s" ?س) + ("d" ?ی) + ("f" ?ب) + ("g" ?ل) + ("h" ?ا) + ("j" ?ت) + ("k" ?ن) + ("l" ?م) + ("z" ?ۍ) + ("x" ?ې) + ("c" ?ز) + ("v" ?ر) + ("b" ?ذ) + ("n" ?د) + ("m" ?ړ) + ("Q" ?ْ) + ("W" ?ٌ) + ("E" ?ٍ) + ("R" ?ً) + ("T" ?ُ) + ("Y" ?ِ) + ("U" ?َ) + ("I" ?ّ) + ("O" ?څ) + ("P" ?ځ) + ("A" ?ښ) + ("S" ?ﺉ) + ("D" ?ي) + ("F" ?پ) + ("G" ?أ) + ("H" ?آ) + ("J" ?ټ) + ("K" ?ڼ) + ("L" ?ة) + ("Z" ?ظ) + ("X" ?ط) + ("C" ?ژ) + ("V" ?ء) + ("B" ?) + ("N" ?ډ) + ("M" ?ؤ) + ("1" ?۱) + ("2" ?۲) + ("3" ?۳) + ("4" ?۴) + ("5" ?۵) + ("6" ?۶) + ("7" ?۷) + ("8" ?۸) + ("9" ?۹) + ("0" ?۰) + ("`" ?) + ("~" ?÷) + ("@" ?٬) + ("#" ?٫) + ("%" ?٪) + ("^" ?×) + ("&" ?«) + ("*" ?») + ("_" ?ـ) + ("[" ?ج) + ("]" ?چ) + ("{" ?\[) + ("}" ?\]) + (";" ?ک) + ("'" ?ګ) + ("\"" ?؛) + ("|" ?٭) + ("," ?و) + ("." ?ږ) + ("<" ?،) + (">" ?.) + ("?" ?؟)) + +;;; End Matter +(provide 'pakistan) +;;; pakistan.el ends here -- 2.42.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-11 11:54 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-18 9:36 ` Eli Zaretskii 2023-11-18 11:12 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 21+ messages in thread From: Eli Zaretskii @ 2023-11-18 9:36 UTC (permalink / raw) To: Rahguzar; +Cc: 66470-done > From: Rahguzar <rahguzar@zohomail.eu> > Cc: 66470@debbugs.gnu.org > Date: Sat, 11 Nov 2023 12:54:24 +0100 > > Eli Zaretskii <eliz@gnu.org> writes: > > > Did you forget to attach the updated patch? > > Yes, sorry about that. I have attached it now. Thanks, installed on the master branch, and closing the bug. In the future, when adding a new feature, please include also suitable NEWS entries and changes for the manuals where appropriate. ^ permalink raw reply [flat|nested] 21+ messages in thread
* bug#66470: 29.1; Provide Urdu input method 2023-11-18 9:36 ` Eli Zaretskii @ 2023-11-18 11:12 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 0 replies; 21+ messages in thread From: Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-18 11:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 66470-done Hi Eli, Eli Zaretskii <eliz@gnu.org> writes: > Thanks, installed on the master branch, and closing the bug. Great! I am happy to have made my first contribution to Emacs and a big thank you for guiding me through the whole process. > In the future, when adding a new feature, please include also > suitable NEWS entries and changes for the manuals where appropriate. Will do. Thanks, Rahguzar ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2023-11-18 11:12 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-10-11 18:36 bug#66470: 29.1; Provide Urdu input method Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-11 18:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 8:53 ` Eli Zaretskii 2023-10-14 9:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 10:53 ` Eli Zaretskii 2023-10-14 11:10 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-14 12:36 ` Eli Zaretskii 2023-10-21 18:59 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-10-22 4:53 ` Eli Zaretskii 2023-10-29 11:51 ` Eli Zaretskii 2023-10-29 16:27 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 8:39 ` Eli Zaretskii 2023-11-04 8:50 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 9:27 ` Eli Zaretskii 2023-11-04 10:56 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-04 11:15 ` Eli Zaretskii 2023-11-04 14:23 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-11 10:21 ` Eli Zaretskii 2023-11-11 11:54 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors 2023-11-18 9:36 ` Eli Zaretskii 2023-11-18 11:12 ` Rahguzar via Bug reports for GNU Emacs, the Swiss army knife of text editors
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).