Skip to content

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

Open
benwbooth opened this Issue Apr 9, 2013 · 2 comments

2 participants

@benwbooth

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
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.