summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2018-10-27 09:15:32 -0700
committerGlenn Morris <rgm@gnu.org>2018-10-27 09:15:32 -0700
commit2df74ce79b910c977167e84d4cb37ede1053663f (patch)
treec349e7c462c20b423030b734c461b90eee17f23f
parent3e81e9a0e7742197354515f3d3ea55fdb201eb29 (diff)
parentdf64da8eb845c9f07ee93bfbf28af41a01a2e83f (diff)
downloademacs-2df74ce79b910c977167e84d4cb37ede1053663f.tar.gz
Merge from origin/emacs-26
df64da8 (origin/emacs-26) * lisp/simple.el (region-extract-function):... 520c486 * lisp/simple.el (region-bounds): Doc fix. (Bug#33168) 9193db0 Improve documentation of 'process-connection-type' 106b9e1 Unify prompt for gnupg passphrase between GNU/Linux and MS-Wi... 2a41616 Doc fix of 'gnus-fetch-old-headers' 29a7644 Deactivate incorrect hyperlinking in gnus-build-sparse-thread... 53ae90f Minor copyedits in cmdargs.texi fc2e65a Improve documentation of X resource loading 13132b3 * lisp/net/tramp-sh.el (tramp-inline-compress-commands): 8361292 ; Fix sorting in admin/MAINTAINERS 92de44f Don't error when indenting malformed Lisp (Bug#30891) c3adbc8 Improve 'isearch-delete-char' documentation (Bug#32990) 6ca71ce ; * lisp/help.el (with-help-window): Remove extra space in doc. f5f9583 Improve XPM load failure message (bug#33126) f3d01d4 Avoid infloop in CPerl mode fontification 71a2d50 Fix minibuffer-help-form for lexical binding 7e8eee6 Fix some NS drawing issues (bug#32932) d72975a * lisp/gnus/mm-util.el (mm-decompress-buffer): Fix split-stri... c97a5f1 * doc/misc/calc.texi (Summary): The +/- key is 'p', not 'P'. # Conflicts: # lisp/gnus/mm-util.el
-rw-r--r--admin/MAINTAINERS2
-rw-r--r--doc/emacs/cmdargs.texi18
-rw-r--r--doc/emacs/frames.texi4
-rw-r--r--doc/emacs/search.texi33
-rw-r--r--doc/emacs/xresources.texi5
-rw-r--r--doc/lispref/processes.texi19
-rw-r--r--doc/misc/calc.texi2
-rw-r--r--etc/PROBLEMS7
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/emacs-lisp/lisp-mode.el4
-rw-r--r--lisp/epg.el2
-rw-r--r--lisp/gnus/gnus-sum.el15
-rw-r--r--lisp/gnus/mm-util.el2
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/isearch.el13
-rw-r--r--lisp/net/tramp-sh.el3
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/simple.el21
-rw-r--r--src/image.c2
-rw-r--r--src/nsterm.m80
20 files changed, 143 insertions, 95 deletions
diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS
index 6db1d8801cb..05faa586c20 100644
--- a/admin/MAINTAINERS
+++ b/admin/MAINTAINERS
@@ -210,8 +210,8 @@ Paul Eggert
Michael Albinus
src/inotify.c
lisp/autorevert.el
- lisp/files.el (file-name-non-special)
lisp/eshell/em-tramp.el
+ lisp/files.el (file-name-non-special)
lisp/net/ange-ftp.el
lisp/notifications.el
lisp/shadowfile.el
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 733919a374a..2e2767ccada 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -305,6 +305,8 @@ not disable loading @file{site-start.el}.
@item --no-site-file
@opindex --no-site-file
+@itemx -nsl
+@opindex -nsl
@cindex @file{site-start.el} file, not loading
Do not load @file{site-start.el} (@pxref{Init File}). The @samp{-Q}
option does this too, but other options like @samp{-q} do not.
@@ -323,14 +325,20 @@ Do not display a startup screen. You can also achieve this effect by
setting the variable @code{inhibit-startup-screen} to non-@code{nil}
in your initialization file (@pxref{Entering Emacs}).
+@item --no-x-resources
+@opindex --no-x-resources
+@cindex X resources, not loading
+Do not load X resources. You can also achieve this effect by setting
+the variable @code{inhibit-x-resources} to @code{t} in your
+initialization file (@pxref{Resources}).
+
@item -Q
@opindex -Q
@itemx --quick
@opindex --quick
-Start Emacs with minimum customizations. This is similar to using @samp{-q},
-@samp{--no-site-file}, @samp{--no-site-lisp}, and @samp{--no-splash}
-together. This also stops Emacs from processing X resources by
-setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}).
+Start Emacs with minimum customizations. This is similar to using
+@samp{-q}, @samp{--no-site-file}, @samp{--no-site-lisp},
+@samp{--no-x-resources}, and @samp{--no-splash} together..
@item -daemon
@opindex -daemon
@@ -373,6 +381,8 @@ Enable expensive correctness checks when dealing with dynamically
loadable modules. This is intended for module authors that wish to
verify that their module conforms to the module API requirements. The
option makes Emacs abort if a module-related assertion triggers.
+@xref{Writing Dynamic Modules,, Writing Dynamically-Loaded Modules,
+elisp, The GNU Emacs Lisp Reference Manual}.
@end table
@node Command Example
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 9f4c7821e98..6bbaae24b17 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -934,6 +934,10 @@ the initial frame, by customizing the variable
specify colors and fonts don't affect menus and the menu bar, since
those are drawn by the toolkit and not directly by Emacs.
+ Frame appearance and behavior can also be customized through X
+resources (@pxref{X Resources}); these override the parameters of the
+initial frame specified in your init file.
+
Note that if you are using the desktop library to save and restore
your sessions, the frames to be restored are recorded in the desktop
file, together with their parameters. When these frames are restored,
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 263c4c5dcca..c9f3ccc5481 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -99,10 +99,18 @@ text that matches the search string---using the @code{isearch} face
that customize this highlighting. The current search string is also
displayed in the echo area.
- If you make a mistake typing the search string, type @key{DEL}.
-Each @key{DEL} cancels the last character of the search string.
-@xref{Error in Isearch}, for more about dealing with unsuccessful
-search.
+@cindex isearch input item
+@cindex input item, isearch
+@findex isearch-delete-char
+@kindex DEL @r{(Incremental search)}
+ If you make a mistake typing the search string, type @key{DEL}
+(@code{isearch-delete-char}). Each @key{DEL} cancels the last input
+item entered during the search. Emacs records a new @dfn{input item}
+whenever you type a command that changes the search string, the
+position of point, the success or failure of the search, the direction
+of the search, the position of the other end of the current search
+result, or the ``wrappedness'' of the search. @xref{Error in
+Isearch}, for more about dealing with unsuccessful search.
@cindex exit incremental search
@cindex incremental search, exiting
@@ -290,14 +298,15 @@ string that failed to match is highlighted using the face
@code{isearch-fail}.
At this point, there are several things you can do. If your string
-was mistyped, you can use @key{DEL} to erase some of it and correct
-it, or you can type @kbd{M-e} and edit it. If you like the place you
-have found, you can type @key{RET} to remain there. Or you can type
-@kbd{C-g}, which removes from the search string the characters that
-could not be found (the @samp{T} in @samp{FOOT}), leaving those that
-were found (the @samp{FOO} in @samp{FOOT}). A second @kbd{C-g} at
-that point cancels the search entirely, returning point to where it
-was when the search started.
+was mistyped, use @key{DEL} to cancel a previous input item
+(@pxref{Basic Isearch}), @kbd{C-M-w} to erase one character at a time,
+or @kbd{M-e} to edit it. If you like the place you have found, you
+can type @key{RET} to remain there. Or you can type @kbd{C-g}, which
+removes from the search string the characters that could not be found
+(the @samp{T} in @samp{FOOT}), leaving those that were found (the
+@samp{FOO} in @samp{FOOT}). A second @kbd{C-g} at that point cancels
+the search entirely, returning point to where it was when the search
+started.
@cindex quitting (in search)
@kindex C-g @r{(Incremental search)}
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index db2c6ffafd2..903090f51a9 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -46,6 +46,11 @@ this file do not take effect immediately, because the X server stores
its own list of resources; to update it, use the command
@command{xrdb}---for instance, @samp{xrdb ~/.Xdefaults}.
+ Settings specified via X resources in general override the
+equivalent settings in Emacs init files (@pxref{Init File}), in
+particular for parameters of the initial frame (@pxref{Frame
+Parameters}).
+
@cindex registry, setting resources (MS-Windows)
(MS-Windows systems do not support X resource files; on such systems,
Emacs looks for X resources in the Windows Registry, first under the
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index e1113e37f10..2afc6a33828 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -598,8 +598,8 @@ communication is only partially asynchronous: Emacs sends data to the
process only when certain functions are called, and Emacs accepts data
from the process only while waiting for input or for a time delay.
-@cindex pty
-@cindex pipe
+@cindex pty, when to use for subprocess communications
+@cindex pipe, when to use for subprocess communications
An asynchronous process is controlled either via a @dfn{pty}
(pseudo-terminal) or a @dfn{pipe}. The choice of pty or pipe is made
when creating the process, by default based on the value of the
@@ -609,11 +609,13 @@ Shell mode, because they allow for job control (@kbd{C-c}, @kbd{C-z},
etc.)@: between the process and its children, and because interactive
programs treat ptys as terminal devices, whereas pipes don't support
these features. However, for subprocesses used by Lisp programs for
-internal purposes, it is often better to use a pipe, because pipes are
+internal purposes (i.e., with no user interaction), where significant
+amounts of data need to be exchanged between the subprocess and the
+Lisp program, it is often better to use a pipe, because pipes are
more efficient, and because they are immune to stray character
injections that ptys introduce for large (around 500 byte) messages.
-Also, the total number of ptys is limited on many systems and it is
-good not to waste them.
+Also, the total number of ptys is limited on many systems, and it is
+good not to waste them unnecessarily.
@defun make-process &rest args
This function is the basic low-level primitive for starting
@@ -666,7 +668,9 @@ pipe, or @code{nil} to use the default derived from the value of the
@code{process-connection-type} variable. This parameter and the value
of @code{process-connection-type} are ignored if a non-@code{nil}
value is specified for the @code{:stderr} parameter; in that case, the
-type will always be @code{pipe}.
+type will always be @code{pipe}. On systems where ptys are not
+available (MS-Windows), this parameter is likewise ignored, and pipes
+are used unconditionally.
@item :noquery @var{query-flag}
Initialize the process query flag to @var{query-flag}.
@@ -873,7 +877,8 @@ around the call to these functions.
Note that the value of this variable is ignored when
@code{make-process} is called with a non-@code{nil} value of the
@code{:stderr} parameter; in that case, Emacs will communicate with
-the process using pipes.
+the process using pipes. It is also ignored if ptys are unavailable
+(MS-Windows).
@smallexample
@group
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 83807c6fd28..f7b23d35471 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -35832,7 +35832,7 @@ keystrokes are not listed in this summary.
@r{ @: _ @:number @: @:-@:number}
@r{ @: e @:number @: @:@:1e number}
@r{ @: # @:number @: @:@:current-radix@tfn{#}number}
-@r{ @: P @:(in number) @: @:+/-@:}
+@r{ @: p @:(in number) @: @:+/-@:}
@r{ @: M @:(in number) @: @:mod@:}
@r{ @: @@ ' " @: (in number)@: @:@:HMS form}
@r{ @: h m s @: (in number)@: @:@:HMS form}
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 6805e8733d5..0cbcca4a8a5 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2599,6 +2599,13 @@ please call support for your X-server and see if you can get a fix.
If you do, please send it to bug-gnu-emacs@gnu.org so we can list it here.
+* Runtime problems specific to macOS
+
+** macOS doesn't come with libxpm, so only XPM3 is supported.
+
+Libxpm is available for macOS as part of the XQuartz project.
+
+
* Build-time problems
** Configuration
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 723cd5010df..b69a63b80f5 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -917,7 +917,7 @@ the current value of the variable, otherwise `symbol-value' is used.
If optional COMMENT argument is non-nil, also prompt for a comment and return
it as the third element in the list."
(let* ((var (read-variable prompt-var))
- (minibuffer-help-form '(describe-variable var))
+ (minibuffer-help-form `(describe-variable ',var))
(val
(let ((prop (get var 'variable-interactive))
(type (get var 'custom-type))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index afb7cbd1dd7..46199196024 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -839,6 +839,10 @@ by more than one line to cross a string literal."
(prog1
(let (indent)
(cond ((= (forward-line 1) 1) nil)
+ ;; Negative depth, probably some kind of syntax error.
+ ((null indent-stack)
+ ;; Reset state.
+ (setq ppss (parse-partial-sexp (point) (point))))
((car indent-stack))
((integerp (setq indent (calculate-lisp-indent ppss)))
(setf (car indent-stack) indent))
diff --git a/lisp/epg.el b/lisp/epg.el
index 9d9bc9051da..c8f24eb39f7 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -655,7 +655,7 @@ callback data (if any)."
:command (cons (epg-context-program context)
args)
:connection-type 'pipe
- :coding '(binary . binary)
+ :coding 'raw-text
:filter #'epg--process-filter
:stderr error-process
:noquery t)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f56b822ac57..f9fae3792b1 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -83,12 +83,12 @@ If an unread article in the group refers to an older, already
read (or just marked as read) article, the old article will not
normally be displayed in the Summary buffer. If this variable is
t, Gnus will attempt to grab the headers to the old articles, and
-thereby build complete threads. If it has the value `some', all
-old headers will be fetched but only enough headers to connect
+thereby build complete threads. If the value is the symbol `some',
+all old headers will be fetched but only enough headers to connect
otherwise loose threads will be displayed. This variable can
also be a number. In that case, no more than that number of old
-headers will be fetched. If it has the value `invisible', all
-old headers will be fetched, but none will be displayed.
+headers will be fetched. If the value is the symbol `invisible',
+all old headers will be fetched, but none will be displayed.
The server has to support NOV for any of this to work.
@@ -203,9 +203,10 @@ Useful functions to put in this list include:
(defcustom gnus-build-sparse-threads nil
"If non-nil, fill in the gaps in threads.
-If `some', only fill in the gaps that are needed to tie loose threads
-together. If `more', fill in all leaf nodes that Gnus can find. If
-non-nil and non-`some', fill in all gaps that Gnus manages to guess."
+If set to the symbol `some', only fill in the gaps that are
+needed to tie loose threads together. If the symbol `more', fill
+in all leaf nodes that Gnus can find. If t (or any other value),
+fill in all gaps that Gnus manages to guess."
:group 'gnus-thread
:type '(choice (const :tag "off" nil)
(const some)
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 25b156803a6..14a232f706a 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -827,7 +827,7 @@ decompressed data. The buffer's multibyteness must be turned off."
(insert-file-contents err-file)
(buffer-string)
(erase-buffer))
- t)
+ nil t)
" ")
"\n")
(setq err-msg
diff --git a/lisp/help.el b/lisp/help.el
index 28288e57f6e..ad782f74cac 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1326,7 +1326,7 @@ puts the buffer specified by BUFFER-OR-NAME in `help-mode' and
displays a message about how to delete the help window when it's no
longer needed. The help window will be selected if
`help-window-select' is non-nil.
-Most of this is done by `help-window-setup', which see."
+Most of this is done by `help-window-setup', which see."
(declare (indent 1) (debug t))
`(progn
;; Make `help-window-point-marker' point nowhere. The only place
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 1e785a44c51..38110d09984 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1984,11 +1984,14 @@ and reads its face argument using `hi-lock-read-face-name'."
(defun isearch-delete-char ()
- "Discard last input item and move point back.
-Last input means the last character or the last isearch command
-that added or deleted characters from the search string,
-moved point, toggled regexp mode or case-sensitivity, etc.
-If no previous match was done, just beep."
+ "Undo last input item during a search.
+
+An input item is the result of a command that pushes a new state
+of isearch (as recorded by the `isearch--state' structure) to
+`isearch-cmds'. Info node `(emacs)Basic Isearch' explains when
+Emacs records a new input item.
+
+If no input items have been entered yet, just beep."
(interactive)
(if (null (cdr isearch-cmds))
(ding)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 956fe2ddb73..11ee0639988 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4492,7 +4492,8 @@ means discard it)."
(if (stringp output) (concat " >" output) ""))))
(defconst tramp-inline-compress-commands
- '(("gzip" "gzip -d")
+ '(;; Suppress warnings about obsolete environment variable GZIP.
+ ("env GZIP= gzip" "env GZIP= gzip -d")
("bzip2" "bzip2 -d")
("xz" "xz -d")
("compress" "compress -d"))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 18a72324c65..7d0884389eb 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8786,7 +8786,7 @@ do extra unwind via `cperl-unwind-to-safe'."
(goto-char new-beg)))
(setq beg (point))
(goto-char end)
- (while (and end
+ (while (and end (< end (point-max))
(progn
(or (bolp) (condition-case nil
(forward-line 1)
diff --git a/lisp/simple.el b/lisp/simple.el
index 562a9124b5c..6a7d210e483 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1071,13 +1071,16 @@ instead of deleted."
(filter-buffer-substring (region-beginning) (region-end) method)))))
"Function to get the region's content.
Called with one argument METHOD which can be:
-- nil: return the content as a string.
+- nil: return the content as a string (list of strings for
+ non-contiguous regions).
- `delete-only': delete the region; the return value is undefined.
-- `bounds': return the boundaries of the region as a list of cons
- cells of the form (START . END).
+- `bounds': return the boundaries of the region as a list of one
+ or more cons cells of the form (START . END).
- anything else: delete the region and return its content
- as a string, after filtering it with `filter-buffer-substring', which
- is called with METHOD as its 3rd argument.")
+ as a string (or list of strings for non-contiguous regions),
+ after filtering it with `filter-buffer-substring', which
+ is called, for each contiguous sub-region, with METHOD as its
+ 3rd argument.")
(defvar region-insert-function
(lambda (lines)
@@ -5527,8 +5530,10 @@ also checks the value of `use-empty-active-region'."
(progn (cl-assert (mark)) t)))
(defun region-bounds ()
- "Return the boundaries of the region as a pair of positions.
-Value is a list of cons cells of the form (START . END)."
+ "Return the boundaries of the region.
+Value is a list of one or more cons cells of the form (START . END).
+It will have more than one cons cell when the region is non-contiguous,
+see `region-noncontiguous-p' and `extract-rectangle-bounds'."
(funcall region-extract-function 'bounds))
(defun region-noncontiguous-p ()
@@ -7935,7 +7940,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
(read-variable (format "Set variable (default %s): " default-var)
default-var)
(read-variable "Set variable: ")))
- (minibuffer-help-form '(describe-variable var))
+ (minibuffer-help-form `(describe-variable ',var))
(prop (get var 'variable-interactive))
(obsolete (car (get var 'byte-obsolete-variable)))
(prompt (format "Set %s %s to value: " var
diff --git a/src/image.c b/src/image.c
index 24decbc0997..ad4f95ba991 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4309,7 +4309,7 @@ xpm_load_image (struct frame *f,
return 1;
failure:
- image_error ("Invalid XPM file (%s)", img->spec);
+ image_error ("Invalid XPM3 file (%s)", img->spec);
x_destroy_x_image (ximg);
x_destroy_x_image (mask_img);
x_clear_image (f, img);
diff --git a/src/nsterm.m b/src/nsterm.m
index 1ef7f5ab516..bcc23ffeaff 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -279,7 +279,6 @@ long context_menu_value = 0;
/* display update */
static int ns_window_num = 0;
-static BOOL gsaved = NO;
static BOOL ns_fake_keydown = NO;
#ifdef NS_IMPL_COCOA
static BOOL ns_menu_bar_is_hidden = NO;
@@ -1234,7 +1233,6 @@ ns_clip_to_rect (struct frame *f, NSRect *r, int n)
NSRectClipList (r, 2);
else
NSRectClip (*r);
- gsaved = YES;
return YES;
}
@@ -1258,11 +1256,7 @@ ns_reset_clipping (struct frame *f)
{
NSTRACE_WHEN (NSTRACE_GROUP_FOCUS, "ns_reset_clipping");
- if (gsaved)
- {
- [[NSGraphicsContext currentContext] restoreGraphicsState];
- gsaved = NO;
- }
+ [[NSGraphicsContext currentContext] restoreGraphicsState];
}
@@ -1288,19 +1282,6 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
return ns_clip_to_rect (f, &clip_rect, 1);
}
-
-static void
-ns_flush_display (struct frame *f)
-/* Force the frame to redisplay. If areas have previously been marked
- dirty by setNeedsDisplayInRect (in ns_clip_to_rect), then this will call
- draw_rect: which will "expose" those areas. */
-{
- block_input ();
- [FRAME_NS_VIEW (f) displayIfNeeded];
- unblock_input ();
-}
-
-
/* ==========================================================================
Visible bell and beep.
@@ -2837,6 +2818,8 @@ ns_clear_frame_area (struct frame *f, int x, int y, int width, int height)
static void
ns_copy_bits (struct frame *f, NSRect src, NSRect dest)
{
+ NSSize delta = NSMakeSize (dest.origin.x - src.origin.x,
+ dest.origin.y - src.origin.y)
NSTRACE ("ns_copy_bits");
if (FRAME_NS_VIEW (f))
@@ -2845,10 +2828,21 @@ ns_copy_bits (struct frame *f, NSRect src, NSRect dest)
/* FIXME: scrollRect:by: is deprecated in macOS 10.14. There is
no obvious replacement so we may have to come up with our own. */
- [FRAME_NS_VIEW (f) scrollRect: src
- by: NSMakeSize (dest.origin.x - src.origin.x,
- dest.origin.y - src.origin.y)];
- [FRAME_NS_VIEW (f) setNeedsDisplay:YES];
+ [FRAME_NS_VIEW (f) scrollRect: src by: delta];
+
+#ifdef NS_IMPL_COCOA
+ /* As far as I can tell from the documentation, scrollRect:by:,
+ above, should copy the dirty rectangles from our source
+ rectangle to our destination, however it appears it clips the
+ operation to src. As a result we need to use
+ translateRectsNeedingDisplayInRect:by: below, and we have to
+ union src and dest so it can pick up the dirty rectangles,
+ and place them, as it also clips to the rectangle.
+
+ FIXME: We need a GNUstep equivalent. */
+ [FRAME_NS_VIEW (f) translateRectsNeedingDisplayInRect:NSUnionRect (src, dest)
+ by:delta];
+#endif
}
}
@@ -3233,15 +3227,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
else
[FRAME_CURSOR_COLOR (f) set];
-#ifdef NS_IMPL_COCOA
- /* TODO: This makes drawing of cursor plus that of phys_cursor_glyph
- atomic. Cleaner ways of doing this should be investigated.
- One way would be to set a global variable DRAWING_CURSOR
- when making the call to draw_phys..(), don't focus in that
- case, then move the ns_reset_clipping() here after that call. */
- NSDisableScreenUpdates ();
-#endif
-
switch (cursor_type)
{
case DEFAULT_CURSOR:
@@ -3275,10 +3260,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
/* draw the character under the cursor */
if (cursor_type != NO_CURSOR)
draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
-
-#ifdef NS_IMPL_COCOA
- NSEnableScreenUpdates ();
-#endif
}
}
@@ -5119,7 +5100,7 @@ static struct redisplay_interface ns_redisplay_interface =
ns_after_update_window_line,
ns_update_window_begin,
ns_update_window_end,
- ns_flush_display, /* flush_display */
+ 0, /* flush_display */
x_clear_window_mouse_face,
x_get_glyph_overhangs,
x_fix_overlapping_area,
@@ -7114,7 +7095,6 @@ not_in_argv (NSString *arg)
size_title = xmalloc (strlen (old_title) + 40);
esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
[window setTitle: [NSString stringWithUTF8String: size_title]];
- [window display];
xfree (size_title);
}
}
@@ -8164,8 +8144,8 @@ not_in_argv (NSString *arg)
- (void)drawRect: (NSRect)rect
{
- int x = NSMinX (rect), y = NSMinY (rect);
- int width = NSWidth (rect), height = NSHeight (rect);
+ const NSRect *rectList;
+ NSInteger numRects;
NSTRACE ("[EmacsView drawRect:" NSTRACE_FMT_RECT "]",
NSTRACE_ARG_RECT(rect));
@@ -8173,9 +8153,23 @@ not_in_argv (NSString *arg)
if (!emacsframe || !emacsframe->output_data.ns)
return;
- ns_clear_frame_area (emacsframe, x, y, width, height);
block_input ();
- expose_frame (emacsframe, x, y, width, height);
+
+ /* Get only the precise dirty rectangles to avoid redrawing
+ potentially large areas of the frame that haven't changed.
+
+ I'm not sure this actually provides much of a performance benefit
+ as it's hard to benchmark, but it certainly doesn't seem to
+ hurt. */
+ [self getRectsBeingDrawn:&rectList count:&numRects];
+ for (int i = 0 ; i < numRects ; i++)
+ {
+ NSRect r = rectList[i];
+ expose_frame (emacsframe,
+ NSMinX (r), NSMinY (r),
+ NSWidth (r), NSHeight (r));
+ }
+
unblock_input ();
/*