New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs freezed when typing '//' #321

Closed
davidshen84 opened this Issue May 12, 2014 · 19 comments

Comments

Projects
None yet
2 participants
@davidshen84

davidshen84 commented May 12, 2014

My environment:

  • Windows 7, 64 bit
  • cygwin 64bit

After I enabled ac, and type /, it gives a list of folders in my system, starting from root. But if I type two / continuously, Emacs got frozen. After a long, it will give a list of folders, like / did.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 12, 2014

Contributor

@davidshen84 Thanks for report.

Could you tell us in more detail ?

  • your configuration
  • sample code which reproduces this issue

Sorry I don't have 64 bit windows machine now(I can't reproduce this issue on Linux platform).

Contributor

syohex commented May 12, 2014

@davidshen84 Thanks for report.

Could you tell us in more detail ?

  • your configuration
  • sample code which reproduces this issue

Sorry I don't have 64 bit windows machine now(I can't reproduce this issue on Linux platform).

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 12, 2014

Hi Syohei,

My Emacs configuration file is at
https://github.com/davidshen84/gist/blob/master/.emacs. No sample code is
needed. Just start Emacs as "Fundamental", then enable
"auto-complete-mode", then type two '/'.

I noticed on Linux this issue does not reproduce. The odd thing is that, on
Windows, if one '/' works, two should also work :)

Regards,
David Shen

http://about.me/davidshen
https://twitter.com/#!/davidshen84

On Mon, May 12, 2014 at 3:50 PM, Syohei YOSHIDA notifications@github.comwrote:

@davidshen84 https://github.com/davidshen84 Thanks for report.

Could you tell us in more detail ?

  • your configuration
  • sample code which reproduces this issue

Sorry I don't have 64 bit windows machine now(I can't reproduce this issue
on Linux platform).


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-42804265
.

davidshen84 commented May 12, 2014

Hi Syohei,

My Emacs configuration file is at
https://github.com/davidshen84/gist/blob/master/.emacs. No sample code is
needed. Just start Emacs as "Fundamental", then enable
"auto-complete-mode", then type two '/'.

I noticed on Linux this issue does not reproduce. The odd thing is that, on
Windows, if one '/' works, two should also work :)

Regards,
David Shen

http://about.me/davidshen
https://twitter.com/#!/davidshen84

On Mon, May 12, 2014 at 3:50 PM, Syohei YOSHIDA notifications@github.comwrote:

@davidshen84 https://github.com/davidshen84 Thanks for report.

Could you tell us in more detail ?

  • your configuration
  • sample code which reproduces this issue

Sorry I don't have 64 bit windows machine now(I can't reproduce this issue
on Linux platform).


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-42804265
.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 13, 2014

Contributor

Sorry I can't reproduce on Cygiwn 32bit Windows Vista 32bit, Emacs 24.3.

Could you show us minimum configuration for reproducing this issue ?
https://github.com/davidshen84/gist/blob/master/.emacs contains some configurations
other than auto-complete.

Contributor

syohex commented May 13, 2014

Sorry I can't reproduce on Cygiwn 32bit Windows Vista 32bit, Emacs 24.3.

Could you show us minimum configuration for reproducing this issue ?
https://github.com/davidshen84/gist/blob/master/.emacs contains some configurations
other than auto-complete.

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 14, 2014

Hi Syohei,

I think I missed one important information in the bug. I was using the
Emacs from cygwin. About the configuration, I removed all the settings
that are not related to AC, but the issue still repro.

