comparison lisp/fringe.el @ 57538:6f85a547ab10

(fringe-mode-initialize): New function. (fringe-mode): Use fringe-mode-initialize as :initialize.
author Richard M. Stallman <rms@gnu.org>
date Sun, 17 Oct 2004 06:49:55 +0000
parents 6024cd83cb88
children fa269b651143 f3ec05478165
comparison
equal deleted inserted replaced
57537:b9687fdf909d 57538:6f85a547ab10
110 fringe-mode)) 110 fringe-mode))
111 (cons 'right-fringe (if (consp fringe-mode) 111 (cons 'right-fringe (if (consp fringe-mode)
112 (cdr fringe-mode) 112 (cdr fringe-mode)
113 fringe-mode)))) 113 fringe-mode))))
114 (setq frames (cdr frames))))) 114 (setq frames (cdr frames)))))
115
116 ;; For initialization of fringe-mode, take account of changes
117 ;; made explicitly to default-frame-alist.
118 (defun fringe-mode-initialize (symbol value)
119 (let* ((left-pair (assq 'left-fringe default-frame-alist))
120 (right-pair (assq 'right-fringe default-frame-alist))
121 (left (cdr left-pair))
122 (right (cdr right-pair)))
123 (if (or left-pair right-pair)
124 ;; If there's something in default-frame-alist for fringes,
125 ;; don't change it, but reflect that into the value of fringe-mode.
126 (progn
127 (setq fringe-mode (cons left right))
128 (if (equal fringe-mode '(nil . nil))
129 (setq fringe-mode nil))
130 (if (equal fringe-mode '(0 . 0))
131 (setq fringe-mode 0)))
132 ;; Otherwise impose the user-specified value of fringe-mode.
133 (custom-initialize-reset symbol value))))
115 134
116 ;;;###autoload 135 ;;;###autoload
117 (defcustom fringe-mode nil 136 (defcustom fringe-mode nil
118 "*Specify appearance of fringes on all frames. 137 "*Specify appearance of fringes on all frames.
119 This variable can be nil (the default) meaning the fringes should have 138 This variable can be nil (the default) meaning the fringes should have
137 (cons :tag "Different left/right sizes" 156 (cons :tag "Different left/right sizes"
138 (integer :tag "Left width") 157 (integer :tag "Left width")
139 (integer :tag "Right width"))) 158 (integer :tag "Right width")))
140 :group 'frames 159 :group 'frames
141 :require 'fringe 160 :require 'fringe
161 :initialize 'fringe-mode-initialize
142 :set 'set-fringe-mode-1) 162 :set 'set-fringe-mode-1)
143 163
144 (defun fringe-query-style (&optional all-frames) 164 (defun fringe-query-style (&optional all-frames)
145 "Query user for fringe style. 165 "Query user for fringe style.
146 Returns values suitable for left-fringe and right-fringe frame parameters. 166 Returns values suitable for left-fringe and right-fringe frame parameters.