From 7dc028e2501feec7d7fca5987ab852b261aa4039 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 6 May 2018 21:49:31 +0100 Subject: [PATCH 1/8] Check NSWindow is actually a frame * src/nsfns.m (Fns_frame_list_z_order): Check NSWindow is an instance of EmacsView before treating it as one. --- src/nsfns.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nsfns.m b/src/nsfns.m index 7f2f060dda8..bd1e2283a0c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1497,7 +1497,8 @@ Frames are listed from topmost (first) to bottommost (last). */) Lisp_Object frame; /* Check against [win parentWindow] so that it doesn't match itself. */ - if (parent == nil || ns_window_is_ancestor (parent, [win parentWindow])) + if ([[win delegate] isKindOfClass:[EmacsView class]] + && (parent == nil || ns_window_is_ancestor (parent, [win parentWindow]))) { XSETFRAME (frame, ((EmacsView *)[win delegate])->emacsframe); frames = Fcons(frame, frames); From 1d9e66aea17787e03954f32c6cd7561c881bb444 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 6 May 2018 10:07:25 -0400 Subject: [PATCH 2/8] Don't check non-X frames for z order (Bug#31373) * src/xfns.c (x_frame_list_z_order): Only use frames with `output_method' set to `output_x_window'. --- src/xfns.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index 20fe61bffd8..3da853ede8a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5300,12 +5300,16 @@ x_frame_list_z_order (Display* dpy, Window window) Lisp_Object frame, tail; FOR_EACH_FRAME (tail, frame) - /* With a reparenting window manager the parent_desc field - usually specifies the topmost windows of our frames. - Otherwise FRAME_OUTER_WINDOW should do. */ - if (XFRAME (frame)->output_data.x->parent_desc == children[i] - || FRAME_OUTER_WINDOW (XFRAME (frame)) == children[i]) - frames = Fcons (frame, frames); + { + struct frame *cf = XFRAME (frame); + /* With a reparenting window manager the parent_desc + field usually specifies the topmost windows of our + frames. Otherwise FRAME_OUTER_WINDOW should do. */ + if (FRAME_X_P (cf) + && (cf->output_data.x->parent_desc == children[i] + || FRAME_OUTER_WINDOW (cf) == children[i])) + frames = Fcons (frame, frames); + } } if (children) XFree ((char *)children); From be2e8cb8be28affa830c21e2425573c3a1855a85 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 10 May 2018 22:47:04 -0400 Subject: [PATCH 3/8] * doc/man/emacs.1.in: Document --fg-daemon and --bg-daemon. --- doc/man/emacs.1.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/man/emacs.1.in b/doc/man/emacs.1.in index 51169530419..e332fb45c7b 100644 --- a/doc/man/emacs.1.in +++ b/doc/man/emacs.1.in @@ -123,7 +123,7 @@ Use specified as the terminal instead of using stdin/stdout. This must be the first argument specified in the command line. .TP -.BI \-\-daemon "\fR[=\fPname\fR]" +.BI \-\-daemon "\fR[=\fPname\fR], " \-\-bg\-daemon "\fR[=\fPname\fR]" Start Emacs as a daemon, enabling the Emacs server and disconnecting from the terminal. You can then use the emacsclient (see .BR emacsclient (1)) @@ -131,6 +131,9 @@ command to connect to the server (with optional .IR name ")." .TP +.BI \-\-fg\-daemon "\fR[=\fPname\fR]" +Like "\-\-bg\-daemon", but don't disconnect from the terminal. +.TP .B \-\-version Display .I Emacs From 087681b8590ba0aa32273c9e11fe088be223d114 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 11 May 2018 12:11:14 +0300 Subject: [PATCH 4/8] Improve documentation of kmacro commands and variables. * lisp/kmacro.el (kmacro-start-macro-or-insert-counter) (kmacro-counter, kmacro-set-format, kmacro-set-counter) (kmacro-add-counter, kmacro-counter-format) (kmacro-insert-counter): Clarify and improve the doc strings. (Bug#31243) --- lisp/kmacro.el | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 8855fa5c314..7abd8aed79a 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -233,12 +233,19 @@ macro to be executed before appending to it." ;;; Keyboard macro counter (defvar kmacro-counter 0 - "Current keyboard macro counter.") + "Current keyboard macro counter. + +This is normally initialized to zero when the macro is defined, +and incremented each time the value of the counter is inserted +into a buffer. See `kmacro-start-macro-or-insert-counter' for +more details.") (defvar kmacro-default-counter-format "%d") (defvar kmacro-counter-format "%d" - "Current keyboard macro counter format.") + "Current keyboard macro counter format. + +Can be set directly via `kmacro-set-format', which see.") (defvar kmacro-counter-format-start kmacro-counter-format "Macro format at start of macro execution.") @@ -254,9 +261,9 @@ macro to be executed before appending to it." (defun kmacro-insert-counter (arg) - "Insert macro counter, then increment it by ARG. + "Insert current value of `kmacro-counter', then increment it by ARG. Interactively, ARG defaults to 1. With \\[universal-argument], insert -previous `kmacro-counter', and do not modify counter." +current value of `kmacro-counter', but do not increment it." (interactive "P") (if kmacro-initial-counter-value (setq kmacro-counter kmacro-initial-counter-value @@ -268,7 +275,7 @@ previous `kmacro-counter', and do not modify counter." (defun kmacro-set-format (format) - "Set macro counter FORMAT." + "Set the format of `kmacro-counter' to FORMAT." (interactive "sMacro Counter Format: ") (setq kmacro-counter-format (if (equal format "") "%d" format)) @@ -284,7 +291,7 @@ previous `kmacro-counter', and do not modify counter." (defun kmacro-set-counter (arg) - "Set `kmacro-counter' to ARG or prompt if missing. + "Set the value of `kmacro-counter' to ARG, or prompt for value if no argument. With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the macro." (interactive "NMacro counter value: ") (if (not (or defining-kbd-macro executing-kbd-macro)) @@ -298,7 +305,7 @@ With \\[universal-argument] prefix, reset counter to its value prior to this ite (defun kmacro-add-counter (arg) - "Add numeric prefix arg (prompt if missing) to macro counter. + "Add the value of numeric prefix arg (prompt if missing) to `kmacro-counter'. With \\[universal-argument], restore previous counter value." (interactive "NAdd to macro counter: ") (if kmacro-initial-counter-value @@ -677,18 +684,21 @@ use \\[kmacro-name-last-macro]." "Record subsequent keyboard input, defining a keyboard macro. The commands are recorded even as they are executed. -Sets the `kmacro-counter' to ARG (or 0 if no prefix arg) before defining the -macro. +Initializes the macro's `kmacro-counter' to ARG (or 0 if no prefix arg) +before defining the macro. With \\[universal-argument], appends to current keyboard macro (keeping the current value of `kmacro-counter'). -When defining/executing macro, inserts macro counter and increments -the counter with ARG or 1 if missing. With \\[universal-argument], -inserts previous `kmacro-counter' (but do not modify counter). +When used during defining/executing a macro, inserts the current value +of `kmacro-counter' and increments the counter value by ARG (or by 1 if no +prefix argument). With just \\[universal-argument], inserts the current value +of `kmacro-counter', but does not modify the counter; this is the +same as incrementing the counter by zero. -The macro counter can be modified via \\[kmacro-set-counter] and \\[kmacro-add-counter]. -The format of the counter can be modified via \\[kmacro-set-format]." +The macro counter can be set directly via \\[kmacro-set-counter] and \\[kmacro-add-counter]. +The format of the inserted value of the counter can be controlled +via \\[kmacro-set-format]." (interactive "P") (if (or defining-kbd-macro executing-kbd-macro) (kmacro-insert-counter arg) From e6bf19cfffaca98da4d8f83fb3675dc972337661 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 11 May 2018 12:32:31 +0300 Subject: [PATCH 5/8] Fix inaccuracies in "Shell Ring" node of Emacs manual * doc/emacs/misc.texi (Shell Ring): Don't mention 'M-s' and don't insist on Shell history commands being "jsut like" similar commands that operate on minibuffer history. Reported by Jorge in emacs-manual-bugs. --- doc/emacs/misc.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 12ebfbf26ac..4aa8e3f700d 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1145,10 +1145,11 @@ Display the buffer's history of shell commands in another window Shell buffers provide a history of previously entered shell commands. To reuse shell commands from the history, use the editing -commands @kbd{M-p}, @kbd{M-n}, @kbd{M-r} and @kbd{M-s}. These work -just like the minibuffer history commands (@pxref{Minibuffer +commands @kbd{M-p}, @kbd{M-n}, and @kbd{M-r}. These work +similar to the minibuffer history commands (@pxref{Minibuffer History}), except that they operate within the Shell buffer rather -than the minibuffer. +than the minibuffer, and @code{M-r} in a Shell buffer invokes +incremental search through shell command history. @kbd{M-p} fetches an earlier shell command to the end of the shell buffer. Successive use of @kbd{M-p} fetches successively earlier From c9c0e40d673a5fc0d24d30ff67ccb7c7f2fb482a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 11 May 2018 12:39:52 +0300 Subject: [PATCH 6/8] More minor changes in shell-related nodes of Emacs manual * doc/emacs/misc.texi (Interactive Shell): Clarify how the window that displays "*shell*" is selected. (Shell Prompts): Fix a typo. Reported by Jorge in emacs-manual-bugs. --- doc/emacs/misc.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 4aa8e3f700d..cd9b67bcdee 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -784,7 +784,8 @@ text in the buffer. To give input to the subshell, go to the end of the buffer and type the input, terminated by @key{RET}. By default, when the subshell is invoked interactively, the -@file{*shell*} buffer is displayed in a new window. This behavior can +@file{*shell*} buffer is displayed in a new window, unless the current +window already shows the @file{*shell*} buffer. This behavior can be customized via @code{display-buffer-alist} (@pxref{Window Choice}). While the subshell is waiting or running a command, you can switch @@ -1071,7 +1072,7 @@ Emacs Lisp Reference Manual}). @vindex comint-use-prompt-regexp @vindex shell-prompt-pattern If you change the variable @code{comint-use-prompt-regexp} to a -non-@code{nil} value, then Comint mode recognize prompts using a +non-@code{nil} value, then Comint mode will recognize prompts using a regular expression (@pxref{Regexps}). In Shell mode, the regular expression is specified by the variable @code{shell-prompt-pattern}. The default value of @code{comint-use-prompt-regexp} is @code{nil}, From 700fcd77d7d3fbe7e48a637db9225706553b0262 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 11 May 2018 16:09:14 -0700 Subject: [PATCH 7/8] * doc/emacs/help.texi: Fix paren typo. --- doc/emacs/help.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index a5700760d44..94d27a276dc 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -491,7 +491,7 @@ buffer (@pxref{Package Menu}). @findex describe-package @kindex C-h P @kbd{C-h P} (@code{describe-package}) prompts for the name of a -package (@pxref{Packages}, and displays a help buffer describing the +package (@pxref{Packages}), and displays a help buffer describing the attributes of the package and the features that it implements. The buffer lists the keywords that relate to the package in the form of buttons. Click on a button with @kbd{mouse-1} or @kbd{mouse-2} to see From b98cf9cdabd710f89eb57645a163fd52db338404 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 May 2018 12:09:05 +0300 Subject: [PATCH 8/8] ; Fix a typo in the Emacs manual * doc/emacs/fixit.texi (Transpose): Fix a typo. Reported by Takesi Ayanokoji . --- doc/emacs/fixit.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 7cacac42400..fe2da7ae4f1 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -180,7 +180,7 @@ Otherwise, a reverse search (@kbd{C-r}) is often the best way. dragging the word preceding or containing point forward as well. The punctuation characters between the words do not move. For example, @w{@samp{FOO, BAR}} transposes into @w{@samp{BAR, FOO}} rather than -@samp{@w{BAR FOO,}}. When point is at the end of the line, it will +@w{@samp{BAR FOO,}}. When point is at the end of the line, it will transpose the word before point with the first word on the next line. @kbd{C-M-t} (@code{transpose-sexps}) is a similar command for