bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55678: 29.0.50; C-c C-w and errors in major-mode-hook


From: Lars Ingebrigtsen
Subject: bug#55678: 29.0.50; C-c C-w and errors in major-mode-hook
Date: Sat, 28 May 2022 12:52:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Visuwesh <visuweshm@gmail.com> writes:

> I have paredit-mode in emacs-lisp-mode-hook, and when the buffer has
> mismatched parens [(check-paren)=nil], it signals an error.  This makes
> `diff-add-log-current-entries' not add any of the entries.
>
> For a simple reproducer,
>
>     1. emacs -Q
>
>     2. M-: (add-hook 'emacs-lisp-mode-hook (defun test () (error "test 
> error")))
>
>     3. Create a temporary git repo, commit an initial change by adding
>        an elisp file.
>
>     4. Add some more text.  C-x v v.
>
>     5. C-c C-w.  Note "test error" in the echo-area.
>
> I narrowed down the problem to `diff-add-log-current-entries' and I
> *think* the problem is in goto-otherbuf function but when I added an
> ignore-error around (funcall (buffer-local-value 'major-mode buf)), I
> noticed no change.  :-/

Isn't the problem here that paredit-mode signals an error when being
switched on?  Modes aren't supposed to do that.

For reference, here's the backtrace in the test case:

Debugger entered--Lisp error: (error "test error")
  signal(error ("test error"))
  error("test error")
  test()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook 
lisp-data-mode-hook emacs-lisp-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook 
lisp-data-mode-hook emacs-lisp-mode-hook))
  run-mode-hooks(emacs-lisp-mode-hook)
  emacs-lisp-mode()
  #f(compiled-function () #<bytecode 0x1cc9cff9c51917ea>)()
  #f(compiled-function (&optional get-current) #<bytecode 0xba06c773444f87>)()
  diff-add-log-current-defuns()
  log-edit-generate-changelog-from-diff()
  funcall-interactively(log-edit-generate-changelog-from-diff)
  call-interactively(log-edit-generate-changelog-from-diff nil nil)
  command-execute(log-edit-generate-changelog-from-diff)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]