Mercurial > emacs
comparison lisp/fringe.el @ 58597:fa269b651143
(fringe): New defgroup.
(fringe-mode): Move to fringe group.
(fringe-indicators): New defcustom.
(set-fringe-indicators-1): New defun.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 28 Nov 2004 00:56:28 +0000 |
parents | 6f85a547ab10 |
children | 119590228e9a |
comparison
equal
deleted
inserted
replaced
58596:89f8e146b919 | 58597:fa269b651143 |
---|---|
32 ;; gratefully acknowledge comments and suggestions made by Miles | 32 ;; gratefully acknowledge comments and suggestions made by Miles |
33 ;; Bader, Eli Zaretski, Richard Stallman, Pavel Janík and others which | 33 ;; Bader, Eli Zaretski, Richard Stallman, Pavel Janík and others which |
34 ;; improved this package. | 34 ;; improved this package. |
35 | 35 |
36 ;;; Code: | 36 ;;; Code: |
37 | |
38 (defgroup fringe nil | |
39 "Window fringes." | |
40 :version "21.4" | |
41 :group 'frames) | |
37 | 42 |
38 ;; Standard fringe bitmaps | 43 ;; Standard fringe bitmaps |
39 | 44 |
40 (defmacro fringe-bitmap-p (symbol) | 45 (defmacro fringe-bitmap-p (symbol) |
41 "Return non-nil if SYMBOL is a fringe bitmap." | 46 "Return non-nil if SYMBOL is a fringe bitmap." |
154 (const :tag "Minimal" (1 . 1)) | 159 (const :tag "Minimal" (1 . 1)) |
155 (integer :tag "Specific width") | 160 (integer :tag "Specific width") |
156 (cons :tag "Different left/right sizes" | 161 (cons :tag "Different left/right sizes" |
157 (integer :tag "Left width") | 162 (integer :tag "Left width") |
158 (integer :tag "Right width"))) | 163 (integer :tag "Right width"))) |
159 :group 'frames | 164 :group 'fringe |
160 :require 'fringe | 165 :require 'fringe |
161 :initialize 'fringe-mode-initialize | 166 :initialize 'fringe-mode-initialize |
162 :set 'set-fringe-mode-1) | 167 :set 'set-fringe-mode-1) |
163 | 168 |
164 (defun fringe-query-style (&optional all-frames) | 169 (defun fringe-query-style (&optional all-frames) |
250 (or (funcall (if (eq side 'left) 'car 'cadr) | 255 (or (funcall (if (eq side 'left) 'car 'cadr) |
251 (window-fringes)) | 256 (window-fringes)) |
252 0) | 257 0) |
253 (float (frame-char-width)))) | 258 (float (frame-char-width)))) |
254 | 259 |
260 | |
261 ;;;###autoload | |
262 (defcustom fringe-indicators nil | |
263 "Visually indicate buffer boundaries and scrolling. | |
264 Setting this variable, changes `default-indicate-buffer-boundaries'." | |
265 :type '(choice (const :tag "No indicators" nil) | |
266 (const :tag "On left" left) | |
267 (const :tag "On right" right) | |
268 (const :tag "Opposite, no arrows" box) | |
269 (const :tag "Opposite, arrows right" mixed) | |
270 (const :tag "Empty lines" empty)) | |
271 :group 'fringe | |
272 :require 'fringe | |
273 :set 'set-fringe-indicators-1) | |
274 | |
275 (defun set-fringe-indicators-1 (ignore value) | |
276 "Set fringe indicators according to VALUE. | |
277 This is usually invoked when setting `fringe-indicators' via customize." | |
278 (setq fringe-indicators value) | |
279 (setq default-indicate-empty-lines nil) | |
280 (setq default-indicate-buffer-boundaries | |
281 (cond | |
282 ((memq value '(left right t)) | |
283 value) | |
284 ((eq value 'box) | |
285 '((top . left) (bottom . right))) | |
286 ((eq value 'mixed) | |
287 '((top . left) (t . right))) | |
288 ((eq value 'empty) | |
289 (setq default-indicate-empty-lines t) | |
290 nil) | |
291 (t nil)))) | |
292 | |
255 (provide 'fringe) | 293 (provide 'fringe) |
256 | 294 |
257 ;;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d | 295 ;;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d |
258 ;;; fringe.el ends here | 296 ;;; fringe.el ends here |