bug#28025: Daemon/server passes string incorrectly to/from Systemd

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Arthur Miller-2
When I start Emacs in daemon mode with Systemd and connect with
emacsclient, I get nil string when I run spellcheck with ispell.
'ispell-word' stack trace from debugger:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("," nil 0)
  split-string(nil "," t)
  ispell-parse-hunspell-affix-file(nil)
  ispell-find-hunspell-dictionaries()
  ispell-set-spellchecker-params()
  ispell-word(nil nil nil t)
  funcall-interactively(ispell-word nil nil nil t)
  call-interactively(ispell-word nil nil)
  command-execute(ispell-word)

When I start emacs in daemon mode from bash command line
directly and connect with emacsclient the spellcheck
works correctly.

I have checked that all paths are setup correctly. Emacs finds
dictionaries (DICPATH setts correctly in systemd service file),
and it also finds spellchecking program (/usr/bin/hunspell).

I believe it might be something with passing strings to and from
d-bus, but I don't have experience with d-bus at all so I really
don't know. It might as well be something completely else,
including my configuration :-).

/arthur


In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.17)
 of 2017-08-03 built on pascal
Repository revision: f465efe412607c6b931e3592e96200f2ff3b8d74
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
Recent messages:
Cleaning up the recentf list...
File /home/arthur/test.txt removed from the recentf list
Cleaning up the recentf list...done (1 removed)
When done with a buffer, type C-x # [2 times]
Cleaning up the recentf list...done (0 removed)
When done with this frame, type C-x 5 0
split-string: Wrong type argument: stringp, nil
"~/.emacs.d/hunspell"
Cleaning up the recentf list...done (0 removed)
Making completion list... [3 times]

Configured using:
 'configure --with-modules --with-mailutils --without-pop'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 MODULES LIBSYSTEMD

Important settings:
  value of $LANG: sv_SE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  electric-pair-mode: t
  show-paren-mode: t
  global-ede-mode: t
  global-fci-mode: t
  auto-insert-mode: t
  dumb-jump-mode: t
  ranger-override-dired-mode: t
  global-auto-revert-mode: t
  global-hl-line-mode: t
  winner-mode: t
  save-place-mode: t
  recentf-mode: t
  global-company-mode: t
  company-mode: t
  window-number-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  semantic-mode: t
  which-function-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  helm-autoresize-mode: t
  async-bytecomp-package-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  fci-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  override-global-mode: t
  cl-old-struct-compat-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/arthur/.emacs.d/plugins/company/company-cmake hides /home/arthur/.emacs.d/plugins/company-cmake/company-cmake
/home/arthur/.emacs.d/lisp/fill-column-indicator hides /home/arthur/.emacs.d/plugins/fill-column-indicator/fill-column-indicator
/home/arthur/.emacs.d/plugins/helm/helm hides /home/arthur/.emacs.d/plugins/helm-core/helm
/home/arthur/.emacs.d/plugins/helm/helm-multi-match hides /home/arthur/.emacs.d/plugins/helm-core/helm-multi-match
/home/arthur/.emacs.d/plugins/helm/helm-source hides /home/arthur/.emacs.d/plugins/helm-core/helm-source
/home/arthur/.emacs.d/plugins/helm/helm-lib hides /home/arthur/.emacs.d/plugins/helm-core/helm-lib
/home/arthur/.emacs.d/plugins/load-relative/el-get-install hides /home/arthur/.emacs.d/plugins/loc-changes/el-get-install
/home/arthur/.emacs.d/plugins/load-relative/el-get-install hides /home/arthur/.emacs.d/plugins/realgud/el-get-install
/home/arthur/.emacs.d/plugins/realgud/realgud hides /home/arthur/.emacs.d/plugins/xxrealgud/realgud
/usr/local/share/emacs/26.0.50/lisp/simple hides /home/arthur/.emacs.d/plugins/emacs-ctable/samples/simple
/home/arthur/.emacs.d/plugins/loc-changes/test/test-basic hides /home/arthur/.emacs.d/plugins/test-simple/test/test-basic
/usr/local/share/emacs/26.0.50/lisp/env hides /home/arthur/.emacs.d/plugins/emacs-window-manager/features/support/env
/usr/local/share/emacs/26.0.50/lisp/env hides /home/arthur/.emacs.d/plugins/multiple-cursors/features/support/env

