;;; ll-char --- ll char -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: ;; ;; (set-face-attribute ' ;; (load-file "~/src/bad-6/bad-font.el") (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'll) (defun what-char (&optional pos) (i) (or pos (setf pos (point))) (let ((char (char-after pos))) (unless (characterp char) (error "No char")) (let* ((new (get-char-code-property char 'name)) (old (get-char-code-property char 'old-name)) (msg (downcase (if (& new old) (@f "%s [old name: %s]" new old) (or new old))))) (kill-new msg) ($ msg)))) ;; (what-char) ; space ;; (what-char)} ; right curly bracket (old name closing curly bracket) ;; M-x what-char RET ; line feed (lf) (defun alphabet (&optional as-list) (let ((abc "a b c d e f g h i j k l m n o p q r s t u v w x y z")) (if as-list (cl-remove ?\s (string-to-list abc)) abc))) ;; (alphabet) ; a b c d e f g h i j k l m n o p q r s t u v w x y z ;; (alphabet 'as-list) ; (97 98 99 100 101 102 103 104 105 106 107 108 ...) ;; (--- (alphabet 'as-list)) ; 26 (defun echo-alphabet (&optional num) (interactive "P") (let ((as-list (alphabet 'as-list))) (or num (setq num (--- as-list))) (let* ((part (cl-subseq as-list 0 num)) (str-list (mapcar (L (c) (char-to-string c)) part)) (str-almost (@f "%s" str-list)) (str (substring str-almost 1 (1- (--- str-almost))))) ($ str)))) (defalias 'abc #'echo-alphabet) ;; (echo-alphabet 2) ; a b ;; (echo-alphabet -2) ; a b c d e f g h i j k l m n o p q r s t u v w x ;; (echo-alphabet 10) ; a b c d e f g h i j ;; (echo-alphabet -10) ; a b c d e f g h i j k l m n o p (<- 'll-char)