help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alt-v behavior near beginning of buffer


From: Matthew Flaschen
Subject: Re: Alt-v behavior near beginning of buffer
Date: Tue, 30 Jan 2007 10:59:24 -0500
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

Kevin Rodgers wrote:
> Matthew Flaschen wrote:
>> I wanted it to go to the beginning of the line either way, so I changed
>> it to:
>>
>> (defun power-bottom ()
>> "Scrolls down a screen if possible, or goes to the bottom of the buffer"
>> (interactive)
>> (if (pos-visible-in-window-p (point-max))
>>     ((lambda()
>>        (goto-char (point-max))
>>        (beginning-of-line)))
>>   (scroll-up)))
>>
>> That lambda syntax took me a while to grasp.  Is there any easier way to
>> do this, short of creating a function just for the lambda?
> 
> Of course:
> 
>     (progn
>       (goto-char (point-max))
>       (beginning-of-line))

Thanks, that's a bit simpler.  I'd seen that command before, but forgot
it (and probably never really understood what it did).

> 
> A good Emacs Lisp exercise would be to allow your new command to accept
> a prefix argument just like scroll-up does, and pass it to scroll-up.

I may do that at some point.

Matt Flaschen


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]