From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id REDVB9uXr14tDwAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 04:19:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eON6C+WXr17CWwAA1q6Kng (envelope-from ) for ; Mon, 04 May 2020 04:19:49 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 C1E239419DF for ; Mon, 4 May 2020 04:19:47 +0000 (UTC) Received: from localhost ([::1]:35738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVSa1-0005Re-RZ for larch@yhetil.org; Mon, 04 May 2020 00:19:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVSZW-0005RR-CF for emacs-orgmode@gnu.org; Mon, 04 May 2020 00:19:14 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:33825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVSZU-0007qy-U5 for emacs-orgmode@gnu.org; Mon, 04 May 2020 00:19:14 -0400 Received: by mail-pj1-x102b.google.com with SMTP id h12so6176684pjz.1 for ; Sun, 03 May 2020 21:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=EbweNg3kuzP7NkZrfzHMFGf7HCdCMrh+XMgd5EsixuU=; b=NAWIOXsRjf0JzMrstySi8st8HIRN71FEz6Ai9uDes+w9nevwiU2bH26mZd6RlZvkS5 ERFA9NvJzNZJECtiPBFzkD70SuGdHBnavFrZRtuOj1CVQSdclXY0+cJnGrG/gzphdQh9 NbFTXNMCjiii21EXFt0vs40yTHg+woDmj5miy/Ez+WGPUE71X18sogP4hNlmN89iDMWU QNwcly+Ns4eq+Zh4bowOlrYm/Cb+y8eHxtkSqnioMdKDqVh4BOhbmP9ZWAsBTbl0T6EC nWEpd1iT14wtMfAvEhxMKlXHVOUqPtT2yalhaGU+wa7rrpllIKGvqZCup1DMkufdfSKA Zy3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=EbweNg3kuzP7NkZrfzHMFGf7HCdCMrh+XMgd5EsixuU=; b=HJ9fFAVirGwEkBH1dLKZoDWEDiYZ849oK9GUYJJkmRztD9Ke+MgmmQvcmC4R/w83MN xBI6htn05SUcce8UTvVohVdriZKbKS/Wul7m5Tpl7KITYDSL6gwr2BgaDCHzct8WokzY nR1NJd8AaotTAzMNhgu1lI321bO5tzazv+yzlOuGuaOCt/Q3qFJN4LC1cFP/z4JPQreI wz7TFBPdHi/U5N3gfClcgj4auG5zo4bpOgLEY9wOIaB0WvHPgwzbEMkNSUn1tMyFnF6n VrcIozqHZadGlIbqorAcvlXJzMbzVirdXnAlfmjmWf3RpzOYhAs6OaNxGJ8zhHqDdfAz VdCg== X-Gm-Message-State: AGi0PuZrk3sLMxxEFlR0I7bqEknyQ0gK8NUu8/zt85yMET2VOBe3w2X+ q/Qci6WC+ulZBHPADIdZcjs= X-Google-Smtp-Source: APiQypIKoUDQdWWRLgI184pFLHzODPRW4IGNSWYyQHjy6SMjHIs+hrxAnWOQx9Ek9MPJ/Zl/5PDWNA== X-Received: by 2002:a17:902:ea86:: with SMTP id x6mr13436694plb.241.1588565950967; Sun, 03 May 2020 21:19:10 -0700 (PDT) Received: from localhost ([210.3.160.218]) by smtp.gmail.com with ESMTPSA id z5sm7445637pfn.142.2020.05.03.21.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2020 21:19:10 -0700 (PDT) From: Ihor Radchenko To: Diego Zamboni , Daryl Manning Subject: Re: Tricking org-mode into using markdown conventions In-Reply-To: References: Date: Mon, 04 May 2020 12:15:05 +0800 Message-ID: <874kswnxo6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_SBL=1.623, URIBL_SBL_A=0.1 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=NAWIOXsR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.21 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49390168421683]; DWL_DNSWL_FAIL(0.00)[gmail.com:server fail,2001:470:142::17:server fail]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.14), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[yantar92@gmail.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; URIBL_BLOCKED(0.00)[sutd.edu.sg:email,zzamboni.org:email,wakatara.com:email,pank.eu:url]; TAGGED_RCPT(0.00)[orgmode]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: ea8M/vzvEkwO > I did a quick test, and it seems > that =3Dprettify-symbols-alist=3D (which is what this code uses) can only > replace for a single character, so I was not able to make it display > the three backticks, but there might be other techniques that can be > used. Yes, there is another technique. See part of my config below: (defun yant/str-to-glyph (str) "Transform string into glyph, displayed correctly." (let ((composition nil)) (dolist (char (string-to-list str) (nreverse (cdr composition))) (push char composition) (push '(Br . Bl) composition)))) (append pretty-symbol-patterns `(((yant/str-to-glyph " ") org-specific ,(format "^\\(\\*\\{%d,%d\\}\\)= \\*[^*]" (1- org-inlinetask-min-level) (1- org-inlinetask-max-level)) (org-= mode) 1) ((yant/str-to-glyph "=E2=87=92=E2=87=92=E2=87=92") org-specific ,= (format "^\\(\\*\\{%d,%d\\}\\)\\(\\*\\)[^*]" (1- org-inlinetask-min-level)= (1- org-inlinetask-max-level)) (org-mode) 2) (?=E2=95=AD org-specific "^[ ]*#[+]NAME" (org-mode)) (?=E2=95=AD org-specific "^[ ]*#[+]name" (org-mode)) (?=E2=94=9C org-specific "[ ]*#[+]begin_src" (org-mode)) (?=E2=94=9C org-specific "[ ]*#[+]BEGIN_SRC" (org-mode)) (?=E2=95=B0 org-specific "[ ]*#[+]end_src" (org-mode)) (?=E2=95=B0 org-specific "[ ]*#[+]END_SRC" (org-mode)) ((yant/str-to-glyph "=F0=9F=93=81=F0=9F=93=81=F0=9F=93=81") org-s= pecific ":\\(ATTACH\\):" (org-mode) 1) ((yant/str-to-glyph "=E2=98=A0D") org-specific "\\ writes: > Hi Daryl, > > If it's for display purposes only, you might be able to simply use > display substitutions for things to appear the way you want. For > example, I use the technique described here: > https://pank.eu/blog/pretty-babel-src-blocks.html to replace the > begin/end_src strings with symbols. I did a quick test, and it seems > that =3Dprettify-symbols-alist=3D (which is what this code uses) can only > replace for a single character, so I was not able to make it display > the three backticks, but there might be other techniques that can be > used. > > --Diego > > On Sun, May 3, 2020 at 6:24 PM Daryl Manning w= rote: >> >> While using C-c C-, is easy enough for insertion and such, I was wonderi= ng if there was any way of having org-mode honour markdown conventions for = things like code fences and quotes. >> >> ``` elisp >> #+begin_src >> #+end_src >> >> #+begin_quote >> #+end_quote >> ``` >> >> being a bit nicer to read with >> >> ``` go >> code block >> ``` >> as well as >> >> > And gentlemen in England now-a-bed. >> > Shall think themselves accurs'd they were not here, >> > And hold their manhoods cheap whiles any speaks. >> > That fought with us upon Saint Crispin's day. >> >> Just curious as to whether that's possible. YMMV before you start debati= ng on whether you think this is a good idea or not... =3D] >> >> Of course, I'd want the code highlighting especially to work that way, t= hough... =3D] Less concerned with whether it works in export modes for the= moment, more about display atm. >> >> thanks! >> Daryl. >> >> >> >> >> > --=20 Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong U= niversity, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg