* compilation-next-error - extra `let' binding?
@ 2008-02-08 18:41 Drew Adams
2008-02-08 18:49 ` Drew Adams
2008-02-10 3:16 ` Stefan Monnier
0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2008-02-08 18:41 UTC (permalink / raw)
To: emacs-pretest-bug
Can't tell for sure without checking all of the code called by the
body of the `let', but it looks like the `let' binding of `loc' in
`compilation-next-error' is superfluous:
(let* ((msg (get-text-property pt 'message))
(loc (car msg)) ; ???????
last)
If so, taking out the binding would make the code easier to
understand. If not, adding a comment for it might make the code easier
to understand.
In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
of 2008-01-30 on PRETEST
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: compilation-next-error - extra `let' binding?
2008-02-08 18:41 compilation-next-error - extra `let' binding? Drew Adams
@ 2008-02-08 18:49 ` Drew Adams
2008-02-10 3:17 ` Stefan Monnier
2008-02-10 3:16 ` Stefan Monnier
1 sibling, 1 reply; 4+ messages in thread
From: Drew Adams @ 2008-02-08 18:49 UTC (permalink / raw)
To: emacs-pretest-bug
It also looks like the test in the second branch of this `if' could be just
(> n 0), for clarity:
(if (zerop n)
(unless ...)
(setq last (nth 2 (car msg)))
(if (>= n 0) ; <== Can't be zero here, anyway.
(compilation-loop ...)
...))
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: compilation-next-error - extra `let' binding?
2008-02-08 18:49 ` Drew Adams
@ 2008-02-10 3:17 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2008-02-10 3:17 UTC (permalink / raw)
To: Drew Adams; +Cc: emacs-pretest-bug
> It also looks like the test in the second branch of this `if' could be just
> (> n 0), for clarity:
> (if (zerop n)
> (unless ...)
> (setq last (nth 2 (car msg)))
> (if (>= n 0) ; <== Can't be zero here, anyway.
> (compilation-loop ...)
> ...))
Couldn't care less,
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: compilation-next-error - extra `let' binding?
2008-02-08 18:41 compilation-next-error - extra `let' binding? Drew Adams
2008-02-08 18:49 ` Drew Adams
@ 2008-02-10 3:16 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2008-02-10 3:16 UTC (permalink / raw)
To: Drew Adams; +Cc: emacs-pretest-bug
> Can't tell for sure without checking all of the code called by the
> body of the `let', but it looks like the `let' binding of `loc' in
> `compilation-next-error' is superfluous:
> (let* ((msg (get-text-property pt 'message))
> (loc (car msg)) ; ???????
> last)
> If so, taking out the binding would make the code easier to
> understand. If not, adding a comment for it might make the code easier
> to understand.
It's actually used by the compilation-loop macro.
I've added a comment to this effect.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-10 3:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 18:41 compilation-next-error - extra `let' binding? Drew Adams
2008-02-08 18:49 ` Drew Adams
2008-02-10 3:17 ` Stefan Monnier
2008-02-10 3:16 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).