Features:
(shadow sort mail-extr emacsbug sendmail server flymake company-oddmuse
company-keywords company-etags company-gtags company-dabbrev-code
company-dabbrev company-files company-capf company-cmake company-xcode
company-clang company-semantic company-eclim company-template
company-css company-nxml company-bbdb disp-table elec-pair paren
ede/speedbar ede/files ede ede/detect ede/base ede/auto ede/source
eieio-speedbar eieio-custom cap-words superword subword lively
column-marker image-dired+ extras member-functions dired-rainbow
dired-hacks-utils autoinsert simple-httpd htmlize dumb-jump f dash s
ranger diminish autorevert filenotify hl-line ztree ztree-diff
ztree-diff-model ztree-dir ztree-view ztree-util rainbow-delimiters
vline all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons memoize
neotree dired-xtra direx dired+ image-file bookmark+ bookmark+-key
bookmark+-1 font-lock+ gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo
gnus-spec gnus-int gnus-range message subr-x puny rfc822 mml mml-sec epa
epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
bookmark+-bmu bookmark+-lit bookmark+-mac winner multiple-cursors
mc-hide-unmatched-lines-mode mc-separate-operations
rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors
mc-edit-lines multiple-cursors-core rect ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff saveplace
recentf tree-widget wid-edit realgud realgud-recursive-autoloads
realgud-zshdb realgud:zshdb-track-mode realgud:zshdb-core
realgud:zshdb-init realgud-trepan3k realgud:trepan3k-track-mode
realgud:trepan3k-core realgud:trepan3k-init realgud-trepan2
realgud:trepan2-track-mode realgud:trepan2-core realgud:trepan2-init
realgud-trepanpl realgud:trepanpl-track-mode realgud:trepanpl-core
realgud:trepanpl-init realgud-trepanjs realgud:trepanjs-track-mode
realgud:trepanjs-core realgud:trepanjs-init realgud-trepan
realgud:trepan-track-mode realgud:trepan-core realgud:trepan-init
realgud-remake realgud:remake-track-mode realgud:remake-core
realgud:remake-init realgud-rdebug realgud-rdebug-track-mode
realgud-rdebug-core realgud-rdebug-init realgud-perldb
realgud:perldb-track-mode realgud:perldb-core realgud:perldb-init
realgud-lang-perl realgud-pdb realgud:pdb-track-mode realgud:pdb-core
realgud:pdb-init realgud-nodejs realgud:nodejs-track-mode
realgud:nodejs-core realgud:nodejs-init realgud-lang-js realgud-kshdb
realgud:kshdb-track-mode realgud:kshdb-core realgud:kshdb-init
realgud-jdb realgud:jdb-track-mode realgud-lang-ruby realgud:jdb-core
realgud:jdb-init gud realgud-ipdb realgud:ipdb-track-mode
realgud:ipdb-core realgud:ipdb-init realgud-lang-python realgud-gub
realgud:gub-track-mode realgud:gub-core realgud:gub-init realgud-gdb
realgud:gdb-track-mode realgud:gdb-init realgud:gdb-core realgud-bashdb
realgud:bashdb-track-mode realgud:bashdb-core realgud:bashdb-init
realgud-lang-posix-shell realgud:run realgud-track-mode
realgud-backtrace-mode realgud-track realgud-shortkey realgud-menu
realgud-eval realgud-cmds realgud-send realgud-window realgud-utils
realgud-init realgud-file esh-var esh-io esh-cmd esh-opt esh-ext
esh-proc esh-arg esh-groups eshell esh-module esh-util esh-mode
realgud-core realgud-reset realgud-buffer-helper
realgud-buffer-backtrace realgud-buffer-command realgud-buffer-info
realgud-regexp realgud-lochist org-element avl-tree
the-org-mode-expansions org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs realgud-bp realgud-bp-image-data realgud-loc
realgud-buffer-source realgud-key realgud-custom key realgud-follow
realgud-lang realgud-fringe realgud-helper test-simple loc-changes
load-relative company pcase avy window-number thing-edit sr-speedbar
semantic/db-mode semantic/db eieio-base semantic/idle semantic/ctxt
semantic/sb speedbar sb-image dframe semantic/sort semantic/format
ezimage semantic/tag-ls semantic/find semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local find-func
cedet indent-guide helm-gtags pulse which-func ggtags ewoc
helm-descbinds helm-mode helm-files rx image-dired image-mode tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec dired-x dired-aux ffap helm-buffers helm-elscreen
helm-tags helm-bookmark helm-adaptive helm-info info bookmark pp
helm-locate helm-grep helm-regexp helm-external helm-net browse-url xml
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source password-cache url-vars
mailcap helm-utils compile comint ansi-color helm-help helm-types helm
helm-source eieio-compat helm-multi-match helm-lib dired dired-loaddefs
helm-config helm-autoloads helm-easymenu async-bytecomp
auto-complete-clang auto-complete-config auto-complete popup
fill-column-indicator js2-mode-expansions js2-mode etags xref project
eieio eieio-core eieio-loaddefs ring js-mode-expansions js time-date
html-mode-expansions sgml-mode dom json map seq byte-opt bytecomp
byte-compile cconv cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs imenu yasnippet
expand-region text-mode-expansions er-basic-expansions thingatpt
expand-region-core expand-region-custom undo-tree derived cl-extra
help-mode easymenu cl-seq edmacro kmacro diff smart-mode-line advice
rich-minority bind-key cl-macs easy-mmode async
sanityinc-solarized-dark-theme color-theme-sanityinc-solarized cl gv
cl-loaddefs cl-lib ispell mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 761586 91350)
 (symbols 48 60661 1)
 (miscs 40 155 215)
 (strings 32 155587 11751)
 (string-bytes 1 5039842)
 (vectors 16 87947)
 (vector-slots 8 1405002 25141)
 (floats 8 583 560)
 (intervals 56 630 0)
 (buffers 992 15))

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Eli Zaretskii
> From: Arthur Miller <[hidden email]>
> Date: Wed, 9 Aug 2017 15:07:27 +0200
>
> When I start Emacs in daemon mode with Systemd and connect with
> emacsclient, I get nil string when I run spellcheck with ispell.
> 'ispell-word' stack trace from debugger:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> string-match("," nil 0)
> split-string(nil "," t)
> ispell-parse-hunspell-affix-file(nil)
> ispell-find-hunspell-dictionaries()
> ispell-set-spellchecker-params()
> ispell-word(nil nil nil t)
> funcall-interactively(ispell-word nil nil nil t)
> call-interactively(ispell-word nil nil)
> command-execute(ispell-word)
>
> When I start emacs in daemon mode from bash command line
> directly and connect with emacsclient the spellcheck
> works correctly.
>
> I have checked that all paths are setup correctly. Emacs finds
> dictionaries (DICPATH setts correctly in systemd service file),
> and it also finds spellchecking program (/usr/bin/hunspell).

