From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: Kyle Meyer <kyle@kyleam.com>, emacs-orgmode@gnu.org
Subject: Re: 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 [thread overview]
Message-ID: <87d1f8t8gf.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <alpine.OSX.2.20.1701271420350.2729@charles-berrys-macbook.local> (Charles C. Berry's message of "Fri, 27 Jan 2017 14:29:17 -0800")
Hello,
"Charles C. Berry" <ccberry@ucsd.edu> 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
next prev parent reply other threads:[~2017-01-27 23:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <dfb1983ec7384aec9ca2172a9b27a66c@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-27 20:17 ` src block: 'C-c C-c can do nothing useful here' if cursor on blank line Eric S Fraga
2017-01-27 21:00 ` Kyle Meyer
2017-01-27 22:29 ` Charles C. Berry
2017-01-27 23:00 ` Nicolas Goaziou [this message]
2017-01-27 18:44 John Hendy
2017-01-27 20:35 ` John Kitchin
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=87d1f8t8gf.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=kyle@kyleam.com \
/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).