From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AAWiEmuZ0GJ8OgEAbAwnHQ (envelope-from ) for ; Fri, 15 Jul 2022 00:32:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yABJEWuZ0GKYowAAG6o9tA (envelope-from ) for ; Fri, 15 Jul 2022 00:32:11 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B977D29EFD for ; Fri, 15 Jul 2022 00:32:10 +0200 (CEST) Received: from localhost ([::1]:34424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC7NR-0000N6-Oe for larch@yhetil.org; Thu, 14 Jul 2022 18:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC7Lz-0000Mw-Vb for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 18:30:40 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:40483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oC7Ly-0003CV-0G for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 18:30:39 -0400 Received: by mail-lj1-x22a.google.com with SMTP id w2so3785800ljj.7 for ; Thu, 14 Jul 2022 15:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qsxT7bqt+XmC+iBWyG9DUr5EVAwC3Tw49XcF0e4gHLk=; b=XsLxvE/yEL+3lJQ5R7ozk70W/WthCbX/zEeY5b4GwNVC5A8Bcc5eF+PMA5kSCfcGbL i4m/d0NZXT/aQpFBljdc582pWIVWMphzJKHp9MnRAn0xrFA6TMXLBvuPAaeYUdadx2pJ L301CuUK8fWtYM0XG4BEjgqSIEGF98ZbE9WXxFge+/DA61R08W1SB3F73rAv0EC9/Tiy wPa36biTzyF6pcE2btED0qQ/O38R+YYvjpcjWHy7GBZXpwKhyGi8wdyWrtGeS5kx3wuj /8xqJ0KqRMauu10Pdu2LfEGGmmfxPyhacaMWY7qVRbwtL8UeUE25mODmV2Q7FZxXM3+x pAAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qsxT7bqt+XmC+iBWyG9DUr5EVAwC3Tw49XcF0e4gHLk=; b=Q7oDezRmOEz74xovhoiq2MmXWD6narB0INpvNY5AkxOYhPJ9etl8FKxkt7pkZReWzr WM0vULbHE/n8fzVljOPCxD1SnkQ04RrjwB5FvVJoyWmhIk+GdyxOQA5AMrKgbVgDW+U5 999kak7e6MdiB0ZN0tIyv+4GruczINvnbV30QR03H9OHZpNoI9Pf903lKHfqCfobHt5l SRU0LG8Q8UdySGAaFyq4migkFtkRiHepDQFN7n26LDqsDzp7/f2NIt8whFwHxreIXn13 ELxXXwNBMSYkebXNTGHANLlK+9WmuotksnY+5DULAu6RKLnrj1fDsflRN41JW344wwqK LTIg== X-Gm-Message-State: AJIora9iYqNq6bcd5kmdoO+ztJJnFzcs5Vm4eaNKz50uF4GZwj0otWfy o+pxIKge3L5NPRfYKmaE9irN2hl3LBxk+VUgnQc= X-Google-Smtp-Source: AGRyM1sATOJ/rljsrHvQ7MsLseCsoP8BX+zLRqIVpWSUuRyR5tW9keCAWFHpzYTG1CNvi0G455VgeuWlyG8QasHPS4s= X-Received: by 2002:a2e:934b:0:b0:24f:cce:5501 with SMTP id m11-20020a2e934b000000b0024f0cce5501mr5406956ljh.443.1657837835033; Thu, 14 Jul 2022 15:30:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6520:2432:b0:1f7:d9f7:61a with HTTP; Thu, 14 Jul 2022 15:30:33 -0700 (PDT) In-Reply-To: <87edyn4sal.fsf@mbork.pl> References: <87y1wxwalv.fsf@posteo.net> <87edyn4sal.fsf@mbork.pl> From: Samuel Wales Date: Thu, 14 Jul 2022 15:30:33 -0700 Message-ID: Subject: Re: [tip/offtopic] A function to describe the characters of a word at point To: Marcin Borkowski Cc: =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= , orgmode Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=samologist@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657837931; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qsxT7bqt+XmC+iBWyG9DUr5EVAwC3Tw49XcF0e4gHLk=; b=IgrAMYVbYSGRDQehp+hf2uGOtnThPLlVNBWI3IpsoMdO6c5uThR0QgXcFaGzUTMntSEOhe QUt8h26lu/Yb351pHAThqhueXwie8kuqPG4gE9+a7MloO6VnmQhjCtfcXXirjW4Cv0WAdG P16toa3gqY+16mUa2ZDHxQVtfqWvo3owRHkdwN7sbYKU2MACmLTMZmraiVRM9dLwynvPuE zvJM2PW1FePliLknFVt3wq+jy0zuAwCazaEA7H/vU5XgKmN3Hu/E61B4b155zLzzf29Ynq WRtymWrWyU41A4IUebNsbzPGj7WVUhgAIyy7/s1kl5Aj4lQo+eLSapGW71ynEA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657837931; a=rsa-sha256; cv=none; b=rK57k9FveWZfEUrRtkBKUcO/pc83+w3Oe9L7UZzHXy/qvwQxoIKvlRkY3daIl//jTAX9V5 fna7cZH5V1JT6cMtoFO0KKE0apK3RgwYMHZZwSHdypwPQSQUKHXhVUY1eMqLUtNm9BoYs7 nniXQKK04DhcoYRbXJo/lPNRYkvDg6YNybizyARpltFD1IFhXuFBUUkTKJT0SKLZcSM75j EdhuVf+MPy2yhVlMFjtY5fMswYJB7jXoc2f97Xit+ny8qVcK4mcUpi0HnDoSmaS07qzeC+ J4+Jba5+GS5I35Tx2cHOaTV5FNORju3nbUpTD96diMznV0A8tfkqXueCMskvgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="XsLxvE/y"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="XsLxvE/y"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B977D29EFD X-Spam-Score: -3.95 X-Migadu-Scanner: scn1.migadu.com X-TUID: EiEgPJnzJSTQ good idea for command. i like the additional ideas too like the help text [i hae that put in echo area even in gui]. for even more blue sky stuff, i was thinking along the lines of information about characters, such as en/locale meanings for cjk. or furigana [ruby text] for the echo area. requires lookup though. (to go along with meanings for input method. :)) On 7/14/22, Marcin Borkowski wrote: > > On 2022-07-13, at 12:49, Juan Manuel Mac=C3=ADas = wrote: > >> Sorry for the slight offtopic. > > Not off-topic at all, as far as I'm concerned! (Though sending this to > help-gnu-emacs might be an even better idea.) I use `C-u C-x =3D' pretty > often, so I fully understand why someone might want to code something > like this. Very nice, thanks for sharing! > > You might want to extend it and create a minor mode which would display > data about the current character in the echo area, Eldoc-style, or in > a tooltip when you hover the mouse pointer over a character. Depending > on what exactly you need, these ideas might be more or less useful, of > course. > > Also, since the answer to quite a few org-related issues seems to be > "just insert a zero-width space", making those stand out (like > non-breaking spaces already are) could also be useful. FWIW, I have > this function in my init.el: > > (defun insert-zero-width-space () > "Insert Unicode character \"zero-width space\"." > (interactive) > (insert "=E2=80=8B")) > > (of course, the 0-width space is invisible between the quotes). > > Best, > mbork > > > >> Since Unicode and character issues come up here from time to time, I'm >> sharing this 'homemade' function that I wrote a long time ago for my >> work, in case someone finds it useful. It Shows a brief descriptive list >> of all characters in a word at point. Each character includes the >> Unicode name, code, and canonical decomposition. Example: >> >> =E1=BC=84=CF=81=CF=87=CE=BF=CE=BD=CF=84=CE=B1 >> >> >> =E1=BC=84 (#1f04) ... GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA ... d= escomp: >> #1f00 #301 >> =CF=81 (#3c1) ... GREEK SMALL LETTER RHO ... descomp: #3c1 >> =CF=87 (#3c7) ... GREEK SMALL LETTER CHI ... descomp: #3c7 >> =CE=BF (#3bf) ... GREEK SMALL LETTER OMICRON ... descomp: #3bf >> =CE=BD (#3bd) ... GREEK SMALL LETTER NU ... descomp: #3bd >> =CF=84 (#3c4) ... GREEK SMALL LETTER TAU ... descomp: #3c4 >> =CE=B1 (#3b1) ... GREEK SMALL LETTER ALPHA ... descomp: #3b1 >> >> >> #+begin_src emacs-lisp >> (defun describe-chars-word-at-point () >> (interactive) >> (setq chars-in-word nil) >> (if >> (not (current-word t t)) >> (error "Not in a word at point...") >> (let >> ((word (current-word t t))) >> (save-excursion >> (with-temp-buffer >> (insert word) >> (goto-char (point-min)) >> (while (re-search-forward "\\(.\\)" nil t) >> (let* ((char-name (save-excursion >> (backward-char) >> (get-char-code-property (char-after >> (point)) 'name))) >> (char-desc (save-excursion >> (backward-char) >> (get-char-code-property (char-after >> (point)) 'decomposition))) >> (char-format (concat (match-string 1) "\s" "(" >> (format "#%x" (string-to-char >> (match-string 1))) >> ")\s...\s" char-name >> "\s...\sdecomp:\s" >> (mapconcat (lambda (cod) >> (format "#%x" >> cod)) >> char-desc " ")))) >> (push char-format chars-in-word))) >> (when (get-buffer "*chars in word*") >> (kill-buffer "*chars in word*")) >> (get-buffer-create "*chars in word*") >> (set-buffer "*chars in word*") >> (insert (mapconcat 'identity >> (reverse chars-in-word) "\n")) >> (view-mode) >> (temp-buffer-window-show "*chars in word*" >> '((display-buffer-below-selected >> display-buffer-at-bottom) >> (inhibit-same-window . t) >> (window-height . >> fit-window-to-buffer)))) >> (pop-to-buffer "*chars in word*"))))) >> #+end_src > > > -- > Marcin Borkowski > http://mbork.pl > > --=20 The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com