[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: input methods for mathematical glyphs

From: Emanuel Berg
Subject: Re: input methods for mathematical glyphs
Date: Thu, 09 Dec 2021 04:05:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

;;; greek-ao.el --- insert Greek chars -*- lexical-binding: t -*-
;;; Commentary:
;;; Author: Emanuel Berg (incal) <>
;;; Created: 2021-12-09
;;; Keywords: key
;;; License: GPL3+
;;; URL:
;;; Version: 1.0.0
;;; Invoke this mode. Insert a Greek char.
;;; Return automatically.
;;; Code:

(defun char-to-greek (c)
  "Convert C to the corresponding Greek char."
  (when (and (<= ?A c)
             (<= c ?Y) )
    (+ c 848) ))

(defun greek-ao-mode-self-insert-command (n)
  "Insert the `last-command-event' char N times, in Greek."
  (interactive "p")
  (let*((chr        last-command-event)
        (greek-char (char-to-greek chr)) )
    (when greek-char
      (insert-char greek-char n))
    (greek-ao-mode 0) ))

(defvar greek-ao-mode-map
  (let ((map (make-keymap)))
    (substitute-key-definition #'self-insert-command
                               map global-map)
    map) )

(define-minor-mode greek-ao-mode
  "Greek Alpha Omega (ao) mode (greek-ao-mode)."
  :init-value nil
  :lighter " Caps")

(defun toggle-greek-ao-mode ()
  "Toggle Greek Alpha Omega (ao) mode (greek-ao-mode)."
  (greek-ao-mode 'toggle) )

(provide 'greek-ao)
;;; greek-ao.el ends here

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]