Mercurial > emacs
annotate lisp/fringe.el @ 110971:80846b446563
lisp/subr.el (last): Use `safe-length' instead of `length' (bug#7206).
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 14 Oct 2010 01:15:03 +0200 |
parents | cd8d9630f156 |
children | 417b1e4d63cd |
rev | line source |
---|---|
103479
a441edf4d939
Add coding: utf-8 cookie.
Kenichi Handa <handa@m17n.org>
parents:
100908
diff
changeset
|
1 ;;; fringe.el --- fringe setup and control -*- coding: utf-8 -*- |
45493 | 2 |
100908 | 3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
106815 | 4 ;; 2009, 2010 Free Software Foundation, Inc. |
45493 | 5 |
6 ;; Author: Simon Josefsson <simon@josefsson.org> | |
7 ;; Maintainer: FSF | |
8 ;; Keywords: frames | |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
9 ;; Package: emacs |
45493 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
45493 | 14 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
16 ;; (at your option) any later version. |
45493 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
45493 | 25 |
26 ;;; Commentary: | |
27 | |
69070 | 28 ;; This file contains code to initialize the built-in fringe bitmaps |
29 ;; as well as helpful functions for customizing the appearance of the | |
30 ;; fringe. | |
45493 | 31 |
32 ;; The code is influenced by scroll-bar.el and avoid.el. The author | |
33 ;; gratefully acknowledge comments and suggestions made by Miles | |
34 ;; Bader, Eli Zaretski, Richard Stallman, Pavel JanÃk and others which | |
35 ;; improved this package. | |
36 | |
37 ;;; Code: | |
38 | |
58597 | 39 (defgroup fringe nil |
40 "Window fringes." | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58599
diff
changeset
|
41 :version "22.1" |
58597 | 42 :group 'frames) |
43 | |
69070 | 44 ;; Define the built-in fringe bitmaps and setup default mappings |
57261
075de3b1e798
(fringe-bitmap-p): New macro.
Kim F. Storm <storm@cua.dk>
parents:
54399
diff
changeset
|
45 |
69072 | 46 (when (boundp 'fringe-bitmaps) |
47 (let ((bitmaps '(question-mark | |
48 left-arrow right-arrow up-arrow down-arrow | |
49 left-curly-arrow right-curly-arrow | |
50 left-triangle right-triangle | |
51 top-left-angle top-right-angle | |
52 bottom-left-angle bottom-right-angle | |
53 left-bracket right-bracket | |
54 filled-rectangle hollow-rectangle | |
55 filled-square hollow-square | |
56 vertical-bar horizontal-bar | |
57 empty-line)) | |
58 (bn 1)) | |
59 (while bitmaps | |
60 (push (car bitmaps) fringe-bitmaps) | |
61 (put (car bitmaps) 'fringe bn) | |
62 (setq bitmaps (cdr bitmaps) | |
63 bn (1+ bn)))) | |
53890
5588b6cc6fba
(no-fringe-bitmap, undef-fringe-bitmap)
Kim F. Storm <storm@cua.dk>
parents:
53257
diff
changeset
|
64 |
69072 | 65 (setq-default fringe-indicator-alist |
66 '((truncation . (left-arrow right-arrow)) | |
67 (continuation . (left-curly-arrow right-curly-arrow)) | |
68 (overlay-arrow . right-triangle) | |
69 (up . up-arrow) | |
70 (down . down-arrow) | |
71 (top . (top-left-angle top-right-angle)) | |
72 (bottom . (bottom-left-angle bottom-right-angle | |
73 top-right-angle top-left-angle)) | |
74 (top-bottom . (left-bracket right-bracket | |
75 top-right-angle top-left-angle)) | |
76 (empty-line . empty-line) | |
77 (unknown . question-mark))) | |
69050
c0e9f855475e
(fringe-bitmaps): Update to new bitmap names.
Kim F. Storm <storm@cua.dk>
parents:
68651
diff
changeset
|
78 |
69072 | 79 (setq-default fringe-cursor-alist |
80 '((box . filled-rectangle) | |
81 (hollow . hollow-rectangle) | |
82 (bar . vertical-bar) | |
83 (hbar . horizontal-bar) | |
84 (hollow-small . hollow-square)))) | |
53890
5588b6cc6fba
(no-fringe-bitmap, undef-fringe-bitmap)
Kim F. Storm <storm@cua.dk>
parents:
53257
diff
changeset
|
85 |
69070 | 86 |
87 (defmacro fringe-bitmap-p (symbol) | |
88 "Return non-nil if SYMBOL is a fringe bitmap." | |
89 `(get ,symbol 'fringe)) | |
90 | |
91 | |
53890
5588b6cc6fba
(no-fringe-bitmap, undef-fringe-bitmap)
Kim F. Storm <storm@cua.dk>
parents:
53257
diff
changeset
|
92 ;; Control presence of fringes |
5588b6cc6fba
(no-fringe-bitmap, undef-fringe-bitmap)
Kim F. Storm <storm@cua.dk>
parents:
53257
diff
changeset
|
93 |
45493 | 94 (defvar fringe-mode) |
95 | |
87702
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
96 (defvar fringe-mode-explicit nil |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
97 "Non-nil means `set-fringe-mode' should really do something. |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
98 This is nil while loading `fringe.el', and t afterward.") |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
99 |
45493 | 100 (defun set-fringe-mode-1 (ignore value) |
101 "Call `set-fringe-mode' with VALUE. | |
102 See `fringe-mode' for valid values and their effect. | |
103 This is usually invoked when setting `fringe-mode' via customize." | |
104 (set-fringe-mode value)) | |
105 | |
106 (defun set-fringe-mode (value) | |
107 "Set `fringe-mode' to VALUE and put the new value into effect. | |
108 See `fringe-mode' for possible values and their effect." | |
109 (setq fringe-mode value) | |
110 | |
87702
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
111 (when fringe-mode-explicit |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
112 (modify-all-frames-parameters |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
113 (list (cons 'left-fringe (if (consp fringe-mode) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
114 (car fringe-mode) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
115 fringe-mode)) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
116 (cons 'right-fringe (if (consp fringe-mode) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
117 (cdr fringe-mode) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
118 fringe-mode)))))) |
45493 | 119 |
57538
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
120 ;; For initialization of fringe-mode, take account of changes |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
121 ;; made explicitly to default-frame-alist. |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
122 (defun fringe-mode-initialize (symbol value) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
123 (let* ((left-pair (assq 'left-fringe default-frame-alist)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
124 (right-pair (assq 'right-fringe default-frame-alist)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
125 (left (cdr left-pair)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
126 (right (cdr right-pair))) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
127 (if (or left-pair right-pair) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
128 ;; If there's something in default-frame-alist for fringes, |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
129 ;; don't change it, but reflect that into the value of fringe-mode. |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
130 (progn |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
131 (setq fringe-mode (cons left right)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
132 (if (equal fringe-mode '(nil . nil)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
133 (setq fringe-mode nil)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
134 (if (equal fringe-mode '(0 . 0)) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
135 (setq fringe-mode 0))) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
136 ;; Otherwise impose the user-specified value of fringe-mode. |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
137 (custom-initialize-reset symbol value)))) |
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
138 |
110426
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
139 (defconst fringe-styles |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
140 '(("default" . nil) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
141 ("no-fringes" . 0) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
142 ("right-only" . (0 . nil)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
143 ("left-only" . (nil . 0)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
144 ("half-width" . (4 . 4)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
145 ("minimal" . (1 . 1)))) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
146 |
45493 | 147 (defcustom fringe-mode nil |
100171 | 148 "Specify appearance of fringes on all frames. |
45493 | 149 This variable can be nil (the default) meaning the fringes should have |
150 the default width (8 pixels), it can be an integer value specifying | |
151 the width of both left and right fringe (where 0 means no fringe), or | |
152 a cons cell where car indicates width of left fringe and cdr indicates | |
153 width of right fringe (where again 0 can be used to indicate no | |
154 fringe). | |
110409
42d133e002e5
Mention rounding of fringe width in the doc string of fringe-mode.
Eli Zaretskii <eliz@gnu.org>
parents:
110399
diff
changeset
|
155 Note that the actual width may be rounded up to ensure that the sum of |
42d133e002e5
Mention rounding of fringe width in the doc string of fringe-mode.
Eli Zaretskii <eliz@gnu.org>
parents:
110399
diff
changeset
|
156 the width of the left and right fringes is a multiple of the frame's |
42d133e002e5
Mention rounding of fringe width in the doc string of fringe-mode.
Eli Zaretskii <eliz@gnu.org>
parents:
110399
diff
changeset
|
157 character width. However, a fringe width of 0 is never rounded. |
45493 | 158 To set this variable in a Lisp program, use `set-fringe-mode' to make |
159 it take real effect. | |
160 Setting the variable with a customization buffer also takes effect. | |
161 If you only want to modify the appearance of the fringe in one frame, | |
64192
258eefd93f5c
(fringe-mode): Add period in docstring.
Juri Linkov <juri@jurta.org>
parents:
64180
diff
changeset
|
162 you can use the interactive function `set-fringe-style'." |
110426
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
163 :type `(choice |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
164 ,@ (mapcar (lambda (style) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
165 (let ((name |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
166 (replace-regexp-in-string "-" " " (car style)))) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
167 `(const :tag |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
168 ,(concat (capitalize (substring name 0 1)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
169 (substring name 1)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
170 ,(cdr style)))) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
171 fringe-styles) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
172 (integer :tag "Specific width") |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
173 (cons :tag "Different left/right sizes" |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
174 (integer :tag "Left width") |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
175 (integer :tag "Right width"))) |
58597 | 176 :group 'fringe |
45493 | 177 :require 'fringe |
57538
6f85a547ab10
(fringe-mode-initialize): New function.
Richard M. Stallman <rms@gnu.org>
parents:
57507
diff
changeset
|
178 :initialize 'fringe-mode-initialize |
45493 | 179 :set 'set-fringe-mode-1) |
180 | |
87702
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
181 ;; We just set fringe-mode, but that was the default. |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
182 ;; If it is set again, that is for real. |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
183 (setq fringe-mode-explicit t) |
7ebe288dfbd0
(fringe-mode-explicit): New variable.
Martin Rudalics <rudalics@gmx.at>
parents:
87649
diff
changeset
|
184 |
45493 | 185 (defun fringe-query-style (&optional all-frames) |
186 "Query user for fringe style. | |
187 Returns values suitable for left-fringe and right-fringe frame parameters. | |
188 If ALL-FRAMES, the negation of the fringe values in | |
189 `default-frame-alist' is used when user enters the empty string. | |
190 Otherwise the negation of the fringe value in the currently selected | |
191 frame parameter is used." | |
110426
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
192 (let* ((mode (completing-read |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
193 (concat |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
194 "Select fringe mode for " |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
195 (if all-frames "all frames" "selected frame") |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
196 " (type ? for list): ") |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
197 fringe-styles nil t)) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
198 (style (assoc (downcase mode) fringe-styles))) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
199 (if style (cdr style) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
200 (if (eq 0 (cdr (assq 'left-fringe |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
201 (if all-frames |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
202 default-frame-alist |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
203 (frame-parameters (selected-frame)))))) |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
204 nil |
cd8d9630f156
* lisp/fringe.el (fringe-styles): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110409
diff
changeset
|
205 0)))) |
45493 | 206 |
207 (defun fringe-mode (&optional mode) | |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
208 "Set the default appearance of fringes on all frames. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
209 |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
210 When called interactively, query the user for MODE. Valid values |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
211 for MODE include `none', `default', `left-only', `right-only', |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
212 `minimal' and `half'. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
213 |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
214 When used in a Lisp program, MODE can be a cons cell where the |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
215 integer in car specifies the left fringe width and the integer in |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
216 cdr specifies the right fringe width. MODE can also be a single |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
217 integer that specifies both the left and the right fringe width. |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
218 If a fringe width specification is nil, that means to use the |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
219 default width (8 pixels). This command may round up the left and |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
220 right width specifications to ensure that their sum is a multiple |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
221 of the character width of a frame. It never rounds up a fringe |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
222 width of 0. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
223 |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
224 Fringe widths set by `set-window-fringes' override the default |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
225 fringe widths set by this command. This command applies to all |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
226 frames that exist and frames to be created in the future. If you |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
227 want to set the default appearance of fringes on the selected |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
228 frame only, see the command `set-fringe-style'." |
45493 | 229 (interactive (list (fringe-query-style 'all-frames))) |
230 (set-fringe-mode mode)) | |
231 | |
232 (defun set-fringe-style (&optional mode) | |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
233 "Set the default appearance of fringes on the selected frame. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
234 |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
235 When called interactively, query the user for MODE. Valid values |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
236 for MODE include `none', `default', `left-only', `right-only', |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
237 `minimal' and `half'. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
238 |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
239 When used in a Lisp program, MODE can be a cons cell where the |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
240 integer in car specifies the left fringe width and the integer in |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
241 cdr specifies the right fringe width. MODE can also be a single |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
242 integer that specifies both the left and the right fringe width. |
52854
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
243 If a fringe width specification is nil, that means to use the |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
244 default width (8 pixels). This command may round up the left and |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
245 right width specifications to ensure that their sum is a multiple |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
246 of the character width of a frame. It never rounds up a fringe |
f6ac1fc587f8
(fringe-mode): Use active voice in docstring.
Lute Kamstra <lute@gnu.org>
parents:
52832
diff
changeset
|
247 width of 0. |
52832
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
248 |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
249 Fringe widths set by `set-window-fringes' override the default |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
250 fringe widths set by this command. If you want to set the |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
251 default appearance of fringes on all frames, see the command |
43bad0db6791
(fringe-mode): Fix docstring.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
252 `fringe-mode'." |
45493 | 253 (interactive (list (fringe-query-style))) |
254 (modify-frame-parameters | |
255 (selected-frame) | |
256 (list (cons 'left-fringe (if (consp mode) (car mode) mode)) | |
257 (cons 'right-fringe (if (consp mode) (cdr mode) mode))))) | |
258 | |
54399
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
259 (defsubst fringe-columns (side &optional real) |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
260 "Return the width, measured in columns, of the fringe area on SIDE. |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
261 If optional argument REAL is non-nil, return a real floating point |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
262 number instead of a rounded integer value. |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
263 SIDE must be the symbol `left' or `right'." |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
264 (funcall (if real '/ 'ceiling) |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
265 (or (funcall (if (eq side 'left) 'car 'cadr) |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
266 (window-fringes)) |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
267 0) |
ad02f6299e9a
2004-03-15 Masatake YAMATO <jet@gyve.org>
Masatake YAMATO <jet@gyve.org>
parents:
53890
diff
changeset
|
268 (float (frame-char-width)))) |
57261
075de3b1e798
(fringe-bitmap-p): New macro.
Kim F. Storm <storm@cua.dk>
parents:
54399
diff
changeset
|
269 |
45493 | 270 (provide 'fringe) |
271 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87702
diff
changeset
|
272 ;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d |
45493 | 273 ;;; fringe.el ends here |