all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
@ 2010-09-29 17:00 Bob Nnamtrop
  2010-09-29 19:45 ` Bob Nnamtrop
  0 siblings, 1 reply; 11+ messages in thread
From: Bob Nnamtrop @ 2010-09-29 17:00 UTC (permalink / raw)
  To: 7135

[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]

When using daemon mode locally on my computer it works correctly.  However,
if I login (using ssh -Y) to a computer with an emacs daemon running
(started with emacs -Q --daemon) and use emacsclient to connect to it
emacsclient does not find the server.  I get the error:

emacsclient -n -c
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

        --socket-name
        --server-file      (or environment variable EMACS_SERVER_FILE)
        --alternate-editor (or environment variable ALTERNATE_EDITOR)

I can get emacsclient to work if I use --server-file option after I have
located the server-file.  I have the following bash function which does this
automatically:

emc () { emacsclient -n -c --socket-name="$( (find /var/ -name server | grep
emacs8060) 2> /dev/null )"}

but emacclient should be able to find the socket on its own.  Note that this
was present in 23.1 and 23.2 as well.

Bob

In GNU Emacs 24.0.50.2 (i386-apple-darwin9.8.0, GTK+ Version 2.20.1)
 of 2010-09-29 on ***
Windowing system distributor `The X.Org Foundation', version 11.0.10802000
configured using `configure  '--prefix=/Users/name/local-emacs-bzr''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

[-- Attachment #2: Type: text/html, Size: 2135 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-29 17:00 bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login Bob Nnamtrop
@ 2010-09-29 19:45 ` Bob Nnamtrop
  2010-09-30  0:34   ` Glenn Morris
  0 siblings, 1 reply; 11+ messages in thread
From: Bob Nnamtrop @ 2010-09-29 19:45 UTC (permalink / raw)
  To: 7135

After sending this bug report I noticed bug # 3992 that mentions that
the system variable TMPDIR is not set when logging in remotely and
suggests setting in .bashrc it with:

if [ -z "$TMPDIR" ]; then
  export TMPDIR=`getconf DARWIN_USER_TEMP_DIR`
fi

I can confirm that this fixes the problem and I have sumbitted a bug
report to Apple to set TMPDIR when logging in remotely.  However, I
wonder if emacsclient could check if TMPDIR is set and if not set it
with the above command so this problem is fixed within emacs.

Bob





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-29 19:45 ` Bob Nnamtrop
@ 2010-09-30  0:34   ` Glenn Morris
  2010-09-30  1:41     ` Glenn Morris
  0 siblings, 1 reply; 11+ messages in thread
From: Glenn Morris @ 2010-09-30  0:34 UTC (permalink / raw)
  To: Bob Nnamtrop; +Cc: 7135


Please try this patch (against the emacs-23 emacsclient.c):

