Subject: 25.1; bug of define-fringe-bitmap

From: [email-masked]
Date: Fri, 10 Feb 2017 17:16:13 +0900

Evaluating the forms below, emacs does not display a framed square.
The rightmost edge is not displayed.

(set-window-fringes nil 20 20) ;; ensure enough space to display image
(define-fringe-bitmap 'test-bitmap
  (vector #b1111111
          #b1000001
          #b1000001
          #b1000001
          #b1000001
          #b1000001
          #b1111111)
  7 7)
(insert "<" (propertize "x" 'display '(left-fringe test-bitmap)) ">\n")

It is needed to align patterns left in 8bit.

(define-fringe-bitmap 'test-bitmap ;; 7x7 pixel framed square
  (vector #b11111110
          #b10000010
          #b10000010
          #b10000010
          #b10000010
          #b10000010
          #b11111110)
  7 7)

To display bitmap images wider than 8pixel,
it is needed to align patterns left in 16bit
and swap the higher 8bit and lower 8bit.

(define-fringe-bitmap 'test-bitmap ;; 12x12 pixel framed square
  (vector #b1111000011111111
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b0001000010000000
          #b1111000011111111)
  12 12)

In GNU Emacs 25.1.1 (i686-w64-mingw32)
 of 2016-09-18 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.0.6002
Configured using:
 'configure --host=i686-w64-mingw32 --without-dbus
 --without-compress-install CFLAGS=-static'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
help-mode easymenu cl-loaddefs pcase cl-lib time-date mule-util
japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
w32notify w32 multi-tty make-network-process emacs)

Memory information:
((conses 8 99865 81085)
 (symbols 32 23773 0)
 (miscs 32 52 151)
 (strings 16 19965 5424)
 (string-bytes 1 496523)
 (vectors 8 13531)
 (vector-slots 4 593497 8174)
 (floats 8 165 34)
 (intervals 28 4286 3949)
 (buffers 520 20))