emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-backward-paragraph probably should *not* signal user-error at start of buffer
@ 2017-07-27 22:10 Omar Antolín Camarena
  2017-07-28  8:16 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Omar Antolín Camarena @ 2017-07-27 22:10 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-backward-paragraph probably should *not* signal user-error at start of buffer
  2017-07-27 22:10 org-backward-paragraph probably should *not* signal user-error at start of buffer Omar Antolín Camarena
@ 2017-07-28  8:16 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-07-28  8:16 UTC (permalink / raw)
  To: Omar Antolín Camarena; +Cc: emacs-orgmode

Hello,

Omar Antolín Camarena <omar.antolin@gmail.com> writes:

> 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.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-28  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-27 22:10 org-backward-paragraph probably should *not* signal user-error at start of buffer Omar Antolín Camarena
2017-07-28  8:16 ` Nicolas Goaziou

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).