From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Dec 2014 10:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 19438@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141950290730609 (code B ref -1); Thu, 25 Dec 2014 10:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Dec 2014 10:21:47 +0000 Received: from localhost ([127.0.0.1]:56904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y45YB-0007xd-1Q for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50862) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y45Y8-0007xT-L3 for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y45Y7-0007ht-Mk for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NUMERIC_HTTP_ADDR,T_DKIM_INVALID,URI_HEX autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y7-0007hn-JO for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y6-0001ot-KA for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y45Y3-0007gq-Ds for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:42 -0500 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]:56331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y3-0007ge-6u for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:39 -0500 Received: by mail-pd0-f181.google.com with SMTP id v10so11473889pde.40 for ; Thu, 25 Dec 2014 02:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=URHakJD32N7SMfKJRQwmXKpMgzb3E8vI3+hm/t3jQ3w=; b=RXFRgiONmkxdjnPv5gDh9O3MQAV9G8vIUCHrSQQc2BBaEC5n9lDwD6+BCqvk2BHku1 /DsZrt4I9bYgbKc1zUbVbjFMiTTMvKIcBPCyzHTn6yZaM27OBo7D0K+6rvO4mZzW+Hra vjYQI2Fo4Jb+lqxIo4SGgWp18+TB/vGDDKuYWJV3LVY0XiWqlDAvF2ByG/YxiwO3ypRr 3+3jIOkRMLSznPI9JSvfloHMeox7JNRfKnwEdWSdagBC9h2U+cDL/8eSFGkCov0DhUBI yTZpFaf2oCO++u+e9oImjzrgHUK/pNuQkP6+oNoz/IHqhBD9mX26um/6tY8yFN8C4qhj VDrQ== X-Received: by 10.70.124.200 with SMTP id mk8mr60723093pdb.147.1419502897707; Thu, 25 Dec 2014 02:21:37 -0800 (PST) Received: from Zeuss-MacBook.local (014136144036.static.ctinets.com. [14.136.144.36]) by mx.google.com with ESMTPSA id qz7sm25105098pbb.12.2014.12.25.02.21.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Dec 2014 02:21:36 -0800 (PST) From: Leo Liu Date: Thu, 25 Dec 2014 18:21:31 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.7 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) I just moved from one network to another and find that my long running Emacs no longer has the right value for (system-name). I am seeing this: (system-name) => Leos-MacBook.local but a freshly-started emacs gives me: 014136144036.static.ctinets.com It turns out system name is not computed dynamically. Could someone fix this problem? Thanks. Leo From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Dec 2014 03:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 19438@debbugs.gnu.org Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.14195662388233 (code B ref 19438); Fri, 26 Dec 2014 03:58:02 +0000 Received: (at 19438) by debbugs.gnu.org; 26 Dec 2014 03:57:18 +0000 Received: from localhost ([127.0.0.1]:57611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4M1d-00028i-AN for submit@debbugs.gnu.org; Thu, 25 Dec 2014 22:57:17 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:24498) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4M1a-00028Y-Ct for 19438@debbugs.gnu.org; Thu, 25 Dec 2014 22:57:15 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUPAOwQflTO+ILA/2dsb2JhbABbgwdSWYI1hVq/AIYdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLDgUhEhQYDSSISgkN1kwBAQEBAQUBAQEBAR2QbweESAWLAYoeiE2RQ4F4hBkhMAGCRgEBAQ X-IPAS-Result: AnUPAOwQflTO+ILA/2dsb2JhbABbgwdSWYI1hVq/AIYdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLDgUhEhQYDSSISgkN1kwBAQEBAQUBAQEBAR2QbweESAWLAYoeiE2RQ4F4hBkhMAGCRgEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="103516062" Received: from 206-248-130-192.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Dec 2014 22:57:13 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 16B1F660A2; Thu, 25 Dec 2014 22:57:13 -0500 (EST) From: Stefan Monnier Message-ID: References: Date: Thu, 25 Dec 2014 22:57:13 -0500 In-Reply-To: (Leo Liu's message of "Thu, 25 Dec 2014 18:21:31 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > I am seeing this: (system-name) => Leos-MacBook.local > but a freshly-started emacs gives me: 014136144036.static.ctinets.com AFAIK neither of those two names correspond to the intended meaning of `system-name', which should be "the name of machine" (something that ideally won't change until the machine is retired or at most re-purposed), rather than "some DNS name you can use to access the machine". [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [206.248.154.181 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 1.3 URI_HEX URI: URI hostname has long hexadecimal sequence 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > I am seeing this: (system-name) => Leos-MacBook.local > but a freshly-started emacs gives me: 014136144036.static.ctinets.com AFAIK neither of those two names correspond to the intended meaning of `system-name', which should be "the name of machine" (something that ideally won't change until the machine is retired or at most re-purposed), rather than "some DNS name you can use to access the machine". [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [206.248.154.181 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 1.3 URI_HEX URI: URI hostname has long hexadecimal sequence 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL > I am seeing this: (system-name) => Leos-MacBook.local > but a freshly-started emacs gives me: 014136144036.static.ctinets.com AFAIK neither of those two names correspond to the intended meaning of `system-name', which should be "the name of machine" (something that ideally won't change until the machine is retired or at most re-purposed), rather than "some DNS name you can use to access the machine". Stefan From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache References: In-Reply-To: Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Dec 2014 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 19438@debbugs.gnu.org, Leo Liu Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.141961009421196 (code B ref 19438); Fri, 26 Dec 2014 16:09:02 +0000 Received: (at 19438) by debbugs.gnu.org; 26 Dec 2014 16:08:14 +0000 Received: from localhost ([127.0.0.1]:58329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4XQy-0005Vj-Fo for submit@debbugs.gnu.org; Fri, 26 Dec 2014 11:08:13 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:53575) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4XQs-0005VW-TW for 19438@debbugs.gnu.org; Fri, 26 Dec 2014 11:08:09 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 3C573A6003C; Fri, 26 Dec 2014 08:08:04 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o2jk9SZZWXO3; Fri, 26 Dec 2014 08:07:59 -0800 (PST) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 92100A60006; Fri, 26 Dec 2014 08:07:59 -0800 (PST) Message-ID: <549D87DB.7010909@cs.ucla.edu> Date: Fri, 26 Dec 2014 08:07:55 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010604000406000003040903" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------010604000406000003040903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Unfortunately even "the name of the machine" can change; e.g., I can invoke the shell command "hostname garfield" to change my machine's name to garfield. Also, I expect that if Emacs has its process migrated (LinuxPMI, anybody?) it will then be running on a different machine with a different name. How about the attached patch? The idea is that (system-name) actually inquires for the current system name, and system-name caches the result. If an Emacs lisp program assigns to system-name, though, it's no longer updated thereafter. --------------010604000406000003040903 Content-Type: text/x-diff; name="0001-system-name-s-returned-value-can-vary.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-system-name-s-returned-value-can-vary.patch" >From 4e356e24a95792ffd2b27f0098792cda269b867a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 26 Dec 2014 07:57:50 -0800 Subject: [PATCH] system-name's returned value can vary Fixes Bug#19438. * doc/lispref/os.texi (System Environment): * etc/NEWS: Document this. * doc/misc/efaq.texi: (Displaying the current file name in the titlebar): * lisp/desktop.el (desktop-save-frameset): * lisp/dnd.el (dnd-get-local-file-uri): * lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers) (nnvirtual-update-xref-header): * lisp/nxml/rng-uri.el (rng-uri-file-name-1): * lisp/org/org-clock.el (org-clock-save): * src/filelock.c (current_lock_owner): * src/xrdb.c (get_environ_db): * src/xterm.c (same_x_server): * src/xterm.c (x_term_init): Prefer (system-name) to system-name. * doc/misc/smtpmail.texi (Server workarounds): Fix grammar. * src/editfns.c (cached_system_name): New static var. (init_and_cache_system_name): New function. (init_editfns, Fsystem_name): Use it. (syms_of_editfns): Initialize it and Vsystem_name to the same value. * src/sysdep.c (init_system_name): Don't create a new string if the current value is already correct. --- ChangeLog | 27 +++++++++++++++++++++++++++ doc/lispref/os.texi | 9 +++++++-- doc/misc/efaq.texi | 2 +- doc/misc/smtpmail.texi | 2 +- etc/NEWS | 3 +++ lisp/desktop.el | 2 +- lisp/dnd.el | 21 +++++++++++---------- lisp/gnus/nnvirtual.el | 4 ++-- lisp/nxml/rng-uri.el | 2 +- lisp/org/org-clock.el | 4 ++-- src/editfns.c | 16 +++++++++++++++- src/filelock.c | 7 ++++--- src/sysdep.c | 23 ++++++++++++----------- src/xrdb.c | 5 +++-- src/xterm.c | 12 +++++++----- 15 files changed, 97 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90d7c0b..fd24995 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2014-12-26 Paul Eggert + + system-name's returned value can vary + Fixes Bug#19438. + * doc/lispref/os.texi (System Environment): + * etc/NEWS: Document this. + * doc/misc/efaq.texi: + (Displaying the current file name in the titlebar): + * lisp/desktop.el (desktop-save-frameset): + * lisp/dnd.el (dnd-get-local-file-uri): + * lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers) + (nnvirtual-update-xref-header): + * lisp/nxml/rng-uri.el (rng-uri-file-name-1): + * lisp/org/org-clock.el (org-clock-save): + * src/filelock.c (current_lock_owner): + * src/xrdb.c (get_environ_db): + * src/xterm.c (same_x_server): + * src/xterm.c (x_term_init): + Prefer (system-name) to system-name. + * doc/misc/smtpmail.texi (Server workarounds): Fix grammar. + * src/editfns.c (cached_system_name): New static var. + (init_and_cache_system_name): New function. + (init_editfns, Fsystem_name): Use it. + (syms_of_editfns): Initialize it and Vsystem_name to the same value. + * src/sysdep.c (init_system_name): Don't create a new string if + the current value is already correct. + 2014-12-25 Paul Eggert Prefer stpcpy to strcat diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index b709447..72d1ec7 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -918,10 +918,15 @@ string. @end defun The symbol @code{system-name} is a variable as well as a function. In -fact, the function returns whatever value the variable +fact, the function normally returns whatever value the variable @code{system-name} currently holds. Thus, you can set the variable @code{system-name} in case Emacs is confused about the name of your -system. The variable is also useful for constructing frame titles +system. If you do not set the variable, the function updates +the variable to the current system name; this behavior can be useful +if your Emacs process has changed systems or if the system has changed +names. + +The @code{system-name} variable is also useful for constructing frame titles (@pxref{Frame Titles}). @c FIXME seems like this section is not the best place for this option? diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 0159101..71c5ae0 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1469,7 +1469,7 @@ machine at which Emacs was invoked. This is done by setting @code{frame-title-format} to the default value of @lisp -(multiple-frames "%b" ("" invocation-name "@@" system-name)) +(multiple-frames "%b" ("" invocation-name "@@" (system-name))) @end lisp To modify the behavior such that frame titlebars contain the buffer's diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi index f539cd0..9cddbfa 100644 --- a/doc/misc/smtpmail.texi +++ b/doc/misc/smtpmail.texi @@ -368,7 +368,7 @@ implement support for common requirements. @vindex smtpmail-local-domain The variable @code{smtpmail-local-domain} controls the hostname sent in the first @code{EHLO} or @code{HELO} command sent to the server. -It should only be set if the @code{system-name} function returns a +It should be set only if the @code{system-name} function returns a name that isn't accepted by the server. Do not set this variable unless your server complains. diff --git a/etc/NEWS b/etc/NEWS index 14933aa..03fc0ed 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -533,6 +533,9 @@ optional repeat-count argument. ** Function `sort' can deal with vectors. +** Function `system-name' now returns an updated value if the current +system's name has changed, or if the Emacs process has changed systems. + --- ** New utilities in subr-x.el: *** New macros `if-let' and `when-let' allow defining bindings and to diff --git a/lisp/desktop.el b/lisp/desktop.el index bad0073..bcf0387 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -940,7 +940,7 @@ Frames with a non-nil `desktop-dont-save' parameter are not saved." (and desktop-restore-frames (frameset-save nil :app desktop--app-id - :name (concat user-login-name "@" system-name) + :name (concat user-login-name "@" (system-name)) :predicate #'desktop--check-dont-save)))) ;;;###autoload diff --git a/lisp/dnd.el b/lisp/dnd.el index 73b531d..2b68b02 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -122,17 +122,18 @@ Return nil if URI is not a local file." ;; The hostname may be our hostname, in that case, convert to a local ;; file. Otherwise return nil. TODO: How about an IP-address as hostname? - (let ((hostname (when (string-match "^file://\\([^/]*\\)" uri) + (let ((system-name (system-name))) + (let ((hostname (when (string-match "^file://\\([^/]*\\)" uri) (downcase (match-string 1 uri)))) - (system-name-no-dot - (downcase (if (string-match "^[^\\.]+" system-name) - (match-string 0 system-name) - system-name)))) - (when (and hostname - (or (string-equal "localhost" hostname) - (string-equal (downcase system-name) hostname) - (string-equal system-name-no-dot hostname))) - (concat "file://" (substring uri (+ 7 (length hostname))))))) + (system-name-no-dot + (downcase (if (string-match "^[^\\.]+" system-name) + (match-string 0 system-name) + system-name)))) + (when (and hostname + (or (string-equal "localhost" hostname) + (string-equal (downcase system-name) hostname) + (string-equal system-name-no-dot hostname))) + (concat "file://" (substring uri (+ 7 (length hostname)))))))) (defsubst dnd-unescape-uri (uri) (replace-regexp-in-string diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index f67943a..d13b492 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -151,7 +151,7 @@ component group will show up when you enter the virtual group.") ;; and clean up the xrefs. (princ article nntp-server-buffer) (nnvirtual-update-xref-header cgroup carticle - prefix system-name) + prefix (system-name)) (forward-line 1)) ) @@ -393,7 +393,7 @@ component group will show up when you enter the virtual group.") (forward-char -1) (delete-char 1)) - (insert "Xref: " system-name " " group ":") + (insert "Xref: " (system-name) " " group ":") (princ article (current-buffer)) (insert " ") diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el index b93624a..43218ec 100644 --- a/lisp/nxml/rng-uri.el +++ b/lisp/nxml/rng-uri.el @@ -85,7 +85,7 @@ Signal an error if URI is not a valid file URL." ((not (string= (downcase scheme) "file")) (rng-uri-error "URI `%s' does not use the `file:' scheme" uri))) (when (not (member authority - (cons system-name '(nil "" "localhost")))) + (cons (system-name) '(nil "" "localhost")))) (rng-uri-error "URI `%s' does not start with `file:///' or `file://localhost/'" uri)) (when query diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 51c8789..c928758 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -2811,8 +2811,8 @@ The details of what will be saved are regulated by the variable (delete-region (point-min) (point-max)) ;;Store clock (insert (format ";; org-persist.el - %s at %s\n" - system-name (format-time-string - (cdr org-time-stamp-formats)))) + (system-name) (format-time-string + (cdr org-time-stamp-formats)))) (if (and (memq org-clock-persist '(t clock)) (setq b (org-clocking-buffer)) (setq b (or (buffer-base-buffer b) b)) diff --git a/src/editfns.c b/src/editfns.c index 430c4c9..2a7dd92 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -93,6 +93,17 @@ static char const *initial_tz; It is OK (though a bit slower) if the user chooses this value. */ static char dump_tz_string[] = "TZ=UtC0"; +/* The cached value of Vsystem_name. This is used only to compare it + to Vsystem_name, so it need not be visible to the GC. */ +static Lisp_Object cached_system_name; + +static void +init_and_cache_system_name (void) +{ + init_system_name (); + cached_system_name = Vsystem_name; +} + void init_editfns (void) { @@ -102,7 +113,7 @@ init_editfns (void) Lisp_Object tem; /* Set up system_name even when dumping. */ - init_system_name (); + init_and_cache_system_name (); #ifndef CANNOT_DUMP /* When just dumping out, set the time zone to a known unlikely value @@ -1365,6 +1376,8 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, doc: /* Return the host name of the machine you are running on, as a string. */) (void) { + if (EQ (Vsystem_name, cached_system_name)) + init_and_cache_system_name (); return Vsystem_name; } @@ -4965,6 +4978,7 @@ functions if all the text being accessed has this property. */); DEFVAR_LISP ("system-name", Vsystem_name, doc: /* The host name of the machine Emacs is running on. */); + Vsystem_name = cached_system_name = Qnil; DEFVAR_LISP ("user-full-name", Vuser_full_name, doc: /* The full name of the user logged in. */); diff --git a/src/filelock.c b/src/filelock.c index f857c48..99215f2 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -592,9 +592,10 @@ current_lock_owner (lock_info_type *owner, char *lfname) return -1; /* On current host? */ - if (STRINGP (Vsystem_name) - && dot - (at + 1) == SBYTES (Vsystem_name) - && memcmp (at + 1, SSDATA (Vsystem_name), SBYTES (Vsystem_name)) == 0) + Lisp_Object system_name = Fsystem_name (); + if (STRINGP (system_name) + && dot - (at + 1) == SBYTES (system_name) + && memcmp (at + 1, SSDATA (system_name), SBYTES (system_name)) == 0) { if (pid == getpid ()) ret = 2; /* We own it. */ diff --git a/src/sysdep.c b/src/sysdep.c index 24cc5cb..b4a9be1 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1420,15 +1420,16 @@ extern int h_errno; void init_system_name (void) { + char *hostname_alloc = NULL; + char *hostname; #ifndef HAVE_GETHOSTNAME struct utsname uts; uname (&uts); - Vsystem_name = build_string (uts.nodename); + hostname = uts.nodename; #else /* HAVE_GETHOSTNAME */ - char *hostname_alloc = NULL; char hostname_buf[256]; ptrdiff_t hostname_size = sizeof hostname_buf; - char *hostname = hostname_buf; + hostname = hostname_buf; /* Try to get the host name; if the buffer is too short, try again. Apparently, the only indication gethostname gives of @@ -1541,15 +1542,15 @@ init_system_name (void) #endif /* !HAVE_GETADDRINFO */ } #endif /* HAVE_SOCKETS */ - Vsystem_name = build_string (hostname); - xfree (hostname_alloc); #endif /* HAVE_GETHOSTNAME */ - { - char *p; - for (p = SSDATA (Vsystem_name); *p; p++) - if (*p == ' ' || *p == '\t') - *p = '-'; - } + char *p; + for (p = hostname; *p; p++) + if (*p == ' ' || *p == '\t') + *p = '-'; + if (! (STRINGP (Vsystem_name) && SBYTES (Vsystem_name) == p - hostname + && strcmp (SSDATA (Vsystem_name), hostname) == 0)) + Vsystem_name = build_string (hostname); + xfree (hostname_alloc); } sigset_t empty_mask; diff --git a/src/xrdb.c b/src/xrdb.c index e21206d..8500fb1 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -385,10 +385,11 @@ get_environ_db (void) { char *home = gethomedir (); ptrdiff_t homelen = strlen (home); + Lisp_Object system_name = Fsystem_name (); ptrdiff_t filenamesize = (homelen + sizeof xdefaults - + SBYTES (Vsystem_name)); + + SBYTES (system_name)); p = filename = xrealloc (home, filenamesize); - lispstpcpy (stpcpy (filename + homelen, xdefaults), Vsystem_name); + lispstpcpy (stpcpy (filename + homelen, xdefaults), system_name); } db = XrmGetFileDatabase (p); diff --git a/src/xterm.c b/src/xterm.c index 0640208..cbd8bf1 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10501,8 +10501,9 @@ static bool same_x_server (const char *name1, const char *name2) { bool seen_colon = false; - const char *system_name = SSDATA (Vsystem_name); - ptrdiff_t system_name_length = SBYTES (Vsystem_name); + Lisp_Object sysname = Fsystem_name (); + const char *system_name = SSDATA (sysname); + ptrdiff_t system_name_length = SBYTES (sysname); ptrdiff_t length_until_period = 0; while (system_name[length_until_period] != 0 @@ -10894,14 +10895,15 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) #endif lim = min (PTRDIFF_MAX, SIZE_MAX) - sizeof "@"; - if (lim - SBYTES (Vinvocation_name) < SBYTES (Vsystem_name)) + Lisp_Object system_name = Fsystem_name (); + if (lim - SBYTES (Vinvocation_name) < SBYTES (system_name)) memory_full (SIZE_MAX); dpyinfo->x_id = ++x_display_id; dpyinfo->x_id_name = xmalloc (SBYTES (Vinvocation_name) - + SBYTES (Vsystem_name) + 2); + + SBYTES (system_name) + 2); char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name); *nametail++ = '@'; - lispstpcpy (nametail, Vsystem_name); + lispstpcpy (nametail, system_name); /* Figure out which modifier bits mean what. */ x_find_modifier_meanings (dpyinfo); -- 1.9.3 --------------010604000406000003040903-- From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Dec 2014 22:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert Cc: 19438@debbugs.gnu.org, Stefan Monnier Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.14196318722184 (code B ref 19438); Fri, 26 Dec 2014 22:12:01 +0000 Received: (at 19438) by debbugs.gnu.org; 26 Dec 2014 22:11:12 +0000 Received: from localhost ([127.0.0.1]:58455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4d6G-0000ZA-61 for submit@debbugs.gnu.org; Fri, 26 Dec 2014 17:11:12 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:56250) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4d6E-0000Z2-Tt for 19438@debbugs.gnu.org; Fri, 26 Dec 2014 17:11:11 -0500 Received: by mail-pd0-f174.google.com with SMTP id fp1so13485479pdb.5 for <19438@debbugs.gnu.org>; Fri, 26 Dec 2014 14:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=dHtiw92IkjLYUK9e3XC5rBBq+/P55cRwqYX5e6vQgeY=; b=rIIfYw0mVoIcNSFzNdd5tgktdiD73LHlGUYPRs2iGh1lUpPZWoVZ5fT1BS02h3nV1F y65Yo9kDD1a/Gp7hs2vq5xfQe/WPdKlNyxYZuVWJhCNxG1K0TC8fU1TEFyJTMJMbBbEN zb0pe8AWC8gF06wTGaEaf1qdio6vHJzlqlbmYZIzYfRQHi/MQhB4f28MWTp9ovDd1JdZ tizLCNsLOt8WKCoe3SAhxMUCkorTcq8qpGgkiPCZsg9agDEDGA255iWQ9dNeyX/qv8xU Lv+Mmc+NGHt3P2I4JE+YnH2IxkHXpuL/po/qa5Xq/dnn2T3JD9swXrbrWuQkpieFtmka tSiw== X-Received: by 10.68.139.1 with SMTP id qu1mr71539806pbb.51.1419631870069; Fri, 26 Dec 2014 14:11:10 -0800 (PST) Received: from 014136144036.static.ctinets.com ([110.144.172.164]) by mx.google.com with ESMTPSA id u4sm29059109pbs.60.2014.12.26.14.11.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Dec 2014 14:11:09 -0800 (PST) From: Leo Liu References: <549D87DB.7010909@cs.ucla.edu> Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= Date: Sat, 27 Dec 2014 09:10:57 +1100 In-Reply-To: <549D87DB.7010909@cs.ucla.edu> (Paul Eggert's message of "Fri, 26 Dec 2014 08:07:55 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (OS X 10.10.1) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-12-27 03:07 +1100, Paul Eggert wrote: > How about the attached patch? The idea is that (system-name) actually > inquires for the current system name, and system-name caches the > result. If an Emacs lisp program assigns to system-name, though, it's > no longer updated thereafter. Why not get rid of the variable system-name? It seems what it provides can be easily achieved without it. Thanks for looking into the issue. Leo From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Dec 2014 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 19438@debbugs.gnu.org, Stefan Monnier Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.14196322212786 (code B ref 19438); Fri, 26 Dec 2014 22:17:02 +0000 Received: (at 19438) by debbugs.gnu.org; 26 Dec 2014 22:17:01 +0000 Received: from localhost ([127.0.0.1]:58459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4dBt-0000is-0N for submit@debbugs.gnu.org; Fri, 26 Dec 2014 17:17:01 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:36448) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4dBq-0000ij-9A for 19438@debbugs.gnu.org; Fri, 26 Dec 2014 17:16:59 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1162DA6003E; Fri, 26 Dec 2014 14:16:57 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HrpuuXm3eHTy; Fri, 26 Dec 2014 14:16:48 -0800 (PST) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 4CC87A6003C; Fri, 26 Dec 2014 14:16:48 -0800 (PST) Message-ID: <549DDE50.7020402@cs.ucla.edu> Date: Fri, 26 Dec 2014 14:16:48 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 References: <549D87DB.7010909@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Leo Liu wrote: > Why not get rid of the variable system-name? It seems what it provides > can be easily achieved without it. It's documented so we shouldn't just remove it; we'd need to mark it as obsolescent. Its documented behavior is "you can set the variable @code{system-name} in case Emacs is confused about the name of your system". I've never found this feature to be useful, though I understand it was useful for others long ago. Perhaps some people still find it useful? Anyway, if there's consensus to mark the variable as obsolescent I can prepare a patch along those lines. From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Dec 2014 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert Cc: 19438@debbugs.gnu.org, Leo Liu Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.141969322726184 (code B ref 19438); Sat, 27 Dec 2014 15:14:02 +0000 Received: (at 19438) by debbugs.gnu.org; 27 Dec 2014 15:13:47 +0000 Received: from localhost ([127.0.0.1]:59190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4t3r-0006oG-29 for submit@debbugs.gnu.org; Sat, 27 Dec 2014 10:13:47 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:32839) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y4t3o-0006o7-CC for 19438@debbugs.gnu.org; Sat, 27 Dec 2014 10:13:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbDoJ5g2CFWsUdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLNBIUGA0kiEoJ1lkBAQEBAQUBAQEBHpBvB4RIBYsBg2GOUI9zggqBeIM7XiGCdwEBAQ X-IPAS-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbDoJ5g2CFWsUdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLNBIUGA0kiEoJ1lkBAQEBAQUBAQEBHpBvB4RIBYsBg2GOUI9zggqBeIM7XiGCdwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="103638344" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Dec 2014 10:13:43 -0500 Received: by pastel.home (Postfix, from userid 20848) id 4AEE7106D; Sat, 27 Dec 2014 10:13:43 -0500 (EST) From: Stefan Monnier Message-ID: References: <549D87DB.7010909@cs.ucla.edu> <549DDE50.7020402@cs.ucla.edu> Date: Sat, 27 Dec 2014 10:13:43 -0500 In-Reply-To: <549DDE50.7020402@cs.ucla.edu> (Paul Eggert's message of "Fri, 26 Dec 2014 14:16:48 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> Why not get rid of the variable system-name? It seems what it provides >> can be easily achieved without it. > It's documented so we shouldn't just remove it; we'd need to mark it > as obsolescent. > Its documented behavior is "you can set the variable @code{system-name} in > case Emacs is confused about the name of your system". I've never found > this feature to be useful, though I understand it was useful for others long > ago. Perhaps some people still find it useful? Anyway, if there's > consensus to mark the variable as obsolescent I can prepare a patch along > those lines. Maybe we could mark it obsolete, tho I'm not completely sure what replaces it. Random thoughts: - "it" is unclear, since currently the var and the function are just identical. - this not-very-useful functionality occasionally causes 30s wait at startup time, so it would be good to get rid of the DNS lookup. Maybe we could make the system-name function return the same as `hostname` (and do it dynamically). > How about the attached patch? The idea is that (system-name) actually > inquires for the current system name, and system-name caches the result. > If an Emacs lisp program assigns to system-name, though, it's no longer > updated thereafter. Sounds OK. Stefan From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Dec 2014 23:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 19438@debbugs.gnu.org, Paul Eggert Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.14197230658169 (code B ref 19438); Sat, 27 Dec 2014 23:32:01 +0000 Received: (at 19438) by debbugs.gnu.org; 27 Dec 2014 23:31:05 +0000 Received: from localhost ([127.0.0.1]:59281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y50p7-00027h-Cw for submit@debbugs.gnu.org; Sat, 27 Dec 2014 18:31:05 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:45427) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y50p5-00027Z-U6 for 19438@debbugs.gnu.org; Sat, 27 Dec 2014 18:31:04 -0500 Received: by mail-pd0-f172.google.com with SMTP id y13so14888434pdi.17 for <19438@debbugs.gnu.org>; Sat, 27 Dec 2014 15:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:face:date :message-id:mime-version:content-type; bh=NnWtFz1XjFlC4nGZwUrYDr+2w6wZPgDMgzmuj3SoLzI=; b=UYt0/4L+taqaaXP1jhwwi4C80FOBQalQpGu3q1Omvy4mxJZoinF2U9C+oWesAKw1Kk 4TuGRT/yTnp5D9AMrdRVhrlEUacMfNOJgkzAGMPZzflNTbwIwnywWmqrMg4EQOM+fO5c Mn2RbcacArOG3UUbDKF2nbbue2u4nnpx4B3j31KU6Chl7lnSY9RByhN8kzySG+MRMEPD kILjAu2qqWl2Eh99RERTNRtQtLEKk5NcNjhkvYbKT7AwMHirx7oJDTo3hnn6qXTI9SnG OmcGDIyAcdg2cLo7RUibPXhMcqhJevfvELv25euXJ1kw0Zw2+Wy5jz1ZeTO3aoORecEM ARJQ== X-Received: by 10.68.242.137 with SMTP id wq9mr23567459pbc.98.1419723062826; Sat, 27 Dec 2014 15:31:02 -0800 (PST) Received: from Zeuss-MacBook.local ([1.157.147.150]) by mx.google.com with ESMTPSA id o3sm31742347pdn.29.2014.12.27.15.30.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Dec 2014 15:31:01 -0800 (PST) From: Leo Liu In-Reply-To: (Stefan Monnier's message of "Sat, 27 Dec 2014 10:13:43 -0500") References: <549D87DB.7010909@cs.ucla.edu> <549DDE50.7020402@cs.ucla.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (OS X 10.10.1) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= Date: Sun, 28 Dec 2014 10:30:33 +1100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-12-28 02:13 +1100, Stefan Monnier wrote: > Maybe we could mark it obsolete, tho I'm not completely sure what > replaces it. Random thoughts: > - "it" is unclear, since currently the var and the function are just identical. > - this not-very-useful functionality occasionally causes 30s wait at > startup time, so it would be good to get rid of the DNS lookup. I am mostly against having a variable and a function for a simple small feature. Such feature should be straightforward to use with either the variable or the function public. With Paul's change it only makes sense to use (system-name), the variable system-name just provides a way to override it. Worst comes to worst, they can advise it. Leo From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Dec 2014 01:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 19438@debbugs.gnu.org, Paul Eggert Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.141972909717647 (code B ref 19438); Sun, 28 Dec 2014 01:12:01 +0000 Received: (at 19438) by debbugs.gnu.org; 28 Dec 2014 01:11:37 +0000 Received: from localhost ([127.0.0.1]:59301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y52OP-0004aY-Gn for submit@debbugs.gnu.org; Sat, 27 Dec 2014 20:11:37 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52438) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y52OM-0004aP-LB for 19438@debbugs.gnu.org; Sat, 27 Dec 2014 20:11:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOHwcSFBgNJIhKCdZZAQEBAQYBAQEBHpBvBwqEPgWLAaQugXiEGSGCdwEBAQ X-IPAS-Result: AjwPAOwQflTO+ILA/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOHwcSFBgNJIhKCdZZAQEBAQYBAQEBHpBvBwqEPgWLAaQugXiEGSGCdwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="103671768" Received: from 206-248-130-192.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Dec 2014 20:11:33 -0500 Received: by ceviche.home (Postfix, from userid 20848) id D94CA660FB; Sat, 27 Dec 2014 20:11:33 -0500 (EST) From: Stefan Monnier Message-ID: References: <549D87DB.7010909@cs.ucla.edu> <549DDE50.7020402@cs.ucla.edu> Date: Sat, 27 Dec 2014 20:11:33 -0500 In-Reply-To: (Leo Liu's message of "Sun, 28 Dec 2014 10:30:33 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > variable or the function public. With Paul's change it only makes sense > to use (system-name), the variable system-name just provides a way to > override it. Worst comes to worst, they can advise it. That's right. But we have to take backward compatibility into account. Stefan From unknown Mon Sep 08 01:50:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19438: 24.4; system-name bad cache Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Dec 2014 02:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: "19438@debbugs.gnu.org" <19438@debbugs.gnu.org>, Paul Eggert Received: via spool by 19438-submit@debbugs.gnu.org id=B19438.1419732229545 (code B ref 19438); Sun, 28 Dec 2014 02:04:02 +0000 Received: (at 19438) by debbugs.gnu.org; 28 Dec 2014 02:03:49 +0000 Received: from localhost ([127.0.0.1]:59321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y53Cu-00008i-Id for submit@debbugs.gnu.org; Sat, 27 Dec 2014 21:03:48 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:53068) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y53Cq-00008W-T5 for 19438@debbugs.gnu.org; Sat, 27 Dec 2014 21:03:45 -0500 Received: by mail-pd0-f180.google.com with SMTP id w10so15042779pde.11 for <19438@debbugs.gnu.org>; Sat, 27 Dec 2014 18:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=7BasOPmK9OHoJ204SVWV4bgAHD1F/P7sg6CrAFzbh/M=; b=L8yc7Oo1p91JkU/Zrhe9+kC5tIS2X2CivdNgcJMSW98qMeGr5qn1bGQmfJkxPqR9Fj w5/i3TWea+MZRgCK/Q7Bf0c4JaLHt6nxLUmms0UsQHXL/accVh21TQI/AGbXVX/hHKyq 90tdx5d5BQEMnnNPuo0u3UEJBjC67f03ryDROe9cRijEhpDm4/o9BxDSNDdCRdBbI9BN 50h4Ua+0HSBdLSpmpeO6ZFfdMmHY5cRMM8qf8J9ccmTtiy1j0lcir0jmPhVqjVaq3f+a u7kH/JpMo4N6FA8htR8HmLlMPqY8j37Umn9nZQ/yy2XQ6QoJ0IiIEstFHXhWQtsuwku6 G9Nw== X-Received: by 10.70.56.37 with SMTP id x5mr46664975pdp.86.1419732223854; Sat, 27 Dec 2014 18:03:43 -0800 (PST) Received: from [10.147.192.41] ([1.157.160.189]) by mx.google.com with ESMTPSA id jz1sm224170pbd.35.2014.12.27.18.03.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Dec 2014 18:03:42 -0800 (PST) References: <549D87DB.7010909@cs.ucla.edu> <549DDE50.7020402@cs.ucla.edu> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (12B440) From: Leo Liu Date: Sun, 28 Dec 2014 13:03:38 +1100 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > On 2014=C4=EA12=D4=C228=C8=D5, at 12:11, Stefan Monnier wrote: >=20 > That's right. But we have to take backward compatibility into account. Agreed. I meant to say phase out:) Leo= From unknown Mon Sep 08 01:50:29 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leo Liu Subject: bug#19438: closed (Re: bug#19438: 24.4; system-name bad cache) Message-ID: References: <54A1BDD4.6060901@cs.ucla.edu> X-Gnu-PR-Message: they-closed 19438 X-Gnu-PR-Package: emacs Reply-To: 19438@debbugs.gnu.org Date: Mon, 29 Dec 2014 20:48:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1419886082-9053-1" This is a multi-part message in MIME format... ------------=_1419886082-9053-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19438: 24.4; system-name bad cache which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19438@debbugs.gnu.org. --=20 19438: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19438 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1419886082-9053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19438-done) by debbugs.gnu.org; 29 Dec 2014 20:47:33 +0000 Received: from localhost ([127.0.0.1]:60569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5hDx-0002LD-GK for submit@debbugs.gnu.org; Mon, 29 Dec 2014 15:47:33 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60662) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5hDu-0002L2-Ey for 19438-done@debbugs.gnu.org; Mon, 29 Dec 2014 15:47:31 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 76CD6A60041; Mon, 29 Dec 2014 12:47:29 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9kfxOhFsig52; Mon, 29 Dec 2014 12:47:20 -0800 (PST) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id C8BC0A60040; Mon, 29 Dec 2014 12:47:20 -0800 (PST) Message-ID: <54A1BDD4.6060901@cs.ucla.edu> Date: Mon, 29 Dec 2014 12:47:16 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#19438: 24.4; system-name bad cache References: <549D87DB.7010909@cs.ucla.edu> <549DDE50.7020402@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19438-done Cc: 19438-done@debbugs.gnu.org, Leo Liu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Stefan Monnier wrote: > Maybe we could make the system-name function return the same as > `hostname` (and do it dynamically). OK, thanks, I revised the patch to do that, and made the var obsolete, and installed something along those lines into the master. (It was 3 patches not one because I installed the wrong version first, sorry.) Marking this as done. ------------=_1419886082-9053-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Dec 2014 10:21:47 +0000 Received: from localhost ([127.0.0.1]:56904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y45YB-0007xd-1Q for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50862) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y45Y8-0007xT-L3 for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y45Y7-0007ht-Mk for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NUMERIC_HTTP_ADDR,T_DKIM_INVALID,URI_HEX autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y7-0007hn-JO for submit@debbugs.gnu.org; Thu, 25 Dec 2014 05:21:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y6-0001ot-KA for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y45Y3-0007gq-Ds for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:42 -0500 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]:56331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y45Y3-0007ge-6u for bug-gnu-emacs@gnu.org; Thu, 25 Dec 2014 05:21:39 -0500 Received: by mail-pd0-f181.google.com with SMTP id v10so11473889pde.40 for ; Thu, 25 Dec 2014 02:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=URHakJD32N7SMfKJRQwmXKpMgzb3E8vI3+hm/t3jQ3w=; b=RXFRgiONmkxdjnPv5gDh9O3MQAV9G8vIUCHrSQQc2BBaEC5n9lDwD6+BCqvk2BHku1 /DsZrt4I9bYgbKc1zUbVbjFMiTTMvKIcBPCyzHTn6yZaM27OBo7D0K+6rvO4mZzW+Hra vjYQI2Fo4Jb+lqxIo4SGgWp18+TB/vGDDKuYWJV3LVY0XiWqlDAvF2ByG/YxiwO3ypRr 3+3jIOkRMLSznPI9JSvfloHMeox7JNRfKnwEdWSdagBC9h2U+cDL/8eSFGkCov0DhUBI yTZpFaf2oCO++u+e9oImjzrgHUK/pNuQkP6+oNoz/IHqhBD9mX26um/6tY8yFN8C4qhj VDrQ== X-Received: by 10.70.124.200 with SMTP id mk8mr60723093pdb.147.1419502897707; Thu, 25 Dec 2014 02:21:37 -0800 (PST) Received: from Zeuss-MacBook.local (014136144036.static.ctinets.com. [14.136.144.36]) by mx.google.com with ESMTPSA id qz7sm25105098pbb.12.2014.12.25.02.21.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Dec 2014 02:21:36 -0800 (PST) From: Leo Liu To: bug-gnu-emacs@gnu.org Subject: 24.4; system-name bad cache X-Debbugs-CC: Date: Thu, 25 Dec 2014 18:21:31 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) I just moved from one network to another and find that my long running Emacs no longer has the right value for (system-name). I am seeing this: (system-name) => Leos-MacBook.local but a freshly-started emacs gives me: 014136144036.static.ctinets.com It turns out system name is not computed dynamically. Could someone fix this problem? Thanks. Leo ------------=_1419886082-9053-1--