annotate src/gutter.c @ 853:2b6fa2618f76

[xemacs-hg @ 2002-05-28 08:44:22 by ben] merge my stderr-proc ws make-docfile.c: Fix places where we forget to check for EOF. code-init.el: Don't use CRLF conversion by default on process output. CMD.EXE and friends work both ways but Cygwin programs don't like the CRs. code-process.el, multicast.el, process.el: Removed. Improvements to call-process-internal: -- allows a buffer to be specified for input and stderr output -- use it on all systems -- implement C-g as documented -- clean up and comment call-process-region uses new call-process facilities; no temp file. remove duplicate funs in process.el. comment exactly how coding systems work and fix various problems. open-multicast-group now does similar coding-system frobbing to open-network-stream. dumped-lisp.el, faces.el, msw-faces.el: Fix some hidden errors due to code not being defined at the right time. xemacs.mak: Add -DSTRICT. ================================================================ ALLOW SEPARATION OF STDOUT AND STDERR IN PROCESSES ================================================================ Standard output and standard error can be processed separately in a process. Each can have its own buffer, its own mark in that buffer, and its filter function. You can specify a separate buffer for stderr in `start-process' to get things started, or use the new primitives: set-process-stderr-buffer process-stderr-buffer process-stderr-mark set-process-stderr-filter process-stderr-filter Also, process-send-region takes a 4th optional arg, a buffer. Currently always uses a pipe() under Unix to read the error output. (#### Would a PTY be better?) sysdep.h, sysproc.h, unexfreebsd.c, unexsunos4.c, nt.c, emacs.c, callproc.c, symsinit.h, sysdep.c, Makefile.in.in, process-unix.c: Delete callproc.c. Move child_setup() to process-unix.c. wait_for_termination() now only needed on a few really old systems. console-msw.h, event-Xt.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.h, process-nt.c, process-unix.c, process.c, process.h, procimpl.h: Rewrite the process methods to handle a separate channel for error input. Create Lstreams for reading in the error channel. Many process methods need change. In general the changes are fairly clear as they involve duplicating what's used for reading the normal stdout and changing for stderr -- although tedious, as such changes are required throughout the entire process code. Rewrote the code that reads process output to do two loops, one for stdout and one for stderr. gpmevent.c, tooltalk.c: set_process_filter takes an argument for stderr. ================================================================ NEW ERROR-TRAPPING MECHANISM ================================================================ Totally rewrite error trapping code to be unified and support more features. Basic function is call_trapping_problems(), which lets you specify, by means of flags, what sorts of problems you want trapped. these can include -- quit -- errors -- throws past the function -- creation of "display objects" (e.g. buffers) -- deletion of already-existing "display objects" (e.g. buffers) -- modification of already-existing buffers -- entering the debugger -- gc -- errors->warnings (ala suspended errors) etc. All other error funs rewritten in terms of this one. Various older mechanisms removed or rewritten. window.c, insdel.c, console.c, buffer.c, device.c, frame.c: When creating a display object, added call to note_object_created(), for use with trapping_problems mechanism. When deleting, call check_allowed_operation() and note_object deleted(). The trapping-problems code records the objects created since the call-trapping-problems began. Those objects can be deleted, but none others (i.e. previously existing ones). bytecode.c, cmdloop.c: internal_catch takes another arg. eval.c: Add long comments describing the "five lists" used to maintain state (backtrace, gcpro, specbind, etc.) in the Lisp engine. backtrace.h, eval.c: Implement trapping-problems mechanism, eliminate old mechanisms or redo in terms of new one. frame.c, gutter.c: Flush out the concept of "critical display section", defined by the in_display() var. Use an internal_bind() to get it reset, rather than just doing it at end, because there may be a non-local exit. event-msw.c, event-stream.c, console-msw.h, device.c, dialog-msw.c, frame.c, frame.h, intl.c, toolbar.c, menubar-msw.c, redisplay.c, alloc.c, menubar-x.c: Make use of new trapping-errors stuff and rewrite code based on old mechanisms. glyphs-widget.c, redisplay.h: Protect calling Lisp in redisplay. insdel.c: Protect hooks against deleting existing buffers. frame-msw.c: Use EQ, not EQUAL in hash tables whose keys are just numbers. Otherwise we run into stickiness in redisplay because internal_equal() can QUIT. ================================================================ SIGNAL, C-G CHANGES ================================================================ Here we change the way that C-g interacts with event reading. The idea is that a C-g occurring while we're reading a user event should be read as C-g, but elsewhere should be a QUIT. The former code did all sorts of bizarreness -- requiring that no QUIT occurs anywhere in event-reading code (impossible to enforce given the stuff called or Lisp code invoked), and having some weird system involving enqueue/dequeue of a C-g and interaction with Vquit_flag -- and it didn't work. Now, we simply enclose all code where we want C-g read as an event with {begin/end}_dont_check_for_quit(). This completely turns off the mechanism that checks (and may remove or alter) C-g in the read-ahead queues, so we just get the C-g normal. Signal.c documents this very carefully. cmdloop.c: Correct use of dont_check_for_quit to new scheme, remove old out-of-date comments. event-stream.c: Fix C-g handling to actually work. device-x.c: Disable quit checking when err out. signal.c: Cleanup. Add large descriptive comment. process-unix.c, process-nt.c, sysdep.c: Use QUIT instead of REALLY_QUIT. It's not necessary to use REALLY_QUIT and just confuses the issue. lisp.h: Comment quit handlers. ================================================================ CONS CHANGES ================================================================ free_cons() now takes a Lisp_Object not the result of XCONS(). car and cdr have been renamed so that they don't get used directly; go through XCAR(), XCDR() instead. alloc.c, dired.c, editfns.c, emodules.c, fns.c, glyphs-msw.c, glyphs-x.c, glyphs.c, keymap.c, minibuf.c, search.c, eval.c, lread.c, lisp.h: Correct free_cons calling convention: now takes Lisp_Object, not Lisp_Cons chartab.c: Eliminate direct use of ->car, ->cdr, should be black box. callint.c: Rewrote using EXTERNAL_LIST_LOOP to avoid use of Lisp_Cons. ================================================================ USE INTERNAL-BIND-* ================================================================ eval.c: Cleanups of these funs. alloc.c, fileio.c, undo.c, specifier.c, text.c, profile.c, lread.c, redisplay.c, menubar-x.c, macros.c: Rewrote to use internal_bind_int() and internal_bind_lisp_object() in place of whatever varied and cumbersome mechanisms were formerly there. ================================================================ SPECBIND SANITY ================================================================ backtrace.h: - Improved comments backtrace.h, bytecode.c, eval.c: Add new mechanism check_specbind_stack_sanity() for sanity checking code each time the catchlist or specbind stack change. Removed older prototype of same mechanism. ================================================================ MISC ================================================================ lisp.h, insdel.c, window.c, device.c, console.c, buffer.c: Fleshed out authorship. device-msw.c: Correct bad Unicode-ization. print.c: Be more careful when not initialized or in fatal error handling. search.c: Eliminate running_asynch_code, an FSF holdover. alloc.c: Added comments about gc-cons-threshold. dialog-x.c: Use begin_gc_forbidden() around code to build up a widget value tree, like in menubar-x.c. gui.c: Use Qunbound not Qnil as the default for gethash. lisp-disunion.h, lisp-union.h: Added warnings on use of VOID_TO_LISP(). lisp.h: Use ERROR_CHECK_STRUCTURES to turn on ERROR_CHECK_TRAPPING_PROBLEMS and ERROR_CHECK_TYPECHECK lisp.h: Add assert_with_message. lisp.h: Add macros for gcproing entire arrays. (You could do this before but it required manual twiddling the gcpro structure.) lisp.h: Add prototypes for new functions defined elsewhere.
author ben
date Tue, 28 May 2002 08:45:36 +0000
parents 2b676dc88c66
children 79c6ff3eef26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Gutter implementation.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2 Copyright (C) 1999, 2000 Andy Piper.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* written by Andy Piper <andy@xemacs.org> with specifiers partially
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ripped-off from toolbar.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #include "frame.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #include "device.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 #include "faces.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #include "glyphs.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "redisplay.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 #include "window.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include "gutter.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 Lisp_Object Vgutter[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 Lisp_Object Vgutter_size[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 Lisp_Object Vgutter_visible_p[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 Lisp_Object Vgutter_border_width[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 Lisp_Object Vdefault_gutter_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 Lisp_Object Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 Lisp_Object Qgutter_size;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
50 Lisp_Object Qgutter_visible;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
51 Lisp_Object Qdefault_gutter_position_changed_hook;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
53 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
54 update_gutter_geometry (struct frame *f, enum gutter_pos pos);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 switch (pos) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 case TOP_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 (frame)->top_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 case BOTTOM_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 (frame)->bottom_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 case LEFT_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 (frame)->left_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 case RIGHT_GUTTER: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (frame)->right_gutter_was_visible = flag; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 default: \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 abort (); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 static int gutter_was_visible (struct frame* frame, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 switch (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 case TOP_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 return frame->top_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 case BOTTOM_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 return frame->bottom_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 case LEFT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 return frame->left_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 case RIGHT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 return frame->right_gutter_was_visible;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 abort ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
91 return 0; /* To keep the compiler happy */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
95 #if 0
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 frame_topmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 while (!NILP (XWINDOW (w)->vchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 w = XWINDOW (w)->vchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
110 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 frame_bottommost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 while (!NILP (XWINDOW (w)->vchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 w = XWINDOW (w)->vchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 while (!NILP (XWINDOW (w)->next))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 w = XWINDOW (w)->next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 frame_leftmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 while (!NILP (XWINDOW (w)->hchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 w = XWINDOW (w)->hchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 frame_rightmost_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 Lisp_Object w = FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 do {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 while (!NILP (XWINDOW (w)->hchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 w = XWINDOW (w)->hchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 while (!NILP (XWINDOW (w)->next))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 w = XWINDOW (w)->next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 /* calculate the coordinates of a gutter for the current frame and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 selected window. we have to be careful in calculating this as we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 need to use *two* windows, the currently selected window will give
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 us the actual height, width and contents of the gutter, but if we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 use this for calculating the gutter positions we run into trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 if it is not the window nearest the gutter. Instead we predetermine
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 the nearest window and then use that.*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 int *width, int *height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 struct window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 * bot = XWINDOW (frame_bottommost_window (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 /* The top and bottom gutters take precedence over the left and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 right. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 switch (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 case TOP_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 *x = FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 *y = FRAME_TOP_BORDER_END (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
186 *width = FRAME_RIGHT_BORDER_START (f)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 - FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 *height = FRAME_TOP_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 case BOTTOM_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 *x = FRAME_LEFT_BORDER_END (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
193 *y = WINDOW_BOTTOM (bot);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
194 *width = FRAME_RIGHT_BORDER_START (f)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 - FRAME_LEFT_BORDER_END (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 case LEFT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 *x = FRAME_LEFT_BORDER_END (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
201 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 *width = FRAME_LEFT_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 *height = WINDOW_BOTTOM (bot)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
204 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 break;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
206
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 case RIGHT_GUTTER:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 *x = FRAME_RIGHT_BORDER_START (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 - FRAME_RIGHT_GUTTER_BOUNDS (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
210 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 *width = FRAME_RIGHT_GUTTER_BOUNDS (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 *height = WINDOW_BOTTOM (bot)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
213 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 abort ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
221 /*
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
222 display_boxes_in_gutter_p
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
223
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
224 Determine whether the required display_glyph_area is completely
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
225 inside the gutter. -1 means the display_box is not in the gutter. 1
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
226 means the display_box and the display_glyph_area are in the
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
227 window. 0 means the display_box is in the gutter but the
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
228 display_glyph_area is not. */
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
229 int display_boxes_in_gutter_p (struct frame *f, struct display_box* db,
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
230 struct display_glyph_area* dga)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
231 {
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
232 enum gutter_pos pos;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
233 GUTTER_POS_LOOP (pos)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
234 {
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
235 if (FRAME_GUTTER_VISIBLE (f, pos))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
236 {
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
237 int x, y, width, height;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
238 get_gutter_coords (f, pos, &x, &y, &width, &height);
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
239 if (db->xpos + dga->xoffset >= x
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
240 &&
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
241 db->ypos + dga->yoffset >= y
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
242 &&
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
243 db->xpos + dga->xoffset + dga->width <= x + width
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
244 &&
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
245 db->ypos + dga->yoffset + dga->height <= y + height)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
246 return 1;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
247 else if (db->xpos >= x && db->ypos >= y
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
248 && db->xpos + db->width <= x + width
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
249 && db->ypos + db->height <= y + height)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
250 return 0;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
251 }
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
252 }
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
253 return -1;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
254 }
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
255
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
256 /* Convert the gutter specifier into something we can actually
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
257 display. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
258 static Lisp_Object construct_window_gutter_spec (struct window* w,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
259 enum gutter_pos pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
260 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
261 Lisp_Object rest, *args;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
262 int nargs = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
263 Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
264
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
265 if (STRINGP (gutter) || NILP (gutter))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
266 return gutter;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
267
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
268 GET_LIST_LENGTH (gutter, nargs);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
269 args = alloca_array (Lisp_Object, nargs >> 1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
270 nargs = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
271
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
272 for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
273 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
274 /* We only put things in the real gutter that are declared to be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
275 visible. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
276 if (!CONSP (WINDOW_GUTTER_VISIBLE (w, pos))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
277 ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
278 !NILP (Fmemq (XCAR (rest), WINDOW_GUTTER_VISIBLE (w, pos))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
279 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
280 args [nargs++] = XCAR (XCDR (rest));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
281 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
282 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
283
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
284 return Fconcat (nargs, args);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
285 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
286
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
287 /* Sizing gutters is a pain so we try and help the user by determining
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
288 what height will accommodate all lines. This is useless on left and
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
289 right gutters as we always have a maximal number of lines. */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
290 static int
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
291 calculate_gutter_size_from_display_lines (enum gutter_pos pos,
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
292 display_line_dynarr* ddla)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
293 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
294 int size = 0;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
295 struct display_line *dl;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
296
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
297 /* For top and bottom the calculation is easy. */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
298 if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
299 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
300 /* grab coordinates of last line */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
301 if (Dynarr_length (ddla))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
302 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
303 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
304 size = (dl->ypos + dl->descent - dl->clip)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
305 - (Dynarr_atp (ddla, 0)->ypos - Dynarr_atp (ddla, 0)->ascent);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
306 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
307 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
308 /* For left and right we have to do some maths. */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
309 else
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
310 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
311 int start_pos = 0, end_pos = 0, line;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
312 for (line = 0; line < Dynarr_length (ddla); line++)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
313 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
314 int block;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
315 dl = Dynarr_atp (ddla, line);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
316
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
317 for (block = 0; block < Dynarr_largest (dl->display_blocks); block++)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
318 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
319 struct display_block *db = Dynarr_atp (dl->display_blocks, block);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
320
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
321 if (db->type == TEXT)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
322 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
323 start_pos = min (db->start_pos, start_pos);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
324 end_pos = max (db->end_pos, end_pos);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
325 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
326 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
327 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
328 size = end_pos - start_pos;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
329 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
330
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
331 return size;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
332 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
333
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
334 static Lisp_Object
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
335 calculate_gutter_size (struct window *w, enum gutter_pos pos)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
336 {
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
337 struct frame* f = XFRAME (WINDOW_FRAME (w));
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
338 int count;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
339 display_line_dynarr* ddla;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
340 Lisp_Object ret = Qnil;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
341
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
342 /* degenerate case */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
343 if (NILP (RAW_WINDOW_GUTTER (w, pos))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
344 ||
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
345 !FRAME_VISIBLE_P (f)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
346 ||
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
347 NILP (w->buffer))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
348 return Qnil;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
349
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
350 /* Redisplay code that we use relies on GC not happening. Make it
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
351 so. */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
352 count = begin_gc_forbidden ();
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
353
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
354 ddla = Dynarr_new (display_line);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
355 /* generate some display lines */
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
356 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
357 FRAME_LEFT_BORDER_END (f),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
358 FRAME_TOP_BORDER_END (f),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
359 FRAME_RIGHT_BORDER_START (f)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
360 - FRAME_LEFT_BORDER_END (f),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
361 FRAME_BOTTOM_BORDER_START (f)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
362 - FRAME_TOP_BORDER_END (f),
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
363 ddla, 0, 0);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
364
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
365 /* Let GC happen again. */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
366 unbind_to (count);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
367
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
368 ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla));
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
369 free_display_lines (ddla);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
370
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
371 return ret;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
372 }
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
373
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 static void
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
375 output_gutter (struct frame *f, enum gutter_pos pos, int force)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 struct device *d = XDEVICE (f->device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 struct window* w = XWINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 int x, y, width, height, ypos;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
382 int line, border_width;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
383 face_index findex;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 display_line_dynarr* ddla, *cdla;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
385 struct display_line *dl = 0;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 int cdla_len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
388 if (!WINDOW_LIVE_P (w))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
389 return;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
390
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
391 border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
392 findex = get_builtin_face_cache_index (w, Vwidget_face);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
393
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
394 if (!f->current_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
395 f->current_display_lines[pos] = Dynarr_new (display_line);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
396 if (!f->desired_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
397 f->desired_display_lines[pos] = Dynarr_new (display_line);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
399 ddla = f->desired_display_lines[pos];
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
400 cdla = f->current_display_lines[pos];
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 cdla_len = Dynarr_length (cdla);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
403 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 get_gutter_coords (f, pos, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 /* generate some display lines */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 x + border_width, y + border_width,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
409 width - 2 * border_width,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 height - 2 * border_width, ddla, 0, findex);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
411
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
412 /* We only output the gutter if we think something of significance
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
413 has changed. This is, for example, because redisplay can cause
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
414 new face cache elements to get added causing compare_runes to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
415 fail because the findex for a particular face has changed. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
416 if (force || f->faces_changed || f->frame_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
417 f->gutter_changed || f->glyphs_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
418 f->size_changed || f->subwindows_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
419 w->windows_changed || f->windows_structure_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
420 cdla_len != Dynarr_length (ddla) ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
421 (f->extents_changed && w->gutter_extent_modiff[pos]))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
423 #ifdef DEBUG_GUTTERS
639
4b7d425dd3c2 [xemacs-hg @ 2001-07-28 05:08:58 by andyp]
andyp
parents: 617
diff changeset
424 stderr_out ("gutter redisplay [%s %dx%d@%d+%d] triggered by %s,\n",
4b7d425dd3c2 [xemacs-hg @ 2001-07-28 05:08:58 by andyp]
andyp
parents: 617
diff changeset
425 pos == TOP_GUTTER ? "TOP" :
4b7d425dd3c2 [xemacs-hg @ 2001-07-28 05:08:58 by andyp]
andyp
parents: 617
diff changeset
426 pos == BOTTOM_GUTTER ? "BOTTOM" :
4b7d425dd3c2 [xemacs-hg @ 2001-07-28 05:08:58 by andyp]
andyp
parents: 617
diff changeset
427 pos == LEFT_GUTTER ? "LEFT" : "RIGHT",
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
428 width, height, x, y, force ? "force" :
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
429 f->faces_changed ? "f->faces_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
430 f->frame_changed ? "f->frame_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
431 f->gutter_changed ? "f->gutter_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
432 f->glyphs_changed ? "f->glyphs_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
433 f->size_changed ? "f->size_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
434 f->subwindows_changed ? "f->subwindows_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
435 w->windows_changed ? "w->windows_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
436 f->windows_structure_changed ? "f->windows_structure_changed" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
437 cdla_len != Dynarr_length (ddla) ? "different display structures" :
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
438 f->extents_changed && w->gutter_extent_modiff[pos] ?
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
439 "f->extents_changed && w->gutter_extent_modiff[pos]" : "<null>");
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
440 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
441 /* Output each line. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
442 for (line = 0; line < Dynarr_length (ddla); line++)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
443 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
444 output_display_line (w, cdla, ddla, line, -1, -1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
445 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
446
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
447 /* If the number of display lines has shrunk, adjust. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
448 if (cdla_len > Dynarr_length (ddla))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
449 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
450 Dynarr_length (cdla) = Dynarr_length (ddla);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
451 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
452
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
453 /* grab coordinates of last line and blank after it. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
454 if (Dynarr_length (ddla) > 0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
455 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
456 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
457 ypos = dl->ypos + dl->descent - dl->clip;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
458 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
459 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
460 ypos = y;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
462 redisplay_clear_region (window, findex, x + border_width , ypos,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
463 width - 2 * border_width, height - (ypos - y) - border_width);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
464 /* If, for some reason, we have more to display than we have
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
465 room for, and we are allowed to resize the gutter, then make
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
466 sure this happens before the next time we try and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
467 output. This can happen when face font sizes change. */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
468 if (dl && EQ (w->gutter_size[pos], Qautodetect)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
469 && (dl->clip > 0 ||
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
470 calculate_gutter_size_from_display_lines (pos, ddla) >
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
471 WINDOW_GUTTER_SIZE_INTERNAL (w, pos)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
472 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
473 /* #### Ideally we would just mark the specifier as dirty
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
474 and everything else would "just work". Unfortunately we have
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
475 two problems with this. One is that the specifier cache
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
476 won't be recalculated unless the specifier code thinks the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
477 cached value has actually changed, even though we have
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
478 marked the specifier as dirty. Additionally, although doing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
479 this results in a gutter size change, we never seem to get
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
480 back into redisplay so that the frame size can be updated. I
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
481 think this is because we are already in redisplay and later
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
482 on the frame will be marked as clean. Thus we also have to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
483 force a pending recalculation of the frame size. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
484 w->gutter_size[pos] = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
485 Fset_specifier_dirty_flag (Vgutter_size[pos]);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
486 update_gutter_geometry (f, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
487 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
488
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
489 /* bevel the gutter area if so desired */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
490 if (border_width != 0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
491 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
492 MAYBE_DEVMETH (d, bevel_area,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
493 (w, findex, x, y, width, height, border_width,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
494 EDGE_ALL, EDGE_BEVEL_OUT));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
495 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
496 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
497 else
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
499 /* Nothing of significance happened so sync the display line
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
500 structs. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
501 for (line = 0; line < Dynarr_length (ddla); line++)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
502 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
503 sync_display_line_structs (w, line, 1, cdla, ddla);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
504 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
507 w->gutter_extent_modiff [pos] = 0;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 clear_gutter (struct frame *f, enum gutter_pos pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 face_index findex = get_builtin_face_cache_index (XWINDOW (window),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
516 Vwidget_face);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 get_gutter_coords (f, pos, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 redisplay_clear_region (window, findex, x, y, width, height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
524 /* [[#### I don't currently believe that redisplay needs to mark the
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
525 glyphs in its structures since these will always be referenced from
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
526 somewhere else. However, I'm not sure enough to stake my life on it
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
527 at this point, so we do the safe thing.]]
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
528
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
529 ALWAYS mark everything. --ben */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
530
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
531 /* See the comment in image_instantiate_cache_result as to why marking
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
532 the glyph will also mark the image_instance. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
533 void
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
534 mark_gutters (struct frame *f)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
535 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
536 enum gutter_pos pos;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
537 GUTTER_POS_LOOP (pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
538 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
539 if (f->current_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
540 mark_redisplay_structs (f->current_display_lines[pos]);
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
541 /* [[#### Do we really need to mark the desired lines?]]
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
542 ALWAYS mark everything. --ben */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
543 if (f->desired_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
544 mark_redisplay_structs (f->desired_display_lines[pos]);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
545 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
546 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
547
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
548 /* This is called by extent_changed_for_redisplay, so that redisplay
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
549 knows exactly what extents have changed. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
550 void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
551 gutter_extent_signal_changed_region_maybe (Lisp_Object obj,
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 639
diff changeset
552 Charbpos start, Charbpos end)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
553 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
554 /* #### Start and end are currently ignored but could be used by a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
555 more optimal gutter redisplay. We currently loop over all frames
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
556 here, this could be optimized. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
557 Lisp_Object frmcons, devcons, concons;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
558
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
559 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
560 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
561 struct frame *f = XFRAME (XCAR (frmcons));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
562 enum gutter_pos pos;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
563 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
564 struct window* w = XWINDOW (window);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
565
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
566 GUTTER_POS_LOOP (pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
567 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
568 if (EQ (WINDOW_GUTTER (w, pos), obj))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
569 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
570 w->gutter_extent_modiff[pos]++;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
571 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
572 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
573 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
574 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
575
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
576 /* We have to change the gutter geometry separately to the gutter
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
577 update since it needs to occur outside of redisplay proper. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
578 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
579 update_gutter_geometry (struct frame *f, enum gutter_pos pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
580 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
581 /* If the gutter geometry has changed then re-layout the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
582 frame. If we are in display there is almost no point in doing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
583 anything else since the frame size changes will be delayed
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
584 until we are out of redisplay proper. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
585 if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
586 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
587 int width, height;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
588 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
589 &width, &height);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
590 change_frame_size (f, height, width, 0);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
591 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
592
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
593 /* Mark sizes as up-to-date. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
594 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
595 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
596
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
597 void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
598 update_frame_gutter_geometry (struct frame *f)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
599 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
600 if (f->gutter_changed || f->windows_structure_changed)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
601 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
602 enum gutter_pos pos;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
603
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
604 /* If the gutter geometry has changed then re-layout the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
605 frame. If we are in display there is almost no point in doing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
606 anything else since the frame size changes will be delayed
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
607 until we are out of redisplay proper. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
608 GUTTER_POS_LOOP (pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
609 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
610 update_gutter_geometry (f, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
611 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
612 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
613 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
614
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 update_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
618 if (f->faces_changed || f->frame_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
619 f->gutter_changed || f->glyphs_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
620 f->size_changed || f->subwindows_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
621 f->windows_changed || f->windows_structure_changed ||
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
622 f->extents_changed)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 enum gutter_pos pos;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
625
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 /* We don't actually care about these when outputting the gutter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 so locally disable them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 int local_clip_changed = f->clip_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 int local_buffers_changed = f->buffers_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 f->clip_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 f->buffers_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 /* and output */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 if (FRAME_GUTTER_VISIBLE (f, pos))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
637 output_gutter (f, pos, 0);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
638
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 else if (gutter_was_visible (f, pos))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
640 clear_gutter (f, pos);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
642
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 f->clip_changed = local_clip_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 f->buffers_changed = local_buffers_changed;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 f->gutter_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 reset_gutter_display_lines (struct frame* f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
652 enum gutter_pos pos;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
653 GUTTER_POS_LOOP (pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
654 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
655 if (f->current_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
656 Dynarr_reset (f->current_display_lines[pos]);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
657 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 int width, int height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 int g_x, g_y, g_width, g_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 if (((y + height) < g_y) || (y > (g_y + g_height)) || !height || !width || !g_height || !g_width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 if (((x + width) < g_x) || (x > (g_x + g_width)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
673 #ifdef DEBUG_WIDGETS
639
4b7d425dd3c2 [xemacs-hg @ 2001-07-28 05:08:58 by andyp]
andyp
parents: 617
diff changeset
674 stderr_out ("redrawing gutter after expose %d+%d, %dx%d\n",
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
675 x, y, width, height);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
676 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 /* #### optimize this - redrawing the whole gutter for every expose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 is very expensive. We reset the current display lines because if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 they're being exposed they are no longer current. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 reset_gutter_display_lines (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 /* Even if none of the gutter is in the area, the blank region at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 the very least must be because the first thing we did is verify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 that some portion of the gutter is in the exposed region. */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
685 output_gutter (f, pos, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 redraw_exposed_gutters (struct frame *f, int x, int y, int width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 int height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 enum gutter_pos pos;
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
693 int depth;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
694
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
695 /* We have to be "in display" when we output the gutter - make it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
696 so. */
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
697 depth = enter_redisplay_critical_section ();
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 if (FRAME_GUTTER_VISIBLE (f, pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 redraw_exposed_gutter (f, pos, x, y, width, height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 }
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
703 exit_redisplay_critical_section (depth);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 free_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
709 enum gutter_pos pos;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
710 GUTTER_POS_LOOP (pos)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
712 if (f->current_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
713 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
714 free_display_lines (f->current_display_lines[pos]);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
715 f->current_display_lines[pos] = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
716 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
717 if (f->desired_display_lines[pos])
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
718 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
719 free_display_lines (f->desired_display_lines[pos]);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
720 f->desired_display_lines[pos] = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
721 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 static enum gutter_pos
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726 decode_gutter_position (Lisp_Object position)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 if (EQ (position, Qtop)) return TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 if (EQ (position, Qbottom)) return BOTTOM_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 if (EQ (position, Qleft)) return LEFT_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 if (EQ (position, Qright)) return RIGHT_GUTTER;
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
732 invalid_constant ("Invalid gutter position", position);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733
801
2b676dc88c66 [xemacs-hg @ 2002-04-01 03:58:02 by ben]
ben
parents: 793
diff changeset
734 RETURN_NOT_REACHED (TOP_GUTTER)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 Set the position that the `default-gutter' will be displayed at.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 Valid positions are 'top, 'bottom, 'left and 'right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 See `default-gutter-position'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 (position))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 enum gutter_pos new = decode_gutter_position (position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 if (cur != new)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 {
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
749 int depth;
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
750
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 /* The following calls will automatically cause the dirty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 flags to be set; we delay frame size changes to avoid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 lots of frame flickering. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 /* #### I think this should be GC protected. -sb */
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
755 depth = enter_redisplay_critical_section ();
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 set_specifier_fallback (Vgutter[new], Vdefault_gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 set_specifier_fallback (Vgutter_size[new],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 new == TOP_GUTTER || new == BOTTOM_GUTTER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 ? Vdefault_gutter_height
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 : Vdefault_gutter_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 set_specifier_fallback (Vgutter_border_width[cur],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 list1 (Fcons (Qnil, Qzero)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 set_specifier_fallback (Vgutter_border_width[new],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 Vdefault_gutter_border_width);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
767 set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt)));
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
768 set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
769
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 Vdefault_gutter_position = position;
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
771 exit_redisplay_critical_section (depth);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
774 run_hook (Qdefault_gutter_position_changed_hook);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
775
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 return position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 Return the position that the `default-gutter' will be displayed at.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 The `default-gutter' will only be displayed here if the corresponding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 position-specific gutter specifier does not provide a value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 return Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 Return the pixel width of the gutter at POS in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 POS defaults to the default gutter position. LOCALE defaults to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 the current window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 (pos, locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 enum gutter_pos p = TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 struct frame *f = decode_frame (FW_FRAME (locale));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 if (NILP (pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 pos = Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 p = decode_gutter_position (pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 get_gutter_coords (f, p, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 return make_int (width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 Return the pixel height of the gutter at POS in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 POS defaults to the default gutter position. LOCALE defaults to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 the current window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 (pos, locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 int x, y, width, height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 enum gutter_pos p = TOP_GUTTER;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 struct frame *f = decode_frame (FW_FRAME (locale));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 if (NILP (pos))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 pos = Vdefault_gutter_position;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 p = decode_gutter_position (pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 get_gutter_coords (f, p, &x, &y, &width, &height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 return make_int (height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 DEFINE_SPECIFIER_TYPE (gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 gutter_after_change (Lisp_Object specifier, Lisp_Object locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 gutter_validate (Lisp_Object instantiator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 if (NILP (instantiator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
845 /* Must be a string or a plist. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
846 if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
847 sferror ("Gutter spec must be string, plist or nil", instantiator);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
848
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 if (!STRINGP (instantiator))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
850 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
851 Lisp_Object rest;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
852
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
853 for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
854 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
855 if (!SYMBOLP (XCAR (rest))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
856 || !STRINGP (XCAR (XCDR (rest))))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
857 sferror ("Gutter plist spec must contain strings", instantiator);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
858 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
859 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 Return non-nil if OBJECT is a gutter specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
865 See `make-gutter-specifier' for a description of possible gutter
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
866 instantiators.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 return GUTTER_SPECIFIERP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 Helper for invalidating the real specifier when default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 specifier caching changes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 recompute_overlaying_specifier (Lisp_Object real_one[4])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 Fset_specifier_dirty_flag (real_one[pos]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 gutter_specs_changed (Lisp_Object specifier, struct window *w,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
887 Lisp_Object oldval, enum gutter_pos pos)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
889 w->real_gutter[pos] = construct_window_gutter_spec (w, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
890 w->real_gutter_size[pos] = w->gutter_size[pos];
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
891
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
892 if (EQ (w->real_gutter_size[pos], Qautodetect)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
893 && !NILP (w->gutter_visible_p[pos]))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
895 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 MARK_GUTTER_CHANGED;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
898 MARK_MODELINE_CHANGED;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
902 /* We define all of these so we can access which actual gutter changed. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
903 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
904 top_gutter_specs_changed (Lisp_Object specifier, struct window *w,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
905 Lisp_Object oldval)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
906 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
907 gutter_specs_changed (specifier, w, oldval, TOP_GUTTER);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
908 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
909
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
910 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
911 bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
912 Lisp_Object oldval)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
913 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
914 gutter_specs_changed (specifier, w, oldval, BOTTOM_GUTTER);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
915 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
916
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
917 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
918 left_gutter_specs_changed (Lisp_Object specifier, struct window *w,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
919 Lisp_Object oldval)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
920 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
921 gutter_specs_changed (specifier, w, oldval, LEFT_GUTTER);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
922 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
923
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
924 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
925 right_gutter_specs_changed (Lisp_Object specifier, struct window *w,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
926 Lisp_Object oldval)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
927 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
928 gutter_specs_changed (specifier, w, oldval, RIGHT_GUTTER);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
929 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
930
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 default_gutter_specs_changed (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 recompute_overlaying_specifier (Vgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 w->real_gutter_size[pos] = w->gutter_size[pos];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 if (EQ (w->real_gutter_size[pos], Qautodetect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 && !NILP (w->gutter_visible_p[pos]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
952
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 MARK_GUTTER_CHANGED;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
954 MARK_MODELINE_CHANGED;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 default_gutter_size_changed_in_window (Lisp_Object specifier, struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 recompute_overlaying_specifier (Vgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 default_gutter_border_width_changed_in_window (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 recompute_overlaying_specifier (Vgutter_border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 default_gutter_visible_p_changed_in_window (Lisp_Object specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 struct window *w,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 Lisp_Object oldval)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 recompute_overlaying_specifier (Vgutter_visible_p);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
979 /* Need to reconstruct the gutter specifier as it is affected by the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
980 visibility. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
981 recompute_overlaying_specifier (Vgutter);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 DECLARE_SPECIFIER_TYPE (gutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 #define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 DEFINE_SPECIFIER_TYPE (gutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 gutter_size_validate (Lisp_Object instantiator)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 if (NILP (instantiator))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 if (!INTP (instantiator) && !EQ (instantiator, Qautodetect))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
996 invalid_argument ("Gutter size must be an integer or 'autodetect", instantiator);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000 Return non-nil if OBJECT is a gutter-size specifier.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1001
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1002 See `make-gutter-size-specifier' for a description of possible gutter-size
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1003 instantiators.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1010 DECLARE_SPECIFIER_TYPE (gutter_visible);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1011 #define GUTTER_VISIBLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_visible)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1012 DEFINE_SPECIFIER_TYPE (gutter_visible);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1013
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1014 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1015 gutter_visible_validate (Lisp_Object instantiator)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1016 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1017 if (NILP (instantiator))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1018 return;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1019
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1020 if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
1021 invalid_argument ("Gutter visibility must be a boolean or list of symbols",
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1022 instantiator);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1023
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1024 if (CONSP (instantiator))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1025 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1026 Lisp_Object rest;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1027
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1028 EXTERNAL_LIST_LOOP (rest, instantiator)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1029 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1030 if (!SYMBOLP (XCAR (rest)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
1031 invalid_argument ("Gutter visibility must be a boolean or list of symbols",
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1032 instantiator);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1033 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1034 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1035 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1036
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1037 DEFUN ("gutter-visible-specifier-p", Fgutter_visible_specifier_p, 1, 1, 0, /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1038 Return non-nil if OBJECT is a gutter-visible specifier.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1039
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1040 See `make-gutter-visible-specifier' for a description of possible
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1041 gutter-visible instantiators.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1042 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1043 (object))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1044 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1045 return GUTTER_VISIBLE_SPECIFIERP (object) ? Qt : Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1046 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1047
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 Ensure that all gutters are correctly showing their gutter specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 Lisp_Object devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 DEVICE_LOOP_NO_BREAK (devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 struct device *d = XDEVICE (XCAR (devcons));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 Lisp_Object frmcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 DEVICE_FRAME_LOOP (frmcons, d)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 struct frame *f = XFRAME (XCAR (frmcons));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1064 MAYBE_DEVMETH (d, frame_output_begin, (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1065
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1066 /* Sequence is quite important here. We not only want to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1067 redisplay the gutter area but we also want to flush any
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1068 frame size changes out so that the gutter redisplay happens
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1069 in a kosha environment.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1070
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1071 This is not only so that things look right but so that
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1072 glyph redisplay optimization kicks in, by default display
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1073 lines will be completely re-output if
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1074 f->windows_structure_changed is 1, and this is true if
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1075 frame size changes haven't been flushed out. Once frame
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1076 size changes have been flushed out we then need to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1077 redisplay the frame in order to flush out pending window
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1078 size changes. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1079 update_frame_gutter_geometry (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1081 if (f->windows_structure_changed)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1082 redisplay_frame (f, 1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1083 else if (FRAME_REPAINT_P (f))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1084 {
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
1085 int depth;
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
1086
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1087 /* We have to be "in display" when we output the gutter
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1088 - make it so. */
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
1089 depth = enter_redisplay_critical_section ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1090 update_frame_gutters (f);
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 801
diff changeset
1091 exit_redisplay_critical_section (depth);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1092 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1093
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1094 MAYBE_DEVMETH (d, frame_output_end, (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1095 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1096
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1097 d->gutter_changed = 0;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1100 /* This is so that further changes to the gutters will trigger redisplay. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1101 gutter_changed_set = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1102 gutter_changed = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1103
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 init_frame_gutters (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 enum gutter_pos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 /* We are here as far in frame creation so cached specifiers are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 already recomputed, and possibly modified by resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 initialization. We need to recalculate autodetected gutters. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 GUTTER_POS_LOOP (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1117 w->real_gutter[pos] = construct_window_gutter_spec (w, pos);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 w->real_gutter_size[pos] = w->gutter_size[pos];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 if (EQ (w->gutter_size[pos], Qautodetect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 && !NILP (w->gutter_visible_p[pos]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 MARK_WINDOWS_CHANGED (w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1127
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1128 /* Keep a record of the current sizes of things. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1129 GUTTER_POS_LOOP (pos)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1130 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1131 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1132 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 syms_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 DEFSUBR (Fgutter_specifier_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 DEFSUBR (Fgutter_size_specifier_p);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1140 DEFSUBR (Fgutter_visible_specifier_p);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 DEFSUBR (Fset_default_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 DEFSUBR (Fdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 DEFSUBR (Fgutter_pixel_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 DEFSUBR (Fgutter_pixel_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 DEFSUBR (Fredisplay_gutter_area);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
1147 DEFSYMBOL (Qgutter_size);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
1148 DEFSYMBOL (Qgutter_visible);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 462
diff changeset
1149 DEFSYMBOL (Qdefault_gutter_position_changed_hook);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 vars_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 staticpro (&Vdefault_gutter_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 Vdefault_gutter_position = Qtop;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 Fprovide (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 specifier_type_create_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 SPECIFIER_HAS_METHOD (gutter, validate);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 SPECIFIER_HAS_METHOD (gutter, after_change);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p");
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1169 SPECIFIER_HAS_METHOD (gutter_size, validate);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1171 INITIALIZE_SPECIFIER_TYPE (gutter_visible, "gutter-visible", "gutter-visible-specifier-p");
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1172 SPECIFIER_HAS_METHOD (gutter_visible, validate);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 reinit_specifier_type_create_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 REINITIALIZE_SPECIFIER_TYPE (gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 REINITIALIZE_SPECIFIER_TYPE (gutter_size);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1180 REINITIALIZE_SPECIFIER_TYPE (gutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 specifier_vars_of_gutter (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 Lisp_Object fb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 Specifier for a fallback gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 The position of this gutter is specified in the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 `default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 gutter (e.g. `top-gutter' if `default-gutter-position' is 'top)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 does not specify a gutter in a particular domain (usually a window),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 then the value of `default-gutter' in that domain, if any, will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 used instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 Note that the gutter at any particular position will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 displayed unless its visibility flag is true and its thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 \(width or height, depending on orientation) is non-zero. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 visibility is controlled by the specifiers `top-gutter-visible-p',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 `bottom-gutter-visible-p', `left-gutter-visible-p', and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 `right-gutter-visible-p', and the thickness is controlled by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 specifiers `top-gutter-height', `bottom-gutter-height',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 `left-gutter-width', and `right-gutter-width'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 Note that one of the four visibility specifiers inherits from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 `default-gutter-visibility' and one of the four thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 specifiers inherits from either `default-gutter-width' or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 `default-gutter-height' (depending on orientation), just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 like for the gutter description specifiers (e.g. `top-gutter')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 mentioned above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 Therefore, if you are setting `default-gutter', you should control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 the visibility and thickness using `default-gutter-visible-p',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 `default-gutter-width', and `default-gutter-height', rather than
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 using position-specific specifiers. That way, you will get sane
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 behavior if the user changes the default gutter position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1221 The gutter value should be a string, a property list of strings or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1222 nil. You can attach extents and glyphs to the string and hence display
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1223 glyphs and text in other fonts in the gutter area. If the gutter value
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1224 is a property list then the strings will be concatenated together
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1225 before being displayed. */ );
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 Vdefault_gutter = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 /* #### It would be even nicer if the specifier caching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 automatically knew about specifier fallbacks, so we didn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 have to do it ourselves. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 set_specifier_caching (Vdefault_gutter,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1232 offsetof (struct window, default_gutter),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 default_gutter_specs_changed,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1234 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 DEFVAR_SPECIFIER ("top-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 &Vgutter[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 Specifier for the gutter at the top of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 set_specifier_caching (Vgutter[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1244 offsetof (struct window, gutter[TOP_GUTTER]),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1245 top_gutter_specs_changed,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1246 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 DEFVAR_SPECIFIER ("bottom-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 &Vgutter[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 Specifier for the gutter at the bottom of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 Note that, unless the `default-gutter-position' is `bottom', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 default the height of the bottom gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 `bottom-gutter-height') is 0; thus, a bottom gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 displayed even if you provide a value for `bottom-gutter'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 set_specifier_caching (Vgutter[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1261 offsetof (struct window, gutter[BOTTOM_GUTTER]),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1262 bottom_gutter_specs_changed,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1263 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 DEFVAR_SPECIFIER ("left-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 &Vgutter[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 Specifier for the gutter at the left edge of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 Note that, unless the `default-gutter-position' is `left', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 default the height of the left gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 `left-gutter-width') is 0; thus, a left gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 displayed even if you provide a value for `left-gutter'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 set_specifier_caching (Vgutter[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1278 offsetof (struct window, gutter[LEFT_GUTTER]),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1279 left_gutter_specs_changed,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1280 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 DEFVAR_SPECIFIER ("right-gutter",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 &Vgutter[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 Specifier for the gutter at the right edge of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 Use `set-specifier' to change this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 See `default-gutter' for a description of a valid gutter instantiator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 Note that, unless the `default-gutter-position' is `right', by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 default the height of the right gutter (controlled by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 `right-gutter-width') is 0; thus, a right gutter will not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 displayed even if you provide a value for `right-gutter'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 set_specifier_caching (Vgutter[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1295 offsetof (struct window, gutter[RIGHT_GUTTER]),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1296 right_gutter_specs_changed,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1297 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 /* initially, top inherits from default; this can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 changed with `set-default-gutter-position'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 fb = list1 (Fcons (Qnil, Qnil));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302 set_specifier_fallback (Vdefault_gutter, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 set_specifier_fallback (Vgutter[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 *Height of the default gutter, if it's oriented horizontally.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314 gutter thickness specifier (e.g. `top-gutter-height' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 `default-gutter-position' is 'top) does not specify a thickness in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 particular domain (a window or a frame), then the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 `default-gutter-height' or `default-gutter-width' (depending on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 gutter orientation) in that domain, if any, will be used instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 Note that `default-gutter-height' is only used when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 `default-gutter-position' is 'top or 'bottom, and `default-gutter-width'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 is only used when `default-gutter-position' is 'left or 'right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 Note that all of the position-specific gutter thickness specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 have a fallback value of zero when they do not correspond to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326 default gutter. Therefore, you will have to set a non-zero thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 value if you want a position-specific gutter to be displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 If you set the height to 'autodetect the size of the gutter will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 calculated to be large enough to hold the contents of the gutter. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 is the default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 Vdefault_gutter_height = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 set_specifier_caching (Vdefault_gutter_height,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1335 offsetof (struct window, default_gutter_height),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 default_gutter_size_changed_in_window,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1337 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 *Width of the default gutter, if it's oriented vertically.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344 */ );
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1345 Vdefault_gutter_width = Fmake_specifier (Qgutter_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 set_specifier_caching (Vdefault_gutter_width,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1347 offsetof (struct window, default_gutter_width),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348 default_gutter_size_changed_in_window,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1349 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 DEFVAR_SPECIFIER ("top-gutter-height",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 &Vgutter_size[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 *Height of the top gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 set_specifier_caching (Vgutter_size[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1360 offsetof (struct window, gutter_size[TOP_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1361 gutter_geometry_changed_in_window, 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 DEFVAR_SPECIFIER ("bottom-gutter-height",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364 &Vgutter_size[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 *Height of the bottom gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1372 offsetof (struct window, gutter_size[BOTTOM_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1373 gutter_geometry_changed_in_window, 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375 DEFVAR_SPECIFIER ("left-gutter-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 &Vgutter_size[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 *Width of left gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 */ );
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1382 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 set_specifier_caching (Vgutter_size[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1384 offsetof (struct window, gutter_size[LEFT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1385 gutter_geometry_changed_in_window, 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1386
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 DEFVAR_SPECIFIER ("right-gutter-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388 &Vgutter_size[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389 *Width of right gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1391
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1393 */ );
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1394 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 set_specifier_caching (Vgutter_size[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1396 offsetof (struct window, gutter_size[RIGHT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1397 gutter_geometry_changed_in_window, 0, 0, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1400 #ifdef HAVE_TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1402 #endif
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1403 #ifdef HAVE_GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1404 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1405 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409 #ifdef HAVE_MS_WINDOWS
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1410 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 set_specifier_fallback (Vdefault_gutter_height, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1417 #ifdef HAVE_TTY
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1418 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420 #ifdef HAVE_X_WINDOWS
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1421 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422 #endif
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1423 #ifdef HAVE_GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1424 fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
1425 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 #ifdef HAVE_MS_WINDOWS
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1427 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1428 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 set_specifier_fallback (Vdefault_gutter_width, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434 fb = list1 (Fcons (Qnil, Qzero));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1438
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439 DEFVAR_SPECIFIER ("default-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 &Vdefault_gutter_border_width /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 *Width of the border around the default gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 gutter border width specifier (e.g. `top-gutter-border-width' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 `default-gutter-position' is 'top) does not specify a border width in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448 particular domain (a window or a frame), then the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 `default-gutter-border-width' in that domain, if any, will be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450 instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454 set_specifier_caching (Vdefault_gutter_border_width,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1455 offsetof (struct window, default_gutter_border_width),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456 default_gutter_border_width_changed_in_window,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1457 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459 DEFVAR_SPECIFIER ("top-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1460 &Vgutter_border_width[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1461 *Border width of the top gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1462 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 set_specifier_caching (Vgutter_border_width[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1468 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1469 gutter_border_width[TOP_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1470 gutter_geometry_changed_in_window, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472 DEFVAR_SPECIFIER ("bottom-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 &Vgutter_border_width[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 *Border width of the bottom gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1478 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1479 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1480 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1481 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1482 gutter_border_width[BOTTOM_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1483 gutter_geometry_changed_in_window, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1485 DEFVAR_SPECIFIER ("left-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1486 &Vgutter_border_width[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1487 *Border width of left gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1489
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1490 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1491 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1492 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1493 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1494 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1495 gutter_border_width[LEFT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1496 gutter_geometry_changed_in_window, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1497
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1498 DEFVAR_SPECIFIER ("right-gutter-border-width",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1499 &Vgutter_border_width[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1500 *Border width of right gutter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1501 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 See `default-gutter-height' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1504 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1506 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1507 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1508 gutter_border_width[RIGHT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1509 gutter_geometry_changed_in_window, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1510
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1511 fb = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1512 #ifdef HAVE_TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1513 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1514 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1515 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1516 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1517 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1518 #ifdef HAVE_MS_WINDOWS
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1519 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1520 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1522 if (!NILP (fb))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1523 set_specifier_fallback (Vdefault_gutter_border_width, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1524
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1525 set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1526 fb = list1 (Fcons (Qnil, Qzero));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1527 set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1528 set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1529 set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1530
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1531 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1532 *Whether the default gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1533 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1534
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1535 The position of the default gutter is specified by the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1536 `set-default-gutter-position'. If the corresponding position-specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1537 gutter visibility specifier (e.g. `top-gutter-visible-p' if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1538 `default-gutter-position' is 'top) does not specify a visible-p value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1539 in a particular domain (a window or a frame), then the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1540 `default-gutter-visible-p' in that domain, if any, will be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1541 instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1543 `default-gutter-visible-p' and all of the position-specific gutter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1544 visibility specifiers have a fallback value of true.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1545 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1546 Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1547 set_specifier_caching (Vdefault_gutter_visible_p,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1548 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1549 default_gutter_visible_p),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1550 default_gutter_visible_p_changed_in_window,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1551 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1552
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1553 DEFVAR_SPECIFIER ("top-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1554 &Vgutter_visible_p[TOP_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1555 *Whether the top gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1556 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1557
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1558 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1559 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1560 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1561 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1562 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1563 gutter_visible_p[TOP_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1564 top_gutter_specs_changed, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1565
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1566 DEFVAR_SPECIFIER ("bottom-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1567 &Vgutter_visible_p[BOTTOM_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1568 *Whether the bottom gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1569 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1570
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1571 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1572 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1573 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1574 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1575 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1576 gutter_visible_p[BOTTOM_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1577 bottom_gutter_specs_changed, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1579 DEFVAR_SPECIFIER ("left-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1580 &Vgutter_visible_p[LEFT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581 *Whether the left gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1583
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1584 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1585 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1586 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1587 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1588 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1589 gutter_visible_p[LEFT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1590 left_gutter_specs_changed, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1591
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1592 DEFVAR_SPECIFIER ("right-gutter-visible-p",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1593 &Vgutter_visible_p[RIGHT_GUTTER] /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1594 *Whether the right gutter is visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1595 This is a specifier; use `set-specifier' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1596
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1597 See `default-gutter-visible-p' for more information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1598 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1599 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER],
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1601 offsetof (struct window,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1602 gutter_visible_p[RIGHT_GUTTER]),
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1603 right_gutter_specs_changed, 0, 0, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1604
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1605 /* initially, top inherits from default; this can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1606 changed with `set-default-gutter-position'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1607 fb = list1 (Fcons (Qnil, Qt));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1608 set_specifier_fallback (Vdefault_gutter_visible_p, fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1609 set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1610 Vdefault_gutter_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1611 set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1612 set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1613 set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614 }