unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bruce Ingalls <bingalls@CUT-this-SPAM-BLOCK.fit-zones.com>
Subject: Re: extract regexp
Date: Tue, 22 Apr 2003 14:08:32 GMT	[thread overview]
Message-ID: <A1cpa.15474$J17.7232@twister.nyc.rr.com> (raw)
In-Reply-To: <3E9EE4FF.7060902@yahoo.com>

Kevin Rodgers wrote:
> lawrence mitchell wrote:

Thanks for your help. This is what I ended up with:

(setq moz-prefs-filename
	"~/.mozilla/...[random name].../default/prefs.js")

(defun moz-get-prefs (key)
   "Returns value in prefs.js corresponding to key. key is line in prefs.js
file, up to desired value (which is followed by closing double quote).
Returns nil, if no key or value not found. Requires the variable
moz-prefs-filename, which is set in e-config.el."

   (with-temp-buffer
     (condition-case err
	(insert-file-contents-literally moz-prefs-filename)
       (error 'nil))
     (if (re-search-forward key nil t)
	(setq server (match-string 1))
       'nil)))

And here is how I call it:

   (moz-get-prefs
        "user_pref(\"mail.server.server1.hostname\", \"\\([^\"]+\\)")

Unfortunately, it gets a little more tricky, as I should check that
mail.server.server*.type
is pop3 or imap, and not nntp, but this is good enough.

  reply	other threads:[~2003-04-22 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17 16:20 extract regexp Bruce Ingalls
2003-04-17 17:11 ` lawrence mitchell
2003-04-17 17:31   ` Kevin Rodgers
2003-04-22 14:08     ` Bruce Ingalls [this message]
2003-04-22 16:28       ` Kevin Rodgers
2003-04-22 17:31         ` Bruce Ingalls

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='A1cpa.15474$J17.7232@twister.nyc.rr.com' \
    --to=bingalls@cut-this-spam-block.fit-zones.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).