all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* More enhancements to fringe bitmaps.
@ 2004-02-09  1:01 Kim F. Storm
  2004-02-09  2:48 ` YAMAMOTO Mitsuharu
                   ` (5 more replies)
  0 siblings, 6 replies; 59+ messages in thread
From: Kim F. Storm @ 2004-02-09  1:01 UTC (permalink / raw)



I have just committed changes to implement a very old item on my
personal to-do list:

   You can now redefine the built-in fringe bitmaps!

In addition you can define your own fringe bitmaps and have them
appear in the left or right fringe of any row to your liking.  You can
even specify the face to use for each of the fringe bitmaps.

I will add something to NEWS and the lispref about it tomorrow.
In the meantime, you can look at the examples below.


    ___HELP NEEDED FROM W32 AND MAC EXPERTS___

But I need help for the W32 and MAC ports!!!  Could someone which know
about pixmaps and clipping on these systems please look at the code
(from xterm.c) that I have inserted in w32term.c and macterm.c with
the following conditionals:

#if 0  /* TODO: fringe overlay_p and cursor_p */

The code in those blocks serves two purposes:

There is some code (adapted to w32 and mac) which aim to use the text
cursor color when the cursor is in the right fringe, but as I have no
way of testing this -- so I didn't enable it.

There is also some code which (on X) sets the clipmask for drawing the
bitmap to the bitmap itself when "overlay_p" is set in the parameter
block; the intention is that the bitmap should be drawn with a
transparent background over another bitmap.  I don't know anything
about clipping on W32 or MAC, so I have no clue how to accomplish this
on those platforms -- so I need help.


Until this is fixed on W32 and MAC, there may be some problems with the
cursor in the right fringe, and to show the overlay arrow in the left
fringe together with a user defined bitmap in the same row.


    ___EXAMPLES___

;;; ====================================================================
;;; Here is an example of using a user-defined fringe bitmaps; it is a red
;;; circle which can be used to mark a debugger breakpoint (instead of
;;; using the display margin as gdba current does).
;;;
;;; Eval this and try M-x xb RET

(defface fringe-standout
  '((t
     :inherit fringe
     :foreground "red"))
  "Face for fringe bitmaps which should stand out.")

;; ..xxxx..
;; .xxxxxx.
;; xxxxxxxx
;; xxxxxxxx
;; xxxxxxxx
;; xxxxxxxx
;; .xxxxxx.
;; ..xxxx..

(defvar circle-fringe-bitmap 
  (define-fringe-bitmap "\x3c\x7e\xff\xff\xff\xff\x7e\x3c"))

