unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: drkm <usenet@fgeorges.org>
Subject: Re: Need help writing file-visiting macro
Date: Mon, 25 Jul 2005 19:44:36 +0200	[thread overview]
Message-ID: <uvf2yzsor.fsf@fgeorges.org> (raw)
In-Reply-To: dc34vd$iq2$1@panix2.panix.com

Roy Smith writes:

> In article <7e7jfegat6.fsf@ada2.unipv.it>,
> Thien-Thi Nguyen  <ttn@glug.org> wrote:

>>roy@panix.com (Roy Smith) writes:

>>> I want it to construct the corresponding _Impl.c filename and
>>> visit that file.  Is that possible?

>>it is possible if the correspondance is at least heuristical.

> I'm not sure what you mean by "heuristical", but it certainly is
> deterministic.  For a given file name X.mdl, the corresponding
> implementation file will be X_Impl.c.

  So you just want the correspondance between the file *name*?
Ok:

    (defun rs:get-impl-filename (mdl-name)
      (unless (string-match "^\\(.+\\)\\.mdl$" mdl-name)
        (error "Not a MDL file name" mdl-name))
      (concat (match-string 1 mdl-name) "_Impl.c"))

--drkm

  reply	other threads:[~2005-07-25 17:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-25 13:58 Need help writing file-visiting macro Roy Smith
2005-07-25 15:33 ` Thien-Thi Nguyen
2005-07-25 16:45   ` Roy Smith
2005-07-25 17:44     ` drkm [this message]
2005-07-25 16:50 ` Sergei Organov
2005-07-25 17:52 ` rgb
2005-07-25 21:02   ` drkm
2005-07-26 22:49     ` rgb
2005-07-25 18:05 ` Kevin Rodgers
2005-07-25 21:38 ` Martin Slouf
2005-07-26 15:52   ` Kevin Rodgers
2005-07-26 18:24     ` Martin Slouf

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=uvf2yzsor.fsf@fgeorges.org \
    --to=usenet@fgeorges.org \
    /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.
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).