aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-03-07 00:03:57 +0100
committerJoakim Verona2013-03-07 00:03:57 +0100
commit2dcf541ff79077c00b5ca257a005a163affb3c9a (patch)
treec57b1582ce2d0ca7c894d36b45a7ff41613d8e05
parent79157e99328fb1d835985dfa89fc2a2fa427d077 (diff)
parentab89e9f9a594c30ce4c04e6d502bee3beaefe908 (diff)
downloademacs-2dcf541ff79077c00b5ca257a005a163affb3c9a.tar.gz
emacs-2dcf541ff79077c00b5ca257a005a163affb3c9a.zip
auto upstream
-rw-r--r--ChangeLog5
-rw-r--r--INSTALL6
-rwxr-xr-xautogen/configure11
-rw-r--r--configure.ac5
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/cc-mode.texi15
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/nndir.el3
-rw-r--r--lisp/gnus/nndraft.el3
-rw-r--r--lisp/progmodes/cc-align.el4
-rw-r--r--lisp/progmodes/ruby-mode.el6
-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
-rw-r--r--test/automated/ruby-mode-tests.el17
23 files changed, 179 insertions, 150 deletions
diff --git a/ChangeLog b/ChangeLog
index 293a554c9f5..84d88fa7f1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12013-03-06 Paul Eggert <eggert@cs.ucla.edu>
2
3 * configure.ac (TERM_HEADER): Remove duplicate definition (Bug#13872).
4 It can mess up 'configure' runs.
5
12013-03-05 Glenn Morris <rgm@gnu.org> 62013-03-05 Glenn Morris <rgm@gnu.org>
2 7
3 * Makefile.in (install-man): Ignore gzip exit status. 8 * Makefile.in (install-man): Ignore gzip exit status.
diff --git a/INSTALL b/INSTALL
index ec19e49b260..925c8b2de71 100644
--- a/INSTALL
+++ b/INSTALL
@@ -656,7 +656,7 @@ Here is a complete list of the variables you may want to set.
656 path variables - `bindir' and `libexecdir'. 656 path variables - `bindir' and `libexecdir'.
657 657
658The above variables serve analogous purposes in the makefiles for all 658The above variables serve analogous purposes in the makefiles for all
659GNU software; the following variable is specific to Emacs. 659GNU software; the following variables are specific to Emacs.
660 660
661`archlibdir' indicates where Emacs installs and expects the executable 661`archlibdir' indicates where Emacs installs and expects the executable
662 files and other architecture-dependent data it uses while 662 files and other architecture-dependent data it uses while
@@ -664,6 +664,10 @@ GNU software; the following variable is specific to Emacs.
664 see), is `/usr/local/libexec/emacs/VERSION/CONFIGURATION-NAME' 664 see), is `/usr/local/libexec/emacs/VERSION/CONFIGURATION-NAME'
665 (where VERSION and CONFIGURATION-NAME are as described above). 665 (where VERSION and CONFIGURATION-NAME are as described above).
666 666
667`GZIP_PROG' is the name of the executable that compresses installed info,
668 manual, and .el files. It defaults to gzip. Setting it to
669 the empty string suppresses compression.
670
667Remember that you must specify any variable values you need each time 671Remember that you must specify any variable values you need each time
668you run `make' in the top directory. If you run `make' once to build 672you run `make' in the top directory. If you run `make' once to build
669emacs, test it, and then run `make' again to install the files, you 673emacs, test it, and then run `make' again to install the files, you
diff --git a/autogen/configure b/autogen/configure
index a1844067f9d..f4e74332006 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -5896,7 +5896,8 @@ else
5896 test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" 5896 test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
5897fi 5897fi
5898 5898
5899# Avoid gnulib's tests for O_NOATIME and O_NOFOLLOW, as we don't use them. 5899# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
5900# as we don't use them.
5900 5901
5901# Avoid gnulib's threadlib module, as we do threads our own way. 5902# Avoid gnulib's threadlib module, as we do threads our own way.
5902 5903
@@ -9887,14 +9888,6 @@ case "${window_system}" in
9887 ;; 9888 ;;
9888esac 9889esac
9889 9890
9890if test -n "${term_header}"; then
9891
9892cat >>confdefs.h <<_ACEOF
9893#define TERM_HEADER "${term_header}"
9894_ACEOF
9895
9896fi
9897
9898if test "$window_system" = none && test "X$with_x" != "Xno"; then 9891if test "$window_system" = none && test "X$with_x" != "Xno"; then
9899 # Extract the first word of "X", so it can be a program name with args. 9892 # Extract the first word of "X", so it can be a program name with args.
9900set dummy X; ac_word=$2 9893set dummy X; ac_word=$2
diff --git a/configure.ac b/configure.ac
index 37ebab86296..86dd8aae23a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1582,11 +1582,6 @@ dnl use the toolkit if we have gtk, or X11R5 or newer.
1582 ;; 1582 ;;
1583esac 1583esac
1584 1584
1585if test -n "${term_header}"; then
1586 AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
1587 [Define to the header for the built-in window system.])
1588fi
1589
1590if test "$window_system" = none && test "X$with_x" != "Xno"; then 1585if test "$window_system" = none && test "X$with_x" != "Xno"; then
1591 AC_CHECK_PROG(HAVE_XSERVER, X, true, false) 1586 AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
1592 if test "$HAVE_XSERVER" = true || 1587 if test "$HAVE_XSERVER" = true ||
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 8ffc040d27f..3a3ed4623d1 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12013-03-06 Alan Mackenzie <acm@muc.de>
2
3 * cc-mode.texi (Custom Line-Up): Clarify position of point on
4 calling a line-up function.
5
12013-03-04 Paul Eggert <eggert@cs.ucla.edu> 62013-03-04 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi: 8 * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi:
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index bb6a5b001ad..4fa4e12cf88 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -6475,13 +6475,14 @@ think is generally useful, you're very welcome to contribute it;
6475please contact @email{bug-cc-mode@@gnu.org}. 6475please contact @email{bug-cc-mode@@gnu.org}.
6476 6476
6477 Line-up functions are passed a single argument, the syntactic 6477 Line-up functions are passed a single argument, the syntactic
6478element (see below). The return value is a @code{c-offsets-alist} 6478element (see below). At the time of the call, point will be somewhere
6479offset specification: for example, an integer, a symbol such as 6479on the line being indented. The return value is a
6480@code{+}, a vector, @code{nil}@footnote{Returning @code{nil} is useful 6480@code{c-offsets-alist} offset specification: for example, an integer,
6481when the offset specification for a syntactic element is a list 6481a symbol such as @code{+}, a vector, @code{nil}@footnote{Returning
6482containing the line-up function (@pxref{c-offsets-alist}).}, or even 6482@code{nil} is useful when the offset specification for a syntactic
6483another line-up function. Full details of these are in 6483element is a list containing the line-up function
6484@ref{c-offsets-alist}. 6484(@pxref{c-offsets-alist}).}, or even another line-up function. Full
6485details of these are in @ref{c-offsets-alist}.
6485 6486
6486Line-up functions must not move point or change the content of the 6487Line-up functions must not move point or change the content of the
6487buffer (except temporarily). They are however allowed to do 6488buffer (except temporarily). They are however allowed to do
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ac56cd8ba79..cef47715dc0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12013-03-06 Dmitry Gutov <dgutov@yandex.ru>
2
3 * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only
4 propertize regexp when not inside a string (Bug#13885).
5
62013-03-06 Alan Mackenzie <acm@muc.de>
7
8 Correct the position of point in some line-up functions.
9 * progmodes/cc-align.el (c-lineup-whitesmith-in-block)
10 (c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of
11 point at column 0 rather than at a random place in the line.
12
12013-03-05 Michael Albinus <michael.albinus@gmx.de> 132013-03-05 Michael Albinus <michael.albinus@gmx.de>
2 14
3 * net/tramp-compat.el (tramp-compat-delete-directory): Implement 15 * net/tramp-compat.el (tramp-compat-delete-directory): Implement
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index d79a09bbfe4..870164023d5 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
12013-03-06 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * nndir.el (nndir-request-list): Remove 2nd argument passed to
4 nnml-request-list. (Bug#13873)
5 (nndir-request-newsgroups): Remove, unused.
6
7 * nndraft.el (nndraft-request-newsgroups): Remove, unused.
8
12013-03-03 Ted Phelps <phelps@gnusto.com> 92013-03-03 Ted Phelps <phelps@gnusto.com>
2 10
3 * shr.el: Make all the overlays set the `evaporate' property so that 11 * shr.el: Make all the overlays set the `evaporate' property so that
diff --git a/lisp/gnus/nndir.el b/lisp/gnus/nndir.el
index b99a0c37d2e..5e68779e977 100644
--- a/lisp/gnus/nndir.el
+++ b/lisp/gnus/nndir.el
@@ -90,8 +90,7 @@
90 (nnml-request-article 0 nndir-current-group 0 0) 90 (nnml-request-article 0 nndir-current-group 0 0)
91 (nnmh-request-group nndir-current-group 0 0) 91 (nnmh-request-group nndir-current-group 0 0)
92 (nnml-close-group nndir-current-group 0) 92 (nnml-close-group nndir-current-group 0)
93 (nnml-request-list (nnoo-current-server 'nndir) nndir-directory) 93 (nnml-request-list (nnoo-current-server 'nndir)))
94 (nnml-request-newsgroups (nnoo-current-server 'nndir) nndir-directory))
95 94
96(provide 'nndir) 95(provide 'nndir)
97 96
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index ad8a8b164de..b19b56ae6ea 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -346,8 +346,7 @@ are generated if and only if they are also in `message-draft-headers'.")
346 nnmh-retrieve-headers 346 nnmh-retrieve-headers
347 nnmh-request-group 347 nnmh-request-group
348 nnmh-close-group 348 nnmh-close-group
349 nnmh-request-list 349 nnmh-request-list))
350 nnmh-request-newsgroups))
351 350
352(provide 'nndraft) 351(provide 'nndraft)
353 352
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index cdd0561a054..33836f25335 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -737,7 +737,7 @@ arglist-cont-nonempty."
737 (setq startpos (c-langelem-pos langelem))))) 737 (setq startpos (c-langelem-pos langelem)))))
738 738
739 (setq startpos (c-langelem-pos langelem) 739 (setq startpos (c-langelem-pos langelem)
740 endpos (point)) 740 endpos (c-point 'bol))
741 741
742 ;; Find a syntactically relevant and unnested "=" token on the 742 ;; Find a syntactically relevant and unnested "=" token on the
743 ;; current line. equalp is in that case set to the number of 743 ;; current line. equalp is in that case set to the number of
@@ -1039,6 +1039,7 @@ brace-list-close, brace-list-intro, statement-block-intro,
1039arglist-intro, arglist-cont-nonempty, arglist-close, and all in* 1039arglist-intro, arglist-cont-nonempty, arglist-close, and all in*
1040symbols, e.g. inclass and inextern-lang." 1040symbols, e.g. inclass and inextern-lang."
1041 (save-excursion 1041 (save-excursion
1042 (beginning-of-line)
1042 (if (and (c-go-up-list-backward) 1043 (if (and (c-go-up-list-backward)
1043 (= (point) (c-point 'boi))) 1044 (= (point) (c-point 'boi)))
1044 nil 1045 nil
@@ -1191,6 +1192,7 @@ Works with: arglist-cont, arglist-cont-nonempty."
1191 (let ((orig-pos (point)) 1192 (let ((orig-pos (point))
1192 alignto) 1193 alignto)
1193 (save-excursion 1194 (save-excursion
1195 (beginning-of-line)
1194 (and 1196 (and
1195 c-opt-asm-stmt-key 1197 c-opt-asm-stmt-key
1196 1198
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 9b007c0063a..6e471d1aa2a 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1276,8 +1276,10 @@ It will be properly highlighted even when the call omits parens."))
1276 "\\)\\s *" 1276 "\\)\\s *"
1277 ;; The regular expression itself. 1277 ;; The regular expression itself.
1278 "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)") 1278 "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)")
1279 (2 (string-to-syntax "\"/")) 1279 (3 (unless (nth 3 (syntax-ppss (match-beginning 2)))
1280 (3 (string-to-syntax "\"/"))) 1280 (put-text-property (match-beginning 2) (match-end 2)
1281 'syntax-table (string-to-syntax "\"/"))
1282 (string-to-syntax "\"/"))))
1281 ("^=en\\(d\\)\\_>" (1 "!")) 1283 ("^=en\\(d\\)\\_>" (1 "!"))
1282 ("^\\(=\\)begin\\_>" (1 "!")) 1284 ("^\\(=\\)begin\\_>" (1 "!"))
1283 ;; Handle here documents. 1285 ;; Handle here documents.
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 }
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index c67f92e6ed9..81bae187218 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -47,17 +47,16 @@ The whitespace before and including \"|\" on each line is removed."
47(defun ruby-test-string (s &rest args) 47(defun ruby-test-string (s &rest args)
48 (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args)) 48 (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args))
49 49
50(defun ruby-assert-state (content &rest values-plist) 50(defun ruby-assert-state (content index value &optional point)
51 "Assert syntax state values at the end of CONTENT. 51 "Assert syntax state values at the end of CONTENT.
52 52
53VALUES-PLIST is a list with alternating index and value elements." 53VALUES-PLIST is a list with alternating index and value elements."
54 (ruby-with-temp-buffer content 54 (ruby-with-temp-buffer content
55 (when point (goto-char point))
55 (syntax-propertize (point)) 56 (syntax-propertize (point))
56 (while values-plist 57 (should (eq (nth index
57 (should (eq (nth (car values-plist) 58 (parse-partial-sexp (point-min) (point)))
58 (parse-partial-sexp (point-min) (point))) 59 value))))
59 (cadr values-plist)))
60 (setq values-plist (cddr values-plist)))))
61 60
62(defun ruby-assert-face (content pos face) 61(defun ruby-assert-face (content pos face)
63 (ruby-with-temp-buffer content 62 (ruby-with-temp-buffer content
@@ -104,6 +103,12 @@ VALUES-PLIST is a list with alternating index and value elements."
104 (ruby-should-indent "a = %w[abc\n def]\n " 0) 103 (ruby-should-indent "a = %w[abc\n def]\n " 0)
105 (ruby-should-indent "a = \"abc\n def\"\n " 0)) 104 (ruby-should-indent "a = \"abc\n def\"\n " 0))
106 105
106(ert-deftest ruby-regexp-doest-start-in-string ()
107 (ruby-assert-state "'(/', /\d+/" 3 nil))
108
109(ert-deftest ruby-regexp-starts-after-string ()
110 (ruby-assert-state "'(/', /\d+/" 3 ?/ 8))
111
107(ert-deftest ruby-indent-simple () 112(ert-deftest ruby-indent-simple ()
108 (ruby-should-indent-buffer 113 (ruby-should-indent-buffer
109 "if foo 114 "if foo