From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2EReJeVff2DoqQAAgWs5BA (envelope-from ) for ; Wed, 21 Apr 2021 01:12:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kBzYIOVff2CrUAAAbx9fmQ (envelope-from ) for ; Tue, 20 Apr 2021 23:12:37 +0000 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 CD9EC2D4DA for ; Wed, 21 Apr 2021 01:12:36 +0200 (CEST) Received: from localhost ([::1]:42610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYzXn-0006tG-IG for larch@yhetil.org; Tue, 20 Apr 2021 19:12:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYzXP-0006tA-HJ for emacs-orgmode@gnu.org; Tue, 20 Apr 2021 19:12:11 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:41809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYzXM-0007i6-BI for emacs-orgmode@gnu.org; Tue, 20 Apr 2021 19:12:11 -0400 Received: by mail-pg1-x533.google.com with SMTP id f29so27884493pgm.8 for ; Tue, 20 Apr 2021 16:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=p5Y8myPsL9fMlLiHHdVVkWC3V182epvSbqNhxil1QTg=; b=K4GGaClxlFVBbIRxNSiqwhjjFVTCHiR6j+dNSZxSEHkFsR5/Mv7ZleUAu3LtpPt2y8 jJ7VOj6G33ryL2YCplPi7E6vowwr4+CoQuPnQYB/0RAlq/NVi5Elwlpg8zG0kOTsG812 A8K6A5XlctxqFpdfEItFRr1MeejBzkmDGKTwzYiygvqk1iLVXEpnfg6Mp+m0jEUl8WWK NdTWr313gVp6tlxCiaFYs1AE1K3hFNAByDNAQRqiL16wGF60BhrnqFmlrCljZuTu3AUV YYgieYNcv6a7iHyshae3yYs1KiuYa6y6rQtG626CaIps5cEgy+/18oPjGiMkHkozINTz TCcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=p5Y8myPsL9fMlLiHHdVVkWC3V182epvSbqNhxil1QTg=; b=h8A7WMTbEiKXsujuyLRcrEHhjgxsXstHAuTBJnCPEhu4XTEuhidVFVqyOMNYIqFv0N GqwoFRhyc+xwUeNlhDejkA0dELjOQZm7jgGJvvyDQlpu+fGGU1wa7bEMooCLz9K86cpJ wpWJlwJpZ0t1R7wrbiRCTG0d41+bGjWKQAMYcsdeY2fx1ADEtJSavFS8PP3euZhTdUlM 6fRYg52lzDaEmrd34Ojc43xXdHOUfR5sUeTQXY/2SLe7MP3NeOEvHTMb02Oraws0PN6w JQtIW8m95kMLM1lTu7eOrcVe4ca+1c7rQd+HLcmdKKGmWRjhAvMWJMQYlo/6eteC+Z7T h2ew== X-Gm-Message-State: AOAM530RcCCz5k0UgOvXoE9KKi6ECx2qiR0MBspb5UO/f7XwC1ldfWNY 0R272Zg6IzWtFID2ehpGpM7buNYToug= X-Google-Smtp-Source: ABdhPJx5BelcRVlcCD4dsQ3z87m6MG/HJ8WSHa8vrI8Sv2CLYAMm9Bzt5UpH/YAgwoEmj5AI1CpJ3w== X-Received: by 2002:a63:ef06:: with SMTP id u6mr18419736pgh.252.1618960326590; Tue, 20 Apr 2021 16:12:06 -0700 (PDT) Received: from tim-desktop (106-69-117-182.dyn.iinet.net.au. [106.69.117.182]) by smtp.gmail.com with ESMTPSA id k1sm119562pgk.9.2021.04.20.16.12.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 16:12:05 -0700 (PDT) References: <877dlnf7vw.fsf@gmail.com> User-agent: mu4e 1.5.11; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Using backticks for the inline code delimeter? Date: Wed, 21 Apr 2021 08:30:08 +1000 In-reply-to: Message-ID: <87y2dcim9p.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x533.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 autolearn=ham autolearn_force=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618960357; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=p5Y8myPsL9fMlLiHHdVVkWC3V182epvSbqNhxil1QTg=; b=cFOlsgcN+vO6D9OVdXwFt2KluG/d/xjI/zE1xCVL8j4Ez4tDWJjxWZ9s4ydfsNhb9RuCjK BbwtX+PTxsAWhumCd10cVemz9640X75NRu20SJ4c/UljhaSFh8ALtOQg3y4wRgeXYZeSer hAh2FuS1I8vYgb3qTefQbqu8Y+qM91s3x17UvB21wvKGdV+gLY3Oetfd91bCmcqhr8PN5c KgNFD9mddIdIluAdahPHWZezbaaZsXd3GoaxwD9zHiVSaxtmPpayirMRkueWXX7upxAn07 3cMMNJAm8JF4KGoAMoRjYiCCJ9ZYE6UMcgH3YSZEtyJ8IjfmrDQPp6PFcG66Ew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618960357; a=rsa-sha256; cv=none; b=YqipADRo5XYF4cYlDuMduIHgAIpUhSWfz8dewJZOPDcxVnfyZQX8d8wFh1Pvi4F5ZKgo1J KY+pLbmZZN8ObdaHkE+vePXCE0YYU1Wu3dSQHETTRXezidyBGZrD3WHyRsdpF0TLoltps9 77719yDvJQAyOcR79gwYaD+iXdqC1+wJVvIajiSEQ4YekPeWov0wasyu53z4oVtXlTqu0F vHqbFmacYhlEdjibZxjZ9Wtt/rJwmgM0jQ4R84PKt05Npt+GQmNhpfLNt73wZERAe3tT/g XNf8y8k8b8SQVQYOxvNLsmlbXv6/n8547u6dmxhuU5wk+QrJu6qn7PzWiBjFfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=K4GGaClx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=K4GGaClx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: CD9EC2D4DA X-Spam-Score: -2.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: zL0ZiEpNQkL0 Matt Price writes: > On Wed., Mar. 31, 2021, 3:22 p.m. Timothy, wrote: > > autofrettage writes: > > > Quick and Dirty: Bind key '`' to ~ in Emacs? > > > > (I guess it is clear I haven't thought about the consequences.) > > You can add that just to the Org-mode map. That wouldn't be too bad, > there's always C-q. > > Is it possible to bind a key in org-mode but bind it back to another character if you're in a special environment, eg a code block? That would > probably be my preference. So "`" inserts "~" when you're writing text but "`" in an elisp or markdown SRC block, for instance. > > I guess just write a function that checks context? Presumably all the overloaded keybindings do this already but I guess I don't really know how they > do so. > Yes, you can do that. However, results can vary. The 'bottleneck' is in determining context. If that is easy, typically no problems. However, if you need something complex or need to scan a large part of the buffer to determine the context, then it can be problematic. > I do in general wish it were easier to switch between writing markdown and writing org, since I often have to write markdown for work. > Sounds like what you really need to do is define a set of key bindings which use the same bindings in both org and markup modes (different bound functions obviously). Instead of entering the character for 'code' using org syntax when in org and markdown syntax when in markdown, you just train your fingers to hit the key binding you have defined for entering 'code'. One nice advantage of this approach is that you can define functions such that if you hit that key binding it will insert the mode specific character if no region is selected, but if a region is selected, wrap that region using the nominated character. This is handy when editing a document because if you come across a section and want to have it rendered has code, bold, underlined etc, you can just select the target region and hit the appropriate key and job done. The other nice thing about this approach is you can generalise this further to other modes, even HTML. You then think in terms of either formatting or semantics (depending on how you define the bindings) and not the lower level syntax. The challenge can be in identifying the most appropriate key bindings. This can depend on the platform you use as well. When I was only using Linux, I used the 'super' key for this and it was great. However, when I also started using a mac, I had to define a new scheme. It can take a bit of work to setup initially, but I think it is worth the effort. I now have the same bindings in multiple modes, so regardless of whether I'm writing markdown, org, html, rich text, etc, I just hit the same key bindings to mark content as code, bold, italic, etc. -- Tim Cross