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

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

Re: critique: my-first-function


From: Emanuel Berg
Subject: Re: critique: my-first-function
Date: Mon, 13 Jun 2016 03:08:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

"James K. Lowden" <address@hidden>
writes:

> (defun open-tall-frames ()
>   "Open two tall frames."
>   (interactive)
>   (let ( (frame-parameters 
>         '((width . 80)
>           (height . 60)
>           (minibuffer . t)
>           (window-system . x)))
>        (frame1 (make-frame frame-parameters))
>        (frame2 (make-frame frame-parameters))
>        )
>   (set-frame-position frame1 -1 0)
>   (set-frame-position frame2 (- (frame-pixel-width frame1)) 0)
> ))

`let' should be `let*' since "frame-parameters"
are used inside the same `let'.

Some more subjective views:

As for style, I think you can align the
data items (lines 5-8).

Instead of "frame1" "frame2", name them after
some property.

And, on line 13, there is a computation, which
I would name and put in the `let' clause as
well. So you set up all data there, and then
only have execution below the `let' - makes it
look good.

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 48 Blogomatic articles -                   




reply via email to

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