emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Sebastien Vauban <sva-news@mygooglest.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Recenter around #+begin_src when moving to previous/next code block
Date: Sun, 15 Sep 2013 06:46:18 +0200	[thread overview]
Message-ID: <A29F0253-B563-4C55-9E01-140C253E1760@gmail.com> (raw)
In-Reply-To: <86wqml3uq2.fsf@somewhere.org>

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

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 <sva-news@mygooglest.com> 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" <sva-news@mygooglest.com>
> 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
> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2013-09-15  4:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 10:02 [PATCH] Recenter around #+begin_src when moving to previous/next code block Sebastien Vauban
2013-09-15  4:46 ` Carsten Dominik [this message]
     [not found]   ` <A29F0253-B563-4C55-9E01-140C253E1760-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-15 19:06     ` Sebastien Vauban
2013-09-16  4:06       ` Carsten Dominik

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=A29F0253-B563-4C55-9E01-140C253E1760@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sva-news@mygooglest.com \
    /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).