all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 31551@debbugs.gnu.org, alexandre.adolphe@gmail.com
Subject: bug#31551: 27.0.50; emacs hangs in hexl-mode on modula2 files
Date: Wed, 06 Jun 2018 18:17:14 +0300	[thread overview]
Message-ID: <83po14vtad.fsf@gnu.org> (raw)
In-Reply-To: <jwvbmcom3gi.fsf-monnier+emacsbugs@gnu.org> (message from Stefan Monnier on Wed, 06 Jun 2018 10:00:04 -0400)

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: Alexandre Adolphe <alexandre.adolphe@gmail.com>, 31551@debbugs.gnu.org
> Date: Wed, 06 Jun 2018 10:00:04 -0400
> 
> > On top of that, show-paren-mode will happily turn itself on in a
> > buffer under Hexl mode, although it makes no sense to me: the Hexl
> > display shows no parens to work with.
> 
> At the same time, it's only enabled if the user explicitly requests it
> (as is the case in the OP's recipe), so I think we can consider this
> a pilot error.

I thought so too, until I turned on show-paren-mode _before_ switching
to Hexl, and saw it still turned on when in Hexl.

> > The fact that syntactical customizations of a mode stay in effect when
> > the display changes so radically sounds like a potential cause of many
> > trouble.  So perhaps the right solution would be to temporarily
> > disable mode syntax while in Hexl mode.
> 
> Agreed.  Hexl-mode should use a "normal" major mode (e.g. calling
> kill-all-local-variables).  In order to properly reset the previous
> major mode, it could either save&restore all previous local-vars, or
> just save the previous major-mode and call that major-mode
> function to restore the state.

Well, this is a much larger job than I hoped will be necessary.  The
problem with "switching off SMIE" is that there doesn't seem to be a
way of doing that: I see no function to "undo" smie-setup, at least
not a documented way (maybe some clever call to smie-setup will undo
the previous one, but I couldn't see how).

> BTW, this "save previous major mode and then restore it" is something
> done in other places (at least doc-view-mode comes to mind, but
> I believe there are others as well) and we should try and avoid
> duplicating that code (i.e. develop a "standard" way to do it).

In the long run, certainly.





  reply	other threads:[~2018-06-06 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 13:24 bug#31551: 27.0.50; emacs hangs in hexl-mode on modula2 files Alexandre Adolphe
2018-06-05 15:30 ` Eli Zaretskii
2018-06-06 14:00   ` Stefan Monnier
2018-06-06 15:17     ` Eli Zaretskii [this message]
2018-06-06 19:27       ` Stefan Monnier
2018-06-07  2:32         ` Eli Zaretskii
2018-06-06 20:51       ` Stefan Monnier
2018-06-20 14:27         ` Stefan Monnier
2018-06-20 15:56           ` Eli Zaretskii
2018-06-22  3:31           ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=83po14vtad.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31551@debbugs.gnu.org \
    --cc=alexandre.adolphe@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.