unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 55678@debbugs.gnu.org
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	[thread overview]
Message-ID: <87pmjy3p4l.fsf@gnus.org> (raw)
In-Reply-To: <87bkvjf2pf.fsf@gmail.com> (Visuwesh's message of "Fri, 27 May 2022 20:21:56 +0530")

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	other threads:[~2022-05-28 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 14:51 bug#55678: 29.0.50; C-c C-w and errors in major-mode-hook Visuwesh
2022-05-28 10:52 ` Lars Ingebrigtsen [this message]
2022-05-28 11:14   ` Visuwesh
2022-05-28 16:46     ` Lars Ingebrigtsen
2022-05-28 17:05       ` Visuwesh
2022-05-29 13:07         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmjy3p4l.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=55678@debbugs.gnu.org \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).