all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Le Wang" <l26wang@gmail.com>
Subject: Re: configuring emacs as a programmer's editor
Date: 30 Jun 2006 21:20:48 -0700	[thread overview]
Message-ID: <1151727648.090459.66440@75g2000cwc.googlegroups.com> (raw)
In-Reply-To: <mailman.3562.1151669638.9609.help-gnu-emacs@gnu.org>

Eli Zaretskii wrote:
> > From: "Le Wang" <l26wang@gmail.com>
> > Date: 30 Jun 2006 01:02:40 -0700
> >
> > (if (string-match "win" (prin1-to-string system-type))
>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> It's much easier to use (symbol-name system-type).  That's if you
> really need the string representation of system-type; you could simply
> use (eq system-type 'windows-nt) or (memq system-type '(windows-nt cygwin))
> instead.

Very good point.  I didn't know about `symbol-name'.  I suggested
regular expression here because I use it in a macro, so the slowdown
only happens at compile time.  But I didn't want to scare Ted off with
the slightly more brackety version. ;-)

(defmacro Init-system-type-load (&rest args)
  "Evaluates to appropriate form based on `system-type'

Takes args in this way

  (Init-system-load (\"regex\" (form1a) (form1b)) (\"string2\"
(forms2a)))

t will match anything."
  (dolist (arg args)
    (when (or (eq (car arg) t)
              (string-match (car arg) (symbol-name system-type)))
      (return (cons 'progn (cdr arg))))))

--
Le

  parent reply	other threads:[~2006-07-01  4:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-30  0:38 configuring emacs as a programmer's editor Ted
2006-06-30  7:03 ` David Kastrup
2006-06-30  7:04 ` Andreas Roehler
2006-06-30  8:02   ` Le Wang
2006-06-30 12:13     ` Eli Zaretskii
     [not found]     ` <mailman.3562.1151669638.9609.help-gnu-emacs@gnu.org>
2006-07-01  4:20       ` Le Wang [this message]
2006-06-30  7:37 ` Le Wang
2006-06-30 16:14   ` Ted
2006-07-01 23:19     ` Le Wang
2006-07-02  3:46     ` B. T. Raven
2006-07-02  8:32       ` Tim X
2006-07-03 20:15     ` Ted
2006-07-04  8:34       ` Tim X
2006-07-03 22:09 ` Jason Rumney

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=1151727648.090459.66440@75g2000cwc.googlegroups.com \
    --to=l26wang@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.