Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

aggressive-indent-mode freezes

已查看 14 次
跳至第一个未读帖子

Luca Ferrari

未读,
2016年2月9日 02:36:312016/2/9
收件人 help-gnu-emacs
Hi all,
I'm trying aggresive-indent-mode
<https://github.com/Malabarba/aggressive-indent-mode> on my emacs
24.5.1 but if I enable the mode on some source buffer quite long in
size (e.g., a php file of around 7k lines) the system becomes
unusable: each line I edit Emacs stops responding for a few seconds (I
guess to auto-indent).
I'm curious if is there anybody else using such mode with success on
large sources and if the problem could be on PHP or a specific
language.

Thanks,
Luca

Alexis

未读,
2016年2月9日 05:32:022016/2/9
收件人 Luca Ferrari、help-gnu-emacs
Using 24.5.3 on an i5-2410M running Debian Jessie x86_64, i just
tried editing a copy of org.el, which weighs in at ~24k
lines. There was a /slight/ lag - perhaps less than half a second?
- but certainly not enough to make editing unworkable.

What hardware and OS are you running Emacs on?


Alexis.


Luca Ferrari

未读,
2016年2月9日 06:40:312016/2/9
收件人 Alexis、help-gnu-emacs
On Tue, Feb 9, 2016 at 11:31 AM, Alexis <flexi...@gmail.com> wrote:
> What hardware and OS are you running Emacs on?

I'm using 24.5.3 on ubuntu 15.10, kernel 4.2.0.16 x64 running on AMD
Athlon(tm) 64 X2 Dual Core Processor 5800+.
I've tried to run it against loaddefs.el (around 31k lines) and it
works fine, so maybe it is a problem of the language (php) it tries to
indent?
Running on a php file it takes around 3 seconds to return responsive,
even with electric indent mode disabled. I've also tried to disable
other minor modes I use like flymake, yas, hs but nothing changed.

Luca

Alexis

未读,
2016年2月9日 07:19:112016/2/9
收件人 Luca Ferrari、help-gnu-emacs

Luca Ferrari <fluc...@infinito.it> writes:

> I've tried to run it against loaddefs.el (around 31k lines) and
> it works fine, so maybe it is a problem of the language (php) it
> tries to indent? Running on a php file it takes around 3
> seconds to return responsive, even with electric indent mode
> disabled. I've also tried to disable other minor modes I use
> like flymake, yas, hs but nothing changed.

Fair enough.

i don't work much with PHP, so i just downloaded the source of
WordPress and searched for the longest file, which turned out to
be wp-includes/class-wp-xmlrpc-server.php, with ~6.5k
lines. Again, editing didn't result in any appreciable lag. (The
lag was certainly less than with org.el, which is not surprising,
given org.el is three times larger.)

Can you try running `emacs -Q`, loading aggressive-indent
manually, and then check if you still observe the significant lag?


Alexis.

Luca Ferrari

未读,
2016年2月10日 02:13:222016/2/10
收件人 Alexis、help-gnu-emacs
On Tue, Feb 9, 2016 at 1:18 PM, Alexis <flexi...@gmail.com> wrote:
> Can you try running `emacs -Q`, loading aggressive-indent manually, and then
> check if you still observe the significant lag?

While I see aggressive-mode-indent is installed I cannot load it
manually via M-x when running emacs -Q. Am I doing something wrong?

Luca

Alexis

未读,
2016年2月10日 02:39:192016/2/10
收件人 Luca Ferrari、help-gnu-emacs
To actually load the library, you'll need to go to your *scratch*
buffer in your emacs -Q session and do something like:

(load
"~/.emacs.d/elpa/aggressive-indent-20160209.956/aggressive-indent-autoloads.el")

changing the 'aggressive-indent-20160209.956' part as
necessary. You can then evaluate that code by positioning the
cursor at the end of it (i.e. just after the closing parenthesis),
then pressing C-x C-e.

You should then find `aggressive-indent-mode` is available via
M-x.

(Normally the `package-initialize` function handles doing all the
package loading stuff for you, but in this instance, we don't want
`package-initialize` doing that, because it would load other
packages, and we're trying to narrow down whether the problem is
with `aggressive-indent-mode` itself, with another package, or a
combination of both.)


Alexis.

Luca Ferrari

未读,
2016年2月10日 06:04:362016/2/10
收件人 Alexis、help-gnu-emacs
On Wed, Feb 10, 2016 at 8:39 AM, Alexis <flexi...@gmail.com> wrote:
> You should then find `aggressive-indent-mode` is available via M-x.
>

Done, and the php file now is indented quickly. Therefore there is
something else that is causing the problem. Now, what is the best way
to find out without having to comment out each loaded module and
iteratively try?

Thanks,
Luca

Alexis

未读,
2016年2月10日 06:29:172016/2/10
收件人 Luca Ferrari、help-gnu-emacs

Luca Ferrari <fluc...@infinito.it> writes:

> Done, and the php file now is indented quickly. Therefore there
> is something else that is causing the problem. Now, what is the
> best way to find out without having to comment out each loaded
> module and iteratively try?

Well, if i were in this situation, i would bisect and re-bisect my
config file to narrow things down to the section which seems to
cause the problem. However, my config is indeed mostly done via a
single file, and i don't make use of things like starter kits,
Spacemacs, etc. If you do, i'm not sure what the best approach
might be - perhaps someone else could make some suggestions .... ?


Alexis.

Joost Kremers

未读,
2016年2月10日 07:03:332016/2/10
收件人
Emacs has a profiler:

(info "(elisp) Profiling")

You can use it to check in what function(s) Emacs spends the most time
while opening/editing the file in question. That usually points to a
package that is resource-intensive.


--
Joost Kremers joostk...@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

Alexis

未读,
2016年2月11日 00:43:582016/2/11
收件人 Joost Kremers、help-gn...@gnu.org

Joost Kremers <joost.m...@gmail.com> writes:

> Emacs has a profiler:
>
> (info "(elisp) Profiling")
>
> You can use it to check in what function(s) Emacs spends the
> most time while opening/editing the file in question. That
> usually points to a package that is resource-intensive.

Excellent suggestion! Thanks. :-)


Alexis.

0 个新帖子