summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-01-09 15:29:25 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2018-01-09 15:29:25 -0800
commitddb26f79b20329ada5f5bc6e1742807d029e06c0 (patch)
tree4eb2572b11bba0c4fa7fc388dc2f65648be89b5e /src
parent0b33768053184ceadda0ca6dc431969e664cd17e (diff)
parent7668717d6fecd610d71b54a33708038b2ede8cce (diff)
downloademacs-ddb26f79b20329ada5f5bc6e1742807d029e06c0.tar.gz
Merge from origin/emacs-26
7668717d6f Merge from Gnulib 9e4d523427 * lisp/epg.el (epg-start-sign): Replace obsolete functions. 26c58f31a8 Small fix for erc-logging-enabled 34b41e3bc6 Quieten semantic normal usage e25f961e37 Avoid irrelevant hyperlink in doc string of 'epa-pinentry-... ec2636513c * doc/misc/tramp.texi (Remote processes): Mention gdb rest... 918a052a42 Query background for gnome terminal version 3.22 (Bug#29716) 1dfc27576a Make pixel-wise scrolling less laggy f92264fc2a Fix child frame placement issues (bug#29953) a5f718c4c5 ; * doc/lispref/text.texi (Change Hooks): Fix last change. e876f5f9fb Describe the precise interaction of complex primitives wit... 3a22097cf6 Fix valgrind report in call-interactively d5f1c87bfe * src/editfns.c (Fsave_excursion): Doc fix. (Bug#30001) b8d74c4578 Fix mark-defun when there's no spaces between successive d... a377c652b5 Fix Dired display and operations on file names with raw bytes d9d6e8a04c ; Comments related to src/termcap.c f8a07fa6b1 Improve documentation of 'gdb-many-windows' f82400798e Fix failures in smerge-mode on MS-Windows
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in2
-rw-r--r--src/callint.c21
-rw-r--r--src/coding.c19
-rw-r--r--src/editfns.c2
-rw-r--r--src/nsterm.h6
-rw-r--r--src/nsterm.m46
-rw-r--r--src/termcap.c3
7 files changed, 71 insertions, 28 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 837bed1acd6..2de888ada33 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -170,7 +170,7 @@ NOTIFY_LIBS = @NOTIFY_LIBS@
## -ltermcap, or -lncurses, or -lcurses, or "".
LIBS_TERMCAP=@LIBS_TERMCAP@
-## terminfo.o if TERMINFO, else tparam.o.
+## terminfo.o if TERMINFO, else (on MS-DOS only: termcap.o +) tparam.o.
TERMCAP_OBJ=@TERMCAP_OBJ@
LIBXMU=@LIBXMU@
diff --git a/src/callint.c b/src/callint.c
index c713e08d4d4..2253cdf3b44 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -778,10 +778,23 @@ invoke it. If KEYS is omitted or nil, the return value of
if anyone tries to define one here. */
case '+':
default:
- error ("Invalid control letter `%c' (#o%03o, #x%04x) in interactive calling string",
- STRING_CHAR ((unsigned char *) tem),
- (unsigned) STRING_CHAR ((unsigned char *) tem),
- (unsigned) STRING_CHAR ((unsigned char *) tem));
+ {
+ /* How many bytes are left unprocessed in the specs string?
+ (Note that this excludes the trailing null byte.) */
+ ptrdiff_t bytes_left = SBYTES (specs) - (tem - string);
+ unsigned letter;
+
+ /* If we have enough bytes left to treat the sequence as a
+ character, show that character's codepoint; otherwise
+ show only its first byte. */
+ if (bytes_left >= BYTES_BY_CHAR_HEAD (*((unsigned char *) tem)))
+ letter = STRING_CHAR ((unsigned char *) tem);
+ else
+ letter = *((unsigned char *) tem);
+
+ error ("Invalid control letter `%c' (#o%03o, #x%04x) in interactive calling string",
+ (int) letter, letter, letter);
+ }
}
if (varies[i] == 0)
diff --git a/src/coding.c b/src/coding.c
index da625403441..901f806e44b 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7437,10 +7437,23 @@ decode_coding (struct coding_system *coding)
while (nbytes-- > 0)
{
- int c = *src++;
+ int c;
- if (c & 0x80)
- c = BYTE8_TO_CHAR (c);
+ /* Copy raw bytes in their 2-byte forms from multibyte
+ text as single characters. */
+ if (coding->src_multibyte
+ && CHAR_BYTE8_HEAD_P (*src) && nbytes > 0)
+ {
+ c = STRING_CHAR_ADVANCE (src);
+ nbytes--;
+ }
+ else
+ {
+ c = *src++;
+
+ if (c & 0x80)
+ c = BYTE8_TO_CHAR (c);
+ }
coding->charbuf[coding->charbuf_used++] = c;
}
produce_chars (coding, Qnil, 1);
diff --git a/src/editfns.c b/src/editfns.c
index 80871a778b9..96bb271b2d6 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1037,7 +1037,7 @@ If you only want to save the current buffer but not point,
then just use `save-current-buffer', or even `with-current-buffer'.
Before Emacs 25.1, `save-excursion' used to save the mark state.
-To save the marker state as well as the point and buffer, use
+To save the mark state as well as point and the current buffer, use
`save-mark-and-excursion'.
usage: (save-excursion &rest BODY) */)
diff --git a/src/nsterm.h b/src/nsterm.h
index 878923cbb41..cc4c6d5e910 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1077,11 +1077,11 @@ struct x_output
window or, if there is no parent window, the screen. */
#define NS_PARENT_WINDOW_LEFT_POS(f) \
(FRAME_PARENT_FRAME (f) != NULL \
- ? [[FRAME_NS_VIEW (f) window] parentWindow].frame.origin.x : 0)
+ ? [FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)) window].frame.origin.x : 0)
#define NS_PARENT_WINDOW_TOP_POS(f) \
(FRAME_PARENT_FRAME (f) != NULL \
- ? ([[FRAME_NS_VIEW (f) window] parentWindow].frame.origin.y \
- + [[FRAME_NS_VIEW (f) window] parentWindow].frame.size.height \
+ ? ([FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)) window].frame.origin.y \
+ + [FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)) window].frame.size.height \
- FRAME_NS_TITLEBAR_HEIGHT (FRAME_PARENT_FRAME (f))) \
: [[[NSScreen screens] objectAtIndex: 0] frame].size.height)
diff --git a/src/nsterm.m b/src/nsterm.m
index b80d832ee0b..1f23a6e4fa8 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1736,7 +1736,6 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
{
NSView *view = FRAME_NS_VIEW (f);
NSArray *screens = [NSScreen screens];
- NSScreen *fscreen = [screens objectAtIndex: 0];
NSScreen *screen = [[view window] screen];
NSTRACE ("x_set_offset");
@@ -1746,26 +1745,41 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
f->left_pos = xoff;
f->top_pos = yoff;
- if (view != nil && screen && fscreen)
+ if (view != nil)
{
- f->left_pos = f->size_hint_flags & XNegative
- ? [screen visibleFrame].size.width + f->left_pos - FRAME_PIXEL_WIDTH (f)
- : f->left_pos;
- /* We use visibleFrame here to take menu bar into account.
- Ideally we should also adjust left/top with visibleFrame.origin. */
-
- f->top_pos = f->size_hint_flags & YNegative
- ? ([screen visibleFrame].size.height + f->top_pos
- - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f)
- - FRAME_TOOLBAR_HEIGHT (f))
- : f->top_pos;
+ if (FRAME_PARENT_FRAME (f) == NULL && screen)
+ {
+ f->left_pos = f->size_hint_flags & XNegative
+ ? [screen visibleFrame].size.width + f->left_pos - FRAME_PIXEL_WIDTH (f)
+ : f->left_pos;
+ /* We use visibleFrame here to take menu bar into account.
+ Ideally we should also adjust left/top with visibleFrame.origin. */
+
+ f->top_pos = f->size_hint_flags & YNegative
+ ? ([screen visibleFrame].size.height + f->top_pos
+ - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f)
+ - FRAME_TOOLBAR_HEIGHT (f))
+ : f->top_pos;
#ifdef NS_IMPL_GNUSTEP
- if (FRAME_PARENT_FRAME (f) == NULL)
- {
if (f->left_pos < 100)
f->left_pos = 100; /* don't overlap menu */
- }
#endif
+ }
+ else if (FRAME_PARENT_FRAME (f) != NULL)
+ {
+ struct frame *parent = FRAME_PARENT_FRAME (f);
+
+ /* On X negative values for child frames always result in
+ positioning relative to the bottom right corner of the
+ parent frame. */
+ if (f->left_pos < 0)
+ f->left_pos = FRAME_PIXEL_WIDTH (parent) - FRAME_PIXEL_WIDTH (f) + f->left_pos;
+
+ if (f->top_pos < 0)
+ f->top_pos = FRAME_PIXEL_HEIGHT (parent) + FRAME_TOOLBAR_HEIGHT (parent)
+ - FRAME_PIXEL_HEIGHT (f) + f->top_pos;
+ }
+
/* Constrain the setFrameTopLeftPoint so we don't move behind the
menu bar. */
NSPoint pt = NSMakePoint (SCREENMAXBOUND (f->left_pos
diff --git a/src/termcap.c b/src/termcap.c
index ee0b8f5cbb6..4d85323a9ef 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -15,6 +15,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* Since 2010-03, 073589f4, Emacs 24.1, this file is only used
+ by the MS-DOS port of Emacs. */
+
/* Emacs config.h may rename various library functions such as malloc. */
#include <config.h>
#include <sys/file.h>