[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
Re: [O] src block: 'C-c C-c can do nothing useful here' if cursor on blank line
Sat, 28 Jan 2017 00:00:00 +0100
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
"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
> (looking-at-p "[ \t]*$")
> (not (eq 'src-block (org-element-type (org-element-context))))))
> 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
Please let me know if it doesn't solve the issue.