emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] src block: 'C-c C-c can do nothing useful here' if cursor on bla


From: Nicolas Goaziou
Subject: Re: [O] src block: 'C-c C-c can do nothing useful here' if cursor on blank line
Date: Sat, 28 Jan 2017 00:00:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

"Charles C. Berry" <address@hidden> writes:

> Nor I. Perhaps it was just an oversight.
>
> FWIW, in `org-ctrl-c-ctrl-c'
>
> :    (looking-at-p "[ \t]*$")
>
> could be
>
> #+BEGIN_SRC emacs-lisp
>    (and
>     (looking-at-p "[ \t]*$")
>     (not (eq 'src-block (org-element-type (org-element-context))))))
> #+END_SRC
>
> without causing a lot of grief. I think `src-block' is the only
> relevant case.

In almost all cases, you don't want C-c C-c to do anything on a blank
line. Commit 0b6a2e2416b0acc28469661d7013f92f82a34267 pointed out before
was pushed because calling C-c C-c on the blank lines right after
a blank line would call `org-set-tags'.

What you suggest is sub-optimal, tho. The point of this quick check is
to eschew `org-element-context' call a few lines below. This would make
two calls instead of one.

I think a proper solution is to bite the bullet and make the check after
calling `org-element-context', in a pcase branch. This is what I did in
ebb9da0d0.

Please let me know if it doesn't solve the issue.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]