Hi Sebastien, I don't think this patch is the right thing - is feels different from standard Emacs behavior. - Carsten On 13.9.2013, at 12:02, Sebastien Vauban wrote: > Hello, > > When moving with C-c C-v C-n (or p) from one code block to the next (or > previous), it's much better if the code block gets centered (vs hidden, > forcing the user to scroll down, as it currently is). > > This is the purpose of this easy patch. > > Best regards, > Seb > > From: "Sebastien Vauban" > Date: Fri, 13 Sep 2013 11:56:56 +0200 > Subject: [PATCH] Recenter around #+begin_src when moving to previous/next code block > > * ob-core.el (org-babel-next-src-block): Recenter after jumping to next code block. > (org-babel-previous-src-block): Recenter after jumping to previous code block. > > --- > lisp/ob-core.el | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lisp/ob-core.el b/lisp/ob-core.el > index d57806b..fd4b1bd 100644 > --- a/lisp/ob-core.el > +++ b/lisp/ob-core.el > @@ -1748,14 +1748,16 @@ buffer or nil if no such result exists." > "Jump to the next source block. > With optional prefix argument ARG, jump forward ARG many source blocks." > (interactive "p") > - (org-next-block arg nil org-babel-src-block-regexp)) > + (org-next-block arg nil org-babel-src-block-regexp) > + (recenter)) > > ;;;###autoload > (defun org-babel-previous-src-block (&optional arg) > "Jump to the previous source block. > With optional prefix argument ARG, jump backward ARG many source blocks." > (interactive "p") > - (org-previous-block arg org-babel-src-block-regexp)) > + (org-previous-block arg org-babel-src-block-regexp) > + (recenter)) > > (defvar org-babel-load-languages) > > -- > 1.7.9 > >