From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Recenter around #+begin_src when moving to previous/next code block Date: Sun, 15 Sep 2013 06:46:18 +0200 Message-ID: References: <86wqml3uq2.fsf@somewhere.org> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C4ACD233-51B3-493A-A326-C8F3667D56AD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL4E5-0003qY-7N for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 00:46:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VL4Dz-0005sB-Bt for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 00:46:25 -0400 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:36267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL4Dz-0005s5-3u for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 00:46:19 -0400 Received: by mail-ee0-f45.google.com with SMTP id c50so1338321eek.18 for ; Sat, 14 Sep 2013 21:46:18 -0700 (PDT) In-Reply-To: <86wqml3uq2.fsf@somewhere.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org --Apple-Mail=_C4ACD233-51B3-493A-A326-C8F3667D56AD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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, >=20 > 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). >=20 > This is the purpose of this easy patch. >=20 > Best regards, > Seb >=20 > 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 >=20 > * 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. >=20 > --- > lisp/ob-core.el | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) >=20 > 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)) >=20 > ;;;###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)) >=20 > (defvar org-babel-load-languages) >=20 > --=20 > 1.7.9 >=20 >=20 --Apple-Mail=_C4ACD233-51B3-493A-A326-C8F3667D56AD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSNTuaAAoJEO+gg/nAZuwMSIAIAJu+fL1p27jzPuvUwmHsH4J+ CPNscvWtbhYoFWW1gPfrEc1eXDtH4uGR8FU14GzrzmF9HqrY18Arv6+pqp+UKjA4 cB8VsSrn8JDhLoWSyao0DAKe/4rKh/xqwOekVRF9hpxfi+wrEKcmf/37wpp7r/RZ KMWL23rGPUc0/zAlYuCEzehq+Y8TA4veRx6BzkUq9BGCSMMHXbSUruInJRHXGFPR +5tTptk1TDeiDaZAsoDP5wyGm5nT7FZnE9i63xVcJvE8LLxXH7JKXYkKL9gTfKWA ksjw4TOgVW93SdPxmgMn46jBhMTotxOADFaY1p4Ep/lKTSP2whprxaxdZghYPzU= =ZGOS -----END PGP SIGNATURE----- --Apple-Mail=_C4ACD233-51B3-493A-A326-C8F3667D56AD--