emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [bug] error on RET in read-only buffer with org-return-follows-link set to t
Date: Thu, 14 May 2020 23:32:24 +0200	[thread overview]
Message-ID: <87r1vmurrr.fsf@gmail.com> (raw)
In-Reply-To: <87wo5egv93.fsf@no.workgroup> (Gregor Zattler's message of "Thu,  14 May 2020 21:40:56 +0200")

[-- Attachment #1: Type: text/plain, Size: 509 bytes --]

Gregor Zattler <telegraph@gmx.net> writes:

> Dear Kévin, org-mode developers, 
>
> with `org-return-follows-link` set to `t` in a read-only
> buffer I now get a `Buffer is read-only: #<buffer
> notmuch-startpage.org>` error when pressing ENTER/RETURN
> with point on an org-mode link.

Oh, right, I added '*' to org-return's interactive spec because I was
mimicking newline's; I had not considered the link-following case.

Should be a simple matter of removing this '*' if I'm not mistaken:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-ret-link.patch --]
[-- Type: text/x-patch, Size: 516 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index be1d1c701..339418314 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17702,7 +17702,7 @@ a timestamp or a link, call `org-open-at-point'.  However, it
 will not happen if point is in a table or on a \"dead\"
 object (e.g., within a comment).  In these case, you need to use
 `org-open-at-point' directly."
-  (interactive "*i\nP\np")
+  (interactive "i\nP\np")
   (let ((context (if org-return-follows-link (org-element-context)
 		   (org-element-at-point))))
     (cond

[-- Attachment #3: Type: text/plain, Size: 251 bytes --]


> I use this dozens of times a day and it would be convenient
> if it was possible to resurrect the old behaviour.

Right, terribly sorry for this blunder.  I'll try to followup with a
unit test to make sure such a regression doesn't creep in again.

      parent reply	other threads:[~2020-05-14 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 19:40 [bug] error on RET in read-only buffer with org-return-follows-link set to t Gregor Zattler
2020-05-14 21:28 ` Nicolas Goaziou
2020-05-14 21:57   ` Kévin Le Gouguec
2020-05-14 22:49     ` Nicolas Goaziou
     [not found]       ` <87a72a6sj6.fsf@nicolasgoaziou.Freitag>
2020-05-15 12:54         ` Gregor Zattler
2020-05-14 21:32 ` Kévin Le Gouguec [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1vmurrr.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).