all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacsclient almost working!
@ 2008-04-21 18:17 Ken Manheimer
  2008-04-21 19:30 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Manheimer @ 2008-04-21 18:17 UTC (permalink / raw)
  To: emacs-devel

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

hi, all.  i'm thrilled to see that - in emacs 23.0.60, debian
"emacs-snapshot" from a few days ago - i can use emacsclient to get a tty
frame connected to a X-based emacs session!  yay, yay, yay!  i had to poke
and prod a bit to get it to work, though, and am wondering whether this is a
known problem.

specifically, if i just do

  emacsclient --tty

i get an assertion error:

  *ERROR*: Assertion failed: (eq (match-end 0) (length string))

i avoid that error by inhibiting the shell environment (and adding back the
TERM setting):

  env -i TERM=xterm emacsclient --tty

(spelunking a tiny bit through the operation, it looks like my elaborate
shell environment, with numerous multi-line shell functions, may be
thwarting server.el server-process-filter.  it may be something else in the
environment, though.)

looks like emacsclient is a bit too sensitive to environment settings.

it sure is nice to use the multi-tty support, though!!
-- 
ken
http://myriadicity.net

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

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

* Re: emacsclient almost working!
  2008-04-21 18:17 emacsclient almost working! Ken Manheimer
@ 2008-04-21 19:30 ` Stefan Monnier
  2008-04-21 22:20   ` Ken Manheimer
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-04-21 19:30 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: emacs-devel

> hi, all.  i'm thrilled to see that - in emacs 23.0.60, debian
> "emacs-snapshot" from a few days ago - i can use emacsclient to get a tty
> frame connected to a X-based emacs session!  yay, yay, yay!  i had to poke
> and prod a bit to get it to work, though, and am wondering whether this is a
> known problem.

> specifically, if i just do

>   emacsclient --tty

> i get an assertion error:

>   *ERROR*: Assertion failed: (eq (match-end 0) (length string))

Not a known problem.  This assertion says that server.el received more
than a single line from emacsclient.  So it may be a problem in
emacsclient where we forget to quote newlines or something like that.

Or it may be something altogether different ;-)

Can you set server-log to t, reproduce the problem and show us the
contents of the " *server*" buffer?


        Stefan




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

* Re: emacsclient almost working!
  2008-04-21 19:30 ` Stefan Monnier
@ 2008-04-21 22:20   ` Ken Manheimer
  2008-04-22  2:52     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Manheimer @ 2008-04-21 22:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1728 bytes --]

On Mon, Apr 21, 2008 at 3:30 PM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> hi, all.  i'm thrilled to see that - in emacs 23.0.60, debian
> > "emacs-snapshot" from a few days ago - i can use emacsclient to get a
> tty
> > frame connected to a X-based emacs session!  yay, yay, yay!  i had to
> poke
> > and prod a bit to get it to work, though, and am wondering whether this
> is a
> > known problem.
>
> > specifically, if i just do
>
> >   emacsclient --tty
>
> > i get an assertion error:
>
> >   *ERROR*: Assertion failed: (eq (match-end 0) (length string))
>
> Not a known problem.  This assertion says that server.el received more
> than a single line from emacsclient.  So it may be a problem in
> emacsclient where we forget to quote newlines or something like that.
>
> Or it may be something altogether different ;-)
>
> Can you set server-log to t, reproduce the problem and show us the
> contents of the " *server*" buffer?


i'm attaching the contents of the " *server*" buffer.  i see at least part
of the problem - i had an environment variable CR which had the value ^M
(char 13).  unsetting that environment variable prevents the problem.

reproducing the problem without the rest of the environment isn't quite as
trivial, though, because just setting the CR as an environment variable (and
TERM=...) isn't sufficient to cause the failure.  i suspect there's an
environment size threshold, but now i'm just speculating.

so i'm able to avoid the problem by no longer setting the "CR=^M"
environment variable (turns out i no longer use it), but i figure you want
to prevent this sensitivity altogether, hence all these niggly details.-)

ken


>
>
>
>        Stefan
>



