aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-03-07 00:03:57 +0100
committerJoakim Verona2013-03-07 00:03:57 +0100
commit2dcf541ff79077c00b5ca257a005a163affb3c9a (patch)
treec57b1582ce2d0ca7c894d36b45a7ff41613d8e05 /src
parent79157e99328fb1d835985dfa89fc2a2fa427d077 (diff)
parentab89e9f9a594c30ce4c04e6d502bee3beaefe908 (diff)
downloademacs-2dcf541ff79077c00b5ca257a005a163affb3c9a.tar.gz
emacs-2dcf541ff79077c00b5ca257a005a163affb3c9a.zip
auto upstream
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog66
-rw-r--r--src/bidi.c2
-rw-r--r--src/coding.c45
-rw-r--r--src/coding.h34
-rw-r--r--src/indent.c8
-rw-r--r--src/lisp.h3
-rw-r--r--src/msdos.c27
-rw-r--r--src/search.c10
-rw-r--r--src/sysdep.c16
-rw-r--r--src/xdisp.c18
10 files changed, 114 insertions, 115 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index af03fa54291..c54d4bee7e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,59 @@
12013-03-06 Eli Zaretskii <eliz@gnu.org>
2
3 * search.c (find_newline_no_quit): Rename from find_next_newline.
4 Add commentary.
5
6 * lisp.h (find_newline_no_quit): Rename prototype.
7
8 * xdisp.c (back_to_previous_line_start)
9 (forward_to_next_line_start, get_visually_first_element)
10 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
11 * indent.c (vmotion): Callers of find_newline_no_quit changed.
12 * bidi.c (bidi_find_paragraph_start): Callers of
13 find_newline_no_quit changed.
14
15 * msdos.c: Change encoding to cp850. (Bug#13879)
16 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
17
182013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
19
20 Coding system support cleanup and minor refactoring.
21 * coding.h (enum coding_result_code): Remove
22 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
23 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
24 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
25 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
26 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
27 (decode_coding_region, encode_coding_region, decode_coding_string):
28 Remove unused compatibility macros.
29 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
30 (record_conversion_result): Adjust user.
31 (syms_of_coding): Likewise.
32 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
33 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
34 (decode_coding_object): Simplify since xrealloc never returns NULL.
35 Add eassert.
36
372013-03-06 Paul Eggert <eggert@cs.ucla.edu>
38
39 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
40 * sysdep.c (list_system_processes)
41 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
42 Make it a stub in this case; otherwise the build might fail,
43 and this code hasn't been tested on such hosts anyway.
44 Problem reported by Nelson H. F. Beebe in
45 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
46 and analyzed by Jérémie Courrèges-Anglas in
47 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
48
492013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
50
51 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
52 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
53 (get_visually_first_element, move_it_vertically_backward): Ajust users.
54 * bidi.c (bidi_find_paragraph_start): Likewise.
55 * indent.c (vmotion): Likewise.
56
12013-03-05 Paul Eggert <eggert@cs.ucla.edu> 572013-03-05 Paul Eggert <eggert@cs.ucla.edu>
2 58
3 FILE's lock is now always .#FILE and may be a regular file (Bug#13807). 59 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
@@ -57,16 +113,6 @@
57 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov 113 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
58 <dmantipov@yandex.ru>. 114 <dmantipov@yandex.ru>.
59 115
602013-03-05 Paul Eggert <eggert@cs.ucla.edu>
61
62 Fix a build failure on OpenBSD 4.x and MirBSD.
63 * sysdep.c (KERN_PROC, kinfo_proc)
64 [BSD_SYSTEM && (!KERN_PROC || __MirBSD__)]:
65 Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9 and MirBSD.
66 list-system-processes still returns nil, but at least it doesn't crash.
67 Problem reported by Nelson H. F. Beebe in
68 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>.
69
702013-03-05 Dmitry Antipov <dmantipov@yandex.ru> 1162013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
71 117
72 * composite.c (get_composition_id, fill_gstring_header): 118 * composite.c (get_composition_id, fill_gstring_header):
diff --git a/src/bidi.c b/src/bidi.c
index 57d154bc544..cf5e580cd8f 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1108,7 +1108,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte)
1108 display string? And what if a display string covering some 1108 display string? And what if a display string covering some
1109 of the text over which we scan back includes 1109 of the text over which we scan back includes
1110 paragraph_start_re? */ 1110 paragraph_start_re? */
1111 pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte); 1111 pos = find_newline_no_quit (pos - 1, -1, &pos_byte);
1112 if (n >= MAX_PARAGRAPH_SEARCH) 1112 if (n >= MAX_PARAGRAPH_SEARCH)
1113 pos_byte = BEGV_BYTE; 1113 pos_byte = BEGV_BYTE;
1114 return pos_byte; 1114 return pos_byte;
diff --git a/src/coding.c b/src/coding.c
index 868fb7df0ea..32da72ab626 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -322,8 +322,7 @@ Lisp_Object Qcall_process, Qcall_process_region;
322Lisp_Object Qstart_process, Qopen_network_stream; 322Lisp_Object Qstart_process, Qopen_network_stream;
323static Lisp_Object Qtarget_idx; 323static Lisp_Object Qtarget_idx;
324 324
325static Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; 325static Lisp_Object Qinsufficient_source, Qinvalid_source, Qinterrupted;
326static Lisp_Object Qinterrupted, Qinsufficient_memory;
327 326
328/* If a symbol has this property, evaluate the value to define the 327/* If a symbol has this property, evaluate the value to define the
329 symbol as a coding system. */ 328 symbol as a coding system. */
@@ -820,18 +819,12 @@ record_conversion_result (struct coding_system *coding,
820 case CODING_RESULT_INSUFFICIENT_SRC: 819 case CODING_RESULT_INSUFFICIENT_SRC:
821 Vlast_code_conversion_error = Qinsufficient_source; 820 Vlast_code_conversion_error = Qinsufficient_source;
822 break; 821 break;
823 case CODING_RESULT_INCONSISTENT_EOL:
824 Vlast_code_conversion_error = Qinconsistent_eol;
825 break;
826 case CODING_RESULT_INVALID_SRC: 822 case CODING_RESULT_INVALID_SRC:
827 Vlast_code_conversion_error = Qinvalid_source; 823 Vlast_code_conversion_error = Qinvalid_source;
828 break; 824 break;
829 case CODING_RESULT_INTERRUPT: 825 case CODING_RESULT_INTERRUPT:
830 Vlast_code_conversion_error = Qinterrupted; 826 Vlast_code_conversion_error = Qinterrupted;
831 break; 827 break;
832 case CODING_RESULT_INSUFFICIENT_MEM:
833 Vlast_code_conversion_error = Qinsufficient_memory;
834 break;
835 case CODING_RESULT_INSUFFICIENT_DST: 828 case CODING_RESULT_INSUFFICIENT_DST:
836 /* Don't record this error in Vlast_code_conversion_error 829 /* Don't record this error in Vlast_code_conversion_error
837 because it happens just temporarily and is resolved when the 830 because it happens just temporarily and is resolved when the
@@ -6884,22 +6877,8 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos)
6884 6877
6885#define ALLOC_CONVERSION_WORK_AREA(coding) \ 6878#define ALLOC_CONVERSION_WORK_AREA(coding) \
6886 do { \ 6879 do { \
6887 int size = CHARBUF_SIZE; \ 6880 coding->charbuf = SAFE_ALLOCA (CHARBUF_SIZE * sizeof (int)); \
6888 \ 6881 coding->charbuf_size = CHARBUF_SIZE; \
6889 coding->charbuf = NULL; \
6890 while (size > 1024) \
6891 { \
6892 coding->charbuf = alloca (sizeof (int) * size); \
6893 if (coding->charbuf) \
6894 break; \
6895 size >>= 1; \
6896 } \
6897 if (! coding->charbuf) \
6898 { \
6899 record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \
6900 return; \
6901 } \
6902 coding->charbuf_size = size; \
6903 } while (0) 6882 } while (0)
6904 6883
6905 6884
@@ -6968,6 +6947,8 @@ decode_coding (struct coding_system *coding)
6968 int carryover; 6947 int carryover;
6969 int i; 6948 int i;
6970 6949
6950 USE_SAFE_ALLOCA;
6951
6971 if (BUFFERP (coding->src_object) 6952 if (BUFFERP (coding->src_object)
6972 && coding->src_pos > 0 6953 && coding->src_pos > 0
6973 && coding->src_pos < GPT 6954 && coding->src_pos < GPT
@@ -7090,6 +7071,8 @@ decode_coding (struct coding_system *coding)
7090 bset_undo_list (current_buffer, undo_list); 7071 bset_undo_list (current_buffer, undo_list);
7091 record_insert (coding->dst_pos, coding->produced_char); 7072 record_insert (coding->dst_pos, coding->produced_char);
7092 } 7073 }
7074
7075 SAFE_FREE ();
7093} 7076}
7094 7077
7095 7078
@@ -7373,6 +7356,8 @@ encode_coding (struct coding_system *coding)
7373 int max_lookup; 7356 int max_lookup;
7374 struct ccl_spec cclspec; 7357 struct ccl_spec cclspec;
7375 7358
7359 USE_SAFE_ALLOCA;
7360
7376 attrs = CODING_ID_ATTRS (coding->id); 7361 attrs = CODING_ID_ATTRS (coding->id);
7377 if (coding->encoder == encode_coding_raw_text) 7362 if (coding->encoder == encode_coding_raw_text)
7378 translation_table = Qnil, max_lookup = 0; 7363 translation_table = Qnil, max_lookup = 0;
@@ -7407,6 +7392,8 @@ encode_coding (struct coding_system *coding)
7407 7392
7408 if (BUFFERP (coding->dst_object) && coding->produced_char > 0) 7393 if (BUFFERP (coding->dst_object) && coding->produced_char > 0)
7409 insert_from_gap (coding->produced_char, coding->produced); 7394 insert_from_gap (coding->produced_char, coding->produced);
7395
7396 SAFE_FREE ();
7410} 7397}
7411 7398
7412 7399
@@ -7695,14 +7682,8 @@ decode_coding_object (struct coding_system *coding,
7695 set_buffer_internal (XBUFFER (coding->dst_object)); 7682 set_buffer_internal (XBUFFER (coding->dst_object));
7696 if (dst_bytes < coding->produced) 7683 if (dst_bytes < coding->produced)
7697 { 7684 {
7685 eassert (coding->produced > 0);
7698 destination = xrealloc (destination, coding->produced); 7686 destination = xrealloc (destination, coding->produced);
7699 if (! destination)
7700 {
7701 record_conversion_result (coding,
7702 CODING_RESULT_INSUFFICIENT_MEM);
7703 unbind_to (count, Qnil);
7704 return;
7705 }
7706 if (BEGV < GPT && GPT < BEGV + coding->produced_char) 7687 if (BEGV < GPT && GPT < BEGV + coding->produced_char)
7707 move_gap_both (BEGV, BEGV_BYTE); 7688 move_gap_both (BEGV, BEGV_BYTE);
7708 memcpy (destination, BEGV_ADDR, coding->produced); 7689 memcpy (destination, BEGV_ADDR, coding->produced);
@@ -10408,10 +10389,8 @@ syms_of_coding (void)
10408 intern_c_string ("coding-category-undecided")); 10389 intern_c_string ("coding-category-undecided"));
10409 10390
10410 DEFSYM (Qinsufficient_source, "insufficient-source"); 10391 DEFSYM (Qinsufficient_source, "insufficient-source");
10411 DEFSYM (Qinconsistent_eol, "inconsistent-eol");
10412 DEFSYM (Qinvalid_source, "invalid-source"); 10392 DEFSYM (Qinvalid_source, "invalid-source");
10413 DEFSYM (Qinterrupted, "interrupted"); 10393 DEFSYM (Qinterrupted, "interrupted");
10414 DEFSYM (Qinsufficient_memory, "insufficient-memory");
10415 DEFSYM (Qcoding_system_define_form, "coding-system-define-form"); 10394 DEFSYM (Qcoding_system_define_form, "coding-system-define-form");
10416 10395
10417 defsubr (&Scoding_system_p); 10396 defsubr (&Scoding_system_p);
diff --git a/src/coding.h b/src/coding.h
index eb95fa13ddb..28a7d776b63 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -272,37 +272,31 @@ enum coding_result_code
272 CODING_RESULT_SUCCESS, 272 CODING_RESULT_SUCCESS,
273 CODING_RESULT_INSUFFICIENT_SRC, 273 CODING_RESULT_INSUFFICIENT_SRC,
274 CODING_RESULT_INSUFFICIENT_DST, 274 CODING_RESULT_INSUFFICIENT_DST,
275 CODING_RESULT_INCONSISTENT_EOL,
276 CODING_RESULT_INVALID_SRC, 275 CODING_RESULT_INVALID_SRC,
277 CODING_RESULT_INTERRUPT, 276 CODING_RESULT_INTERRUPT
278 CODING_RESULT_INSUFFICIENT_MEM
279 }; 277 };
280 278
281 279
282/* Macros used for the member `mode' of the struct coding_system. */ 280/* Macros used for the member `mode' of the struct coding_system. */
283 281
284/* If set, recover the original CR or LF of the already decoded text
285 when the decoding routine encounters an inconsistent eol format. */
286#define CODING_MODE_INHIBIT_INCONSISTENT_EOL 0x01
287
288/* If set, the decoding/encoding routines treat the current data as 282/* If set, the decoding/encoding routines treat the current data as
289 the last block of the whole text to be converted, and do the 283 the last block of the whole text to be converted, and do the
290 appropriate finishing job. */ 284 appropriate finishing job. */
291#define CODING_MODE_LAST_BLOCK 0x02 285#define CODING_MODE_LAST_BLOCK 0x01
292 286
293/* If set, it means that the current source text is in a buffer which 287/* If set, it means that the current source text is in a buffer which
294 enables selective display. */ 288 enables selective display. */
295#define CODING_MODE_SELECTIVE_DISPLAY 0x04 289#define CODING_MODE_SELECTIVE_DISPLAY 0x02
296 290
297/* This flag is used by the decoding/encoding routines on the fly. If 291/* This flag is used by the decoding/encoding routines on the fly. If
298 set, it means that right-to-left text is being processed. */ 292 set, it means that right-to-left text is being processed. */
299#define CODING_MODE_DIRECTION 0x08 293#define CODING_MODE_DIRECTION 0x04
300 294
301#define CODING_MODE_FIXED_DESTINATION 0x10 295#define CODING_MODE_FIXED_DESTINATION 0x08
302 296
303/* If set, it means that the encoding routines produces some safe 297/* If set, it means that the encoding routines produces some safe
304 ASCII characters (usually '?') for unsupported characters. */ 298 ASCII characters (usually '?') for unsupported characters. */
305#define CODING_MODE_SAFE_ENCODING 0x20 299#define CODING_MODE_SAFE_ENCODING 0x10
306 300
307 /* For handling composition sequence. */ 301 /* For handling composition sequence. */
308#include "composite.h" 302#include "composite.h"
@@ -725,22 +719,6 @@ extern Lisp_Object from_unicode (Lisp_Object str);
725 719
726/* Macros for backward compatibility. */ 720/* Macros for backward compatibility. */
727 721
728#define decode_coding_region(coding, from, to) \
729 decode_coding_object (coding, Fcurrent_buffer (), \
730 from, CHAR_TO_BYTE (from), \
731 to, CHAR_TO_BYTE (to), Fcurrent_buffer ())
732
733
734#define encode_coding_region(coding, from, to) \
735 encode_coding_object (coding, Fcurrent_buffer (), \
736 from, CHAR_TO_BYTE (from), \
737 to, CHAR_TO_BYTE (to), Fcurrent_buffer ())
738
739
740#define decode_coding_string(coding, string, nocopy) \
741 decode_coding_object (coding, string, 0, 0, SCHARS (string), \
742 SBYTES (string), Qt)
743
744#define encode_coding_string(coding, string, nocopy) \ 722#define encode_coding_string(coding, string, nocopy) \
745 (STRING_MULTIBYTE(string) ? \ 723 (STRING_MULTIBYTE(string) ? \
746 (encode_coding_object (coding, string, 0, 0, SCHARS (string), \ 724 (encode_coding_object (coding, string, 0, 0, SCHARS (string), \
diff --git a/src/indent.c b/src/indent.c
index 9bf75bc6d95..abb4e08ad08 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1843,7 +1843,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1843 ptrdiff_t bytepos; 1843 ptrdiff_t bytepos;
1844 Lisp_Object propval; 1844 Lisp_Object propval;
1845 1845
1846 prevline = find_next_newline_no_quit (from - 1, -1, &bytepos); 1846 prevline = find_newline_no_quit (from - 1, -1, &bytepos);
1847 while (prevline > BEGV 1847 while (prevline > BEGV
1848 && ((selective > 0 1848 && ((selective > 0
1849 && indented_beyond_p (prevline, bytepos, selective)) 1849 && indented_beyond_p (prevline, bytepos, selective))
@@ -1853,7 +1853,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1853 Qinvisible, 1853 Qinvisible,
1854 text_prop_object), 1854 text_prop_object),
1855 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1855 TEXT_PROP_MEANS_INVISIBLE (propval))))
1856 prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); 1856 prevline = find_newline_no_quit (prevline - 1, -1, &bytepos);
1857 pos = *compute_motion (prevline, 0, 1857 pos = *compute_motion (prevline, 0,
1858 lmargin, 1858 lmargin,
1859 0, 1859 0,
@@ -1894,7 +1894,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1894 ptrdiff_t bytepos; 1894 ptrdiff_t bytepos;
1895 Lisp_Object propval; 1895 Lisp_Object propval;
1896 1896
1897 prevline = find_next_newline_no_quit (from, -1, &bytepos); 1897 prevline = find_newline_no_quit (from, -1, &bytepos);
1898 while (prevline > BEGV 1898 while (prevline > BEGV
1899 && ((selective > 0 1899 && ((selective > 0
1900 && indented_beyond_p (prevline, bytepos, selective)) 1900 && indented_beyond_p (prevline, bytepos, selective))
@@ -1904,7 +1904,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1904 Qinvisible, 1904 Qinvisible,
1905 text_prop_object), 1905 text_prop_object),
1906 TEXT_PROP_MEANS_INVISIBLE (propval)))) 1906 TEXT_PROP_MEANS_INVISIBLE (propval))))
1907 prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); 1907 prevline = find_newline_no_quit (prevline - 1, -1, &bytepos);
1908 pos = *compute_motion (prevline, 0, 1908 pos = *compute_motion (prevline, 0,
1909 lmargin, 1909 lmargin,
1910 0, 1910 0,
diff --git a/src/lisp.h b/src/lisp.h
index f978a3b2fe0..46c1937c862 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3351,8 +3351,7 @@ extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t,
3351 ptrdiff_t *, ptrdiff_t *, bool); 3351 ptrdiff_t *, ptrdiff_t *, bool);
3352extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, 3352extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
3353 EMACS_INT, bool); 3353 EMACS_INT, bool);
3354extern ptrdiff_t find_next_newline (ptrdiff_t, int); 3354extern ptrdiff_t find_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
3355extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
3356extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, 3355extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t,
3357 ptrdiff_t, ptrdiff_t *); 3356 ptrdiff_t, ptrdiff_t *);
3358extern void syms_of_search (void); 3357extern void syms_of_search (void);
diff --git a/src/msdos.c b/src/msdos.c
index ac8c90455d7..ee47109d5f2 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1,4 +1,4 @@
1/* MS-DOS specific C utilities. -*- coding: raw-text -*- 1/* MS-DOS specific C utilities. -*- coding: cp850 -*-
2 2
3Copyright (C) 1993-1997, 1999-2013 Free Software Foundation, Inc. 3Copyright (C) 1993-1997, 1999-2013 Free Software Foundation, Inc.
4 4
@@ -20,6 +20,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20/* Contributed by Morten Welinder */ 20/* Contributed by Morten Welinder */
21/* New display, keyboard, and mouse control by Kim F. Storm */ 21/* New display, keyboard, and mouse control by Kim F. Storm */
22 22
23/* Note: This file MUST use a unibyte encoding, to both display the
24 keys on the non-US keyboard layout as their respective labels, and
25 provide the correct byte values for the keyboard input to inject
26 into Emacs. See 'struct dos_keyboard_map' below. As long as there
27 are only European keyboard layouts here, we are OK with DOS
28 codepage 850 encoding. */
29
23/* Note: some of the stuff here was taken from end of sysdep.c in demacs. */ 30/* Note: some of the stuff here was taken from end of sysdep.c in demacs. */
24 31
25#include <config.h> 32#include <config.h>
@@ -1965,10 +1972,10 @@ struct dos_keyboard_map
1965 1972
1966static struct dos_keyboard_map us_keyboard = { 1973static struct dos_keyboard_map us_keyboard = {
1967/* 0 1 2 3 4 5 */ 1974/* 0 1 2 3 4 5 */
1968/* 01234567890123456789012345678901234567890 12345678901234 */ 1975/* 01234567890123456789012345678901234567890 123 45678901234 */
1969 "`1234567890-= qwertyuiop[] asdfghjkl;'\\ zxcvbnm,./ ", 1976 "`1234567890-= qwertyuiop[] asdfghjkl;'\\ \\zxcvbnm,./ ",
1970/* 0123456789012345678901234567890123456789 012345678901234 */ 1977/* 0123456789012345678901234567890123456789 012345678901234 */
1971 "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| ZXCVBNM<>? ", 1978 "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| |ZXCVBNM<>? ",
1972 0, /* no Alt-Gr key */ 1979 0, /* no Alt-Gr key */
1973 0 /* no translate table */ 1980 0 /* no translate table */
1974}; 1981};
@@ -1976,9 +1983,9 @@ static struct dos_keyboard_map us_keyboard = {
1976static struct dos_keyboard_map fr_keyboard = { 1983static struct dos_keyboard_map fr_keyboard = {
1977/* 0 1 2 3 4 5 */ 1984/* 0 1 2 3 4 5 */
1978/* 012 3456789012345678901234567890123456789012345678901234 */ 1985/* 012 3456789012345678901234567890123456789012345678901234 */
1979 "&\",(-_)= azertyuiop^$ qsdfghjklm* wxcvbnm;:! ", 1986 "&\"'(-_)= azertyuiop^$ qsdfghjklm* <wxcvbn,;:! ",
1980/* 0123456789012345678901234567890123456789012345678901234 */ 1987/* 0123456789012345678901234567890123456789012345678901234 */
1981 " 1234567890+ AZERTYUIOP QSDFGHJKLM% WXCVBN?./ ", 1988 " 1234567890+ AZERTYUIOP QSDFGHJKLM% >WXCVBN?./ ",
1982/* 01234567 89012345678901234567890123456789012345678901234 */ 1989/* 01234567 89012345678901234567890123456789012345678901234 */
1983 " ~#{[|`\\^@]} ", 1990 " ~#{[|`\\^@]} ",
1984 0 /* no translate table */ 1991 0 /* no translate table */
@@ -2000,9 +2007,9 @@ static struct kbd_translate it_kbd_translate_table[] = {
2000static struct dos_keyboard_map it_keyboard = { 2007static struct dos_keyboard_map it_keyboard = {
2001/* 0 1 2 3 4 5 */ 2008/* 0 1 2 3 4 5 */
2002/* 0 123456789012345678901234567890123456789012345678901234 */ 2009/* 0 123456789012345678901234567890123456789012345678901234 */
2003 "\\1234567890'< qwertyuiop+> asdfghjkl zxcvbnm,.- ", 2010 "\\1234567890'< qwertyuiop+> asdfghjkl <zxcvbnm,.- ",
2004/* 01 23456789012345678901234567890123456789012345678901234 */ 2011/* 01 23456789012345678901234567890123456789012345678901234 */
2005 "|!\"$%&/()=?^> QWERTYUIOP* ASDFGHJKL ZXCVBNM;:_ ", 2012 "|!\"$%&/()=?^> QWERTYUIOP* ASDFGHJKL >ZXCVBNM;:_ ",
2006/* 0123456789012345678901234567890123456789012345678901234 */ 2013/* 0123456789012345678901234567890123456789012345678901234 */
2007 " {}~` [] @# ", 2014 " {}~` [] @# ",
2008 it_kbd_translate_table 2015 it_kbd_translate_table
@@ -2011,9 +2018,9 @@ static struct dos_keyboard_map it_keyboard = {
2011static struct dos_keyboard_map dk_keyboard = { 2018static struct dos_keyboard_map dk_keyboard = {
2012/* 0 1 2 3 4 5 */ 2019/* 0 1 2 3 4 5 */
2013/* 0123456789012345678901234567890123456789012345678901234 */ 2020/* 0123456789012345678901234567890123456789012345678901234 */
2014 "1234567890+| qwertyuiop~ asdfghjkl' zxcvbnm,.- ", 2021 "1234567890+| qwertyuiop~ asdfghjkl' <zxcvbnm,.- ",
2015/* 01 23456789012345678901234567890123456789012345678901234 */ 2022/* 01 23456789012345678901234567890123456789012345678901234 */
2016 "!\"#$%&/()=?` QWERTYUIOP^ ASDFGHJKL* ZXCVBNM;:_ ", 2023 "!\"#$%&/()=?` QWERTYUIOP^ ASDFGHJKL* >ZXCVBNM;:_ ",
2017/* 0123456789012345678901234567890123456789012345678901234 */ 2024/* 0123456789012345678901234567890123456789012345678901234 */
2018 " @$ {[]} | ", 2025 " @$ {[]} | ",
2019 0 /* no translate table */ 2026 0 /* no translate table */
diff --git a/src/search.c b/src/search.c
index 1c0f57487f9..090965ead3b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -941,15 +941,17 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte,
941 return count * direction; 941 return count * direction;
942} 942}
943 943
944/* Like find_newline, but doesn't allow QUITting and doesn't return
945 SHORTAGE. */
944ptrdiff_t 946ptrdiff_t
945find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) 947find_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos)
946{ 948{
947 return find_newline (from, 0, cnt, NULL, bytepos, 0); 949 return find_newline (from, 0, cnt, NULL, bytepos, 0);
948} 950}
949 951
950/* Like find_next_newline, but returns position before the newline, 952/* Like find_newline, but returns position before the newline, not
951 not after, and only search up to TO. This isn't just 953 after, and only search up to TO.
952 find_next_newline (...)-1, because you might hit TO. */ 954 This isn't just find_newline_no_quit (...)-1, because you might hit TO. */
953 955
954ptrdiff_t 956ptrdiff_t
955find_before_next_newline (ptrdiff_t from, ptrdiff_t to, 957find_before_next_newline (ptrdiff_t from, ptrdiff_t to,
diff --git a/src/sysdep.c b/src/sysdep.c
index c4b937183ca..fe6371623a9 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2541,20 +2541,12 @@ list_system_processes (void)
2541 return proclist; 2541 return proclist;
2542} 2542}
2543 2543
2544#elif defined BSD_SYSTEM 2544#elif defined DARWIN_OS || defined __FreeBSD__
2545
2546/* OpenBSD 4.9 and earlier do not have KERN_PROC. Approximate it with
2547 KERN_PROC2. MirBSD's KERN_PROC seems to be busted. */
2548# if !defined KERN_PROC || defined __MirBSD__
2549# undef KERN_PROC
2550# define KERN_PROC KERN_PROC2
2551# define kinfo_proc kinfo_proc2
2552# endif
2553 2545
2554Lisp_Object 2546Lisp_Object
2555list_system_processes (void) 2547list_system_processes (void)
2556{ 2548{
2557#if defined DARWIN_OS || defined __NetBSD__ || defined __OpenBSD__ 2549#ifdef DARWIN_OS
2558 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; 2550 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
2559#else 2551#else
2560 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC}; 2552 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
@@ -2580,10 +2572,8 @@ list_system_processes (void)
2580 len /= sizeof (struct kinfo_proc); 2572 len /= sizeof (struct kinfo_proc);
2581 for (i = 0; i < len; i++) 2573 for (i = 0; i < len; i++)
2582 { 2574 {
2583#if defined DARWIN_OS || defined __NetBSD__ 2575#ifdef DARWIN_OS
2584 proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist); 2576 proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist);
2585#elif defined __OpenBSD__
2586 proclist = Fcons (make_fixnum_or_float (procs[i].p_pid), proclist);
2587#else 2577#else
2588 proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist); 2578 proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist);
2589#endif 2579#endif
diff --git a/src/xdisp.c b/src/xdisp.c
index 83e3a06d21d..28acbbdb8c0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5940,9 +5940,8 @@ pop_it (struct it *it)
5940static void 5940static void
5941back_to_previous_line_start (struct it *it) 5941back_to_previous_line_start (struct it *it)
5942{ 5942{
5943 IT_CHARPOS (*it) 5943 IT_CHARPOS (*it) = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1,
5944 = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, 5944 &IT_BYTEPOS (*it));
5945 -1, &IT_BYTEPOS (*it));
5946} 5945}
5947 5946
5948 5947
@@ -5958,7 +5957,7 @@ back_to_previous_line_start (struct it *it)
5958 5957
5959 Newlines may come from buffer text, overlay strings, or strings 5958 Newlines may come from buffer text, overlay strings, or strings
5960 displayed via the `display' property. That's the reason we can't 5959 displayed via the `display' property. That's the reason we can't
5961 simply use find_next_newline_no_quit. 5960 simply use find_newline_no_quit.
5962 5961
5963 Note that this function may not skip over invisible text that is so 5962 Note that this function may not skip over invisible text that is so
5964 because of text properties and immediately follows a newline. If 5963 because of text properties and immediately follows a newline. If
@@ -6014,7 +6013,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
6014 if (!newline_found_p) 6013 if (!newline_found_p)
6015 { 6014 {
6016 ptrdiff_t bytepos, start = IT_CHARPOS (*it); 6015 ptrdiff_t bytepos, start = IT_CHARPOS (*it);
6017 ptrdiff_t limit = find_next_newline_no_quit (start, 1, &bytepos); 6016 ptrdiff_t limit = find_newline_no_quit (start, 1, &bytepos);
6018 Lisp_Object pos; 6017 Lisp_Object pos;
6019 6018
6020 eassert (!STRINGP (it->string)); 6019 eassert (!STRINGP (it->string));
@@ -7474,9 +7473,8 @@ get_visually_first_element (struct it *it)
7474 if (string_p) 7473 if (string_p)
7475 it->bidi_it.charpos = it->bidi_it.bytepos = 0; 7474 it->bidi_it.charpos = it->bidi_it.bytepos = 0;
7476 else 7475 else
7477 it->bidi_it.charpos 7476 it->bidi_it.charpos = find_newline_no_quit (IT_CHARPOS (*it), -1,
7478 = find_next_newline_no_quit (IT_CHARPOS (*it), -1, 7477 &it->bidi_it.bytepos);
7479 &it->bidi_it.bytepos);
7480 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); 7478 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
7481 do 7479 do
7482 { 7480 {
@@ -9123,8 +9121,8 @@ move_it_vertically_backward (struct it *it, int dy)
9123 && IT_CHARPOS (*it) > BEGV 9121 && IT_CHARPOS (*it) > BEGV
9124 && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') 9122 && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
9125 { 9123 {
9126 ptrdiff_t nl_pos = 9124 ptrdiff_t nl_pos = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1,
9127 find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1, NULL); 9125 NULL);
9128 9126
9129 move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); 9127 move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS);
9130 } 9128 }