From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Input method generator package - Re: Unicode fonts Date: Sun, 23 May 2021 22:42:02 +0300 Message-ID: References: <87im3a5xqc.fsf@zoho.eu> <83h7iuj6i1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0WGvKXc20hQ+XFKQ" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15346"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) To: GNU Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 23 21:44:13 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lku1E-0003jW-T6 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 23 May 2021 21:44:12 +0200 Original-Received: from localhost ([::1]:58462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lku1D-0007gt-T6 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 23 May 2021 15:44:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lku03-0006mN-CW for help-gnu-emacs@gnu.org; Sun, 23 May 2021 15:42:59 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:50733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lku00-0004k1-QV for help-gnu-emacs@gnu.org; Sun, 23 May 2021 15:42:58 -0400 Original-Received: from localhost ([::ffff:102.87.235.181]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000ADF01.0000000060AAB03D.000007A8; Sun, 23 May 2021 12:42:53 -0700 Mail-Followup-To: GNU Emacs Help Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130142 Archived-At: --0WGvKXc20hQ+XFKQ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit And here is the ๐ผ๐‘๐‘ƒ๐‘ˆ๐‘‡ ๐‘€๐ธ๐‘‡๐ป๐‘‚๐ท ๐บ๐ธ๐‘๐ธ๐‘…๐ด๐‘‡๐‘‚๐‘… package: ;;; Run M-x rcd-input-method-generator RET to generate ๐“ฏ๐“ช๐“ท๐“ฌ๐”‚ input ;;; methods. ;;; ;;; CIRCLED LATIN: โ“โ“‘โ“’โ““โ“”โ“•โ“—โ“˜โ“™โ“šโ“›โ“œโ“โ“žโ“Ÿโ“ โ“กโ“ขโ“ฃโ“ฆโ“งโ“จโ“ฉ ;;; FULLWIDTH LATIN: ๏ผฆ๏ผต๏ผฌ๏ผฌ๏ผท๏ผฉ๏ผค๏ผด๏ผจ ๏ผฌ๏ผก๏ผด๏ผฉ๏ผฎ ;;; สŸแด€แด›ษชษด สŸแด‡แด›แด›แด‡ส€ ๊œฑแดแด€สŸสŸ แด แด‡ส€ส ษดษชแด„แด‡ ๊œฐแดส€ ๊œฑแดแด„ษชแด€สŸ แดแด‡แด…ษชแด€ ;;; ๐•ธ๐–†๐–™๐–๐–Š๐–’๐–†๐–™๐–Ž๐–ˆ๐–†๐–‘ ๐•ญ๐–”๐–‘๐–‰ ๐•ฑ๐–—๐–†๐–๐–™๐–š๐–— ;;; ๐‘ด๐’‚๐’•๐’‰๐’†๐’Ž๐’‚๐’•๐’Š๐’„๐’‚๐’ ๐‘ฉ๐’๐’๐’… ๐‘ฐ๐’•๐’‚๐’๐’Š๐’„ ;;; ๐Œ๐š๐ญ๐ก๐ž๐ฆ๐š๐ญ๐ข๐œ๐š๐ฅ ๐๐จ๐ฅ๐ ;;; ๐”ป๐•†๐•Œ๐”น๐•ƒ๐”ผ ๐•Š๐•‹R๐•ŒC๐•‚ ;;; ๐‘€๐ด๐‘‡๐ป๐ธ๐‘€๐ด๐‘‡๐ผ๐ถ๐ด๐ฟ ๐ผ๐‘‡๐ด๐ฟ๐ผ๐ถ ;;; ๐“‚๐’ถ๐“‰๐’ฝe๐“‚๐’ถ๐“‰๐’พ๐’ธ๐’ถ๐“ ๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰ ;;; ๐“ช๐“ท๐“ญ ๐“ผ๐“ฎ๐“ฟ๐“ฎ๐“ป๐“ช๐“ต ๐“ธ๐“ฝ๐“ฑ๐“ฎ๐“ป๐“ผ ;;; ;;; customize place to save the in variable `rcd-input-method-directory' https://hyperscope.link/3/7/7/4/1/Emacs-Input-Method-Generator-37741.html Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns Sign an open letter in support of Richard M. Stallman https://stallmansupport.org/ --0WGvKXc20hQ+XFKQ Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="input-method-generator.el" Content-Transfer-Encoding: 8bit ;;; input-method-generator.el --- Input Method Generator ;; Copyright (C) 2021 by Jean Louis ;; Author: Jean Louis ;; Version: 0.1 ;; Package-Requires: () ;; Keywords: convenience ;; URL: https://hyperscope.link/3/7/7/4/1/Emacs-Input-Method-Generator-37741.html ;; This file is not part of GNU Emacs. ;; This program 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. ;; ;; This program 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 this program. If not, see . ;;; Commentary: ;;; ;;; Run M-x rcd-input-method-generator RET to generate ๐“ฏ๐“ช๐“ท๐“ฌ๐”‚ input ;;; methods. ;;; ;;; CIRCLED LATIN: โ“โ“‘โ“’โ““โ“”โ“•โ“—โ“˜โ“™โ“šโ“›โ“œโ“โ“žโ“Ÿโ“ โ“กโ“ขโ“ฃโ“ฆโ“งโ“จโ“ฉ ;;; FULLWIDTH LATIN: ๏ผฆ๏ผต๏ผฌ๏ผฌ๏ผท๏ผฉ๏ผค๏ผด๏ผจ ๏ผฌ๏ผก๏ผด๏ผฉ๏ผฎ ;;; สŸแด€แด›ษชษด สŸแด‡แด›แด›แด‡ส€ ๊œฑแดแด€สŸสŸ แด แด‡ส€ส ษดษชแด„แด‡ ๊œฐแดส€ ๊œฑแดแด„ษชแด€สŸ แดแด‡แด…ษชแด€ ;;; ๐•ธ๐–†๐–™๐–๐–Š๐–’๐–†๐–™๐–Ž๐–ˆ๐–†๐–‘ ๐•ญ๐–”๐–‘๐–‰ ๐•ฑ๐–—๐–†๐–๐–™๐–š๐–— ;;; ๐‘ด๐’‚๐’•๐’‰๐’†๐’Ž๐’‚๐’•๐’Š๐’„๐’‚๐’ ๐‘ฉ๐’๐’๐’… ๐‘ฐ๐’•๐’‚๐’๐’Š๐’„ ;;; ๐Œ๐š๐ญ๐ก๐ž๐ฆ๐š๐ญ๐ข๐œ๐š๐ฅ ๐๐จ๐ฅ๐ ;;; ๐”ป๐•†๐•Œ๐”น๐•ƒ๐”ผ ๐•Š๐•‹R๐•ŒC๐•‚ ;;; ๐‘€๐ด๐‘‡๐ป๐ธ๐‘€๐ด๐‘‡๐ผ๐ถ๐ด๐ฟ ๐ผ๐‘‡๐ด๐ฟ๐ผ๐ถ ;;; ๐“‚๐’ถ๐“‰๐’ฝe๐“‚๐’ถ๐“‰๐’พ๐’ธ๐’ถ๐“ ๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰ ;;; ๐“ช๐“ท๐“ญ ๐“ผ๐“ฎ๐“ฟ๐“ฎ๐“ป๐“ช๐“ต ๐“ธ๐“ฝ๐“ฑ๐“ฎ๐“ป๐“ผ ;;; ;;; customize place to save the in variable `rcd-input-method-directory' ;;; ;;; Change Log: ;;; Code: (defcustom rcd-input-method-directory "~/" "Define the directory to generated input method files." :group 'rcd :type 'string) (defun string-to-file-force (string file) "Print STRING into file, matters not if file exists. Return FILE as file name." (with-temp-file file (insert string)) file) (defvar rcd-input-methods '( "CIRCLED LATIN@" "FULLWIDTH LATIN@" "LATIN LETTER SMALL" "MATHEMATICAL BOLD FRAKTUR" "MATHEMATICAL BOLD ITALIC" "MATHEMATICAL BOLD SCRIPT" "MATHEMATICAL BOLD" "MATHEMATICAL DOUBLE-STRUCK" "MATHEMATICAL ITALIC" "MATHEMATICAL MONOSPACE" "MATHEMATICAL SANS-SERIF BOLD ITALIC" "MATHEMATICAL SANS-SERIF BOLD" "MATHEMATICAL SANS-SERIF ITALIC" "MATHEMATICAL SANS-SERIF" "MATHEMATICAL SCRIPT" ) "The input methods that this package can generate and load.") (defun rcd-input-method-generator () "Generate ๐“ฏ๐“ช๐“ท๐“ฌ๐”‚ input method. Activate it with \\[toggle-input-method] or set it with \\[set-input-method]" (interactive) (let* ((completion-ignore-case t) (input-method (completing-read"Input method: " rcd-input-methods)) (unicode-part (upcase (string-trim input-method))) (name (string-replace "@" "" (downcase input-method))) (name (string-replace " " "-" name)) (title (capitalize input-method)) (description (concat title " Input Method")) (file (concat "input-method-" name ".el"))) (string-to-file-force (rcd-input-method-generate input-method unicode-part name title description) file) (load-file file))) (defun rcd-input-method-generate (input-method unicode-part name title description) "Generate INPUT-METHOD. Uses UNICODE-PART, NAME, TITLE and DESCRIPTION." (let* ((mode-1 (when (string-match "@" unicode-part) t)) (unicode-part (replace-regexp-in-string "@" "" unicode-part)) (unicode-part-capital (if mode-1 (concat unicode-part " CAPITAL LETTER ") (concat unicode-part " CAPITAL "))) (unicode-part-small (if mode-1 (concat unicode-part " SMALL LETTER ") (concat unicode-part " SMALL ")))) (with-temp-buffer (insert (format ";;;; Input method: %s\n\n" title)) (insert "(quail-define-package\n") (insert (format " \"%s\" \"Unicode\" \"%s\" t\n" name title)) (insert (format " \"%s\"\n" description)) (insert (format " nil t nil nil nil nil nil nil nil nil t)\n\n")) (insert "(quail-define-rules") (let ((num 65)) (while (< num 91) (let* ((name (concat unicode-part-capital (char-to-string num))) (char-from-name (condition-case nil (char-from-name name) (error "")))) (when char-from-name (insert (format "\n (\"%s\" %d)" (char-to-string num) char-from-name)))) (setq num (1+ num)))) (let ((num 97)) (while (< num (+ 97 26)) (let* ((name (concat unicode-part-small (upcase (char-to-string num)))) (char-from-name (condition-case nil (char-from-name name) (error "")))) (when char-from-name (insert (format "\n (\"%s\" %d)" (char-to-string num) char-from-name)))) (setq num (1+ num)))) (insert ")\n\n") (buffer-string)))) ;;; input-method-generator.el ends here --0WGvKXc20hQ+XFKQ--