(defun xb ()
  "Insert the circle-fringe-bitmap in right fringe of current line."
  (interactive)
  (let ((b (line-beginning-position))) 
    (add-text-properties b (+ b 1) 
      `(display (left-fringe ,circle-fringe-bitmap fringe-standout)))))


;;; ====================================================================
;;; Assign a different color to the overlay arrow.

(require 'fringe)

(defface fringe-arrow
  '((t
     :inherit fringe
     :foreground "green"))
  "Face for arrow fringe bitmap.")

(set-fringe-bitmap-face overlay-arrow-fringe-bitmap 'fringe-arrow)


;;; ====================================================================
;;; Use a ~ bitmap to mark empty lines  (viper mode may like this :-)

;; ........
;; ..xx....
;; .x..x..x
;; .....xx.

(require 'fringe)

(define-fringe-bitmap "\x00\x30\x49\x06" nil nil 'top empty-line-fringe-bitmap)

(setq indicate-empty-lines t)


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 59+ messages in thread
* Re: More enhancements to fringe bitmaps.
@ 2004-02-11 23:41 Nick Roberts
  2004-02-12  1:18 ` Miles Bader
  2004-02-12 12:07 ` Kim F. Storm
  0 siblings, 2 replies; 59+ messages in thread
From: Nick Roberts @ 2004-02-11 23:41 UTC (permalink / raw)



> ;;; Here is an example of using a user-defined fringe bitmaps; it is a red
> ;;; circle which can be used to mark a debugger breakpoint (instead of
> ;;; using the display margin as gdba current does).

I recall a thread about 15 months ago about the fringe versus the display
margin for breakpoint icons. However, I must admit that I've never quite
understood the need for the fringe. Using the display margin does shunt the
code sideways but I've got used to that. On the other hand, the overlay arrow
already uses the fringe so it could get a bit crowded. Also, on text-only
terminals the character `B' or `b' in the display margin marks a debugger
breakpoint while the fringe is unavailable. Would the concept of the fringe
make sense for such terminals?


    Nick                                         http://www.nick.uklinux.net

^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2004-03-23  2:27 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-09  1:01 More enhancements to fringe bitmaps Kim F. Storm
2004-02-09  2:48 ` YAMAMOTO Mitsuharu
2004-02-09 14:54   ` Kim F. Storm
2004-02-09 14:27     ` Jason Rumney
2004-02-09 20:09       ` Harald Maier
2004-02-11  2:54     ` YAMAMOTO Mitsuharu
2004-02-11 11:17       ` Kim F. Storm
2004-02-11 11:28         ` YAMAMOTO Mitsuharu
2004-02-11 14:03           ` Stefan Monnier
2004-02-12  0:58             ` YAMAMOTO Mitsuharu
2004-02-14  0:39           ` Kim F. Storm
2004-02-14  8:08             ` Harald Maier
2004-02-14 15:31             ` YAMAMOTO Mitsuharu
2004-02-15 17:19               ` Kim F. Storm
2004-02-16 10:22       ` YAMAMOTO Mitsuharu
2004-02-16 13:22         ` Kim F. Storm
2004-02-17  3:13           ` YAMAMOTO Mitsuharu
2004-02-17 22:41             ` Kim F. Storm
2004-02-18  2:32               ` YAMAMOTO Mitsuharu
2004-02-18 22:04                 ` Kim F. Storm
2004-02-19  4:28                   ` YAMAMOTO Mitsuharu
2004-02-19  8:38                     ` Jason Rumney
2004-02-19  9:52                     ` Kim F. Storm
2004-02-09  8:54 ` Masatake YAMATO
2004-02-09 16:49   ` Kim F. Storm
2004-02-10  1:28     ` Johan Bockgård
2004-02-14  0:58       ` Kim F. Storm
2004-02-09 15:02 ` Matt Hodges
2004-02-14  0:46   ` Kim F. Storm
2004-02-09 19:54 ` Tak Ota
2004-02-09 20:37   ` Tak Ota
2004-03-08 13:48 ` Marco Munari 16447.64651
2004-03-08 23:52   ` Kim F. Storm
2004-03-11 15:27     ` Miles Bader
2004-03-17 13:59       ` Marco Munari
2004-03-11 17:06     ` Marco Munari 16464.32679
2004-03-11  0:22 ` Marco Munari 16447.64651
2004-03-17  3:56   ` Miles Bader
2004-03-18  5:08     ` Marc Munari 16473.4929
2004-03-18 13:27       ` Kim F. Storm
2004-03-18 19:05         ` Marco Munari 16473.54072
2004-03-18 23:43           ` Kim F. Storm
2004-03-19  3:44             ` Marco Munari
2004-03-19 14:04               ` Kim F. Storm
2004-03-21  3:27                 ` Marco Munari
2004-03-22 10:59                   ` Kim F. Storm
2004-03-23  2:27                     ` Marco Munari 16479.36044
  -- strict thread matches above, loose matches on Subject: below --
2004-02-11 23:41 Nick Roberts
2004-02-12  1:18 ` Miles Bader
2004-02-12 11:55   ` Kim F. Storm
2004-02-12 12:32     ` Miles Bader
2004-02-13 17:34     ` Richard Stallman
2004-02-13 21:53       ` Kim F. Storm
2004-02-12 16:42   ` Nick Roberts
2004-02-12 20:55     ` Miles Bader
2004-02-12 12:07 ` Kim F. Storm
2004-02-12 16:59   ` Nick Roberts
2004-02-12 23:35     ` Kim F. Storm
2004-02-13 19:25       ` Nick Roberts

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.