mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-24 22:07:36 +00:00
Misc minor simplifications in C code.
* src/buffer.c (Fset_buffer_multibyte): Signal an error instead of widening. (Fmake_overlay): Remove redundant tests. * src/coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special case for the special 0 coding-system. * src/frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
This commit is contained in:
parent
9f7b98f812
commit
090cf9dbb0
5 changed files with 19 additions and 14 deletions
2
etc/NEWS
2
etc/NEWS
|
|
@ -619,6 +619,8 @@ inefficiency, and not namespace-clean.
|
|||
|
||||
* Incompatible Lisp Changes in Emacs 24.3
|
||||
|
||||
** set-buffer-multibyte now signals an error in narrowed buffers.
|
||||
|
||||
+++
|
||||
** (random) by default now returns a different random sequence in
|
||||
every Emacs run. Use (random S), where S is a string, to set the
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
|
||||
|
||||
* coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
|
||||
case for the special 0 coding-system.
|
||||
|
||||
* buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
|
||||
(Fmake_overlay): Remove redundant tests.
|
||||
|
||||
2012-10-02 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
|
||||
|
|
|
|||
13
src/buffer.c
13
src/buffer.c
|
|
@ -2464,7 +2464,7 @@ current buffer is cleared. */)
|
|||
begv = BEGV, zv = ZV;
|
||||
|
||||
if (narrowed)
|
||||
Fwiden ();
|
||||
error ("Changing multibyteness in a narrowed buffer");
|
||||
|
||||
if (NILP (flag))
|
||||
{
|
||||
|
|
@ -3847,17 +3847,16 @@ for the rear of the overlay advance when text is inserted there
|
|||
end = OVERLAY_END (overlay);
|
||||
if (OVERLAY_POSITION (end) < b->overlay_center)
|
||||
{
|
||||
if (b->overlays_after)
|
||||
XOVERLAY (overlay)->next = b->overlays_after;
|
||||
eassert (b->overlays_after);
|
||||
XOVERLAY (overlay)->next = b->overlays_after;
|
||||
set_buffer_overlays_after (b, XOVERLAY (overlay));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (b->overlays_before)
|
||||
XOVERLAY (overlay)->next = b->overlays_before;
|
||||
eassert (b->overlays_before);
|
||||
XOVERLAY (overlay)->next = b->overlays_before;
|
||||
set_buffer_overlays_before (b, XOVERLAY (overlay));
|
||||
}
|
||||
|
||||
/* This puts it in the right list, and in the right order. */
|
||||
recenter_overlay_lists (b, b->overlay_center);
|
||||
|
||||
|
|
@ -4141,7 +4140,7 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
|
|||
/* Put all the overlays we want in a vector in overlay_vec.
|
||||
Store the length in len. */
|
||||
noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len,
|
||||
0, 0, 0);
|
||||
NULL, NULL, 0);
|
||||
|
||||
/* Make a list of them all. */
|
||||
result = Flist (noverlays, overlay_vec);
|
||||
|
|
|
|||
|
|
@ -646,10 +646,8 @@ struct coding_system
|
|||
for file names, if any. */
|
||||
#define ENCODE_FILE(name) \
|
||||
(! NILP (Vfile_name_coding_system) \
|
||||
&& !EQ (Vfile_name_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \
|
||||
: (! NILP (Vdefault_file_name_coding_system) \
|
||||
&& !EQ (Vdefault_file_name_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \
|
||||
: name))
|
||||
|
||||
|
|
@ -658,10 +656,8 @@ struct coding_system
|
|||
for file names, if any. */
|
||||
#define DECODE_FILE(name) \
|
||||
(! NILP (Vfile_name_coding_system) \
|
||||
&& !EQ (Vfile_name_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \
|
||||
: (! NILP (Vdefault_file_name_coding_system) \
|
||||
&& !EQ (Vdefault_file_name_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \
|
||||
: name))
|
||||
|
||||
|
|
@ -670,7 +666,6 @@ struct coding_system
|
|||
for system functions, if any. */
|
||||
#define ENCODE_SYSTEM(str) \
|
||||
(! NILP (Vlocale_coding_system) \
|
||||
&& !EQ (Vlocale_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (str, Vlocale_coding_system, 1) \
|
||||
: str)
|
||||
|
||||
|
|
@ -678,7 +673,6 @@ struct coding_system
|
|||
for system functions, if any. */
|
||||
#define DECODE_SYSTEM(str) \
|
||||
(! NILP (Vlocale_coding_system) \
|
||||
&& !EQ (Vlocale_coding_system, make_number (0)) \
|
||||
? code_convert_string_norecord (str, Vlocale_coding_system, 0) \
|
||||
: str)
|
||||
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ affects all frames on the same terminal device. */)
|
|||
Lisp_Object terminal;
|
||||
|
||||
terminal = Fassq (Qterminal, parms);
|
||||
if (!NILP (terminal))
|
||||
if (CONSP (terminal))
|
||||
{
|
||||
terminal = XCDR (terminal);
|
||||
t = get_terminal (terminal, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue