[Top][All Lists]

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

[O] org-backward-paragraph probably should *not* signal user-error at st

From: Omar Antolín Camarena
Subject: [O] org-backward-paragraph probably should *not* signal user-error at start of buffer
Date: Thu, 27 Jul 2017 15:10:00 -0700

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

reply via email to

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