Can you explain how DICPATH enters this picture?  AFAIR, Hunspell
should be able to find its dictionaries without that variable,
assuming Hunspell is installed correctly.  So why do you need DICPATH?

In any case, please note that Emacs is not the one who looks at the
value of DICPATH: Hunspell is.  That value is _reported_ to Emacs, but
it's Hunspell that reports the value.  So maybe the problem is that
the value of DICPATH visible to Hunspell is empty or invalid.

(Caveat: I know almost nothing about systemd and related atrocities.)



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Glenn Morris-3
In reply to this post by Arthur Miller-2
Arthur Miller wrote:

> I have checked that all paths are setup correctly. Emacs finds
> dictionaries (DICPATH setts correctly in systemd service file),
> and it also finds spellchecking program (/usr/bin/hunspell).
>
> I believe it might be something with passing strings to and from
> d-bus, but I don't have experience with d-bus at all so I really
> don't know.

I don't see what D-Bus would have to do with this.
I imagine that the environment of Emacs when started from systemd is
different from when you start it normally, and something is missing that
means hunspell can't find its dictionaries.

You might compare the value of 'process-environment' in the two Emacs to
see what differs. Or M-x ispell-buffer-with-debug might provide more
information. Or edebug ispell-find-hunspell-dictionaries and step
through it to see where things go wrong.





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Arthur Miller-2
> Can you explain how DICPATH enters this picture?  AFAIR, Hunspell
> should be able to find its dictionaries without that variable,
> assuming Hunspell is installed correctly.  So why do you need DICPATH?

Above stack trace points to "ispell-parse-hunspell-affix-file", which seems to
be a parser for affix files. But as I wrote I am not sure, I don't know so much
about how emacs does stuff internally. Anyway, I have checked so that path
given to emacs is not empty. When I do (getenv "DICPATH") it prints correct
path where dictionaries are. Hunspell is found as well, and Hunspell itself
finds everything correctly when I check from shell.

> I don't see what D-Bus would have to do with this.
Systemd-bus is D-bus if I understood Systemd docs correctly. I am by no
means an expert in either d-bus or sytemd, just ordinary user.

> I imagine that the environment of Emacs when started from systemd is
> different from when you start it normally, and something is missing that
> means hunspell can't find its dictionaries.

Yeah, I imagined that too, so that is why I passed DICPATH to systemd
service as well but that didn't solve the problem. Here is service file. If
Emas gets it's paths from Hunspell, than it sounds as expected, and after
that the only thing I can imagine is problem is how strings are passed
between processes.

