Open
Description
After installing cperl mode from stable melpa I get crash (full backtrace below) after pressing '{' key (or any other electric key). Emacs 24.3.1.
If I see correctly, that is fixed in current code (the problem is last-command-char => last-command-event migration), so the only thing necessary to fix is to make stable release (= tag 6.3 or 7.0).
Would you mind?
Debugger entered--Lisp error: (void-variable last-command-char)
(eq last-command-char 125)
(and (eq last-command-char 125) (not (condition-case nil (save-excursion (up-list (- (prefix-numeric-value arg))) (or (cperl-after-expr-p nil "{;)") (cperl-after-block-p nil (quote pre)))) (error nil))))
(if (and (eq last-command-char 125) (not (condition-case nil (save-excursion (up-list (- (prefix-numeric-value arg))) (or (cperl-after-expr-p nil "{;)") (cperl-after-block-p nil (quote pre)))) (error nil)))) (self-insert-command (prefix-numeric-value arg)) (if (and (not arg) (eolp) (or (and (null only-before) (save-excursion (skip-chars-backward " ") (bolp))) (and (eq last-command-char 123) (not cperl-extra-newline-before-brace) (save-excursion (skip-chars-backward " ") (eq (preceding-char) 41))) (if cperl-auto-newline (progn (cperl-indent-line) (newline) t) nil))) (progn (self-insert-command (prefix-numeric-value arg)) (cperl-indent-line) (if cperl-auto-newline (setq insertpos (1- (point)))) (if (and cperl-auto-newline (null only-before)) (progn (newline) (cperl-indent-line))) (save-excursion (if insertpos (progn (goto-char insertpos) (search-forward (make-string 1 last-command-char)) (setq insertpos (1- ...)))) (delete-char -1)))) (if insertpos (save-excursion (goto-char insertpos) (self-insert-command (prefix-numeric-value arg))) (self-insert-command (prefix-numeric-value arg))))
(if (and other-end (not cperl-brace-recursing) (cperl-val (quote cperl-electric-parens)) (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point))) (progn (save-excursion (setq insertpos (point-marker)) (goto-char other-end) (setq last-command-char 123) (cperl-electric-lbrace arg insertpos)) (forward-char 1)) (if (and (eq last-command-char 125) (not (condition-case nil (save-excursion (up-list (- ...)) (or (cperl-after-expr-p nil "{;)") (cperl-after-block-p nil ...))) (error nil)))) (self-insert-command (prefix-numeric-value arg)) (if (and (not arg) (eolp) (or (and (null only-before) (save-excursion (skip-chars-backward " ") (bolp))) (and (eq last-command-char 123) (not cperl-extra-newline-before-brace) (save-excursion (skip-chars-backward " ") (eq ... 41))) (if cperl-auto-newline (progn (cperl-indent-line) (newline) t) nil))) (progn (self-insert-command (prefix-numeric-value arg)) (cperl-indent-line) (if cperl-auto-newline (setq insertpos (1- (point)))) (if (and cperl-auto-newline (null only-before)) (progn (newline) (cperl-indent-line))) (save-excursion (if insertpos (progn (goto-char insertpos) (search-forward ...) (setq insertpos ...))) (delete-char -1)))) (if insertpos (save-excursion (goto-char insertpos) (self-insert-command (prefix-numeric-value arg))) (self-insert-command (prefix-numeric-value arg)))))
(let (insertpos (other-end (if (and cperl-electric-parens-mark (cperl-mark-active) (< (mark) (point))) (mark) nil))) (if (and other-end (not cperl-brace-recursing) (cperl-val (quote cperl-electric-parens)) (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point))) (progn (save-excursion (setq insertpos (point-marker)) (goto-char other-end) (setq last-command-char 123) (cperl-electric-lbrace arg insertpos)) (forward-char 1)) (if (and (eq last-command-char 125) (not (condition-case nil (save-excursion (up-list ...) (or ... ...)) (error nil)))) (self-insert-command (prefix-numeric-value arg)) (if (and (not arg) (eolp) (or (and (null only-before) (save-excursion ... ...)) (and (eq last-command-char 123) (not cperl-extra-newline-before-brace) (save-excursion ... ...)) (if cperl-auto-newline (progn ... ... t) nil))) (progn (self-insert-command (prefix-numeric-value arg)) (cperl-indent-line) (if cperl-auto-newline (setq insertpos (1- ...))) (if (and cperl-auto-newline (null only-before)) (progn (newline) (cperl-indent-line))) (save-excursion (if insertpos (progn ... ... ...)) (delete-char -1)))) (if insertpos (save-excursion (goto-char insertpos) (self-insert-command (prefix-numeric-value arg))) (self-insert-command (prefix-numeric-value arg))))))
cperl-electric-brace(nil)
(let ((cperl-brace-recursing t) (cperl-auto-newline cperl-auto-newline) (other-end (or end (if (and cperl-electric-parens-mark (cperl-mark-active) (> (mark) (point))) (save-excursion (goto-char (mark)) (point-marker)) nil))) pos after) (and (cperl-val (quote cperl-electric-lbrace-space)) (eq (preceding-char) 36) (save-excursion (skip-chars-backward "$") (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)")) (insert 32)) (if (and (save-excursion (beginning-of-line) (not (looking-at "[ ]*#"))) (cperl-after-expr-p nil "{;)")) nil (setq cperl-auto-newline nil)) (cperl-electric-brace arg) (and (cperl-val (quote cperl-electric-parens)) (eq last-command-char 123) (memq last-command-char (append cperl-electric-parens-string nil)) (or (if other-end (goto-char (marker-position other-end))) t) (setq last-command-char 125 pos (point)) (progn (cperl-electric-brace arg t) (goto-char pos))))
cperl-electric-lbrace(nil)
call-interactively(cperl-electric-lbrace nil nil)
PS stable melpa offers cperl-mode 6.2 as this is newest existing tag.
Metadata
Metadata
Assignees
Labels
No labels