zk-phi / symon

Tiny graphical system monitor
289 stars 26 forks source link

shows error in minibuffer if cwd doesn't exist #12

Closed etherald closed 9 years ago

etherald commented 9 years ago

When creating a file in a non existent directory (so that Emacs suggests using M-x make-directory RET RET) symon shows the following error in the minibuffer: Error running timer `symon--update': (file-error "Setting current directory" "no such file or directory" "/home/majcw/gt-bin/")

zk-phi commented 9 years ago

thanks for reporting. hmm... I tried write-file to a non-existent directory with vanilla Emacs but I couldn't reproduce. if you can, please reproduce the error with debug-on-error turned on

(setq debug-on-error t)

and let me see the stacktrace to detect the problem.

etherald commented 9 years ago

I am able to reproduce on the original install, which is in a VirtualBox Debian environment using a .vdi image as boot disk. I enabled debug-on-error but no backtrace is generated, just the message in the messages buffer.

I tried it on another install, here is the backtrace:


Debugger entered--Lisp error: (file-error "Setting current directory" "no such file or directory" "/home/endian/testingdir/") call-process("/bin/bash" nil t nil "-c" "cat /proc/stat") apply(call-process "/bin/bash" nil t nil ("-c" "cat /proc/stat")) process-file("/bin/bash" nil t nil "-c" "cat /proc/stat") shell-command-to-string("cat /proc/stat")

[nil

"\306\307!\203G^@\310\311!^X\312\313^H\"^Y\314\315\316\317\320^H\"\321\322#\"^Z\323\324\n\"^[\325\n8^^K^M@Z^^$\f^MAZ^^%^K\fB^U\326\327^N$^N%Z\330^N$\245\ \"\210.^G\202L^@\326\327\321\"\210\331\332!\203\201^@\310\333!^X\312\334^H\"\210\326\335\315\317\336^H\"!\330\315\317\320^H\"!\245\"\210\312\337^H\"\210\ 326\340\315\317\320^H\"!\"\210)\202\213^@\326\335\321\"\210\326\340\321\"\210\326\341^N&\205\233^@\315\342\343^N& \"A!\"\207" [str lst total idle symon-default-linux-fetcher--last-cpu-ticks file-exists-p "/proc/stat" shell-command-to-string "cat /proc/stat" string-match "^cpu_>(.)$" mapcar read split-string match-string 1 nil t apply + 3 symon-commit-status cpu 100 executable-find "free" "free -m" "^Mem:[ ]([0-9]+)[ ]([0-9]+)>" memory 2 "^Swap:[ ]_[0-9]+[ ]*([0-9]+)>" swap battery assoc 112 total-diff idle-diff battery-status-function] 7]() symon--update() apply(symon--update nil) byte-code("r\301^H\302H^H\303H\"\210)\301\207" [timer apply 5 6] 4) timer-event-handler([t 21707 47818 161066 3 symon--update nil nil 199000]) read-event(nil t 1) sit-for(1 t) after-find-file(t t) find-file-noselect-1(# "~/testingdir/testfile" nil nil "~/testingdir/testfile" nil) find-file-noselect("/home/endian/testingdir/testfile" nil nil) ido-file-internal(raise-frame) ido-find-file() call-interactively(ido-find-file nil nil) command-execute(ido-find-file)


Under the error condition, any activity (such as typing in the buffer) causes the error message to disappear, then replace with the normal symon display, which then gets replaced with the error msg again.

If I create the directory with make-directory symon comes back and works normally with no error.

zk-phi commented 9 years ago

thanks. I've just updated symon not to use shell commands. does the latest version works fine ?

etherald commented 9 years ago

It's working now, thanks!

It still showed the error on the vbox system until I moved my setup files to ~/.emacs.d/lisp the way Emacs has been telling me to since I upgraded. This was already done on the other system and it stopped showing the error immediately after I updated the symon package.