I looked at process-environment var and the content is different,
but what regards PATH and DICPATH it's same:

Emacs daemon started with systemd as user service:

("TERM=dumb" "DICPATH=~/.emacs.d/hunspell" "INVOCATION_ID=af861fc0688846f6a70a09261064560f" "MANAGERPID=604" "XDG_RUNTIME_DIR=/run/user/1000" "USER=*****" "SHELL=/bin/bash" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" "MAIL=/var/spool/mail/*****" "LOGNAME=*****" "LANG=sv_SE.UTF-8" "JOURNAL_STREAM=9:15268" "HOME=/home/*****" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus")

Emacs daemon started from shell:

("OLDPWD=/home/*****" "_=/usr/local/bin/emacs" "HISTSIZE=5000" "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/ant/bin:/opt/ant/bin" "LARCH_PATH=/usr/share/splint/lib" "ANT_HOME=/opt/ant" "XAUTHORITY=/home/*****/.Xauthority" "XDG_RUNTIME_DIR=/run/user/1000" "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" "LOGNAME=*****" "IRC_CLIENT=irssi" "SHLVL=3" "XDG_SEAT=seat0" "AUTOFEATURE=true autotest" "TERM=dumb" "SHELL=/bin/bash" "WINDOWPATH=1" "VISUAL=emacsclient -c -a emacs" "MAIL=/var/spool/mail/*****" "_JAVA_OPTIONS=-Dsun.java2d.opengl=true" "GTK_MODULES=canberra-gtk-module" "ALTERNATE_EDITOR=emacsclient -c -a emacs" "HOME=/home/*****" "PWD=/home/*****/emacs" "TERMINOLOGY=1" "LSCOLORS=Gxfxcxdxdxegedabagacad" "USER=*****" "XDG_SESSION_ID=c1" "HG=/usr/bin/hg" "SCM_CHECK=true" "GIT_HOSTING=[hidden email]" "XDG_VTNR=1" "JAVA_HOME=/usr/lib/jvm/default/jre" "LCLIMPORTDIR=/usr/share/splint/imports" "EDITOR=emacsclient -t -a emacs -t" "TODO=t" "HISTCONTROL=ignorespace:erasedups" "HISTIGNORE=pwd:ls:ls -l:cd:cd ..:cd -:cd --" "TZ=:/etc/localtime" "LANG=sv_SE.UTF-8" "DICPATH=/home/*****/.emacs.d/hunspell" "BASH_IT=/home/*****/.bash-it" "BASH_IT_THEME=bobby" "XTERM_256_COLORS=1" "LD_LIBRARY_PATH=:/usr/local/lib:/usr/local/lib" "GREP_COLOR=1;33")

When I run M-x ispell-buffer-with-debug, I get same backtrace as posted in my original message. I also get following (*ispell-debug* buffer):

-- ispell-fhd: Skipping entry: AVAILABLE DICTIONARIES (path is not mandatory for -d option):
-- ispell-fhd: Skipping entry: Can't open affix or dictionary files for dictionary named "sv_SE".

I don't know it says it can't open entry, since I can see the dictionary, and when started from shell, emacs has no problem opening it :).

I have to admit that I am not very proficient using edebug. To be honest I have no idea how to step through code properly with it, and manual does
not give me much clues. It list all commands but one to use to step through. I am probably just not smart enough to understand it. Anyway
stacktrace was gigantic, about 20 lines tall, but about 7800 chars wide so I am not posting it here. But help how to step through and find more info
is appreciated.


2017-08-09 22:00 GMT+02:00 Glenn Morris <[hidden email]>:
Arthur Miller wrote:

> I have checked that all paths are setup correctly. Emacs finds
> dictionaries (DICPATH setts correctly in systemd service file),
> and it also finds spellchecking program (/usr/bin/hunspell).
>
> I believe it might be something with passing strings to and from
> d-bus, but I don't have experience with d-bus at all so I really
> don't know.

I don't see what D-Bus would have to do with this.
I imagine that the environment of Emacs when started from systemd is
different from when you start it normally, and something is missing that
means hunspell can't find its dictionaries.

You might compare the value of 'process-environment' in the two Emacs to
see what differs. Or M-x ispell-buffer-with-debug might provide more
information. Or edebug ispell-find-hunspell-dictionaries and step
through it to see where things go wrong.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Noam Postavsky-2
Arthur Miller <[hidden email]> writes:

> I looked at process-environment var and the content is different,
> but what regards PATH and DICPATH it's same:
>
> Emacs daemon started with systemd as user service:
>
> ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell"
[...]

> Emacs daemon started from shell:
[...]
> "DICPATH=/home/*****/.emacs.d/hunspell"

