diff options
-rwxr-xr-x | build-aux/config.guess | 4 | ||||
-rwxr-xr-x | build-aux/config.sub | 4 | ||||
-rwxr-xr-x | build-aux/update-copyright | 7 | ||||
-rw-r--r-- | doc/emacs/building.texi | 8 | ||||
-rw-r--r-- | doc/lispref/text.texi | 23 | ||||
-rw-r--r-- | doc/misc/tramp.texi | 4 | ||||
-rw-r--r-- | lib/md5.c | 7 | ||||
-rw-r--r-- | lib/md5.h | 7 | ||||
-rw-r--r-- | lib/sha1.c | 7 | ||||
-rw-r--r-- | lib/sha1.h | 7 | ||||
-rw-r--r-- | lib/sha256.c | 7 | ||||
-rw-r--r-- | lib/sha256.h | 7 | ||||
-rw-r--r-- | lib/sha512.c | 7 | ||||
-rw-r--r-- | lib/sha512.h | 7 | ||||
-rw-r--r-- | lib/signal.in.h | 2 | ||||
-rw-r--r-- | lib/stat-time.h | 10 | ||||
-rw-r--r-- | lisp/cedet/semantic/lex.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 18 | ||||
-rw-r--r-- | lisp/epa.el | 7 | ||||
-rw-r--r-- | lisp/epg.el | 4 | ||||
-rw-r--r-- | lisp/erc/erc-log.el | 5 | ||||
-rw-r--r-- | lisp/pixel-scroll.el | 71 | ||||
-rw-r--r-- | lisp/term/xterm.el | 7 | ||||
-rw-r--r-- | lisp/vc/smerge-mode.el | 6 | ||||
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/callint.c | 21 | ||||
-rw-r--r-- | src/coding.c | 19 | ||||
-rw-r--r-- | src/editfns.c | 2 | ||||
-rw-r--r-- | src/nsterm.h | 6 | ||||
-rw-r--r-- | src/nsterm.m | 46 | ||||
-rw-r--r-- | src/termcap.c | 3 |
31 files changed, 245 insertions, 93 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess index 770cb5c7eb0..ba28704cd61 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-12-17' +timestamp='2018-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." diff --git a/build-aux/config.sub b/build-aux/config.sub index 4fa505b51aa..a2ff1fb0565 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-11-23' +timestamp='2018-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." diff --git a/build-aux/update-copyright b/build-aux/update-copyright index 5b11e306cdc..3bb26abea1b 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' if 0; # Update an FSF copyright year list to include the current year. -my $VERSION = '2017-09-13.06:45'; # UTC +my $VERSION = '2018-01-04.14:48'; # UTC # Copyright (C) 2009-2018 Free Software Foundation, Inc. # @@ -81,6 +81,7 @@ my $VERSION = '2017-09-13.06:45'; # UTC # B. (c) # C. @copyright{} # D. © +# E. © # # 4. The "Copyright" appears at the beginning of a line, except that it # may be prefixed by any sequence (e.g., a comment) of no more than @@ -124,7 +125,7 @@ use strict; use warnings; my $copyright_re = 'Copyright'; -my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©|©)'; my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; $holder ||= 'Free Software Foundation, Inc.'; my $prefix_max = 5; @@ -263,7 +264,9 @@ else print STDERR "$ARGV: warning: copyright statement not found\n"; } +# Hey Emacs! # Local variables: +# coding: utf-8 # mode: perl # indent-tabs-mode: nil # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 6af2d9d7545..eb8d2027cf8 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -916,6 +916,14 @@ layout by typing @kbd{M-x gdb-restore-windows}. To toggle between the many windows layout and a simple layout with just the GUD interaction buffer and a source file, type @kbd{M-x gdb-many-windows}. + If you have an elaborate window setup, and don't want +@code{gdb-many-windows} to disrupt that, it is better to invoke +@kbd{M-x gdb} in a separate frame to begin with, then the arrangement +of windows on your original frame will not be affected. A separate +frame for GDB sessions can come in especially handy if you work on a +text-mode terminal, where the screen estate for windows could be at a +premium. + You may also specify additional GDB-related buffers to display, either in the same frame or a different one. Select the buffers you want by typing @code{M-x gdb-display-@var{buffertype}-buffer} or diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index c62862f2100..299ed0b7d98 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5123,14 +5123,21 @@ these functions, and neither do certain internal buffer changes, such as changes in buffers created by Emacs internally for certain jobs, that should not be visible to Lisp programs. - Do @emph{not} expect the before-change hooks and the after-change -hooks be called in balanced pairs around each buffer change. Also -don't expect the before-change hooks to be called for every chunk of -text Emacs is about to delete. These hooks are provided on the -assumption that Lisp programs will use either before- or the -after-change hooks, but not both, and the boundaries of the region -where the changes happen might include more than just the actual -changed text, or even lump together several changes done piecemeal. +The vast majority of buffer changing primitives will call +@code{before-change-functions} and @code{after-change-functions} in +balanced pairs, once for each change, where the arguments to these +hooks exactly delimit the change being made. Yet, hook functions +should not rely on this always being the case, because some complex +primitives call @code{before-change-functions} once before making +changes, and then call @code{after-change-functions} zero or more +times, depending on how many individual changes the primitive is +making. When that happens, the arguments to +@code{before-change-functions} will enclose a region in which the +individual changes are made, but won't necessarily be the minimal such +region, and the arguments to each successive call of +@code{after-change-functions} will then delimit the part of text being +changed exactly. In general, we advise to use either before- or the +after-change hooks, but not both. @defmac combine-after-change-calls body@dots{} The macro executes @var{body} normally, but arranges to call the diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index deaafb3d257..5052b436536 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2855,6 +2855,10 @@ warning, which can be ignored: &"warning: GDB: Failed to set controlling terminal: Operation not permitted\n" @end example +@noindent +As consequence, there will be restrictions in I/O of the process to be +debugged. + Relative file names are based on the remote default directory. When @file{myprog.pl} exists in @file{@trampfn{ssh,host,/home/user}}, valid calls include: diff --git a/lib/md5.c b/lib/md5.c index 8bdd4a7884b..9dc915e2cf0 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -469,3 +469,10 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) ctx->D = D; } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/md5.h b/lib/md5.h index 4adfcdd9cfd..d89f819a97b 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -133,3 +133,10 @@ extern int __md5_stream (FILE *stream, void *resblock) __THROW; # endif #endif /* md5.h */ + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha1.c b/lib/sha1.c index 89a0f71e203..ce0f0b2e71f 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -434,3 +434,10 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) } } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha1.h b/lib/sha1.h index 62c507bbdf0..b1db15da1e7 100644 --- a/lib/sha1.h +++ b/lib/sha1.h @@ -98,3 +98,10 @@ extern int sha1_stream (FILE *stream, void *resblock); # endif #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha256.c b/lib/sha256.c index 2f28fcd7100..85405b20fdf 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -577,3 +577,10 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) } } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha256.h b/lib/sha256.h index ca06691241a..e3449864bb6 100644 --- a/lib/sha256.h +++ b/lib/sha256.h @@ -101,3 +101,10 @@ extern int sha224_stream (FILE *stream, void *resblock); # endif #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha512.c b/lib/sha512.c index d6a8ce181a1..8a6dd4e83ac 100644 --- a/lib/sha512.c +++ b/lib/sha512.c @@ -629,3 +629,10 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx) } } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/sha512.h b/lib/sha512.h index 516e75b3013..6a0aadba02f 100644 --- a/lib/sha512.h +++ b/lib/sha512.h @@ -104,3 +104,10 @@ extern int sha384_stream (FILE *stream, void *resblock); # endif #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/lib/signal.in.h b/lib/signal.in.h index 483413dc7f5..7d4927b828e 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -137,7 +137,7 @@ _GL_FUNCDECL_RPL (pthread_sigmask, int, _GL_CXXALIAS_RPL (pthread_sigmask, int, (int how, const sigset_t *new_mask, sigset_t *old_mask)); # else -# if !@HAVE_PTHREAD_SIGMASK@ +# if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask) _GL_FUNCDECL_SYS (pthread_sigmask, int, (int how, const sigset_t *new_mask, sigset_t *old_mask)); # endif diff --git a/lib/stat-time.h b/lib/stat-time.h index 5f8bf4e126f..104f5376682 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -102,15 +102,13 @@ get_stat_mtime_ns (struct stat const *st) /* Return the nanosecond component of *ST's birth time. */ _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE -get_stat_birthtime_ns (struct stat const *st) +get_stat_birthtime_ns (struct stat const *st _GL_UNUSED) { # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC return STAT_TIMESPEC (st, st_birthtim).tv_nsec; # elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC return STAT_TIMESPEC_NS (st, st_birthtim); # else - /* Avoid a "parameter unused" warning. */ - (void) st; return 0; # endif } @@ -160,7 +158,7 @@ get_stat_mtime (struct stat const *st) /* Return *ST's birth time, if available; otherwise return a value with tv_sec and tv_nsec both equal to -1. */ _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE -get_stat_birthtime (struct stat const *st) +get_stat_birthtime (struct stat const *st _GL_UNUSED) { struct timespec t; @@ -184,8 +182,6 @@ get_stat_birthtime (struct stat const *st) /* Birth time is not supported. */ t.tv_sec = -1; t.tv_nsec = -1; - /* Avoid a "parameter unused" warning. */ - (void) st; #endif #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ @@ -212,7 +208,7 @@ get_stat_birthtime (struct stat const *st) errno to EOVERFLOW if normalization overflowed. This function is intended to be private to this .h file. */ _GL_STAT_TIME_INLINE int -stat_time_normalize (int result, struct stat *st) +stat_time_normalize (int result, struct stat *st _GL_UNUSED) { #if defined __sun && defined STAT_TIMESPEC if (result == 0) diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index 2f216e6e00c..0403e5e7f20 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -471,6 +471,7 @@ PROPERTY set." ;;; Lexical Analyzer framework settings ;; +;; FIXME change to non-obsolete default. (defvar semantic-lex-analyzer 'semantic-flex "The lexical analyzer used for a given buffer. See `semantic-lex' for documentation. @@ -1856,7 +1857,7 @@ end of the return token will be larger than END. To truly restrict scanning, use `narrow-to-region'. The last argument, LENGTH specifies that `semantic-flex' should only return LENGTH tokens." - (message "`semantic-flex' is an obsolete function. Use `define-lex' to create lexers.") + (declare (obsolete define-lex "23.2")) (if (not semantic-flex-keywords-obarray) (setq semantic-flex-keywords-obarray [ nil ])) (let ((ts nil) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 5aa3ac8742a..5a89923f8fb 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -411,12 +411,13 @@ whitespace." ;; See https://lists.gnu.org/r/help-gnu-emacs/2016-08/msg00141.html (save-excursion (forward-line 0) - (< (line-end-position) - (let ((ppss (syntax-ppss))) - (when (nth 4 ppss) - (goto-char (nth 8 ppss))) - (forward-comment (point-max)) - (point))))) + (let ((ppss (syntax-ppss))) + (and (null (nth 3 ppss)) + (< (line-end-position) + (progn (when (nth 4 ppss) + (goto-char (nth 8 ppss))) + (forward-comment (point-max)) + (point))))))) (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." @@ -434,10 +435,7 @@ whitespace." (progn (skip-syntax-backward "-" (line-beginning-position)) (not (bolp))) ; Check for blank line. - (progn (parse-partial-sexp - (line-beginning-position) (line-end-position) - nil t (syntax-ppss (line-beginning-position))) - (eolp))))) ; Check for non-comment text. + (beginning-of-defun--in-emptyish-line-p)))) ; Check for non-comment text. (forward-line (if first-line-p 0 1)))) (defvar end-of-defun-function diff --git a/lisp/epa.el b/lisp/epa.el index 2b14a003484..8694de48172 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -56,12 +56,15 @@ If neither t nor nil, ask user for confirmation." :type 'integer :group 'epa) +;; In the doc string below, we say "symbol `error'" to avoid producing +;; a hyperlink for `error' the function. (defcustom epa-pinentry-mode nil "The pinentry mode. GnuPG 2.1 or later has an option to control the behavior of -Pinentry invocation. Possible modes are: `ask', `cancel', -`error', and `loopback'. See the GnuPG manual for the meanings. +Pinentry invocation. The value should be the symbol `error', +`ask', `cancel', or `loopback'. See the GnuPG manual for the +meanings. In epa commands, a particularly useful mode is `loopback', which redirects all Pinentry queries to the caller, so Emacs can query diff --git a/lisp/epg.el b/lisp/epg.el index 3c20c270490..dc0e2df5838 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1676,8 +1676,8 @@ If you are unsure, use synchronous version of this function (setf (epg-context-operation context) 'sign) (setf (epg-context-result context) nil) (unless (memq mode '(t detached nil normal)) ;i.e. cleartext - (epg-context-set-armor context nil) - (epg-context-set-textmode context nil)) + (setf (epg-context-armor context) nil) + (setf (epg-context-textmode context) nil)) (epg--start context (append (list (if (memq mode '(t detached)) "--detach-sign" diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index de2fa16c50b..3294350b6ee 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -321,12 +321,13 @@ If BUFFER is nil, the value of `current-buffer' is used. Logging is enabled if `erc-log-channels-directory' is non-nil, the directory is writable (it will be created as necessary) and `erc-enable-logging' returns a non-nil value." + (or buffer (setq buffer (current-buffer))) (and erc-log-channels-directory (or (functionp erc-log-channels-directory) (erc-directory-writable-p erc-log-channels-directory)) (if (functionp erc-enable-logging) - (funcall erc-enable-logging (or buffer (current-buffer))) - erc-enable-logging))) + (funcall erc-enable-logging buffer) + (buffer-local-value 'erc-enable-logging buffer)))) (defun erc-log-standardize-name (filename) "Make FILENAME safe to use as the name of an ERC log. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index bfc48bac2e2..d362419e0fc 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -82,6 +82,27 @@ case you need scrolling resolution of a pixel, set to 1. After a pixel scroll, typing \\[next-line] or \\[previous-line] scrolls the window to make it fully visible, and undoes the effect of the pixel-level scroll.") +(defvar pixel-dead-time 0.1 + "Minimal interval in seconds before next smooth scrolling. +If another scrolling request arrives within this period, scrolling +will be carried out without pixel resolution. If zero, scrolling +is always with pixel resolution.") + +(defvar pixel-last-scroll-time 0 + "Time when the last scrolling was made, in second since the epoch.") + +(defun pixel-scroll-in-rush-p () + "Return non-nil if next scroll should be non-smooth. +When scrolling request is delivered soon after the previous one, +user is in hurry. When the time since last scroll is larger than +`pixel-dead-time', we are ready for another smooth scroll, and this +function returns nil." + (let* ((current-time (float-time)) + (scroll-in-rush-p (< (- current-time pixel-last-scroll-time) + pixel-dead-time))) + (setq pixel-last-scroll-time current-time) + scroll-in-rush-p)) + ;;;###autoload (define-minor-mode pixel-scroll-mode "A minor mode to scroll text pixel-by-pixel. @@ -104,35 +125,39 @@ if ARG is omitted or nil." This is an alternative of `scroll-up'. Scope moves downward." (interactive) (or arg (setq arg 1)) - (dotimes (ii arg) ; move scope downward - (let ((amt (if pixel-resolution-fine-flag - (if (integerp pixel-resolution-fine-flag) - pixel-resolution-fine-flag - (frame-char-height)) - (pixel-line-height)))) - (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close - (scroll-up 1) ; relay on robust method - (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) - (vertical-motion 1)) ; move point downward - (pixel-scroll-pixel-up amt))))) ; move scope downward + (if (pixel-scroll-in-rush-p) + (scroll-up arg) + (dotimes (ii arg) ; move scope downward + (let ((amt (if pixel-resolution-fine-flag + (if (integerp pixel-resolution-fine-flag) + pixel-resolution-fine-flag + (frame-char-height)) + (pixel-line-height)))) + (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close + (scroll-up 1) ; relay on robust method + (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) + (vertical-motion 1)) ; move point downward + (pixel-scroll-pixel-up amt)))))) ; move scope downward (defun pixel-scroll-down (&optional arg) "Scroll text of selected window down ARG lines. This is and alternative of `scroll-down'. Scope moves upward." (interactive) (or arg (setq arg 1)) - (dotimes (ii arg) - (let ((amt (if pixel-resolution-fine-flag - (if (integerp pixel-resolution-fine-flag) - pixel-resolution-fine-flag - (frame-char-height)) - (pixel-line-height -1)))) - (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) - (vertical-motion -1)) ; move point upward - (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen - (pixel-eob-at-top-p)) ; for file with a long line - (scroll-down 1) ; relay on robust method - (pixel-scroll-pixel-down amt))))) + (if (pixel-scroll-in-rush-p) + (scroll-down arg) + (dotimes (ii arg) + (let ((amt (if pixel-resolution-fine-flag + (if (integerp pixel-resolution-fine-flag) + pixel-resolution-fine-flag + (frame-char-height)) + (pixel-line-height -1)))) + (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) + (vertical-motion -1)) ; move point upward + (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen + (pixel-eob-at-top-p)) ; for file with a long line + (scroll-down 1) ; relay on robust method + (pixel-scroll-pixel-down amt)))))) (defun pixel-bob-at-top-p (amt) "Return non-nil if window-start is at beginning of the current buffer. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 2a982917a85..fea9851d720 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -675,8 +675,13 @@ Return the pasted text as a string." (when (and (> version 2000) (equal (match-string 1 str) "1")) ;; Hack attack! bug#16988: gnome-terminal reports "1;NNNN;0" ;; with a large NNNN but is based on a rather old xterm code. - ;; Gnome terminal 3.6.1 reports 1;3406;0 ;; Gnome terminal 2.32.1 reports 1;2802;0 + ;; Gnome terminal 3.6.1 reports 1;3406;0 + ;; Gnome terminal 3.22.2 reports 1;4601;0 and *does* support + ;; background color querying (Bug#29716). + (when (> version 4000) + (xterm--query "\e]11;?\e\\" + '(("\e]11;" . xterm--report-background-handler)))) (setq version 200)) (when (equal (match-string 1 str) "83") ;; `screen' (which returns 83;40003;0) seems to also lack support for diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 761536745f4..ea99d31e898 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1019,7 +1019,7 @@ chars to try and eliminate some spurious differences." (setq s short))) (dotimes (_i (1- len)) (insert s))))))) (unless (bolp) (error "Smerge refine internal error")) - (let ((coding-system-for-write 'emacs-internal)) + (let ((coding-system-for-write 'utf-8-emacs-unix)) (write-region (point-min) (point-max) file nil 'nomessage)))) (defun smerge--refine-highlight-change (beg match-num1 match-num2 props) @@ -1084,7 +1084,9 @@ used to replace chars to try and eliminate some spurious differences." ;; Call diff on those files. (unwind-protect (with-temp-buffer - (let ((coding-system-for-read 'emacs-internal)) + ;; Allow decoding the EOL format, as on MS-Windows the Diff + ;; utility might produce CR-LF EOLs. + (let ((coding-system-for-read 'utf-8-emacs)) (call-process diff-command nil t nil (if (and smerge-refine-ignore-whitespace (not smerge-refine-weight-hack)) 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> |