Yuki-Inoue / elisp-format

Originally from EmacsWiki
https://www.emacswiki.org/emacs/elisp-format.el
GNU General Public License v3.0
16 stars 3 forks source link

`Invalid regular expression` with emacs-snapshot #5

Open pawciobiel opened 2 years ago

pawciobiel commented 2 years ago

I see Invalid regular expression when formatting any buffer with emacs-snapshot 20220711:107361-9fe663530c~ubuntu20.04.1 GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-07-12 and ./elpa/elisp-format-20160508.952/elisp-format.el

I've tried debugging it a bit, here are outputs with stacks:

Debugger entered--returning value: "\\s-*\\([`',]?@?(+\\(\\(\\_<&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>\\|\\..."
  concat("\\s-*\\([`',]?@?(+" "\\(" "\\(\\_<&\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\_>\\|\\_<:\\(?:\\sw\\|\\s_\\|\\..." "\\|" "\\(?:buffer-substring\\(?:-no-properties\\)?\\|$
* (let ((search-regexp (concat "\\s-*\\([`',]?@?(+" "\\(" elisp-format-buildin-keywords-regexp "\\|" elisp-format-newline-keyword-addons-regexp "\\)" "\\)\\b[^\\B\\s$
* elisp-format-split-keyword(1 #<marker at 16 in dupa.el>)
* (save-excursion (if (and start end) nil (if mark-active (progn (setq start (region-beginning)) (setq end (region-end)) (deactivate-mark)) (setq start (progn (begin$
* (let ((start-time (elisp-format-get-current-time))) (message "Format %s ..." (buffer-name)) (check-parens) (save-excursion (if (and start end) nil (if mark-active $
* (lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) (message "$
* apply((lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) (mes$
* elisp-format-region()
Debugger entered--beginning evaluation of function call form:
* (while (re-search-forward search-regexp end t) (elisp-format-split-keyword-internal 1))
* (let ((search-regexp (concat "\\s-*\\([`',]?@?(+" "\\(" elisp-format-buildin-keywords-regexp "\\|" elisp-format-newline-keyword-addons-regexp "\\)" "\\)\\b[^\\B\\s$
* elisp-format-split-keyword(1 #<marker at 16 in dupa.el>)
* (save-excursion (if (and start end) nil (if mark-active (progn (setq start (region-beginning)) (setq end (region-end)) (deactivate-mark)) (setq start (progn (begin$
* (let ((start-time (elisp-format-get-current-time))) (message "Format %s ..." (buffer-name)) (check-parens) (save-excursion (if (and start end) nil (if mark-active $
* (lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) (message "$
* apply((lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) (mes$
* elisp-format-region()
Debugger entered--beginning evaluation of function call form:
* (re-search-forward search-regexp end t)
* (while (re-search-forward search-regexp end t) (elisp-format-split-keyword-internal 1))
* (let ((search-regexp (concat "\\s-*\\([`',]?@?(+" "\\(" elisp-format-buildin-keywords-regexp "\\|" elisp-format-newline-keyword-addons-regexp "\\)" "\\)\\b[^\\B\\s$
* elisp-format-split-keyword(1 #<marker at 16 in dupa.el>)
* (save-excursion (if (and start end) nil (if mark-active (progn (setq start (region-beginning)) (setq end (region-end)) (deactivate-mark)) (setq start (progn (begin$
* (let ((start-time (elisp-format-get-current-time))) (message "Format %s ..." (buffer-name)) (check-parens) (save-excursion (if (and start end) nil (if mark-active $
* (lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) (message "$
* apply((lambda (&optional start end) "Format current region or buffer.\nThis function wil..." (interactive) (let ((start-time (elisp-format-get-current-time))) 
djgoku commented 1 year ago

I know this doesn't help you with using elisp-format. But I'll share what I found to help me format my elisp code:

https://emacs.stackexchange.com/a/55759 https://stackoverflow.com/a/12991513