(dolist (p '("/.emacs.d"
"
/.emacs.d/auto-complete"))
(add-to-list 'load-path p))

;; load ac
(progn
(require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default))

I tried to start Emacs from cygwin, or from Windows by executing the .exe
file. The results are the same.

Regards,
David Shen

http://about.me/davidshen
https://twitter.com/#!/davidshen84

On Tue, May 13, 2014 at 6:21 PM, Syohei YOSHIDA notifications@github.comwrote:

Sorry I can't reproduce on Cygiwn 32bit Windows Vista 32bit, Emacs 24.3.

Could you show us minimum configuration for reproducing this issue ?
https://github.com/davidshen84/gist/blob/master/.emacs contains some
configurations
other than auto-complete.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-42938813
.

davidshen84 commented May 14, 2014

Hi Syohei,

I think I missed one important information in the bug. I was using the
Emacs from cygwin. About the configuration, I removed all the settings
that are not related to AC, but the issue still repro.

(dolist (p '("/.emacs.d"
"
/.emacs.d/auto-complete"))
(add-to-list 'load-path p))

;; load ac
(progn
(require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default))

I tried to start Emacs from cygwin, or from Windows by executing the .exe
file. The results are the same.

Regards,
David Shen

http://about.me/davidshen
https://twitter.com/#!/davidshen84

On Tue, May 13, 2014 at 6:21 PM, Syohei YOSHIDA notifications@github.comwrote:

Sorry I can't reproduce on Cygiwn 32bit Windows Vista 32bit, Emacs 24.3.

Could you show us minimum configuration for reproducing this issue ?
https://github.com/davidshen84/gist/blob/master/.emacs contains some
configurations
other than auto-complete.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-42938813
.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 15, 2014

Contributor

@davidshen84 Isn't your emacs package of Cygwin ?
Could you tell us about your emacs if you don't use cygwin emacs ?

Contributor

syohex commented May 15, 2014

@davidshen84 Isn't your emacs package of Cygwin ?
Could you tell us about your emacs if you don't use cygwin emacs ?

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 15, 2014

@syohex yes, my Emacs is installed by the cygwin package installer. But there's another version of Emacs for Windows, at http://ftp.gnu.org/pub/gnu/emacs/windows/. I just want to clarify that I am not using the latter one.

davidshen84 commented May 15, 2014

@syohex yes, my Emacs is installed by the cygwin package installer. But there's another version of Emacs for Windows, at http://ftp.gnu.org/pub/gnu/emacs/windows/. I just want to clarify that I am not using the latter one.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 16, 2014

Contributor

@davidshen84 Could you tell us your auto-complete version ?
Could you check this issue with latest version if you use old version ?

http://www.emacswiki.org/emacs/AutoComplete

(From above URL comment, there was this bug but it had been fixed.)

Contributor

syohex commented May 16, 2014

@davidshen84 Could you tell us your auto-complete version ?
Could you check this issue with latest version if you use old version ?

http://www.emacswiki.org/emacs/AutoComplete

(From above URL comment, there was this bug but it had been fixed.)

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 16, 2014

I got my auto-complete from
http://cx4a.org/software/auto-complete/#Latest_Stable, and my environment
was set up just two weeks ago, and it is v1.3.1.

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Fri, May 16, 2014 at 4:13 PM, Syohei YOSHIDA notifications@github.comwrote:

@davidshen84 https://github.com/davidshen84 Could you tell us your
auto-complete version ?
Could you check this issue with latest version if you use old version ?

http://www.emacswiki.org/emacs/AutoComplete

(From above URL comment, there was this bug but it had been fixed.)


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43307342
.

davidshen84 commented May 16, 2014

I got my auto-complete from
http://cx4a.org/software/auto-complete/#Latest_Stable, and my environment
was set up just two weeks ago, and it is v1.3.1.

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Fri, May 16, 2014 at 4:13 PM, Syohei YOSHIDA notifications@github.comwrote:

@davidshen84 https://github.com/davidshen84 Could you tell us your
auto-complete version ?
Could you check this issue with latest version if you use old version ?

http://www.emacswiki.org/emacs/AutoComplete

(From above URL comment, there was this bug but it had been fixed.)


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43307342
.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 16, 2014

Contributor

It's old version.

Please install auto-complete from MELPA with package.el.
I suppose MELPA version works well.

Contributor

syohex commented May 16, 2014

It's old version.

Please install auto-complete from MELPA with package.el.
I suppose MELPA version works well.

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 17, 2014

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose this is the right way to uninstall the old version?

I installed the version from MELPA. Now, after I enable auto-complete-mode, then type /, I no longer get a list of the directories of my system, nor my Emacs hangs :) I suppose this is the correct behavior? For me, I actually don't want the original behavior. But it keeps bugging me.

Also, when I install from MELPA, I no longer get a message which suggest me
adding the following lines in my Emacs configuration file:

  (require 'auto-complete-config)
  (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
  (ac-config-default)

I assume there're no longer necessary and can be removed?

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Fri, May 16, 2014 at 11:58 PM, Syohei YOSHIDA
notifications@github.comwrote:

It's old version.

Please install auto-complete from MELPA with package.el.
I suppose MELPA version works well.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43348244
.

davidshen84 commented May 17, 2014

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose this is the right way to uninstall the old version?

I installed the version from MELPA. Now, after I enable auto-complete-mode, then type /, I no longer get a list of the directories of my system, nor my Emacs hangs :) I suppose this is the correct behavior? For me, I actually don't want the original behavior. But it keeps bugging me.

Also, when I install from MELPA, I no longer get a message which suggest me
adding the following lines in my Emacs configuration file:

  (require 'auto-complete-config)
  (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
  (ac-config-default)

I assume there're no longer necessary and can be removed?

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Fri, May 16, 2014 at 11:58 PM, Syohei YOSHIDA
notifications@github.comwrote:

It's old version.

Please install auto-complete from MELPA with package.el.
I suppose MELPA version works well.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43348244
.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 17, 2014

Contributor

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose this is the right way to uninstall the old version?

Yes.

Now, after I enable auto-complete-mode, then type */*, I no longer get a list of the directories of my system, nor my Emacs hangs :) I suppose this is the correct behavior?

Please add ac-source-filename to ac-sources as below if you want to complete
file name.

(setq-default ac-sources '(ac-source-filename ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))

(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)

I assume there're no longer necessary and can be removed?

No. First line and third line are necessary.
However 2nd line is not necessary.

Contributor

syohex commented May 17, 2014

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose this is the right way to uninstall the old version?

Yes.

Now, after I enable auto-complete-mode, then type */*, I no longer get a list of the directories of my system, nor my Emacs hangs :) I suppose this is the correct behavior?

Please add ac-source-filename to ac-sources as below if you want to complete
file name.

(setq-default ac-sources '(ac-source-filename ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))

(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)

I assume there're no longer necessary and can be removed?

No. First line and third line are necessary.
However 2nd line is not necessary.

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 17, 2014

OK, I added (setq-default ac-sources '(ac-source-filename)) to my .emacs,
then type //, my Emacs hanged again :(

I guess this ac-source-filename is really the root cause.

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Sat, May 17, 2014 at 3:04 PM, Syohei YOSHIDA notifications@github.comwrote:

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose
this is the right way to uninstall the old version?

Yes.

Now, after I enable auto-complete-mode, then type */*, I no longer get
a list of the directories of my system, nor my Emacs hangs :)
I suppose
this is the correct behavior?

Please add ac-source-filename to ac-sources as below if you want to
complete
file name.

(setq-default ac-sources '(ac-source-filename ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))

(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)

I assume there're no longer necessary and can be removed?

No. First line and third line are necessary.
However 2nd line is not necessary.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43399823
.

davidshen84 commented May 17, 2014

OK, I added (setq-default ac-sources '(ac-source-filename)) to my .emacs,
then type //, my Emacs hanged again :(

I guess this ac-source-filename is really the root cause.

Shen Xi
about.me/davidshen
[image: Shen Xi on about.me]
http://about.me/davidshenhttps://twitter.com/#!/davidshen84

On Sat, May 17, 2014 at 3:04 PM, Syohei YOSHIDA notifications@github.comwrote:

I removed ~/.emacs.d/auto-complete and ~/.emacs.d/ac-comphist.*. I suppose
this is the right way to uninstall the old version?

Yes.

Now, after I enable auto-complete-mode, then type */*, I no longer get
a list of the directories of my system, nor my Emacs hangs :)
I suppose
this is the correct behavior?

Please add ac-source-filename to ac-sources as below if you want to
complete
file name.

(setq-default ac-sources '(ac-source-filename ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))

(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)

I assume there're no longer necessary and can be removed?

No. First line and third line are necessary.
However 2nd line is not necessary.


Reply to this email directly or view it on GitHubhttps://github.com/auto-complete/auto-complete/issues/321#issuecomment-43399823
.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 18, 2014

Contributor

@davidshen84 I confirmed this issue is reproduced on Windows 7 machine.
file-regular-p takes several seconds on Windows machine with some inputs.
We should improve calling file-regular-p.

Contributor

syohex commented May 18, 2014

@davidshen84 I confirmed this issue is reproduced on Windows 7 machine.
file-regular-p takes several seconds on Windows machine with some inputs.
We should improve calling file-regular-p.

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 18, 2014

Maybe it is not the single cause? Because when I type a single /, the directories are prompt instantly.

davidshen84 commented May 18, 2014

Maybe it is not the single cause? Because when I type a single /, the directories are prompt instantly.

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 18, 2014

Contributor

I suppose caustion is only file-regular-p.

(file-regular-p "/a") returns immediatly but (file-regular-p "//a") returns after 2-3 seconds
later on Windows. I think we should check whether file is existed firstly, and we check whether
file is regular file if file is existed.

Contributor

syohex commented May 18, 2014

I suppose caustion is only file-regular-p.

(file-regular-p "/a") returns immediatly but (file-regular-p "//a") returns after 2-3 seconds
later on Windows. I think we should check whether file is existed firstly, and we check whether
file is regular file if file is existed.

syohex added a commit that referenced this issue May 19, 2014

Fix freeze issue on Windows(#321)
Windows assume file which starts with '\\'(or '//' in Emacs), is remote
file. If such file is passed to file API(such as 'stat'), it takes
several seconds. So we don't treat such files as completion target.
@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 19, 2014

Contributor

@davidshen84 Could you check following version ?
(Replace old auto-complete.el with following file and remove *.elc file if you byte-compiled.)

https://raw.githubusercontent.com/auto-complete/auto-complete/improve-windows-filename-completion/auto-complete.el

Contributor

syohex commented May 19, 2014

@davidshen84 Could you check following version ?
(Replace old auto-complete.el with following file and remove *.elc file if you byte-compiled.)

https://raw.githubusercontent.com/auto-complete/auto-complete/improve-windows-filename-completion/auto-complete.el

@davidshen84

This comment has been minimized.

Show comment
Hide comment
@davidshen84

davidshen84 May 19, 2014

@syohex I tried the new file, under Windows 7 64bit.

  • When I type single /, the directories are prompted normally
  • When I type //, the first directory name flashed in and out instantly. No hangs anymore

I think the behavior is good enough to me. Thank you 👍

davidshen84 commented May 19, 2014

@syohex I tried the new file, under Windows 7 64bit.

  • When I type single /, the directories are prompted normally
  • When I type //, the first directory name flashed in and out instantly. No hangs anymore

I think the behavior is good enough to me. Thank you 👍

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 19, 2014

Contributor

Thanks for reviewing. I'll merge it later.

Contributor

syohex commented May 19, 2014

Thanks for reviewing. I'll merge it later.

syohex added a commit that referenced this issue May 19, 2014

@syohex

This comment has been minimized.

Show comment
Hide comment
@syohex

syohex May 19, 2014

Contributor

@davidshen84 I have merged. Please reopen the issue if you still have problems.

Thank you for reporting the issue.

Contributor

syohex commented May 19, 2014

@davidshen84 I have merged. Please reopen the issue if you still have problems.

Thank you for reporting the issue.

@syohex syohex closed this May 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment