GNU bug report logs - #11226
format-mode-line, %z, mode-line-mule-info, and unibyte

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Wed, 11 Apr 2012 19:18:01 UTC

Severity: minor

Found in version 24.0.95

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11226 in the body.
You can then email your comments to 11226 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11226; Package emacs. (Wed, 11 Apr 2012 19:18:01 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: format-mode-line, %z, mode-line-mule-info, and unibyte
Date: Wed, 11 Apr 2012 15:16:34 -0400
Package: emacs
Version: 24.0.95

mode-line-mule-info contains this:

(propertize
 "%z" 'help-echo [...]
 (format "Buffer coding system %s\nmouse-1: describe coding system"
  (if enable-multibyte-characters
       (concat "(multi-byte): "
                    (symbol-name buffer-file-coding-system))
                       (concat "(unibyte): "
                                  (symbol-name buffer-file-coding-system))))

The intent is obviously that you see (multibyte) in the mode-line
tooltip in a multibyte buffer, and (unibyte) otherwise.

However, you will never see the unibyte tooltip, because:

(set-buffer-multibyte nil)
(format-mode-line "%z")
    -> ""

ie, the empty string, so there is nowhere for the help-echo to display.
Compare with "-" in multibyte buffers.

If it returned " " instead of "", you would see the tooltip.




bug closed, send any further explanations to 11226 <at> debbugs.gnu.org and Glenn Morris <rgm <at> gnu.org> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 03 Jun 2012 10:27:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11226; Package emacs. (Sun, 03 Jun 2012 10:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 11226 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 11226 <at> debbugs.gnu.org
Subject: Re: bug#11226: format-mode-line, %z, mode-line-mule-info, and unibyte
Date: Sun, 03 Jun 2012 18:24:39 +0800
Glenn Morris <rgm <at> gnu.org> writes:

> The intent is obviously that you see (multibyte) in the mode-line
> tooltip in a multibyte buffer, and (unibyte) otherwise.
>
> However, you will never see the unibyte tooltip, because:
>
> (set-buffer-multibyte nil)
> (format-mode-line "%z")
>     -> ""
>
> If it returned " " instead of "", you would see the tooltip.

Sounds reasonable; fixed in trunk.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Jul 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.