Could the fact that you have "~" instead of "/home/****/" in the systemd
service be significant?  Does it help to change that?

> I have to admit that I am not very proficient using edebug. To be honest I
> have no idea how to step through code properly with it, and manual does
> not give me much clues. It list all commands but one to use to step
> through.

SPC is the stepping command (should be explained in `(elisp) Using
Edebug').



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Eli Zaretskii
> From: [hidden email]
> Date: Thu, 10 Aug 2017 08:54:29 -0400
> Cc: [hidden email]
>
> > Emacs daemon started with systemd as user service:
> >
> > ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell"
> [...]
>
> > Emacs daemon started from shell:
> [...]
> > "DICPATH=/home/*****/.emacs.d/hunspell"
>
> Could the fact that you have "~" instead of "/home/****/" in the systemd
> service be significant?  Does it help to change that?

Indeed, I don't think Hunspell expands "~" in DICPATH.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: SV: Re: bug#28025: Daemon/server passes string incorrectly to/from Systemd

Arthur Miller-2
In reply to this post by Arthur Miller-2
Aha. I guess you are ptobably correct. I am not at home again before tomorrow, but as soon as I am at home I will try it. Thanks!


Skickat från min Samsung-enhet


-------- Originalmeddelande --------
Från: Eli Zaretskii <[hidden email]>
Datum: 2017-08-10 17:18 (GMT+01:00)
Till: [hidden email]
Kopia: [hidden email], [hidden email]
Rubrik: Re: bug#28025: Daemon/server passes string incorrectly to/from Systemd

> From: [hidden email]
> Date: Thu, 10 Aug 2017 08:54:29 -0400
> Cc: [hidden email]
>
> > Emacs daemon started with systemd as user service:
> >
> > ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell"
> [...]
>
> > Emacs daemon started from shell:
> [...]
> > "DICPATH=/home/*****/.emacs.d/hunspell"
>
> Could the fact that you have "~" instead of "/home/****/" in the systemd
> service be significant?  Does it help to change that?

Indeed, I don't think Hunspell expands "~" in DICPATH.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Re: bug#28025: Daemon/server passes string incorrectly to/from Systemd

Arthur Miller-2
Yepp tilde in DICPATH was the problem! No bug in Emacs! :-)

I am so used to bash, so I always forgett it's bash that does the expansion, and it fails
in cases like this.

Thank you all for the help!

2017-08-10 17:59 GMT+02:00 arthur.miller.no1 <[hidden email]>:
Aha. I guess you are ptobably correct. I am not at home again before tomorrow, but as soon as I am at home I will try it. Thanks!


Skickat från min Samsung-enhet


-------- Originalmeddelande --------
Från: Eli Zaretskii <[hidden email]>
Datum: 2017-08-10 17:18 (GMT+01:00)
Till: [hidden email]
Kopia: [hidden email], [hidden email]
Rubrik: Re: bug#28025: Daemon/server passes string incorrectly to/from Systemd

> From: [hidden email]
> Date: Thu, 10 Aug 2017 08:54:29 -0400
> Cc: [hidden email]
>
> > Emacs daemon started with systemd as user service:
> >
> > ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell"
> [...]
>
> > Emacs daemon started from shell:
> [...]
> > "DICPATH=/home/*****/.emacs.d/hunspell"
>
> Could the fact that you have "~" instead of "/home/****/" in the systemd
> service be significant?  Does it help to change that?

Indeed, I don't think Hunspell expands "~" in DICPATH.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Eli Zaretskii
> From: Arthur Miller <[hidden email]>
> Date: Fri, 11 Aug 2017 16:06:48 +0200
> Cc: [hidden email]
>
> Yepp tilde in DICPATH was the problem! No bug in Emacs! :-)
>
> I am so used to bash, so I always forgett it's bash that does the expansion, and it fails
> in cases like this.
>
> Thank you all for the help!

Thanks, I'm therefore closing this bug.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug#28025: Daemon/server passes string incorrectly to/from Systemd

Glenn Morris-3
In reply to this post by Arthur Miller-2
Arthur Miller wrote:

>> I don't see what D-Bus would have to do with this.
> Systemd-bus is D-bus if I understood Systemd docs correctly.

That may be, but it's not relevant to what Emacs does once it is started.

> Emacs daemon started with systemd as user service:
>
> ("TERM=dumb" "DICPATH=~/.emacs.d/hunspell"

There is no variable expansion inside systemd's "Environment" specifier,
and I don't think it does tilde expansion anywhere.

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=

Specifiers work, so I guess you could use "%h" instead of "~".

https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers



Loading...