emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Omar Antolín Camarena" <omar.antolin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-backward-paragraph probably should *not* signal user-error at start of buffer
Date: Thu, 27 Jul 2017 15:10:00 -0700	[thread overview]
Message-ID: <CAL03oy+uaco8m6-d9oeRsOh8EtXBa9bTtae51nCL984s=KdeRA@mail.gmail.com> (raw)

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

I just noticed that org-backward-paragraph raises a user error if you call
it at the beginning of the buffer. This is not what the general
backward-paragraph command does, nor is it what I remember other Emacs
movement commands doing when the move can't actually be done.

I think consistency with other movement commands is reason enough to change
the behavior of org-backward-paragraph, but here's a potentially more
convincing reason: the function org-inside-LaTeX-fragment-p is supposed to
return nil if point is inside a LaTeX fragment (and a truthy value
otherwise). But since org-inside-LaTeX-fragment-p uses
org-backward-paragraph internally, what actually happens is that it works
as described *unless* you are at the beginning of the buffer in which case
it doesn't return any value at all but instead signals a user-error!

I've worked around this in my own code by changing
(org-inside-LaTeX-fragment-p) to (unless (bobp)
(org-inside-LaTeX-fragment-p)), but it feels like org-backward-paragraph
should be changed instead.

-- 
Omar Antolín Camarena

[-- Attachment #2: Type: text/html, Size: 1245 bytes --]

             reply	other threads:[~2017-07-27 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 22:10 Omar Antolín Camarena [this message]
2017-07-28  8:16 ` org-backward-paragraph probably should *not* signal user-error at start of buffer Nicolas Goaziou

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='CAL03oy+uaco8m6-d9oeRsOh8EtXBa9bTtae51nCL984s=KdeRA@mail.gmail.com' \
    --to=omar.antolin@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).