all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Wright <daniel.d.wright@gmail.com>
Subject: Re: compile-command customisation
Date: Thu, 24 Feb 2005 10:19:50 +0100	[thread overview]
Message-ID: <e49350af050224011925dceae6@mail.gmail.com> (raw)

Thien-Thi Nguyen <ttn@glug.org> writes:
>Daniel Wright <daniel.d.wright@gmail.com> writes:
>
>> how it could be done better :)
>
>some standard tips:
>
>(if CONDITION (progn EXP ...))
>=> (when CONDITION EXP ...)
>
>(unless CONDITION (progn EXP ...))
>=> (unless CONDITION EXP ...)
>
>you can lift `file-name-sans-extension', like so:
>
>(... (file-name-sans-extension file)
>... (file-name-sans-extension file) ...)
>=> (let ((fn-noext (file-name-sans-extension file)))
>    (... fn-noext
>     ... fn-noext ...))
>
>generally, these transforms do not change your algorithm,
>so it is only better in the sense that it is more easy to
>read.  improving the algorithm is your sack of joy to haul.

Thanks for the help! It really does make it a lot easier to read. It
seemed necessary to use "let*" so that file-noext gets evaluated
correctly:

...
(let* ((count 0) (file (file-name-nondirectory buffer-file-name))
     (file-noext (file-name-sans-extension file)))
...

After reading the reply from Kevin Rodgers, I'll leave the improvement
of this algorithm: I'm sure there are plenty of others to improve.. ;)

Thanks again!
Daniel

             reply	other threads:[~2005-02-24  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-24  9:19 Daniel Wright [this message]
     [not found] <mailman.1420.1109237398.32256.help-gnu-emacs@gnu.org>
2005-02-25 13:49 ` compile-command customisation Stefan Monnier
2005-02-26 12:02   ` Daniel Wright
     [not found] <421ce346.7d020262.679d.ffff9321SMTPIN_ADDED@mx.gmail.com>
2005-02-24  9:41 ` Daniel Wright
  -- strict thread matches above, loose matches on Subject: below --
2005-02-24  8:59 Daniel Wright
     [not found] <mailman.1248.1109165001.32256.help-gnu-emacs@gnu.org>
2005-02-23 14:51 ` Stefan Monnier
2005-02-26 22:13   ` Steinar Børmer
2005-02-26 22:23   ` Steinar Børmer
2005-02-27  2:43     ` Stefan Monnier
2005-02-23 15:44 ` Thien-Thi Nguyen
2005-02-23 15:48 ` Kevin Rodgers
2005-02-23 12:51 Daniel Wright

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

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

  git send-email \
    --in-reply-to=e49350af050224011925dceae6@mail.gmail.com \
    --to=daniel.d.wright@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.