unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Tury <tury.peter@gmail.com>
Subject: next-line + recenter (- redraw frame)?
Date: Fri, 03 Mar 2006 16:54:14 GMT	[thread overview]
Message-ID: <5xlh1kdb5ttw$.1eomol2tpwh55.dlg@40tude.net> (raw)

Hi,

I've created a tiny function for ease reading:

(defun down-center ()
  "Moves point down by one line and then moves the line to the
center of the screen.
Keeps columns as next-line does.
Created for ease reading (of program source codes) (since this
way the user always can see the most lines around)."
  (interactive)       
  (if (eq last-command 'down-center)
      (setq last-command 'next-line))
  (next-line)
  (recenter))

(define-key global-map [M-down] 'down-center)

Please comment it!

I am especially interested in these:

- do you know some builtin function what does the same (=so this function
is totally unnecessary) in emacs 22?

- how could I get rid of setting last-command (it seems to be a quite ugly
solution for me...) (it is necessary if you go through e.g. an empty or too
short line: then, without this last-command setting, the original column is
lost (since next-line (more exactly: line-move-1) uses last-command :-((

- how could I get rid of redrawing the frame? recenter's doc writes: "Just
C-u as prefix means put point in the center of the window
and redisplay normally--don't erase and redraw the frame." -- I would like
to use this. But how to call recenter from elisp "just uing C-u as prefix"?
It seems for me that if I put "(universal-argument)" (what is bound to C-u)
before "(recenter)" it doesn't help.

Thanks,
P

             reply	other threads:[~2006-03-03 16:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-03 16:54 Peter Tury [this message]
2006-03-03 17:36 ` next-line + recenter (- redraw frame)? Ralf Angeli
2006-03-06  8:17   ` Peter Tury
2006-03-06  8:43     ` Ralf Angeli
2006-03-06  9:34       ` Peter Tury
2006-03-03 22:20 ` Peter Dyballa
     [not found] ` <mailman.1.1141424503.26251.help-gnu-emacs@gnu.org>
2006-03-06  8:36   ` Peter Tury
2006-03-26  2:38     ` David Combs
2006-03-26 10:10       ` Peter Dyballa
2006-03-27 15:51       ` Kevin Rodgers

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='5xlh1kdb5ttw$.1eomol2tpwh55.dlg@40tude.net' \
    --to=tury.peter@gmail.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.
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).