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

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

Re: Need help writing file-visiting macro


From: drkm
Subject: Re: Need help writing file-visiting macro
Date: Mon, 25 Jul 2005 19:44:36 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt)

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 via email to

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