diff options
| author | Stefan Monnier | 2010-09-19 11:32:52 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-09-19 11:32:52 +0200 |
| commit | 37c0347eb5a2e197c747a6a11e452041acbe28b3 (patch) | |
| tree | 3d146ad43f835e8241b35317f81dba2357be2e92 | |
| parent | 149caf54c79b771d16f4ce56c5c98a4750ec327f (diff) | |
| download | emacs-37c0347eb5a2e197c747a6a11e452041acbe28b3.tar.gz emacs-37c0347eb5a2e197c747a6a11e452041acbe28b3.zip | |
* lisp/fringe.el (fringe-styles): New var.
(fringe-mode, fringe-query-style): Use it.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/fringe.el | 66 |
2 files changed, 41 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3bc6f5baba..f53ca2b8f3c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,12 @@ | |||
| 1 | 2010-09-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * fringe.el (fringe-styles): New var. | ||
| 4 | (fringe-mode, fringe-query-style): Use it. | ||
| 5 | |||
| 1 | 2010-09-18 Michael R. Mauger <mmaug@yahoo.com> | 6 | 2010-09-18 Michael R. Mauger <mmaug@yahoo.com> |
| 2 | 7 | ||
| 3 | * progmodes/sql.el: Version 2.8 | 8 | * progmodes/sql.el: Version 2.8 |
| 4 | (sql-login-params): Updated widget structure; changes still | 9 | (sql-login-params): Update widget structure; changes still |
| 5 | needed. | 10 | needed. |
| 6 | (sql-product-alist): Add :list-all and :list-table features for | 11 | (sql-product-alist): Add :list-all and :list-table features for |
| 7 | SQLite, Postgres and MySQL products. | 12 | SQLite, Postgres and MySQL products. |
diff --git a/lisp/fringe.el b/lisp/fringe.el index b23cea1c0e7..6f5f496e907 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el | |||
| @@ -136,6 +136,14 @@ See `fringe-mode' for possible values and their effect." | |||
| 136 | ;; Otherwise impose the user-specified value of fringe-mode. | 136 | ;; Otherwise impose the user-specified value of fringe-mode. |
| 137 | (custom-initialize-reset symbol value)))) | 137 | (custom-initialize-reset symbol value)))) |
| 138 | 138 | ||
| 139 | (defconst fringe-styles | ||
| 140 | '(("default" . nil) | ||
| 141 | ("no-fringes" . 0) | ||
| 142 | ("right-only" . (0 . nil)) | ||
| 143 | ("left-only" . (nil . 0)) | ||
| 144 | ("half-width" . (4 . 4)) | ||
| 145 | ("minimal" . (1 . 1)))) | ||
| 146 | |||
| 139 | (defcustom fringe-mode nil | 147 | (defcustom fringe-mode nil |
| 140 | "Specify appearance of fringes on all frames. | 148 | "Specify appearance of fringes on all frames. |
| 141 | This variable can be nil (the default) meaning the fringes should have | 149 | This variable can be nil (the default) meaning the fringes should have |
| @@ -152,16 +160,19 @@ it take real effect. | |||
| 152 | Setting the variable with a customization buffer also takes effect. | 160 | Setting the variable with a customization buffer also takes effect. |
| 153 | If you only want to modify the appearance of the fringe in one frame, | 161 | If you only want to modify the appearance of the fringe in one frame, |
| 154 | you can use the interactive function `set-fringe-style'." | 162 | you can use the interactive function `set-fringe-style'." |
| 155 | :type '(choice (const :tag "Default width" nil) | 163 | :type `(choice |
| 156 | (const :tag "No fringes" 0) | 164 | ,@ (mapcar (lambda (style) |
| 157 | (const :tag "Only right" (0 . nil)) | 165 | (let ((name |
| 158 | (const :tag "Only left" (nil . 0)) | 166 | (replace-regexp-in-string "-" " " (car style)))) |
| 159 | (const :tag "Half width" (4 . 4)) | 167 | `(const :tag |
| 160 | (const :tag "Minimal" (1 . 1)) | 168 | ,(concat (capitalize (substring name 0 1)) |
| 161 | (integer :tag "Specific width") | 169 | (substring name 1)) |
| 162 | (cons :tag "Different left/right sizes" | 170 | ,(cdr style)))) |
| 163 | (integer :tag "Left width") | 171 | fringe-styles) |
| 164 | (integer :tag "Right width"))) | 172 | (integer :tag "Specific width") |
| 173 | (cons :tag "Different left/right sizes" | ||
| 174 | (integer :tag "Left width") | ||
| 175 | (integer :tag "Right width"))) | ||
| 165 | :group 'fringe | 176 | :group 'fringe |
| 166 | :require 'fringe | 177 | :require 'fringe |
| 167 | :initialize 'fringe-mode-initialize | 178 | :initialize 'fringe-mode-initialize |
| @@ -178,27 +189,20 @@ If ALL-FRAMES, the negation of the fringe values in | |||
| 178 | `default-frame-alist' is used when user enters the empty string. | 189 | `default-frame-alist' is used when user enters the empty string. |
| 179 | Otherwise the negation of the fringe value in the currently selected | 190 | Otherwise the negation of the fringe value in the currently selected |
| 180 | frame parameter is used." | 191 | frame parameter is used." |
| 181 | (let ((mode (intern (completing-read | 192 | (let* ((mode (completing-read |
| 182 | (concat | 193 | (concat |
| 183 | "Select fringe mode for " | 194 | "Select fringe mode for " |
| 184 | (if all-frames "all frames" "selected frame") | 195 | (if all-frames "all frames" "selected frame") |
| 185 | " (type ? for list): ") | 196 | " (type ? for list): ") |
| 186 | '(("none") ("default") ("left-only") | 197 | fringe-styles nil t)) |
| 187 | ("right-only") ("half") ("minimal")) | 198 | (style (assoc (downcase mode) fringe-styles))) |
| 188 | nil t)))) | 199 | (if style (cdr style) |
| 189 | (cond ((eq mode 'none) 0) | 200 | (if (eq 0 (cdr (assq 'left-fringe |
| 190 | ((eq mode 'default) nil) | 201 | (if all-frames |
| 191 | ((eq mode 'left-only) '(nil . 0)) | 202 | default-frame-alist |
| 192 | ((eq mode 'right-only) '(0 . nil)) | 203 | (frame-parameters (selected-frame)))))) |
| 193 | ((eq mode 'half) '(4 . 4)) | 204 | nil |
| 194 | ((eq mode 'minimal) '(1 . 1)) | 205 | 0)))) |
| 195 | ((eq mode (intern "")) | ||
| 196 | (if (eq 0 (cdr (assq 'left-fringe | ||
| 197 | (if all-frames | ||
| 198 | default-frame-alist | ||
| 199 | (frame-parameters (selected-frame)))))) | ||
| 200 | nil | ||
| 201 | 0))))) | ||
| 202 | 206 | ||
| 203 | (defun fringe-mode (&optional mode) | 207 | (defun fringe-mode (&optional mode) |
| 204 | "Set the default appearance of fringes on all frames. | 208 | "Set the default appearance of fringes on all frames. |