annotate oldXMenu/Locate.c @ 27701:5e135f0faf1d
(bibtex-mode): Replaced manual splitting of path
at ':' characters by call to split-string.
Added RCS version identification.
Some temporary comments removed.
(bibtex-field-name, bibtex-entry-type): Made the relationship
explicit.
(bibtex-field-const): Allow capital letters.
(bibtex-start-of-string): Deleted because unused.
Unified some nomenclature. We no longer
use the term 'reference' to describe a bibtex entry as a whole.
Further, reference keys are no longer called 'labels'.
(bibtex-keys): Renamed to bibtex-reference-keys.
(bibtex-reformat-previous-labels): Renamed to
bibtex-reformat-previous-reference-keys.
(bibtex-reference-type): Renamed to bibtex-entry-type.
(bibtex-reference-head): Renamed to bibtex-entry-head.
(bibtex-reference-maybe-empty-head): Renamed to
bibtex-entry-maybe-empty-head.
(bibtex-key-in-reference): Renamed to bibtex-key-in-entry.
(bibtex-search-reference): Renamed to bibtex-search-entry.
(bibtex-enclosing-reference-maybe-empty-head): Renamed to
bibtex-enclosing-entry-maybe-empty-head.
(bibtex-entry-field-alist, bibtex-entry-head,
bibtex-font-lock-keywords, bibtex-skip-to-valid-entry,
bibtex-map-entries, bibtex-search-entry,
bibtex-enclosing-entry-maybe-empty-head, bibtex-format-entry,
bibtex-generate-autokey, bibtex-parse-keys, bibtex-pop, bibtex-mode,
bibtex-submit-bug-report, bibtex-entry, bibtex-print-help-message,
bibtex-make-field, bibtex-end-of-entry, bibtex-sort-buffer,
bibtex-find-entry-location, bibtex-validate, bibtex-find-text,
bibtex-kill-entry, bibtex-clean-entry, bibtex-reformat,
bibtex-complete-key, bibtex-String) : Use the new nomenclature.
(bibtex-strings, bibtex-keys): Removed redundant
comment.
(bibtex-format-field-delimiters): New function, functionality
extracted from bibtex-format-entry.
(bibtex-autokey-get-yearfield-digits): New function, functionality
extracted from bibtex-autokey-get-yearfield.
Completely reimplemented parsing of bibtex
entries in order to avoid stack overflow in the regexp matcher if
field contents become large.
(bibtex-cfield, bibtex-name-in-cfield, bibtex-text-in-cfield,
bibtex-field-string-part-not-braced,
bibtex-field-string-part-no-inner-braces,
bibtex-field-string-part-1-inner-brace,
bibtex-field-string-part-2-inner-braces,
bibtex-field-string-part-3-inner-braces, bibtex-field-string-braced,
bibtex-field-string-quoted, bibtex-field-string,
bibtex-field-string-or-const, bibtex-field-text, bibtex-field,
bibtex-name-in-field, bibtex-text-in-field, bibtex-reference-infix,
bibtex-string, bibtex-key-in-string, bibtex-text-in-string): Deleted
as parsing is now performed by the following functions.
(bibtex-parse-nested-braces, bibtex-parse-field-string-braced,
bibtex-parse-quoted-string, bibtex-parse-field-string-quoted,
bibtex-parse-field-string, bibtex-search-forward-field-string,
bibtex-parse-association, bibtex-field-name-for-parsing,
bibtex-parse-field-name, bibtex-parse-field-text, bibtex-parse-field,
bibtex-search-forward-field, bibtex-search-backward-field,
bibtex-start-of-field, bibtex-end-of-field,
bibtex-start-of-name-in-field, bibtex-end-of-name-in-field,
bibtex-start-of-text-in-field, bibtex-end-of-text-in-field,
bibtex-parse-string-prefix, bibtex-parse-string-postfix,
bibtex-parse-string, bibtex-search-forward-string,
bibtex-search-backward-string, bibtex-start-of-string,
bibtex-end-of-string, bibtex-start-of-reference-key-in-string,
bibtex-end-of-reference-key-in-string, bibtex-start-of-text-in-string,
bibtex-end-of-text-in-string): New functions for the parsing of bibtex
entries. Instead of reporting the results of the parsing by
match-beginning or match-end, these functions return data structures
that hold the corresponding positions.
(bibtex-enclosing-field): Changed to also report field boundaries by
return values rather than by match-beginning or match-end. The
following functions have been adapted to use the new parsing
functions.
(bibtex-skip-to-valid-entry, bibtex-search-reference,
bibtex-enclosing-field, bibtex-format-entry,
bibtex-autokey-get-namefield, bibtex-autokey-get-titlestring,
bibtex-parse-keys, bibtex-complete, bibtex-pop, bibtex-mode,
bibtex-print-help-message, bibtex-end-of-entry,
bibtex-ispell-abstract, bibtex-validate, bibtex-next-field,
bibtex-find-text, bibtex-remove-OPT-or-ALT, bibtex-remove-delimiters,
bibtex-kill-field, bibtex-empty-field, bibtex-fill-entry): Use the new
method for parsing.
(bibtex-assoc-of-regexp, bibtex-skip-to-valid-entry,
bibtex-map-entries, bibtex-flash-head,
bibtex-enclosing-reference-maybe-empty-head, bibtex-format-entry,
bibtex-autokey-change, bibtex-autokey-get-namefield,
bibtex-autokey-get-names, bibtex-autokey-get-titlestring,
bibtex-autokey-get-titles, bibtex-parse-keys, bibtex-pop, bibtex-mode,
bibtex-end-of-entry, bibtex-ispell-abstract, bibtex-sort-buffer,
bibtex-validate, bibtex-remove-OPT-or-ALT, bibtex-remove-delimiters,
bibtex-kill-field, bibtex-kill-entry): Use let* instead of let in
order to make the new binding of case-fold-search immediately
visible.
Copyright notice is up to date.
Added constant 'bibtex-maintainer-salutation.
(bibtex-mode): use with-temp-buffer rather
than make-temp-name, use match-string-no-properties and eliminate
a quadratic behavior when building bibtex-strings.
(bibtex-reference-key): Accept string entries whose
reference key contains upper case letters.
(bibtex-reference-head): Allow entries to start with
a new line.
Hiding of entry bodies is not longer provided by
bibtex.el directly. Instead the hideshow package can be used.
Added a special bibtex entry to hs-special-modes-alist.
(bibtex-hs-forward-sexp): Added for hideshow.el.
(bibtex-entry-field-alist): Added booktitle field to
proceedings entry type (for cross referencing). Thanks to
Wagner Toledo Correa for the suggestion.
Added `reftex-view-crossref-from-bibtex' to menu.
author |
Gerd Moellmann <gerd@gnu.org> |
date |
Tue, 15 Feb 2000 09:38:09 +0000 |
parents |
bbce331da1be |
children |
23a1cea22d13 |
rev |
line source |
25858
|
1 #include "copyright.h"
|
|
2
|
|
3 /* $Header: /u/src/emacs/19.0/oldXMenu/RCS/Locate.c,v 1.1 1992/04/11 22:10:20 jimb Exp $ */
|
|
4 /* Copyright Massachusetts Institute of Technology 1985 */
|
|
5
|
|
6 /*
|
|
7 * XMenu: MIT Project Athena, X Window system menu package
|
|
8 *
|
|
9 * XMenuLocate - Return data necessary to position and locate
|
|
10 * a menu on the screen.
|
|
11 *
|
|
12 * Author: Tony Della Fera, DEC
|
|
13 * January 11, 1985
|
|
14 *
|
|
15 */
|
|
16
|
|
17 #include "XMenuInt.h"
|
|
18
|
|
19 int
|
|
20 XMenuLocate(display, menu, p_num, s_num, x_pos, y_pos, ul_x, ul_y, width, height)
|
|
21 register Display *display; /* Previously opened display. */
|
|
22 register XMenu *menu; /* Menu object being located. */
|
|
23 int p_num; /* Active pane number. */
|
|
24 int s_num; /* Active selection number. */
|
|
25 int x_pos; /* X coordinate of mouse active position. */
|
|
26 int y_pos; /* Y coordinate of mouse active position. */
|
|
27 int *ul_x; /* Returned upper left menu X coordinate. */
|
|
28 int *ul_y; /* Returned upper left menu Y coordinate. */
|
|
29 int *width; /* Returned menu width. */
|
|
30 int *height; /* Returned menu height. */
|
|
31 {
|
|
32 register XMPane *p_ptr; /* XMPane pointer. */
|
|
33 register XMSelect *s_ptr; /* XMSelect pointer. */
|
|
34
|
|
35 /*
|
|
36 * Are the position arguments positive?
|
|
37 */
|
|
38 if ((x_pos <= 0) || (y_pos <= 0)) {
|
|
39 _XMErrorCode = XME_ARG_BOUNDS;
|
|
40 return(XM_FAILURE);
|
|
41 }
|
|
42
|
|
43 /*
|
|
44 * Find the right pane.
|
|
45 */
|
|
46 p_ptr = _XMGetPanePtr(menu, p_num);
|
|
47 if (p_ptr == NULL) return(XM_FAILURE);
|
|
48
|
|
49 /*
|
|
50 * Find the right selection.
|
|
51 */
|
|
52 s_ptr = _XMGetSelectionPtr(p_ptr, s_num);
|
|
53
|
|
54 /*
|
|
55 * Check to see that the menu's dependencies have been
|
|
56 * recomputed and are up to date. If not, do it now.
|
|
57 */
|
|
58 if (menu->recompute) XMenuRecompute(display, menu);
|
|
59
|
|
60 /*
|
|
61 * Compute the new menu origin such that the active point lies
|
|
62 * in the center of the desired active pane and selection.
|
|
63 * This sets the values of ul_x and ul_y.
|
|
64 */
|
|
65 _XMTransToOrigin(display, menu, p_ptr, s_ptr, x_pos, y_pos, ul_x, ul_y);
|
|
66
|
|
67 /*
|
|
68 * Set remaining return argument values.
|
|
69 */
|
|
70 *width = menu->width;
|
|
71 *height = menu->height;
|
|
72
|
|
73 /*
|
|
74 * Return successfully.
|
|
75 */
|
|
76 _XMErrorCode = XME_NO_ERROR;
|
|
77 return(XM_SUCCESS);
|
|
78 }
|