From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Tury Newsgroups: gmane.emacs.help Subject: next-line + recenter (- redraw frame)? Date: Fri, 03 Mar 2006 16:54:14 GMT Organization: Nokia Message-ID: <5xlh1kdb5ttw$.1eomol2tpwh55.dlg@40tude.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1141422444 14692 80.91.229.2 (3 Mar 2006 21:47:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2006 21:47:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 03 22:47:23 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFI7G-0007hv-RR for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Mar 2006 22:47:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFI7G-0006JU-S6 for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Mar 2006 16:47:14 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.bahnhof.se!195.197.54.117.MISMATCH!feeder1.news.jippii.net!nntp.inet.fi!inet.fi!newsfeed1.nokia.com!news1.nokia.com!news2.nokia.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: 40tude_Dialog/2.0.15.1 Original-Lines: 39 Original-NNTP-Posting-Host: 172.24.170.74 Original-X-Complaints-To: newsmaster@nokia.com Original-X-Trace: news2.nokia.com 1141404854 172.24.170.74 (Fri, 03 Mar 2006 18:54:14 EET) Original-NNTP-Posting-Date: Fri, 03 Mar 2006 18:54:14 EET Original-Xref: shelby.stanford.edu gnu.emacs.help:137895 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33517 Archived-At: 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