[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/gnus-cloud 2204fd1 17/61: Merge branch 'master' of
From: |
Teodor Zlatanov |
Subject: |
[Emacs-diffs] scratch/gnus-cloud 2204fd1 17/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs |
Date: |
Fri, 1 Jul 2016 17:37:52 +0000 (UTC) |
branch: scratch/gnus-cloud
commit 2204fd1314116910ceb85fc71ee604e62a2ca1f0
Merge: a744c73 cc113e5
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
src/coding.c | 12 ++++++++----
src/fileio.c | 16 ++++++++++++++++
src/lread.c | 8 ++++++--
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/src/coding.c b/src/coding.c
index 804b628..29c90f0 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6826,7 +6826,14 @@ decode_eol (struct coding_system *coding)
while (pos_byte < pos_end)
{
+ int incr;
+
p = BYTE_POS_ADDR (pos_byte);
+ if (coding->dst_multibyte)
+ incr = BYTES_BY_CHAR_HEAD (*p);
+ else
+ incr = 1;
+
if (*p == '\r' && p[1] == '\n')
{
del_range_2 (pos, pos_byte, pos + 1, pos_byte + 1, 0);
@@ -6834,10 +6841,7 @@ decode_eol (struct coding_system *coding)
pos_end--;
}
pos++;
- if (coding->dst_multibyte)
- pos_byte += BYTES_BY_CHAR_HEAD (*p);
- else
- pos_byte++;
+ pos_byte += incr;
}
coding->produced -= n;
coding->produced_char -= n;
diff --git a/src/fileio.c b/src/fileio.c
index facc4be..b1f9d3c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3359,6 +3359,21 @@ restore_window_points (Lisp_Object window_markers,
ptrdiff_t inserted,
}
}
+/* Make sure the gap is at Z_BYTE. This is required to treat buffer
+ text as a linear C char array. */
+static void
+maybe_move_gap (struct buffer *b)
+{
+ if (BUF_GPT_BYTE (b) != BUF_Z_BYTE (b))
+ {
+ struct buffer *cb = current_buffer;
+
+ set_buffer_internal (b);
+ move_gap_both (Z, Z_BYTE);
+ set_buffer_internal (cb);
+ }
+}
+
/* FIXME: insert-file-contents should be split with the top-level moved to
Elisp and only the core kept in C. */
@@ -3942,6 +3957,7 @@ by calling `format-decode', which see. */)
coding_system = CODING_ID_NAME (coding.id);
set_coding_system = true;
+ maybe_move_gap (XBUFFER (conversion_buffer));
decoded = BUF_BEG_ADDR (XBUFFER (conversion_buffer));
inserted = (BUF_Z_BYTE (XBUFFER (conversion_buffer))
- BUF_BEG_BYTE (XBUFFER (conversion_buffer)));
diff --git a/src/lread.c b/src/lread.c
index 9f804ac..5c47f78 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1204,7 +1204,11 @@ Return t if the file exists and loads successfully. */)
specbind (Qold_style_backquotes, Qnil);
record_unwind_protect (load_warn_old_style_backquotes, file);
- if (suffix_p (found, ".elc") || (fd >= 0 && (version = safe_to_load_version
(fd)) > 0))
+ int is_elc;
+ if ((is_elc = suffix_p (found, ".elc")) != 0
+ /* version = 1 means the file is empty, in which case we can
+ treat it as not byte-compiled. */
+ || (fd >= 0 && (version = safe_to_load_version (fd)) > 1))
/* Load .elc files directly, but not when they are
remote and have no handler! */
{
@@ -1231,7 +1235,7 @@ Return t if the file exists and loads successfully. */)
/* openp already checked for newness, no point doing it again.
FIXME would be nice to get a message when openp
ignores suffix order due to load_prefer_newer. */
- if (!load_prefer_newer)
+ if (!load_prefer_newer && is_elc)
{
result = stat (SSDATA (efound), &s1);
if (result == 0)
- [Emacs-diffs] scratch/gnus-cloud ca64136 04/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, (continued)
- [Emacs-diffs] scratch/gnus-cloud ca64136 04/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2fff330 05/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud b1f7821 03/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 92163e0 06/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud b335707 09/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 8136bd2 12/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 8e9940f 07/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 9703790 13/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2f858df 19/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud ad87a3e 15/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 2204fd1 17/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs,
Teodor Zlatanov <=
- [Emacs-diffs] scratch/gnus-cloud a744c73 16/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud cc0e1f6 20/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 586ee65 22/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud bd8a5e4 08/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 30107d5 21/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 5afcf2f 29/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud c402cc0 30/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud c8f94d8 26/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 4fd911a 10/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01
- [Emacs-diffs] scratch/gnus-cloud 3706ef2 11/61: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Teodor Zlatanov, 2016/07/01