From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aNQuFyovA195XgAA0tVLHw (envelope-from ) for ; Mon, 06 Jul 2020 14:03:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6GTmEiovA19hRwAAbx9fmQ (envelope-from ) for ; Mon, 06 Jul 2020 14:03:22 +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 A76A29400BF for ; Mon, 6 Jul 2020 14:03:21 +0000 (UTC) Received: from localhost ([::1]:51254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsRiK-0002dF-7H for larch@yhetil.org; Mon, 06 Jul 2020 10:03:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsRgj-000160-MQ for emacs-orgmode@gnu.org; Mon, 06 Jul 2020 10:01:41 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:44067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsRgh-0007IB-So for emacs-orgmode@gnu.org; Mon, 06 Jul 2020 10:01:41 -0400 Received: by mail-qk1-x734.google.com with SMTP id b4so34764401qkn.11 for ; Mon, 06 Jul 2020 07:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version:content-transfer-encoding; bh=iTkwlDSyuVOW8jmFSY19hSCc9Aw1nMBCn/rSvjR/Ohs=; b=UZ3l8CfjoTUyIrvIyuZUD5K8ArYz7aepLFMi8ysugjfBteIQkMBOQyy4RFC/p0N4QA gPfptxyHnGVsKDORJn7i2naKUgrJN6EfFaKBBgWm+Smt2RY71vqNj0JYIXJpCydMofIW KUZxuKzgj7wd4E2XTt6jy9/C6gMjeAmzS4mkJWJSx5ral1Hu3qHMQIkCeKgpiyGdAH1M 5PpXpGbU/kpS/RfDpJRYCj42h3T/8jtliEEaPb1XBp3t0FgjXYGHdRUzBqAR/93YVpPr PGYdYAP6oI9tPf6Y1vfpure7uvNVlnavIW6Xntf+JMV0IXdYBbmedovctOIjq2B9lvmx bj3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version:content-transfer-encoding; bh=iTkwlDSyuVOW8jmFSY19hSCc9Aw1nMBCn/rSvjR/Ohs=; b=cyXqX4f4WOoVfXj7DWRo5G6FBDmeEYv+zaCZELmcA3URTnU8FjVZi7/owmkdXR3C9Z 8TlDLeKtZpj5v6YJm2VuMaDM04BJ1qjC9wbn94i4QnP1Jdps01N2I0b0vX61RyPEHdLh /K/BECvsBqanzIrjh/wIKRI8T3vOWr/tDbIeEYJB7jhCSZtWH3OP/3YRl5+Emj6dGhFB x1FR6kRHBxySP3CyjmSWwPZk1PtiW6r9VPqiFG1HfKacKaEQE/5RQ+ljY0V4K2rXTh9X KqWdYgQPfsF/oHGj5HV0DKVG20/laDqMl2uNByA4BapA/qSjZGcXPmWCj8p3GiZTkFQU fihA== X-Gm-Message-State: AOAM5319ZYoYirz/HnRVo3QB2/jC67c3h749j/Jx8KfhsWD3LNQqPbsy SWhcqa4nK4kaZlNvlKpwsUb1RYw53HA= X-Google-Smtp-Source: ABdhPJzSC8qzaWpR7yEnfrhMb9W35oAuv+eH7JmyxE+Wkfyjh9fxrZWQJsM7LR0RmlZ9OvXZyr29fw== X-Received: by 2002:a05:620a:148d:: with SMTP id w13mr38145539qkj.215.1594044098288; Mon, 06 Jul 2020 07:01:38 -0700 (PDT) Received: from gusbrs-laptop ([193.37.252.69]) by smtp.gmail.com with ESMTPSA id g16sm24219599qko.5.2020.07.06.07.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 07:01:37 -0700 (PDT) References: <877dvzwtdy.fsf@kyleam.com> <87d05rcpgh.fsf@gmail.com> <871rm6wson.fsf@kyleam.com> <87mu4svaj9.fsf@gmail.com> <87lfkctqkl.fsf@nicolasgoaziou.fr> <877dvus2mx.fsf@nicolasgoaziou.fr> <87r1tq44ms.fsf@nicolasgoaziou.fr> <87o8ot4rh3.fsf@gmail.com> User-agent: mu4e 1.4.10; emacs 27.0.91 From: Gustavo Barros To: Nicolas Goaziou Subject: Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region In-reply-to: <87o8ot4rh3.fsf@gmail.com> Message-ID: <873664yc77.fsf@gmail.com> Date: Mon, 06 Jul 2020 11:01:32 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=gusbrs.2016@gmail.com; helo=mail-qk1-x734.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: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_HELO_NONE=0.001, SPF_PASS=-0.001 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: emacs-orgmode@gnu.org, Shankar Rao Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=UZ3l8Cfj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Spam-Score: 0.09 X-TUID: EqCrT4yygMj2 Hi Nicolas, Hi All, On Sun, 05 Jul 2020 at 17:49, Gustavo Barros =20 wrote: > A fourth issue is point placement after the emphasis is=20 > added. `org-emphasis' > takes a stance here and places point within the emphasis. I do agree=20 > with this > option, but it is still true that sometimes, one might want or need=20 > otherwise. > This, of course, gets more interesting when=20 > `org-hide-emphasis-markers' is t. > And I actually think this issue is still more general. One thing is=20 > to "add > emphasis markers to existing text", another is "adding text around=20 > existing > emphasis markers". The first one is superbly dealt with by this > implementation of `org-emphasize', the second one, as far as I can=20 > see, not > equally so. After sleeping over this problem, I think I had an interesting idea to=20 allow some control of point position in an intuitive fashion. I thus=20 submit it to the list. Consider the following suggested behavior for `org-emphasize': i)=20 anything in the direction opposite to the emphasis expansion direction=20 is ignored, regardless of whether point is at a word boundary or not on=20 that side (this corresponds to the current implementation, but goes=20 against my initial suggestion of considering the right boundary of a=20 word as "part" of the previous word); ii) point never moves (and this is=20 different from the current implementation). Simple, clear cut rules. And they would make it possible to control=20 whether point is placed within or outside the emphasis markers by=20 manipulating point position wrt whitespace /before/ calling=20 `org-emphasize'. So, taking the current forward expansion direction, if=20 we wanted to emphasize the following word, we would have: i) if the=20 point is placed before whitespace preceding the following word, point=20 will be left where is is, which will result to be outside the emphasis=20 markers; ii) if point is within a word (which includes the left=20 boundary) point will end inside the markers; it also hasn't moved, just=20 the marker was applied before it. Some examples, again assuming forward expansion: #+begin_src org foo|=C2=B7bar foo=C2=B7|bar foo=C2=B7b|ar foo=C2=B7bar| #+end_src for `M-o *', the results would be: #+begin_src org foo|=C2=B7*bar* foo=C2=B7*|bar* foo=C2=B7*b|ar* foo=C2=B7bar| #+end_src Assuming a backwards expansion direction was to exist (and the more I=20 think of this, the more I lean towards preferring this as the default),=20 we could do the following. I'm typing something: #+begin_src org foo=C2=B7bar| #+end_src But then I decide to emphasize "bar", and only "bar". I could go with=20 `SPC M-o *' to get: #+begin_src org foo=C2=B7*bar*=C2=B7| #+end_src And be able to just keep on typing: #+begin_src org foo=C2=B7*bar*=C2=B7baz| #+end_src I wouldn't say this goes all the way to solve the "adding text around=20 existing emphasis markers" problem. But, as far as my scrutiny went, I=20 do think it goes quite a stretch. And it is quite simple, which should=20 make for "intuitive" hopefully. WDYT? Best, Gustavo.