-- 
ken
http://myriadicity.net

[-- Attachment #1.2: Type: text/html, Size: 2497 bytes --]

[-- Attachment #2: emacsclient_log.txt --]
[-- Type: text/plain, Size: 4671 bytes --]

Mon Apr 21 18:12:04 2008 server <*30*>: Status changed to open: open from -
Mon Apr 21 18:12:04 2008 server <*30*>: server-delete-client
Mon Apr 21 18:12:04 2008 server <*30*>: Received -env MANPATH= -env time=10 -env packages=&_session-funcs&_session-vars&_term-vars&_term-funcs&_term-vars&_login-actions -env TERM=linux -env SHELL=/bin/bash -env XDG_SESSION_COOKIE=ae1e497797f8aa6d7c8f36e74808cad8-1208815247.129955-1015505485 -env SSH_CLIENT=127.0.1.1&_60278&_22 -env auto_resume=exact -env history_control=ignoreboth -env hardpaths=1 -env SSH_TTY=/dev/pts/5 -env tick=: -env stallTime=300 -env USER=klm -env LS_COLORS=no=00:fi=00:di=00:ln=36:pi=30;43;04:so=01;35:bd=30;43;01:cd=34;43;01:or=40;31;01:ex=32:*.tar=04:*.tgz=04:*.arj=04:*.taz=04:*.lzh=04:*.zip=04:*.z=04:*.Z=04:*.gz=04:*.deb=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=01;34: -env notify=1 -env stdPS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$&_ -env us=\033[4m -env MAIL=/var/mail/klm -env PATH=.:/home/klm/bin:/home/klm/env/bash:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/X11R6/bin -env PWD=/home/klm -env LANG=en_US.UTF-8 -env wasTerm= -env PYTHONSTARTUP=/home/klm/env/python/pythonrc -env PS1=\@&_\[\033[01;35m\]\h\[\033[m\].\W&_\#${tick}&_ -env KLMHOME=/home/klm -env CR=
 -env PS2=&_ -env SHLVL=1 -env HOME=/home/klm -env HUNT=name=Gland -env me=\033[m -env md=\033[01;35m -env LESS=-XRdqeismPm?f%f:line.&_?m(%i&_of&_%m)&_.%lb&_?e(END?x,&_Next\:&_%x.):?pb%pb\%:byte&_%bb?s/%s...%t -env LOGNAME=klm -env CVS_RSH=ssh -env SSH_CONNECTION=127.0.1.1&_60278&_127.0.1.1&_22 -env DISPLAY=localhost:10.0 -env MAIL_WARNING=on -env ONBASE= -env bashRcSourced=t -env origPath=.:/home/klm/bin:/home/klm/env/bash:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/X11R6/bin -env OLC_MAIL_RECORD=/home/klm/mail/sent-olc -env enable_prompt_monitor=()&_{&_&_PROMPT_COMMAND="StatusCheck"&n} -env df=()&_{&_&_/bin/df&_-h&_"$@"&n} -env disable_prompt_monitor=()&_{&_&_unset&_PROMPT_COMMAND&n} -env SetOrnaments=()&_{&_&_case&_$TERM&_in&_&n&_vt100*&_|&_screen&_|&_linux&_|&_cygwin&_|&_uterm&_|&_xterm&_|&_exterm&_|&_dumb&_|&_emacs)&n&_AssignPrompt&_"\033[4m"&_"\033[01;35m"&_"\033[m"&n&_;;&n&_sun)&n&_AssignPrompt&_""&_"\033[7m"&_"\033[m"&_1&n&_;;&n&_*)&n&_AssignPrompt&_""&_""&_""&n&_;;&n&_esac&n} -env Setterm=()&_{&_&_TERM=${1};&n&_SetOrnaments&n} -env StatusCheck=()&_{&_&_STATUS=$?;&n&_if&_[&_$STATUS&_!=&_0&_];&_then&n&_echo&_-n&_"err&_${STATUS}:&_";&n&_history&_1;&n&_fi&n} -env clean_dir=()&_{&_&_local&_subjs="";&n&_local&_exp;&n&_for&_pat&_in&_"*~"&_".*~";&n&_do&n&_exp=$(eval&_"echo&_$pat");&n&_if&_[&_-z&_"$exp"&_-o&_"$exp"&_=&_"$pat"&_-a&_!&_-e&_"$pat"&_];&_then&n&_:;&n&_else&n&_if&_[&_-z&_"$subjs"&_];&_then&n&_subjs="$exp";&n&_else&n&_subjs="$subjs&_$exp";&n&_fi;&n&_fi;&n&_done;&n&_if&_[&_-z&_"$subjs"&_];&_then&n&_echo&_"(No&_matches&_for&_'*~&_.*~')";&n&_return&_0;&n&_else&n&_echo&_$subjs;&n&_fi;&n&_echo&_-n&_"Delete?&_['Y'es,&_'n'o,&_'a'sk]&_";&n&_read&_r;&n&_if&_[&_"$r"&_=&_"n"&_-o&_"$r"&_=&_"N"&_];&_then&n&_echo&_No&_deletions.;&n&_else&n&_if&_[&_"$r"&_=&_"a"&_];&_then&n&_rm&_-i&_$subjs;&n&_else&n&_rm&_$subjs;&n&_fi;&n&_fi&n} -env AssignPrompt=()&_{&_&_euid=`id&_|&_sed&_-e&_'s/).*$//'&_-e&_'s/^.*(//'`;&n&_us="$1";&n&_md="$2";&n&_me="$3";&n&_if&_[&_"$euid"&_=&_root&_];&_then&n&_tick='#';&n&_else&n&_tick=':';&n&_fi;&n&_export&_PS1="\@&_\[${md}\]\h\[${me}\].\W&_\#"'${tick}&_';&n&_PS2="&_"&n} -env ll=()&_{&_&_ls&_-AF&_--color&_-FAlh&_"$@"&n} -env lm=()&_{&_&_ls&_-AF&_--color&_-lhAF&_$*&_|&_less&n} -env lh=()&_{&_&_ls&_-AF&_--color&_-lhtFA&_"$@"&_|&_head&n} -env require=()&_{&_&_local&_fn;&n&_if&_havepkg&_$1;&_then&n&_if&_[&_-n&_"$verboseRequire"&_];&_then&n&_echo&_require:&_had&_$1;&n&_fi;&n&_return&_0;&n&_else&n&_if&_[&_-z&_"$2"&_];&_then&n&_fn=$1;&n&_else&n&_fn=$2;&n&_fi;&n&_if&_.&_$fn;&_then&n&_if&_havepkg&_$1;&_then&n&_if&_[&_-n&_"$verboseRequire"&_];&_then&n&_echo&_require:&_loaded&_$1;&n&_fi;&n&_return&_0;&n&_else&n&_echo&_require:&_package&_"<$1>"&_not&_provided&_in&_$fn&_1>&&2;&n&_fi;&n&_else&n&_if&_[&_-n&_"$2"&_];&_then&n&_echo&_require:&_file&_$2&_not&_found&_for&_package&_$1&_1>&&2;&n&_else&n&_echo&_require:&_package&_$1&_not&_f
Mon Apr 21 18:12:04 2008 server <*30*>: Sent -error Assertion&_failed:&_(eq&_(match&-end&_0)&_(length&_string))
Mon Apr 21 18:12:04 2008 server <*30*>: Assertion failed: (eq (match-end 0) (length string))
Mon Apr 21 18:12:04 2008 server <*30*>: Status changed to closed: deleted
Mon Apr 21 18:12:04 2008 server <*30*>: server-delete-client
Mon Apr 21 18:12:04 2008 server <*30*>: Deleted

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

* Re: emacsclient almost working!
  2008-04-21 22:20   ` Ken Manheimer
@ 2008-04-22  2:52     ` Stefan Monnier
  2008-04-22 17:52       ` Ken Manheimer
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-04-22  2:52 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: emacs-devel

> i'm attaching the contents of the " *server*" buffer.  I see at least part
> of the problem - I had an environment variable CR which had the value ^M
> (char 13).  unsetting that environment variable prevents the problem.

Thanks, does the patch below fix the problem?


        Stefan


--- server.el.~1.164.~	2008-04-20 17:31:51.000000000 -0400
+++ server.el	2008-04-21 22:51:49.000000000 -0400
@@ -500,8 +500,9 @@
 		       :filter 'server-process-filter
 		       ;; We must receive file names without being decoded.
 		       ;; Those are decoded by server-process-filter according
-		       ;; to file-name-coding-system.
-		       :coding 'raw-text
+		       ;; to file-name-coding-system.  Also don't get
+		       ;; confused by CRs since we don't quote them.
+		       :coding 'raw-text-unix
 		       ;; The other args depend on the kind of socket used.
 		       (if server-use-tcp
 			   (list :family nil




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

* Re: emacsclient almost working!
  2008-04-22  2:52     ` Stefan Monnier
@ 2008-04-22 17:52       ` Ken Manheimer
  2008-04-23  1:37         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Manheimer @ 2008-04-22 17:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

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

On Mon, Apr 21, 2008 at 10:52 PM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > i'm attaching the contents of the " *server*" buffer.  I see at least
> part
> > of the problem - I had an environment variable CR which had the value ^M
> > (char 13).  unsetting that environment variable prevents the problem.
>
> Thanks, does the patch below fix the problem?


yes.  thanks!


>        Stefan
>
>
> --- server.el.~1.164.~  2008-04-20 17:31:51.000000000 -0400
> +++ server.el   2008-04-21 22:51:49.000000000 -0400
> @@ -500,8 +500,9 @@
>                       :filter 'server-process-filter
>                       ;; We must receive file names without being decoded.
>                       ;; Those are decoded by server-process-filter
> according
> -                      ;; to file-name-coding-system.
> -                      :coding 'raw-text
> +                      ;; to file-name-coding-system.  Also don't get
> +                      ;; confused by CRs since we don't quote them.
> +                      :coding 'raw-text-unix
>                       ;; The other args depend on the kind of socket used.
>                       (if server-use-tcp
>                           (list :family nil
>



-- 
ken
http://myriadicity.net

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

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

* Re: emacsclient almost working!
  2008-04-22 17:52       ` Ken Manheimer
@ 2008-04-23  1:37         ` Stefan Monnier
  2008-04-23  8:50           ` Jason Rumney
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-04-23  1:37 UTC (permalink / raw)
  To: Ken Manheimer; +Cc: emacs-devel

>> > i'm attaching the contents of the " *server*" buffer.  I see at least
>> part
>> > of the problem - I had an environment variable CR which had the value ^M
>> > (char 13).  unsetting that environment variable prevents the problem.
>> 
>> Thanks, does the patch below fix the problem?

> yes.  thanks!

Could someone test it with w32?


        Stefan




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

* Re: emacsclient almost working!
  2008-04-23  1:37         ` Stefan Monnier
@ 2008-04-23  8:50           ` Jason Rumney
  2008-04-23 15:35             ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Rumney @ 2008-04-23  8:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Ken Manheimer, emacs-devel

Stefan Monnier wrote:

> Could someone test it with w32?
>   

Emacsclient still works OK on w32 after applying it.





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

* Re: emacsclient almost working!
  2008-04-23  8:50           ` Jason Rumney
@ 2008-04-23 15:35             ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2008-04-23 15:35 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Ken Manheimer, emacs-devel

>> Could someone test it with w32?
> Emacsclient still works OK on w32 after applying it.

Great, thanks,


        Stefan




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

end of thread, other threads:[~2008-04-23 15:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 18:17 emacsclient almost working! Ken Manheimer
2008-04-21 19:30 ` Stefan Monnier
2008-04-21 22:20   ` Ken Manheimer
2008-04-22  2:52     ` Stefan Monnier
2008-04-22 17:52       ` Ken Manheimer
2008-04-23  1:37         ` Stefan Monnier
2008-04-23  8:50           ` Jason Rumney
2008-04-23 15:35             ` Stefan Monnier

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.