unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs@gnu.org>
Subject: bug#5370: M-x hexl-mode M-x hexl-mode leaves unwanted ruler
Date: Wed, 13 Jan 2010 05:52:12 +0100	[thread overview]
Message-ID: <f7ccd24b1001122052n726ba65bied1ef40e238ff9e3@mail.gmail.com> (raw)

  emacs -Q
  M-x hexl-mode <RET>
  y              ; to the question about discarding undo
  M-x hexl-mode <RET>
  C-c C-c

now *scratch* has a ruler, thanks to `header-line-format' containing

   (:eval (funcall ruler-mode-ruler-function))

while `ruler-mode' is nil (so M-x ruler-mode doesn't remove it).

The second call to hexl-mode bypasses most of the hexl-mode
initialization, but runs `hexl-mode-hook', which by default contains
`hexl-activate-ruler', so the ruler is initialized again. `ruler-mode'
already has code to save header-line-format, but it seems like it
isn't dealing too well with reentering.

So, I think the bug is in ruler-mode. But, what to do? Create a stack
of previous header-line-format's? At some point the thing turns
ridiculous. In the case above, however, it is a real bug (though
harmless) because the unwary user will have a hard time removing the
ruler.

Still, shouldn't hexl-activate-ruler be a noop when the buffer is
already in hexl-mode? It is certainly possible to do

  M-x hexl-mode  ; you have a hexl ruler
  M-x ruler-mode  ; to turn it off
  M-x hexl-mode  ; you get it back

but I can't really say whether the user would expect at that point to
have a hexl ruler or not in the buffer :-)

    Juanma







             reply	other threads:[~2010-01-13  4:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  4:52 Juanma Barranquero [this message]
2010-06-30 22:46 ` bug#5370: M-x hexl-mode M-x hexl-mode leaves unwanted ruler Chong Yidong
2010-07-01  0:21   ` Juanma Barranquero
2010-07-01  5:31     ` Chong Yidong

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=f7ccd24b1001122052n726ba65bied1ef40e238ff9e3@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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).