summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-12-29 12:37:53 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-12-29 12:38:58 -0800
commitf9acac751d4cd22480e62cc63936b1208ca9fe48 (patch)
tree49f37d577e63a00042dc990ec92651d19be8870a /lisp
parentce1ebdf1ba8acc75e8f959f414652cdc87e76401 (diff)
downloademacs-f9acac751d4cd22480e62cc63936b1208ca9fe48.tar.gz
system-name's returned value can vary
Also, the system-name variable is now obsolete. 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/message.el (message-make-fqdn): * 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, and avoid naming locals 'system-name'. * doc/misc/smtpmail.texi (Server workarounds): Fix grammar. * lisp/startup.el (system-name): Now an obsolete variable. * 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 [HAVE_SOCKETS]: Don't include <sys/socket.h>, <netdb.h>. (h_errno) [TRY_AGAIN && !HAVE_H_ERRNO]: Remove decl. (init_system_name) [HAVE_SOCKETS]: Don't canonicalize the name. Don't create a new string if the current value is already correct.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dnd.el21
-rw-r--r--lisp/gnus/nnvirtual.el4
-rw-r--r--lisp/nxml/rng-uri.el2
-rw-r--r--lisp/org/org-clock.el4
5 files changed, 17 insertions, 16 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el
index bad0073fbba..bcf038762da 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 73b531dfd16..2b68b025ac1 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 f67943a336a..d13b492ddb3 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 b93624a4f22..43218ec7c88 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 51c87892a9c..c9287586e4e 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))