Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

aggressive-indent-mode freezes

14 views
Skip to first unread message

Luca Ferrari

unread,
Feb 9, 2016, 2:36:31 AM2/9/16
to 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

unread,
Feb 9, 2016, 5:32:02 AM2/9/16
to 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

unread,
Feb 9, 2016, 6:40:31 AM2/9/16
to 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

unread,
Feb 9, 2016, 7:19:11 AM2/9/16
to 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

unread,
Feb 10, 2016, 2:13:22 AM2/10/16
to 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

unread,
Feb 10, 2016, 2:39:19 AM2/10/16
to 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

unread,
Feb 10, 2016, 6:04:36 AM2/10/16
to 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

unread,
Feb 10, 2016, 6:29:17 AM2/10/16
to 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

unread,
Feb 10, 2016, 7:03:33 AM2/10/16
to
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

unread,
Feb 11, 2016, 12:43:58 AM2/11/16
to 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 new messages