annotate lisp/fringe.el @ 51415:762217a72cae

Long overdue merge. Don't require `compile' since it seems unnecessary. For all internal variables and functions the docstring comments have been converted into proper docstrings (bibtex-maintainer-address, bibtex-maintainer-salutation) (bibtex-version): Remove support for bug reporting. (bibtex-field-delimiters, bibtex-entry-delimiters) (bibtex-sort-ignore-string-entries, bibtex-maintain-sorted-entries) Replace make-variable-buffer-local by make-local-variable for (bibtex-entry-format): New tag `required-fields'. (bibtex-maintain-sorted-entries): New var. (bibtex-sort-entry-class, bibtex-sort-entry-class-alist): New vars. (bibtex-predefined-month-strings, bibtex-predefined-strings): Make into alists with pairs (abbreviation expansion). (bibtex-autokey-titleword-change-strings) (bibtex-autokey-transcriptions): Make into alists. Add new replacement pairs. (bibtex-autokey-use-crossref): New var. Replace bibtex-autokey-year-use-crossref-entry because updated code for autokey generation handles crossrefs independently of particular fields. (bibtex-reference-key, bibtex-mode-syntax-table): Remove = because it can't be part of a string's key. (bibtex-complete-key-cleanup): New var. (bibtex-complete): Merge bibtex-complete-string and bibtex-complete-key into it (and bind to M-tab). (bibtex-valid-entry-re, bibtex-any-valid-entry-re) (bibtex-valid-entry-whitespace-re, bibtex-empty-field-re) (bibtex-quoted-string-re): New vars. (bibtex-field-name-for-parsing): Don't make-variable-buffer-local. (zmacs-regions): Declare to quieten the byte-compiler. (bibtex-comment-start): Don't include the space. (bibtex-font-lock-syntactic-keywords): New var. (bibtex-font-lock-keywords): Remove the entry for @Comment. (bibtex-parse-field-string): Merge the functionality of bibtex-parse-field-string-braced, bibtex-parse-quoted-string and bibtex-parse-field-string-quoted. (bibtex-search-forward-field-string): Remove. (bibtex-parse-association): Use when. (bibtex-parse-field-name): Use when. (bibtex-parse-field-text): Use when and cond. (bibtex-parse-field): Use let. (bibtex-search-forward-field, bibtex-search-backward-field): Make bound optional, use let, setq, and cddr. (bibtex-start-of-field, bibtex-start-of-name-in-field) (bibtex-end-of-name-in-field): Use nth. (bibtex-name-in-field, bibtex-text-in-field-bounds) (bibtex-text-in-field, bibtex-type-in-head, bibtex-key-in-head) (bibtex-text-in-string): New functions. (bibtex-reference-key-in-string): New fun. Merge of bibtex-start-of-reference-key-in-string and bibtex-end-of-reference-key-in-string. (bibtex-parse-string-prefix): Use let and when. (bibtex-parse-string-postfix): Use when. (bibtex-search-forward-string, bibtex-search-backward-string): Use save-excursion and setq. (bibtex-member-of-regexp): Use let. (bibtex-assoc-of-regexp): Use caar und let. (bibtex-skip-to-valid-entry): Return buffer position. (bibtex-map-entries): Use save-excursion. (bibtex-progress-message): Simplify. (bibtex-search-entry): Use skip-chars-forward, when, save-match-data. (bibtex-move-outside-of-entry): Handle the case that point is before first entry. (bibtex-enclosing-field): Use save-excursion, when. (bibtex-format-field-delimiters): Merge into bibtex-format-entry. (bibtex-enclosing-entry-maybe-empty-head): Simplify. (bibtex-format-entry): Simplify. Handle new tag required-fields of bibtex-entry-format. (bibtex-autokey-abbrev): Accept negative values of len. (bibtex-autokey-get-field, bibtex-autokey-demangle-title): New funs. (bibtex-autokey-get-namefield, bibtex-autokey-get-namelist) (bibtex-autokey-get-yearfield-digits, bibtex-autokey-get-yearfield) (bibtex-autokey-get-titlestring): Remove. (bibtex-autokey-get-names): Simplify. (bibtex-autokey-get-titles): Rename to bibtex-autokey-get-title. (bibtex-autokey-demangle-name): Simplify, avoid error messages. (bibtex-generate-autokey): Simplify. (bibtex-parse-keys): Simplify, use push. (bibtex-parse-strings): New fun similar to bibtex-parse-keys. (bibtex-string-files-init): New fun. (bibtex-parse-buffers-stealthily): Use bibtex-parse-keys, bibtex-string-files-init and bibtex-parse-strings. (bibtex-complete): Rename to bibtex-complete-internal, use push, bibtex-reference-key-in-string, no sorting. (bibtex-complete-string-cleanup): New fun, displays expansion of completed strings. (bibtex-choose-completion-string): New fun. Required for choose-completion-string-functions. (bibtex-do-auto-fill): Remove. Set fill-prefix in bibtex-mode. (bibtex-pop): Simplify. (bibtex-mode): Move setting of bibtex-string to bibtex-parse-strings. Set choose-completion-string-functions. (bibtex-print-help-message,bibtex-make-field, bibtex-end-of-entry) (bibtex-count-entries): Simplify. (bibtex-entry-index, bibtex-lessp): New funs for generalized sorting scheme of indices, see bibtex-maintain-sorted-entries. (bibtex-sort-buffer): Use bibtex-lessp for sorting. (bibtex-find-crossref, bibtex-find-entry): New funs. (bibtex-find-entry-location): Rename to bibtex-prepare-new-entry, use bibtex-lessp, Simplify. (bibtex-validate): Simplify. Fixe bug of internal variable questionable-month. (bibtex-remove-OPT-or-ALT): Use when. (bibtex-remove-delimiters, bibtex-kill-field, bibtex-kill-entry) (bibtex-clean-entry, bibtex-fill-entry, bibtex-reformat): Simplify. (bibtex-convert-alien): Use deactivate-mark rather than the non-existent bibtex-mark-active variable. (bibtex-complete-string, bibtex-complete-key): Merge into new `smart' defun bibtex-complete. (bibtex-String): Update for new sorting scheme, distinguish empty and non-empty key strings.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 02 Jun 2003 22:30:09 +0000
parents 7efc8970b32c
children 695cf19ef79e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
1 ;;; fringe.el --- change fringes appearance in various ways
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
2
50127
7efc8970b32c (fringe-mode): Autoload so that
Simon Josefsson <jas@extundo.com>
parents: 45524
diff changeset
3 ;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
4
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
5 ;; Author: Simon Josefsson <simon@josefsson.org>
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
6 ;; Maintainer: FSF
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
7 ;; Keywords: frames
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
8
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
10
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
14 ;; any later version.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
15
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
19 ;; GNU General Public License for more details.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
20
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
25
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
26 ;;; Commentary:
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
27
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
28 ;; This file contains helpful functions for customizing the appearance
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
29 ;; of the fringe.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
30
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
31 ;; The code is influenced by scroll-bar.el and avoid.el. The author
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
32 ;; gratefully acknowledge comments and suggestions made by Miles
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
33 ;; Bader, Eli Zaretski, Richard Stallman, Pavel Janík and others which
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
34 ;; improved this package.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
35
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
36 ;;; Code:
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
37
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
38 (defvar fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
39
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
40 (defun set-fringe-mode-1 (ignore value)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
41 "Call `set-fringe-mode' with VALUE.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
42 See `fringe-mode' for valid values and their effect.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
43 This is usually invoked when setting `fringe-mode' via customize."
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
44 (set-fringe-mode value))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
45
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
46 (defun set-fringe-mode (value)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
47 "Set `fringe-mode' to VALUE and put the new value into effect.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
48 See `fringe-mode' for possible values and their effect."
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
49 (setq fringe-mode value)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
50
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
51 ;; Apply it to default-frame-alist.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
52 (let ((parameter (assq 'left-fringe default-frame-alist)))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
53 (if (consp parameter)
45524
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
54 (setcdr parameter (if (consp fringe-mode)
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
55 (car fringe-mode)
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
56 fringe-mode))
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
57 (setq default-frame-alist
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
58 (cons (cons 'left-fringe (if (consp fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
59 (car fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
60 fringe-mode))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
61 default-frame-alist))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
62 (let ((parameter (assq 'right-fringe default-frame-alist)))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
63 (if (consp parameter)
45524
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
64 (setcdr parameter (if (consp fringe-mode)
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
65 (cdr fringe-mode)
f48a8ed9d03a (set-fringe-mode): Work when updating
Simon Josefsson <jas@extundo.com>
parents: 45518
diff changeset
66 fringe-mode))
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
67 (setq default-frame-alist
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
68 (cons (cons 'right-fringe (if (consp fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
69 (cdr fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
70 fringe-mode))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
71 default-frame-alist))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
72
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
73 ;; Apply it to existing frames.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
74 (let ((frames (frame-list)))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
75 (while frames
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
76 (modify-frame-parameters
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
77 (car frames)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
78 (list (cons 'left-fringe (if (consp fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
79 (car fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
80 fringe-mode))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
81 (cons 'right-fringe (if (consp fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
82 (cdr fringe-mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
83 fringe-mode))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
84 (setq frames (cdr frames)))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
85
50127
7efc8970b32c (fringe-mode): Autoload so that
Simon Josefsson <jas@extundo.com>
parents: 45524
diff changeset
86 ;;;###autoload
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
87 (defcustom fringe-mode nil
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
88 "*Specify appearance of fringes on all frames.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
89 This variable can be nil (the default) meaning the fringes should have
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
90 the default width (8 pixels), it can be an integer value specifying
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
91 the width of both left and right fringe (where 0 means no fringe), or
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
92 a cons cell where car indicates width of left fringe and cdr indicates
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
93 width of right fringe (where again 0 can be used to indicate no
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
94 fringe).
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
95 To set this variable in a Lisp program, use `set-fringe-mode' to make
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
96 it take real effect.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
97 Setting the variable with a customization buffer also takes effect.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
98 If you only want to modify the appearance of the fringe in one frame,
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
99 you can use the interactive function `toggle-fringe'"
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
100 :type '(choice (const :tag "Default width" nil)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
101 (const :tag "No fringes" 0)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
102 (const :tag "Only right" (0 . nil))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
103 (const :tag "Only left" (nil . 0))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
104 (const :tag "Half width" (5 . 5))
45518
182c7dd36ef1 Fix :type of `fringe-mode' for last modification.
Simon Josefsson <jas@extundo.com>
parents: 45516
diff changeset
105 (const :tag "Minimal" (1 . 1))
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
106 (integer :tag "Specific width")
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
107 (cons :tag "Different left/right sizes"
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
108 (integer :tag "Left width")
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
109 (integer :tag "Right width")))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
110 :group 'frames
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
111 :require 'fringe
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
112 :set 'set-fringe-mode-1)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
113
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
114 (defun fringe-query-style (&optional all-frames)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
115 "Query user for fringe style.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
116 Returns values suitable for left-fringe and right-fringe frame parameters.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
117 If ALL-FRAMES, the negation of the fringe values in
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
118 `default-frame-alist' is used when user enters the empty string.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
119 Otherwise the negation of the fringe value in the currently selected
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
120 frame parameter is used."
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
121 (let ((mode (intern (completing-read
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
122 "Select fringe mode for all frames (SPACE for list): "
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
123 '(("none") ("default") ("left-only")
45516
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
124 ("right-only") ("half") ("minimal"))
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
125 nil t))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
126 (cond ((eq mode 'none) 0)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
127 ((eq mode 'default) nil)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
128 ((eq mode 'left-only) '(nil . 0))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
129 ((eq mode 'right-only) '(0 . nil))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
130 ((eq mode 'half) '(5 . 5))
45516
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
131 ((eq mode 'minimal) '(1 . 1))
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
132 ((eq mode (intern ""))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
133 (if (eq 0 (cdr (assq 'left-fringe
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
134 (if all-frames
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
135 default-frame-alist
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
136 (frame-parameters (selected-frame))))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
137 nil
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
138 0)))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
139
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
140 ;;;###autoload
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
141 (defun fringe-mode (&optional mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
142 "Toggle appearance of fringes on all frames.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
143 Valid values for MODE include `none', `default', `left-only',
45516
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
144 `right-only', `minimal' and `half'. MODE can also be a cons cell
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
145 where the integer in car will be used as left fringe width and the
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
146 integer in cdr will be used as right fringe width. If MODE is not
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
147 specified, the user is queried.
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
148 It applies to all frames that exist and frames to be created in the
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
149 future.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
150 If you want to set appearance of fringes on the selected frame only,
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
151 see `set-fringe-style'."
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
152 (interactive (list (fringe-query-style 'all-frames)))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
153 (set-fringe-mode mode))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
154
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
155 ;;;###autoload
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
156 (defun set-fringe-style (&optional mode)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
157 "Set appearance of fringes on selected frame.
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
158 Valid values for MODE include `none', `default', `left-only',
45516
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
159 `right-only', `minimal' and `half'. MODE can also be a cons cell
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
160 where the integer in car will be used as left fringe width and the
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
161 integer in cdr will be used as right fringe width. If MODE is not
6b848a738ec6 (fringe-query-style): New fringe style "minimal".
Simon Josefsson <jas@extundo.com>
parents: 45493
diff changeset
162 specified, the user is queried.
45493
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
163 If you want to set appearance of fringes on all frames, see `fringe-mode'."
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
164 (interactive (list (fringe-query-style)))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
165 (modify-frame-parameters
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
166 (selected-frame)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
167 (list (cons 'left-fringe (if (consp mode) (car mode) mode))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
168 (cons 'right-fringe (if (consp mode) (cdr mode) mode)))))
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
169
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
170 (provide 'fringe)
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
171
6d49cede6000 Initial version.
Simon Josefsson <jas@extundo.com>
parents:
diff changeset
172 ;;; fringe.el ends here