*** lib-src/emacsclient.c	2010-01-13 15:38:28 +0000
--- lib-src/emacsclient.c	2010-09-29 20:48:44 +0000
***************
*** 1249,1255 ****
--- 1249,1261 ----
        {
  	tmpdir = egetenv ("TMPDIR");
  	if (!tmpdir)
+           {
+ #ifdef DARWIN_OS
+             tmpdir = egetenv ("DARWIN_USER_TEMP_DIR"); /* bug#3992 */
+             if (!tmpdir)
+ #endif
                tmpdir = "/tmp";
+           }
  	socket_name = alloca (strlen (tmpdir) + strlen (server_name)
  			      + EXTRA_SPACE);
  	sprintf (socket_name, "%s/emacs%d/%s",






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  0:34   ` Glenn Morris
@ 2010-09-30  1:41     ` Glenn Morris
  2010-09-30  5:30       ` Jan Djärv
  0 siblings, 1 reply; 11+ messages in thread
From: Glenn Morris @ 2010-09-30  1:41 UTC (permalink / raw)
  To: Bob Nnamtrop; +Cc: 7135


> +             tmpdir = egetenv ("DARWIN_USER_TEMP_DIR"); /* bug#3992 */

Oh, is this D_U_T_D thing actually an environment variable, though?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  1:41     ` Glenn Morris
@ 2010-09-30  5:30       ` Jan Djärv
  2010-09-30  6:45         ` Glenn Morris
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Djärv @ 2010-09-30  5:30 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Bob Nnamtrop, 7135



Glenn Morris skrev 2010-09-30 03.41:
>
>> +             tmpdir = egetenv ("DARWIN_USER_TEMP_DIR"); /* bug#3992 */
>
> Oh, is this D_U_T_D thing actually an environment variable, though?
>
>

No.  It is a getconf variable.

	Jan D.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  5:30       ` Jan Djärv
@ 2010-09-30  6:45         ` Glenn Morris
  2010-09-30  9:17           ` Eli Zaretskii
                             ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Glenn Morris @ 2010-09-30  6:45 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Bob Nnamtrop, 7135

Jan Djärv wrote:

> No.  It is a getconf variable.

Something more like this then?

*** lib-src/emacsclient.c	2010-01-13 15:38:28 +0000
--- lib-src/emacsclient.c	2010-09-30 06:40:27 +0000
***************
*** 1249,1255 ****
--- 1249,1266 ----
        {
  	tmpdir = egetenv ("TMPDIR");
  	if (!tmpdir)
+           {
+ #ifdef DARWIN_OS
+             size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
+             if (n > 0)
+               {
+                 tmpdir = alloca (n);
+                 confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
+               }
+             else
+ #endif
                tmpdir = "/tmp";
+           }
  	socket_name = alloca (strlen (tmpdir) + strlen (server_name)
  			      + EXTRA_SPACE);
  	sprintf (socket_name, "%s/emacs%d/%s",






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  6:45         ` Glenn Morris
@ 2010-09-30  9:17           ` Eli Zaretskii
  2010-10-01  3:57             ` Glenn Morris
  2010-09-30 10:14           ` Jan Djärv
  2010-10-01  3:43           ` Glenn Morris
  2 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2010-09-30  9:17 UTC (permalink / raw)
  To: Glenn Morris; +Cc: bobnnamtrop, 7135

> From: Glenn Morris <rgm@gnu.org>
> Date: Thu, 30 Sep 2010 02:45:59 -0400
> Cc: Bob Nnamtrop <bobnnamtrop@gmail.com>, 7135@debbugs.gnu.org
> 
> Jan Djärv wrote:
> 
> > No.  It is a getconf variable.
> 
> Something more like this then?
> 
> *** lib-src/emacsclient.c	2010-01-13 15:38:28 +0000
> --- lib-src/emacsclient.c	2010-09-30 06:40:27 +0000
> ***************
> *** 1249,1255 ****
> --- 1249,1266 ----
>         {
>   	tmpdir = egetenv ("TMPDIR");
>   	if (!tmpdir)
> +           {
> + #ifdef DARWIN_OS
> +             size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
> +             if (n > 0)
> +               {
> +                 tmpdir = alloca (n);
> +                 confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
> +               }
> +             else
> + #endif
>                 tmpdir = "/tmp";
> +           }

If this works, shouldn't it rather be part of egetenv?  Or at least a
new get_tmpdir function that would call egetenv on all platforms
except Darwin, and use the above on Darwin?






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  6:45         ` Glenn Morris
  2010-09-30  9:17           ` Eli Zaretskii
@ 2010-09-30 10:14           ` Jan Djärv
  2010-09-30 18:09             ` Bob Nnamtrop
  2010-10-01  3:43           ` Glenn Morris
  2 siblings, 1 reply; 11+ messages in thread
From: Jan Djärv @ 2010-09-30 10:14 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Bob Nnamtrop, 7135



Glenn Morris skrev 2010-09-30 08.45:
> +           {
> + #ifdef DARWIN_OS
> +             size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
> +             if (n>  0)
> +               {
> +                 tmpdir = alloca (n);
> +                 confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
> +               }
> +             else
> + #endif
>                  tmpdir = "/tmp";
> +           }

That works.

	Jan D.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30 10:14           ` Jan Djärv
@ 2010-09-30 18:09             ` Bob Nnamtrop
  0 siblings, 0 replies; 11+ messages in thread
From: Bob Nnamtrop @ 2010-09-30 18:09 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 7135

On Thu, Sep 30, 2010 at 4:14 AM, Jan Djärv <jan.h.d@swipnet.se> wrote:
>
>
> Glenn Morris skrev 2010-09-30 08.45:
>>
>> +           {
>> + #ifdef DARWIN_OS
>> +             size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t)
>> 0);
>> +             if (n>  0)
>> +               {
>> +                 tmpdir = alloca (n);
>> +                 confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
>> +               }
>> +             else
>> + #endif
>>                 tmpdir = "/tmp";
>> +           }
>
> That works.
>
>        Jan D.
>

Yes, this works for me also.

Thanks,
Bob





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  6:45         ` Glenn Morris
  2010-09-30  9:17           ` Eli Zaretskii
  2010-09-30 10:14           ` Jan Djärv
@ 2010-10-01  3:43           ` Glenn Morris
  2 siblings, 0 replies; 11+ messages in thread
From: Glenn Morris @ 2010-10-01  3:43 UTC (permalink / raw)
  To: 7135-done

Version: 23.3

2010-10-01  Glenn Morris  <rgm at gnu.org>

        * emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a
        fall-back DARWIN_USER_TEMP_DIR.  (Bug#3992)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login
  2010-09-30  9:17           ` Eli Zaretskii
@ 2010-10-01  3:57             ` Glenn Morris
  0 siblings, 0 replies; 11+ messages in thread
From: Glenn Morris @ 2010-10-01  3:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 7135

Eli Zaretskii wrote:

> If this works, shouldn't it rather be part of egetenv?  Or at least a
> new get_tmpdir function that would call egetenv on all platforms
> except Darwin, and use the above on Darwin?

I'm not sure if this matters anywhere outside of the current context.
I added a kludge to the init of temporary-file-directory in the trunk.
Maybe as you say there should be a Ftemporary_file_directory that is
used there and elsewhere.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-10-01  3:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 17:00 bug#7135: 24.0.50; Mac OS X X11: emacsclient cannot find server from remote login Bob Nnamtrop
2010-09-29 19:45 ` Bob Nnamtrop
2010-09-30  0:34   ` Glenn Morris
2010-09-30  1:41     ` Glenn Morris
2010-09-30  5:30       ` Jan Djärv
2010-09-30  6:45         ` Glenn Morris
2010-09-30  9:17           ` Eli Zaretskii
2010-10-01  3:57             ` Glenn Morris
2010-09-30 10:14           ` Jan Djärv
2010-09-30 18:09             ` Bob Nnamtrop
2010-10-01  3:43           ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.