From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Owens Newsgroups: gmane.emacs.help Subject: Re: OS X (or other OS's): how to get a fully-qualified domain name? Date: Mon, 26 Jul 2004 23:59:29 +0000 (UTC) Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <41058F9A.90905@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1090886414 19375 80.91.224.253 (27 Jul 2004 00:00:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jul 2004 00:00:14 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 27 02:00:01 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BpFNx-0004gU-00 for ; Tue, 27 Jul 2004 02:00:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpFR0-0005CE-V6 for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Jul 2004 20:03:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BpFQs-0005C9-7l for help-gnu-emacs@gnu.org; Mon, 26 Jul 2004 20:03:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BpFQq-0005Bx-NR for help-gnu-emacs@gnu.org; Mon, 26 Jul 2004 20:03:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpFQq-0005Bu-Ko for help-gnu-emacs@gnu.org; Mon, 26 Jul 2004 20:03:00 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BpFNU-0007sL-CO for help-gnu-emacs@gnu.org; Mon, 26 Jul 2004 19:59:32 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BpFNT-0001zd-00 for ; Tue, 27 Jul 2004 01:59:31 +0200 Original-Received: from adsl-68-122-68-133.dsl.pltn13.pacbell.net ([68.122.68.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Jul 2004 01:59:31 +0200 Original-Received: from john_owens by adsl-68-122-68-133.dsl.pltn13.pacbell.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Jul 2004 01:59:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 25 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 68.122.68.133 (Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19814 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19814 Kevin Rodgers yahoo.com> writes: > John Owens wrote: > > What would be ideal is if I could use the system-name function to > > dynamically return where I am (since if I run emacs at home, then go > > to work, plug it in, and use emacs there, I'd like emacs to use the > > work machine's domain name, not the one from home). > > C-h v user-mail-address > C-h v mail-host-address Unfortunately, neither of these is dynamic (at least I don't think so - I just set them statically in .emacs). > To get the domain name in Emacs on Unix, try this: > > (shell-command-to-string "awk '/^domain/ {printf $2}' /etc/resolv.conf") Also unfortunately, OS X doesn't give a FQDN (in mine, it just says sbcglobal.net which is my domain but not my hostname). Any thoughts on doing any of this dynamically? JDO