emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d9851c6df2: Ensure local `default-directory' when calling `proces


From: Michael Albinus
Subject: master d9851c6df2: Ensure local `default-directory' when calling `process-attributes'.
Date: Fri, 8 Apr 2022 06:48:08 -0400 (EDT)

branch: master
commit d9851c6df2d5b5e950329968ac268a06ef4adfbf
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Ensure local `default-directory' when calling `process-attributes'.
    
    * lisp/server.el (server-running-p):
    * lisp/subr.el (memory-limit): Ensure local `default-directory'
    when calling `process-attributes'.
---
 lisp/server.el | 3 ++-
 lisp/subr.el   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/server.el b/lisp/server.el
index da60f1cda7..763cf27f7a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -779,7 +779,8 @@ by the current Emacs process, use the `server-process' 
variable."
   (condition-case nil
       (if server-use-tcp
          (with-temp-buffer
-           (insert-file-contents-literally (expand-file-name name 
server-auth-dir))
+            (setq default-directory server-auth-dir)
+           (insert-file-contents-literally (expand-file-name name))
            (or (and (looking-at "127\\.0\\.0\\.1:[0-9]+ \\([0-9]+\\)")
                     (assq 'comm
                           (process-attributes
diff --git a/lisp/subr.el b/lisp/subr.el
index 34f7bb6888..e7d5d36461 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2719,7 +2719,8 @@ It can be retrieved with `(process-get PROCESS 
PROPNAME)'."
 
 (defun memory-limit ()
   "Return an estimate of Emacs virtual memory usage, divided by 1024."
-  (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0))
+  (let ((default-directory temporary-file-directory))
+    (or (cdr (assq 'vsize (process-attributes (emacs-pid)))) 0)))
 
 
 ;;;; Input and display facilities.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]