Mercurial > hg > xemacs-beta
annotate src/insdel.h @ 5652:cc6f0266bc36
Avoid #'delq in core Lisp, for the sake of style, a very slightly smaller binary
lisp/ChangeLog addition:
2012-05-01 Aidan Kehoe <kehoea@parhasard.net>
Avoid #'delq in core code, for the sake of style and a (very
slightly) smaller binary.
* behavior.el (disable-behavior):
* behavior.el (compute-behavior-group-children):
* buff-menu.el (buffers-tab-items):
* byte-optimize.el (byte-optimize-delay-constants-math):
* byte-optimize.el (byte-optimize-logmumble):
* byte-optimize.el (byte-decompile-bytecode-1):
* byte-optimize.el (byte-optimize-lapcode):
* bytecomp.el:
* bytecomp.el (byte-compile-arglist-warn):
* bytecomp.el (byte-compile-warn-about-unresolved-functions):
* bytecomp.el (byte-compile-lambda):
* bytecomp.el (byte-compile-out-toplevel):
* bytecomp.el (byte-compile-insert):
* bytecomp.el (byte-compile-defalias-warn):
* cl-macs.el (cl-upcase-arg):
* cl-macs.el (cl-transform-lambda):
* cl-macs.el (cl-do-proclaim):
* cl-macs.el (defstruct):
* cl-macs.el (cl-make-type-test):
* cl-macs.el (define-compiler-macro):
* cl-macs.el (delete-duplicates):
* cus-edit.el (widget-face-value-delete):
* cus-edit.el (face-history):
* easymenu.el (easy-menu-remove):
* files.el (files-fetch-hook-value):
* files.el (file-expand-wildcards):
* font-lock.el (font-lock-update-removed-keyword-alist):
* font-lock.el (font-lock-remove-keywords):
* frame.el (frame-initialize):
* frame.el (frame-notice-user-settings):
* frame.el (set-frame-font):
* frame.el (delete-other-frames):
* frame.el (get-frame-for-buffer-noselect):
* gnuserv.el (gnuserv-kill-buffer-function):
* gnuserv.el (gnuserv-check-device):
* gnuserv.el (gnuserv-kill-client):
* gnuserv.el (gnuserv-buffer-done-1):
* gtk-font-menu.el (gtk-reset-device-font-menus):
* gutter-items.el (buffers-tab-items):
* gutter.el (set-gutter-element-visible-p):
* info.el (Info-find-file-node):
* info.el (Info-history-add):
* info.el (Info-build-annotation-completions):
* info.el (Info-index):
* info.el (Info-reannotate-node):
* itimer.el (delete-itimer):
* itimer.el (start-itimer):
* lib-complete.el (lib-complete:cache-completions):
* loadhist.el (unload-feature):
* menubar-items.el (build-buffers-menu-internal):
* menubar.el (delete-menu-item):
* menubar.el (relabel-menu-item):
* msw-font-menu.el (mswindows-reset-device-font-menus):
* mule/make-coding-system.el (fixed-width-generate-helper):
* next-error.el (next-error-find-buffer):
* obsolete.el:
* obsolete.el (find-non-ascii-charset-string):
* obsolete.el (find-non-ascii-charset-region):
* occur.el (multi-occur-by-filename-regexp):
* occur.el (occur-1):
* packages.el (packages-package-hierarchy-directory-names):
* packages.el (package-get-key-1):
* process.el (setenv):
* simple.el (undo):
* simple.el (handle-pre-motion-command-current-command-is-motion):
* sound.el (load-sound-file):
* wid-edit.el (widget-field-value-delete):
* wid-edit.el (widget-checklist-match-inline):
* wid-edit.el (widget-checklist-match-find):
* wid-edit.el (widget-editable-list-delete-at):
* wid-edit.el (widget-editable-list-entry-create):
* window.el (quit-window):
* x-font-menu.el (x-reset-device-font-menus-core):
1. Replace (delq nil (mapcar ....)) with analogous (mapcan ...)
forms; this is in non-dumped files, it was done previously in
dumped files.
2. Replace (delq FOO (copy-sequence BAR)) with (remove* FOO BAR),
where #'eq and #'eql are equivalent
3. Replace (delq FOO BAR) with (delete* FOO BAR), where FOO is not
a non-fixnum number. Saves a little space in the dumped file
(since the compiler macro adds :test #'eq to the delete* call if
it's not clear that FOO is not a non-fixnum number).
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 01 May 2012 16:17:42 +0100 |
parents | 308d34e9f07d |
children | 65d65b52d608 |
rev | line source |
---|---|
428 | 1 /* Buffer insertion/deletion and gap motion for XEmacs. |
2 Copyright (C) 1985-1994 Free Software Foundation, Inc. | |
3 | |
4 This file is part of XEmacs. | |
5 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4953
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
428 | 7 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4953
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4953
diff
changeset
|
9 option) any later version. |
428 | 10 |
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
4953
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
428 | 18 |
19 /* Synched up with: Not in FSF. */ | |
20 | |
21 /* Mostly rewritten by Ben Wing. */ | |
22 | |
440 | 23 #ifndef INCLUDED_insdel_h_ |
24 #define INCLUDED_insdel_h_ | |
428 | 25 |
26 /************************************************************************/ | |
27 /* changing a buffer's text */ | |
28 /************************************************************************/ | |
29 | |
665 | 30 int begin_multiple_change (struct buffer *buf, Charbpos start, Charbpos end); |
428 | 31 void end_multiple_change (struct buffer *buf, int count); |
32 | |
33 /* flags for functions below */ | |
34 | |
35 #define INSDEL_BEFORE_MARKERS 1 | |
36 #define INSDEL_NO_LOCKING 2 | |
37 | |
665 | 38 Charcount buffer_insert_string_1 (struct buffer *buf, Charbpos pos, |
867 | 39 const Ibyte *nonreloc, Lisp_Object reloc, |
428 | 40 Bytecount offset, Bytecount length, |
41 int flags); | |
665 | 42 Charcount buffer_insert_raw_string_1 (struct buffer *buf, Charbpos pos, |
867 | 43 const Ibyte *nonreloc, |
428 | 44 Bytecount length, int flags); |
665 | 45 Charcount buffer_insert_lisp_string_1 (struct buffer *buf, Charbpos pos, |
428 | 46 Lisp_Object str, int flags); |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
867
diff
changeset
|
47 Charcount buffer_insert_ascstring_1 (struct buffer *buf, Charbpos pos, |
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
867
diff
changeset
|
48 const Ascbyte *s, int flags); |
665 | 49 Charcount buffer_insert_emacs_char_1 (struct buffer *buf, Charbpos pos, |
867 | 50 Ichar ch, int flags); |
665 | 51 Charcount buffer_insert_c_char_1 (struct buffer *buf, Charbpos pos, char c, |
428 | 52 int flags); |
665 | 53 Charcount buffer_insert_from_buffer_1 (struct buffer *buf, Charbpos pos, |
54 struct buffer *buf2, Charbpos pos2, | |
428 | 55 Charcount length, int flags); |
56 | |
57 /* Macros for insertion functions that insert at point after markers. | |
58 All of these can GC. */ | |
59 | |
60 #define buffer_insert_string(buf, nonreloc, reloc, offset, length) \ | |
61 buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, 0) | |
62 #define buffer_insert_raw_string(buf, string, length) \ | |
63 buffer_insert_raw_string_1 (buf, -1, string, length, 0) | |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
867
diff
changeset
|
64 #define buffer_insert_ascstring(buf, s) \ |
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
867
diff
changeset
|
65 buffer_insert_ascstring_1 (buf, -1, s, 0) |
428 | 66 #define buffer_insert_lisp_string(buf, str) \ |
67 buffer_insert_lisp_string_1 (buf, -1, str, 0) | |
68 #define buffer_insert_c_char(buf, c) \ | |
69 buffer_insert_c_char_1 (buf, -1, c, 0) | |
70 #define buffer_insert_emacs_char(buf, ch) \ | |
71 buffer_insert_emacs_char_1 (buf, -1, ch, 0) | |
72 #define buffer_insert_from_buffer(buf, b, index, length) \ | |
73 buffer_insert_from_buffer_1 (buf, -1, b, index, length, 0) | |
74 | |
665 | 75 void buffer_delete_range (struct buffer *buf, Charbpos from, Charbpos to, |
428 | 76 int flags); |
867 | 77 void buffer_replace_char (struct buffer *b, Charbpos pos, Ichar ch, |
428 | 78 int not_real_change, int force_lock_check); |
79 | |
80 | |
81 /************************************************************************/ | |
82 /* tracking buffer changes */ | |
83 /************************************************************************/ | |
84 | |
85 /* Split into two parts. One part goes with a buffer's text (possibly | |
86 shared), the other with the buffer itself. */ | |
87 | |
88 struct buffer_text_change_data | |
89 { | |
90 /* multiple change stuff */ | |
91 int in_multiple_change; | |
665 | 92 Charbpos mc_begin, mc_orig_end, mc_new_end; |
428 | 93 int mc_begin_signaled; |
94 }; | |
95 | |
96 struct each_buffer_change_data | |
97 { | |
98 Charcount begin_unchanged, end_unchanged; | |
99 /* redisplay needs to know if a newline was deleted so its | |
100 incremental-redisplay algorithm will fail */ | |
101 int newline_was_deleted; | |
102 Charcount begin_extent_unchanged, end_extent_unchanged; | |
103 }; | |
104 | |
105 /* Number of characters at the beginning and end of the buffer that | |
106 have not changed since the last call to buffer_reset_changes(). | |
107 If no changes have occurred since then, both values will be -1. | |
108 | |
109 "Changed" means that the text has changed. */ | |
110 | |
111 #define BUF_BEGIN_UNCHANGED(buf) ((buf)->changes->begin_unchanged) | |
112 #define BUF_END_UNCHANGED(buf) ((buf)->changes->end_unchanged) | |
113 | |
114 /* Number of characters at the beginning and end of the buffer that | |
115 have not had a covering extent change since the last call to | |
116 buffer_reset_changes (). If no changes have occurred since then, | |
117 both values will be -1. | |
118 | |
119 "Changed" means that the extents covering the text have changed. */ | |
120 | |
121 #define BUF_EXTENT_BEGIN_UNCHANGED(buf) \ | |
122 ((buf)->changes->begin_extent_unchanged) | |
123 #define BUF_EXTENT_END_UNCHANGED(buf) \ | |
124 ((buf)->changes->end_extent_unchanged) | |
125 | |
126 #define BUF_NEWLINE_WAS_DELETED(buf) \ | |
127 ((buf)->changes->newline_was_deleted) | |
128 | |
129 void buffer_extent_signal_changed_region (struct buffer *buf, | |
665 | 130 Charbpos start, |
131 Charbpos end); | |
428 | 132 void buffer_reset_changes (struct buffer *buf); |
133 | |
134 | |
135 | |
136 /************************************************************************/ | |
137 /* other related functions */ | |
138 /************************************************************************/ | |
139 | |
665 | 140 Membpos do_marker_adjustment (Membpos mpos, Membpos from, |
141 Membpos to, Bytecount amount); | |
428 | 142 |
867 | 143 void fixup_internal_substring (const Ibyte *nonreloc, |
428 | 144 Lisp_Object reloc, |
145 Bytecount offset, Bytecount *len); | |
146 | |
147 /* In font-lock.c */ | |
148 void font_lock_maybe_update_syntactic_caches (struct buffer *buf, | |
665 | 149 Charbpos start, |
150 Charbpos orig_end, | |
151 Charbpos new_end); | |
428 | 152 void font_lock_buffer_was_killed (struct buffer *buf); |
153 | |
665 | 154 void barf_if_buffer_read_only (struct buffer *buf, Charbpos from, |
155 Charbpos to); | |
428 | 156 |
157 void init_buffer_text (struct buffer *b); | |
158 void uninit_buffer_text (struct buffer *b); | |
159 | |
440 | 160 #endif /* INCLUDED_insdel_h_ */ |