From: wildernesscat@hotmail.com (Danny Dorfman)
Subject: Re: How to automate file-opening (derived filename)?
Date: 8 Jan 2003 22:44:47 -0800 [thread overview]
Message-ID: <30055c1f.0301082244.35405451@posting.google.com> (raw)
In-Reply-To: 87heckhlfg.fsf@fbigm.here
Here is what I got from posting a question at http://www.experts-exchange.com
This actually does the trick! (from user "itonju01")
> This works for me. You can rename it to whatever you want
> instead of open-x-header.
>
> Hopefully the backslashes aren't munged by the expert-exchange posting system.
>
> Enjoy.
>
>
> (defun open-x-header ()
> (interactive)
> (if
> ;; replace /a/ with /ZZZ/
> (string-match "^\\(.*\\)/a/\\(.*\\)\\.c$" buffer-file-name)
>
> ;; replace find-file-other-window with find-file
> ;; or find-file-other-frame if you wish
> (find-file-other-window
> (concat (match-string 1 buffer-file-name)
> "/"
> "b" ;; replace with YYY
> "/"
> (match-string 2 buffer-file-name)
> ".h"))
> (message "No match.")))
>
next prev parent reply other threads:[~2003-01-09 6:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-07 14:52 How to automate file-opening (derived filename)? Danny Dorfman
2003-01-07 18:19 ` Friedrich Dominicus
2003-01-08 6:03 ` Alfred M. Szmidt
[not found] ` <mailman.53.1042007441.21513.help-gnu-emacs@gnu.org>
2003-01-08 11:54 ` Danny Dorfman
2003-01-11 12:49 ` Kai Großjohann
2003-01-08 13:05 ` Danny Dorfman
2003-01-09 6:39 ` Friedrich Dominicus
2003-01-09 6:44 ` Danny Dorfman [this message]
2003-01-09 8:06 ` Friedrich Dominicus
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=30055c1f.0301082244.35405451@posting.google.com \
--to=wildernesscat@hotmail.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.
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).