From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs Subject: bug#38485: "prettified" symbols Date: Fri, 6 Dec 2019 00:51:25 -0500 Message-ID: References: <3183ba6c-6aea-fa25-bb32-7e5ff7c04ad6@gmail.com> <83y2vshyvn.fsf@gnu.org> <478afae1-0080-c825-5a53-1bc8e897a1cc@gmail.com> <83sgm0hvhx.fsf@gnu.org> <4e6c87d3-21c0-1820-96f2-62bb0dd7c925@gmail.com> <83r21khquw.fsf@gnu.org> <32a6f122-f21a-4522-21d6-0ae0a17b6bee@gmail.com> <83o8wnigy5.fsf@gnu.org> <83a786iyvc.fsf@gnu.org> <5b3d638e-5913-2c3d-dba1-0c3f387a7ff2@gmail.com> <83o8wmh705.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="208507"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 Cc: casouri@gmail.com, 38485@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 18:20:00 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idHGp-000s5R-Ta for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 18:20:00 +0100 Original-Received: from localhost ([::1]:41738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idHGo-0001xp-0N for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 12:19:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idGKN-0006I5-8M for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idGKK-0003lh-TE for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:35 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idGKK-000358-PY for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:32 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1id6X3-00017l-Pp for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 00:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2019 05:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38485 X-GNU-PR-Package: emacs Original-Received: via spool by 38485-submit@debbugs.gnu.org id=B38485.15756114964243 (code B ref 38485); Fri, 06 Dec 2019 05:52:01 +0000 Original-Received: (at 38485) by debbugs.gnu.org; 6 Dec 2019 05:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:45536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1id6Wd-00016I-OQ for submit@debbugs.gnu.org; Fri, 06 Dec 2019 00:51:36 -0500 Original-Received: from mail-qk1-f177.google.com ([209.85.222.177]:39634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1id6Wb-00015s-He for 38485@debbugs.gnu.org; Fri, 06 Dec 2019 00:51:34 -0500 Original-Received: by mail-qk1-f177.google.com with SMTP id d124so5555433qke.6 for <38485@debbugs.gnu.org>; Thu, 05 Dec 2019 21:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IU9WpfEPyRWXPWyNme8NxGz7/UQbZiYN1dZXl1PTR50=; b=LCjRK+b1IGNvncU1yhiRyQFPekeAyX4D2Uy7Yor8v/i/2zXO0WCPKKZORfaXR2D037 C8QRTOQHKu5SmV3v6v5xlrKMf9q7Dy7rGXms2P5XeMJD/Bm3UYpSCeMDpJ7gUf/+b3JN MSfRpcYay1aUxM1i0QzJ10ZBrjM92YdleYCLwmL370rU0qgBR9KdrRnEOG+/k0X7uvcv SnfmgWJnNQwgl/gSSHGjVrm3utp2CXCV28wDggl+R6AxcouA1W4ntqd69wNXZXwYe8BY 5bVGfs+eZJ8tK5xy816H6mVetq2HtPTq4trc8mO14xui5Z5lGsdJMlbK4AZ0PM4YNe2G oQQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IU9WpfEPyRWXPWyNme8NxGz7/UQbZiYN1dZXl1PTR50=; b=tEGK3RcmcSSFrd1BwSe0w67yCLTC1AiRjyrVjMZXwjZB5etBcynr3zjvynVnDRtsJu kcsZ+vJ4tsn9VDA+8ap94Wl2CfyOD3rJrKm3PUsa0A/ZhERJuoxVmuVWoj0gUiWMat8o aCBYoNgCIn5kEA+I5KIZp1di0oPD72dTjH2lDeNwE95uisx80JanyikfPgjZTmUFL/75 lI+N9VO2hMz70gJFnIeSRnw1AlrBuSZqDwd+uS6gAdGb6FrmQ9MZOEkwIgiXAQDTGpiz uIHVGdyi9MAYVuCULtK9m7Lo9tG4vGH5JhcI8axnmy0Qxz3IVVhs57w2EJzeaAsrxQ/L QJYw== X-Gm-Message-State: APjAAAUPhl9yQ0FiH5T1HfTnofdGLtxq8zjxCEr7TqSjBw01OBObBNwq xynoH/3DxcjfGOHOLQi8SBKzIzUi X-Google-Smtp-Source: APXvYqxsyhKhWAjNnVhg9IAbDmCX4LPk/yFI3k8LX3cwzwDl3cf7yhs5Lskb9tMdWwcfJdp6R58DZA== X-Received: by 2002:a37:b842:: with SMTP id i63mr12146961qkf.451.1575611487748; Thu, 05 Dec 2019 21:51:27 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:c1ed:a694:851c:6c56? ([2601:184:4180:66e7:c1ed:a694:851c:6c56]) by smtp.googlemail.com with ESMTPSA id z4sm5571867qkz.62.2019.12.05.21.51.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Dec 2019 21:51:27 -0800 (PST) In-Reply-To: Content-Language: en-GB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172952 Archived-At: On 2019-12-05 23:15, Richard Stallman wrote: > Would someone please send me a 10-line general explanation of > what the "prettified" symbols feature does, or would do?> > In what modes or contexts would this operate, by default? Happy to oblige :) prettified-symbols-mode is a minor mode that appeared around Emacs 24.5 or so, a few years ago. It lets users instruct Emacs to change the way certain words or symbols are displayed, to make the contents of the buffer more visually appealing or easier to read. It doesn't change the actual contents of the buffer, nor what gets saved to disk. For example, consider the following bits of C and C++ code: pstr->wcs[idx] != WEOF || pstr->valid_len == idx + 1 std::cout << (x >= 0); If I set prettify-symbols-alist to the following value: (setq-local prettify-symbols-alist '(("->" . ?→) ("!=" . ?≠) ("==" . ?≡) (">=" . ?≥) ("||" . ?‖) ("::" . ?∷) ("<<" . ?≪))) then Emacs will display these snippets thus: pstr→wcs[idx] ≠ WEOF ‖ pstr→valid_len ≡ idx + 1 std∷cout ≪ (x ≥ 0); I don't think this feature is enabled by default in any mode that ships with Emacs, but it is in some third-party packages. It is particularly popular for users of math-oriented programming languages; for example, this is the value of prettify-symbols-alist in fstar-mode: '(("exists" . ?∃) ("forall" . ?∀) ("fun" . ?λ) ("nat" . ?ℕ) ("int" . ?ℤ) ("True" . ?⊤) ("False" . ?⊥) ("*" . ?×) (":=" . ?≔) ("::" . ?⸬) ("<=" . ?≤) (">=" . ?≥) ("<>" . ?≠) ("/\\" . ?∧) ("\\/" . ?∨) ("~" . ?¬) ("||" . ?‖) ("<==>" . ?⟺) ("==>" . ?⟹) ;; ("<==" . ?⟸) ("->" . ?→) ("~>" . ?↝) ("=>" . ?⇒) ("<-" . ?←) ("<--" . ?⟵) ("-->" . ?⟶) ("<<" . ?≪) ("<|" . ?◃) ("|>" . ?▹) ("'a" . ?α) ("'b" . ?β) ("'c" . ?γ) ("'d" . ?δ) ("'e" . ?ε) ("'f" . ?φ) ("'g" . ?χ) ("'h" . ?η) ("'i" . ?ι) ("'k" . ?κ) ("'m" . ?μ) ("'n" . ?ν) ("'p" . ?π) ("'q" . ?θ) ("'r" . ?ρ) ("'s" . ?σ) ("'t" . ?τ) ("'u" . ?ψ) ("'w" . ?ω) ("'x" . ?ξ) ("'z" . ?ζ)) You should try it :) It's packaged with Emacs, and it's a really neat feature. Clément.