aki2o / emacs-plsense

Provide omni completion for Perl.
29 stars 4 forks source link

plsense server works fine, but the auto completion is not working #9

Open kb01 opened 8 years ago

kb01 commented 8 years ago

Hello,

Plsense server works fine for me now: thank you for the latest bug fix (https://github.com/aki2o/emacs-plsense/commit/f6fb22607a5252b2556d2e7fa14f1bcab5d9747a).

But the auto completion is not working (no list showing after I type 'use IO::', for displaying the installed modules), though, after successful server start after typing plsense-server-start, using Emacs v24.5.1. that's the .emacs configuration file I'm using: http://pastebin.com/1aXmbxmG.

How to solve this issue?

Thanks in advance.

aki2o commented 8 years ago

Hi, @kb01 Try to do M-x plsense-server-status and plsense-buffer-is-ready at the time. If the server is running and the buffer is ready, show me the log at the time by the following steps.

  1. M-x plsense--log-enable-logging
  2. Get this trouble
  3. M-x plsense--log-open-log
  4. Paste or attach the buffer string
kb01 commented 8 years ago

@aki2o This is the log:

Work Server is Running. Resolve Server is Running. Yes Making completion list... [2 times] [Log4E] Not exist log buffer.

aki2o commented 8 years ago

It's not the log which I want... The time of "show me the log at the time" means when you encountered the trouble which you refer to in this issue.

kb01 commented 8 years ago

I followed all the steps, and thats what I got: http://postimg.org/image/3tco4plgr/.

and finally, after clicking save, I get this log:

14:21:40 [TRACE] Start add source : use warnings; 14:21:40 [DEBUG] Start request server. cmdstr[codeadd use warnings;] waitsec[nil] 14:21:40 [TRACE] Received server response.

14:25:49 [DEBUG] Start request server. cmdstr[update /home/kb01/Public/test.pl] waitsec[nil] 14:25:50 [TRACE] Received server response.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

14:25:50 [TRACE] Received server response. Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/share/perl5/site_perl/Class/Std/Storable.pm line 51.

aki2o commented 8 years ago

Hmm... It seems that plsense-setup-current-buffer have not been executed. Normally, it should be set into the hook of major-mode by plsense-config-default. Try to M-x plsense-setup-current-buffer.

And,

kb01 commented 8 years ago

plsense-setup-current-buffer solved the problem.

"Main Server is Running" is shown.

major-mode is a variable defined in `C source code'.
Its value is lisp-interaction-mode
Original value was fundamental-mode
Local in buffer *scratch*; global value is fundamental-mode

  Automatically becomes buffer-local when set.

Documentation:
Symbol for current buffer's major mode.
The default value (normally `fundamental-mode') affects new buffers.
A value of nil means to use the current buffer's major mode, provided
it is not marked as "special".

When a mode is used by default, `find-file' switches to it before it
reads the contents into the buffer and before it finishes setting up
the buffer.  Thus, the mode and its hooks should not expect certain
variables such as `buffer-read-only' and `buffer-file-coding-system'
to be set up.

You can customize this variable.
ac-sources is a variable defined in `auto-complete.el'.
Its value is
(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)

  Automatically becomes buffer-local when set.

Documentation:
Sources for completion.

What is the best way to fix this problem using .emacs configuration ?

aki2o commented 8 years ago

Do you use lisp-interaction-mode for coding Perl? If so, this trouble cause is that you use a major-mode other than the modes of plsense-enable-modes. In this case, you should customize this variable like the following after (require 'plsense).

(add-to-list 'plsense-enable-modes 'lisp-interaction-mode)
kb01 commented 8 years ago

No, I don't use it. This is my emacs configuration file: http://pastebin.com/1aXmbxmG.

aki2o commented 8 years ago

major-mode and ac-sources are buffer local variables. So, you should do M-x describe-variable on the buffer which you have this trouble on.

Although, maybe this trouble cause is the above I mentioned because manual plsense-setup-current-buffer solved the problem.

kb01 commented 8 years ago

adding (add-to-list 'plsense-enable-modes 'lisp-interaction-mode) to the emacs configuration didn't solve the problem either: I need a more practical way for fixing this bug.

xTpx commented 8 years ago

@aki2o Similar problems, but M-x plsense-setup-current-buffer not working. log4e-plsense show this. 14:49:19 [ERROR] failed setup : Cannot open load file: 没有那个文件或目录, anything Exception is 'file-error'. Cannot open load file: 没有那个文件或目录, anything at signal(file-error ("Cannot open load file" "没有那个文件或目录" "anything")) http://pastebin.com/HqAywU33