From mboxrd@z Thu Jan 1 00:00:00 1970 From: Win Treese Subject: Re: open link in source code block Date: Sat, 5 Jan 2019 10:41:20 -0500 Message-ID: References: <8585C713-3A24-4FE3-A187-A4587F3ADC97@acm.org> <87y37zo0za.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggsout.gnu.org ([209.51.188.92]:51451 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfo4t-0004h5-1f for Emacs-orgmode@gnu.org; Sat, 05 Jan 2019 10:41:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfo4p-0004Vo-Qg for Emacs-orgmode@gnu.org; Sat, 05 Jan 2019 10:41:34 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59569) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfo4p-0004M1-IJ for Emacs-orgmode@gnu.org; Sat, 05 Jan 2019 10:41:31 -0500 In-Reply-To: <87y37zo0za.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Eric S Fraga Cc: Emacs-orgmode@gnu.org > On Jan 5, 2019, at 5:25 AM, Eric S Fraga wrote: >=20 > On Friday, 4 Jan 2019 at 19:38, Win Treese wrote: >> Suppose I have the following Org file contents: >>=20 >> * test >>=20 >> #+BEGIN_SRC emacs-lisp >> (setq yyy 3) >> ;; See https://www.gnu.org >> #+END_SRC >>=20 >> The URL for gnu.org is highlighted as a clickable link. But if I = click >> it, the source block is evaluated. This seems rather unexpected, >> especially since my intention was to open the link. >=20 > Probably expected albeit maybe not your preferred behaviour; all about > precedence. In any case, I would suggest that the easy solution would > be to move such links out of the src block. I usually put these as = org > comments, along the lines of >=20 > # See https://www.gnu.org > #+BEGIN_SRC emacs-lisp > (setq yyy 3) > #+END_SRC >=20 > My approach to literate programming is to have no (significant) = comments > in the code segments themselves. Each code block is small and has all > commentary in the text, not the code. Thanks for the note, Eric. I think the style you describe is good in most cases. I stumbled over = this in a more complicated situation in which rearranging things doesn=E2=80=99t = work. This seems like a slightly bigger problem, though: clicking on a = highlighted link doesn=E2=80=99t just fail to open the link, it executes the source = block, which can have very unintended side effects. I wonder if the issue is an artifact of implementation rather than = intentional design: org-open-at-mouse sets point to the location of the click and = then calls org-open-at-point. The documentation at points says that C-c C-o = in=20 a source block opens the results of evaluation (fair enough, although = the docstring does not). So the problem seems to be about the mouse click behavior, not the basic function of org-open-at-point. Thanks, Win