jrockway / cperl-mode

cperl-mode with 5.10 fixes, mx-declare support, perl6 support, etc.
102 stars 33 forks source link

cperl-mode causes emacs to hang when writing perldoc lines #15

Closed benwbooth closed 6 years ago

benwbooth commented 11 years ago

When writing embedded perldoc in a perl module, sometimes (about half the time), Emacs hangs with 100% CPU usage. Here is an example:

=head2 test

=cut

=head3 test

If I type the preceding lines into an empty perl file in cperl mode, about half the time Emacs will hang right after I press Enter at the end of the head3 line. Pressing CTRL-g seems to fix the problem.

I tried setting Debug on CTRL-g and I got this backtrace after unfreezing with CTRL-g:

Debugger entered--Lisp error: (quit)
  cperl-unwind-to-safe(t 32)
  cperl-fontify-syntaxically(32)
  cperl-update-syntaxification(32 32)
  cperl-sniff-for-indent(nil)
  cperl-calculate-indent(nil)
  cperl-indent-line()
  indent-according-to-mode()
  (if (not evil-auto-indent) (newline count) (delete-horizontal-space t) (newline count) (indent-according-to-mode))
  (cond ((and widget (fboundp (quote widget-type)) (fboundp (quote widget-button-press)) (or (and (symbolp widget) (get widget (quote widget-type))) (and (consp widget) (get (widget-type widget) (quote widget-type))))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (if (fboundp (quote widget-button-press)) (progn (widget-button-press (point))))) ((and (fboundp (quote button-at)) (fboundp (quote push-button)) (button-at (point))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (push-button)) ((or (evil-emacs-state-p) (and (evil-insert-state-p) (not buffer-read-only))) (if (not evil-auto-indent) (newline count) (delete-horizontal-space t) (newline count) (indent-according-to-mode))) (t (evil-next-line count)))
  (let* ((field (get-char-property (point) (quote field))) (button (get-char-property (point) (quote button))) (doc (get-char-property (point) (quote widget-doc))) (widget (or field button doc))) (cond ((and widget (fboundp (quote widget-type)) (fboundp (quote widget-button-press)) (or (and (symbolp widget) (get widget (quote widget-type))) (and (consp widget) (get (widget-type widget) (quote widget-type))))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (if (fboundp (quote widget-button-press)) (progn (widget-button-press (point))))) ((and (fboundp (quote button-at)) (fboundp (quote push-button)) (button-at (point))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (push-button)) ((or (evil-emacs-state-p) (and (evil-insert-state-p) (not buffer-read-only))) (if (not evil-auto-indent) (newline count) (delete-horizontal-space t) (newline count) (indent-according-to-mode))) (t (evil-next-line count))))
  (save-restriction (if (and (not (evil-operator-state-p)) (not (eobp)) (save-excursion (goto-char (point-max)) (bolp))) (progn (evil-narrow nil (1- (point-max))))) (let* ((field (get-char-property (point) (quote field))) (button (get-char-property (point) (quote button))) (doc (get-char-property (point) (quote widget-doc))) (widget (or field button doc))) (cond ((and widget (fboundp (quote widget-type)) (fboundp (quote widget-button-press)) (or (and (symbolp widget) (get widget ...)) (and (consp widget) (get ... ...)))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (if (fboundp (quote widget-button-press)) (progn (widget-button-press (point))))) ((and (fboundp (quote button-at)) (fboundp (quote push-button)) (button-at (point))) (if (evil-operator-state-p) (progn (setq evil-inhibit-operator t))) (push-button)) ((or (evil-emacs-state-p) (and (evil-insert-state-p) (not buffer-read-only))) (if (not evil-auto-indent) (newline count) (delete-horizontal-space t) (newline count) (indent-according-to-mode))) (t (evil-next-line count)))))
  evil-ret(nil)
  call-interactively(evil-ret nil nil)
renormalist commented 11 years ago

I can confirm but have no idea what's going on.

For the archives: which particular cperl-mode version are you using? Either upstream version or if from github please say from which branch.

Thanks!

benwbooth commented 11 years ago

On Apr 13, 2013, at 3:23 AM, Steffen Schwigon notifications@github.com wrote:

I can confirm but have no idea what's going on.

For the archives: which particular cperl-mode version are you using? Either upstream version or if from github please say from which branch.

I was using the git version from https://github.com/jrockway/cperl-mode. However, I have now switched to the version that comes with emacs 23.3 and I am no longer experiencing this problem.

Ben

renormalist commented 6 years ago

Newer Emacses don't have this issue. Closing.