annotate oldXMenu/insque.c @ 96158:44b22c5bd2a9

Factor out the magic numbers controlling the calendar layout. (calendar-month-digit-width, calendar-month-width) (calendar-right-margin): New variables. (calendar-recompute-layout-variables, calendar-set-layout-variable): New functions. (calendar-left-margin, calendar-intermonth-spacing) (calendar-column-width, calendar-day-header-width) (calendar-day-digit-width): New options. (calendar-first-date-row): New constant. (calendar-move-to-column, calendar-ensure-newline): New functions, replacing calendar-insert-indented. (calendar-insert-indented): Remove function. (calendar-generate-month): Use calendar-move-to-column and calendar-ensure-newline. Use layout variables. (calendar-generate, calendar-update-mode-line) (calendar-font-lock-keywords): Use layout variables. (calendar-column-to-month): New function. (calendar-cursor-to-date): Use calendar-column-to-month. Use layout variables.
author Glenn Morris <rgm@gnu.org>
date Sat, 21 Jun 2008 19:28:09 +0000
parents 3765d76f7fa8
children a04b5f26a401
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
75059
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
1 /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003,
79743
43c5da03890c Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78334
diff changeset
2 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
75059
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
3
94791
3765d76f7fa8 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
4 This program is free software: you can redistribute it and/or modify
75059
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
5 it under the terms of the GNU General Public License as published by
94791
3765d76f7fa8 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
6 the Free Software Foundation, either version 3 of the License, or
3765d76f7fa8 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
7 (at your option) any later version.
75059
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
8
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
9 This program is distributed in the hope that it will be useful,
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
12 GNU General Public License for more details.
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
13
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
14 You should have received a copy of the GNU General Public License
94791
3765d76f7fa8 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
65000
3861ff8f4bf1 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 52401
diff changeset
16
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
17 /* This file implements the emacs_insque and emacs_remque functions,
75059
8003d205a12f Add license notice.
Richard M. Stallman <rms@gnu.org>
parents: 74548
diff changeset
18 clones of the insque and remque functions of BSD. They and all
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
19 their callers have been renamed to emacs_mumble to allow us to
Dave Love <fx@gnu.org>
parents:
diff changeset
20 include this file in the menu library on all systems. */
Dave Love <fx@gnu.org>
parents:
diff changeset
21
Dave Love <fx@gnu.org>
parents:
diff changeset
22
Dave Love <fx@gnu.org>
parents:
diff changeset
23 struct qelem {
Dave Love <fx@gnu.org>
parents:
diff changeset
24 struct qelem *q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
25 struct qelem *q_back;
Dave Love <fx@gnu.org>
parents:
diff changeset
26 char q_data[1];
Dave Love <fx@gnu.org>
parents:
diff changeset
27 };
Dave Love <fx@gnu.org>
parents:
diff changeset
28
Dave Love <fx@gnu.org>
parents:
diff changeset
29 /* Insert ELEM into a doubly-linked list, after PREV. */
Dave Love <fx@gnu.org>
parents:
diff changeset
30
Dave Love <fx@gnu.org>
parents:
diff changeset
31 void
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 25858
diff changeset
32 emacs_insque (elem, prev)
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
33 struct qelem *elem, *prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
34 {
Dave Love <fx@gnu.org>
parents:
diff changeset
35 struct qelem *next = prev->q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
36 prev->q_forw = elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
37 if (next)
Dave Love <fx@gnu.org>
parents:
diff changeset
38 next->q_back = elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
39 elem->q_forw = next;
Dave Love <fx@gnu.org>
parents:
diff changeset
40 elem->q_back = prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
41 }
Dave Love <fx@gnu.org>
parents:
diff changeset
42
Dave Love <fx@gnu.org>
parents:
diff changeset
43 /* Unlink ELEM from the doubly-linked list that it is in. */
Dave Love <fx@gnu.org>
parents:
diff changeset
44
Dave Love <fx@gnu.org>
parents:
diff changeset
45 emacs_remque (elem)
Dave Love <fx@gnu.org>
parents:
diff changeset
46 struct qelem *elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
47 {
Dave Love <fx@gnu.org>
parents:
diff changeset
48 struct qelem *next = elem->q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
49 struct qelem *prev = elem->q_back;
Dave Love <fx@gnu.org>
parents:
diff changeset
50 if (next)
Dave Love <fx@gnu.org>
parents:
diff changeset
51 next->q_back = prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
52 if (prev)
Dave Love <fx@gnu.org>
parents:
diff changeset
53 prev->q_forw = next;
Dave Love <fx@gnu.org>
parents:
diff changeset
54 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
55
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
56 /* arch-tag: a8719d1a-5c3f-4bce-b36b-173106d36165
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
57 (do not change this comment) */