From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cJE3K5Y50GJ2ggEAbAwnHQ (envelope-from ) for ; Thu, 14 Jul 2022 17:43:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ME3bKZY50GIs1wAAG6o9tA (envelope-from ) for ; Thu, 14 Jul 2022 17:43:18 +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 534BB30F5D for ; Thu, 14 Jul 2022 17:43:17 +0200 (CEST) Received: from localhost ([::1]:55750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC0zk-0003Df-G1 for larch@yhetil.org; Thu, 14 Jul 2022 11:43:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC0z3-0003C8-EB for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 11:42:33 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:38334) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC0yz-0008SR-LW for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 11:42:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 65577E6680; Thu, 14 Jul 2022 17:42:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5mp_jTc2hpWv; Thu, 14 Jul 2022 17:42:13 +0200 (CEST) Received: from localhost (83.21.46.80.ipv4.supernova.orange.pl [83.21.46.80]) by mail.mojserwer.eu (Postfix) with ESMTPSA id CE924E6276; Thu, 14 Jul 2022 17:42:12 +0200 (CEST) References: <87y1wxwalv.fsf@posteo.net> User-agent: mu4e 1.1.0; emacs 29.0.50 From: Marcin Borkowski To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [tip/offtopic] A function to describe the characters of a word at point Message-ID: <87edyn4sal.fsf@mbork.pl> In-reply-to: <87y1wxwalv.fsf@posteo.net> Date: Thu, 14 Jul 2022 17:42:08 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=195.110.48.8; envelope-from=mbork@mbork.pl; helo=mail.mojserwer.eu X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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=1657813398; 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; bh=A4gJq+Q11Vvg6qHut1SgU3OgdeZt/M+m5t6JOTCG7qI=; b=ozpAukP9LI00kHZN5s0MhJpgO3tELGwB+X37k9U0D0AnhFYXJwdSMTIvrSvntqaaIgITEV CjoNcR/PiQke0QCRBURJD1NfyP4m0Y069/DiHeN8L7T2IvDdS+Eii54FesqY4/gp/4BQ0m twWjsxlcRGr/dCiEROXrsuwAF/KDzDwYssdWniyjCOuQtyThM36shuWzhFkYf7rj2k/4/W TUCms4LBDyE8/SR/Xc5DuScTLdQJs8UpwHrUiAlepJi7FBR+1/fEdiO1bVNDJ80/vnCllr +i3Mg+2ipWrTdxaNaJPoSa/fB0OvEjUt81oWh22WE0/eEwQ7D2tO867jt6CDbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657813398; a=rsa-sha256; cv=none; b=iLV5Rxp+RSN4MVM7FqtWgNw0bKbdKdPSGtuwQ6aRtehb4haBkbfLa/xKVIhQCEglYXWpqs p0oC6jwURxi1+sdSJVrIenfaov0mrhLfhl1V2a0dfxF07RxBQ83j/yJLMeL0CvT6damIm3 /vJbZKZYC/wxSMPyLmb9LBgKwhwTo6mes5Xd0i4kfsxhdCB0ZklNM8kEHZErc4mXzN6rIT nHhTDXDXKM0+EwrfUjGpvb50n0DJTJIjI4uWfCI0oMD1SIkCo9QzaW3tSrWjDrbGAPpXDK 6gqfZsVIle/2ZYNV5xTkydSjKQMERevKgRxoJBAuKgQzwJYb0rZWKdQZb9jyAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 534BB30F5D X-Spam-Score: -2.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: jpUrRXh9Elqh On 2022-07-13, at 12:49, Juan Manuel Mac=C3=ADas w= rote: > 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 ... de= scomp: #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 (po= int)) 'name))) > (char-desc (save-excursion > (backward-char) > (get-char-code-property (char-after (po= int)) 'decomposition))) > (char-format (concat (match-string 1) "\s" "(" > (format "#%x" (string-to-char (= match-string 1))) > ")\s...\s" char-name "\s...\sde= comp:\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 dis= play-buffer-at-bottom) > (inhibit-same-window . t) > (window-height . fit-window-to-buf= fer)))) > (pop-to-buffer "*chars in word*"))))) > #+end_src --=20 Marcin Borkowski http://mbork.pl