summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2024-03-23 06:51:39 -0400
committerEli Zaretskii <eliz@gnu.org>2024-03-23 06:51:39 -0400
commite813c0fa3a17107b5b4857e186bc2512a3f8ae3c (patch)
tree2ae4f94c0516ea8e38e74cd2d6e5b030fa9c9dea
parentd7a6a6941bc8c0553b4dc5864ffdbfd677af90af (diff)
parent689f04a2ddfae856153bed762cc1461d66ec88de (diff)
downloademacs-e813c0fa3a17107b5b4857e186bc2512a3f8ae3c.tar.gz
Merge from origin/emacs-29
689f04a2ddf Clarify description of format-spec truncation 759dedfab07 More accurate documentation of 'rmail-mail-new-frame' fa79de7c6b8 ; * lisp/calendar/calendar.el: Remove extra space. 7f6e335f4b4 Fix documentation of M-SPC in user manual 5bdc2436c64 ; * lisp/emacs-lisp/cl-macs.el (cl-labels): Fix stray dif... 8014dbb2ad8 * admin/notes/bugtracker: Minor copyedit. 06a991e7e87 ; * admin/notes/bugtracker: Minor copyedit. c890622e1a9 Tweak regexp for object initializers in csharp-mode (bug#... f48babb1120 `term-mode': mention the keymap to add keybindings to 8cf05d9be12 Fix 'shortdoc-copy-function-as-kill' d5901f3f05e Improve documentation of 'edebug-print-*' variables
-rw-r--r--admin/notes/bugtracker4
-rw-r--r--doc/emacs/killing.texi28
-rw-r--r--doc/emacs/rmail.texi5
-rw-r--r--doc/lispref/strings.texi2
-rw-r--r--lisp/calendar/calendar.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/emacs-lisp/edebug.el12
-rw-r--r--lisp/format-spec.el6
-rw-r--r--lisp/progmodes/csharp-mode.el7
-rw-r--r--lisp/term.el11
-rw-r--r--test/lisp/progmodes/csharp-mode-resources/indent.erts19
-rw-r--r--test/lisp/progmodes/csharp-mode-tests.el30
12 files changed, 102 insertions, 26 deletions
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker
index b47061884d6..419d91ae854 100644
--- a/admin/notes/bugtracker
+++ b/admin/notes/bugtracker
@@ -430,8 +430,8 @@ reassign 123 spam
*** To change the title of a bug:
retitle 123 Some New Title
-*** To change the submitter address:
-submitter 123 none@example.com
+*** To change the submitter name and address:
+submitter 123 J. Hacker <none@example.com>
Note that it does not seem to work to specify "Submitter:" in the
pseudo-header when first reporting a bug.
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 9717c02f782..57adc037cb7 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -91,9 +91,11 @@ Delete the next character (@code{delete-char}).
@item M-\
Delete spaces and tabs around point (@code{delete-horizontal-space}).
+@item M-x just-one-space
+Delete spaces and tabs around point, leaving one space.
@item M-@key{SPC}
-Delete spaces and tabs around point, leaving one space
-(@code{just-one-space}).
+Delete spaces and tabs around point in flexible ways
+(@code{cycle-spacing}).
@item C-x C-o
Delete blank lines around the current line (@code{delete-blank-lines}).
@item M-^
@@ -118,12 +120,13 @@ characters before and after point. With a prefix argument, this only
deletes spaces and tab characters before point.
@findex just-one-space
-@code{just-one-space} does likewise but leaves a single space before
-point, regardless of the number of spaces that existed previously
-(even if there were none before). With a numeric argument @var{n}, it
-leaves @var{n} spaces before point if @var{n} is positive; if @var{n}
-is negative, it deletes newlines in addition to spaces and tabs,
-leaving @minus{}@var{n} spaces before point.
+@kbd{M-x just-one-space} deletes tabs and spaces around point, but
+leaves a single space before point, regardless of the number of spaces
+that existed previously (even if there were none before). With a
+numeric argument @var{n}, it leaves @var{n} spaces before point if
+@var{n} is positive; if @var{n} is negative, it deletes newlines in
+addition to spaces and tabs, leaving @minus{}@var{n} spaces before
+point.
@kindex M-SPC
@findex cycle-spacing
@@ -131,7 +134,14 @@ leaving @minus{}@var{n} spaces before point.
The command @code{cycle-spacing} (@kbd{M-@key{SPC}}) acts like a more
flexible version of @code{just-one-space}. It performs different
space cleanup actions defined by @code{cycle-spacing-actions}, in a
-cyclic manner, if you call it repeatedly in succession.
+cyclic manner, if you call it repeatedly in succession. By default,
+the first invocation does the same as @code{just-one-space}, the
+second deletes all whitespace characters around point like
+@code{delete-horizontal-space}, and the third restores the original
+whitespace characters; then it cycles. If invoked with a prefix
+argument, each action is given that value of the argument. The user
+option @code{cycle-spacing-actions} can include other members; see the
+doc string of that option for the details.
@kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines
after the current line. If the current line is blank, it deletes all
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 51bd6086ce0..f94708b08ac 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -875,7 +875,10 @@ already composing, or to alter a message you have sent.
If you set the variable @code{rmail-mail-new-frame} to a
non-@code{nil} value, then all the Rmail commands to start sending a
message create a new frame to edit it in. This frame is deleted when
-you send the message.
+you send the message (but not if it is the only visible frame on the
+current display, or if it's a text-mode frame). If this frame cannot
+be deleted when you send the message, Emacs will try to reuse it for
+composing subsequent messages.
@ignore
@c FIXME does not work with Message -> Kill Message
, or when you use the @samp{Cancel} item in the @samp{Mail} menu.
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 4fe94f78cba..a2285098aad 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -1369,7 +1369,7 @@ given width and precision, if specified.
@item >
This flag causes the substitution to be truncated on the right to the
-given width, if specified.
+given width and precision, if specified.
@item ^
This flag converts the substituted text to upper case (@pxref{Case
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 2c3e7d28301..10c86571804 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1985,7 +1985,7 @@ Gregorian date Sunday, December 31, 1 BC. This function does not
handle dates in years BC."
;; For an explanation, see the footnote on page 384 of "Calendrical
;; Calculations, Part II: Three Historical Calendars" by
- ;; E. M. Reingold, N. Dershowitz, and S. M. Clamen,
+ ;; E. M. Reingold, N. Dershowitz, and S. M. Clamen,
;; Software--Practice and Experience, Volume 23, Number 4 (April,
;; 1993), pages 383-404 <https://doi.org/10.1002/spe.4380230404>
;; <http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.42.6421&rep=rep1&type=pdf>.
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 129b83c61b9..ab31946d8ab 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2250,7 +2250,7 @@ Like `cl-flet' but the definitions can refer to previous ones.
;;;###autoload
(defmacro cl-labels (bindings &rest body)
"Make local (recursive) function definitions.
-+BINDINGS is a list of definitions of the form (FUNC ARGLIST BODY...) where
+BINDINGS is a list of definitions of the form (FUNC ARGLIST BODY...) where
FUNC is the function name, ARGLIST its arguments, and BODY the
forms of the function body. FUNC is defined in any BODY, as well
as FORM, so you can write recursive and mutually recursive
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 4c7dbb4ef8c..1d3db4a588d 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -193,11 +193,15 @@ Use this with caution since it is not debugged."
(defcustom edebug-print-length 50
- "If non-nil, default value of `print-length' for printing results in Edebug."
- :type '(choice integer (const nil)))
+ "Maximum length of list to print before abbreviating, when in Edebug.
+If this is nil, use the value of `print-length' instead."
+ :type '(choice (integer :tag "A number")
+ (const :tag "Use `print-length'" nil)))
(defcustom edebug-print-level 50
- "If non-nil, default value of `print-level' for printing results in Edebug."
- :type '(choice integer (const nil)))
+ "Maximum depth of list nesting to print before abbreviating, when in Edebug.
+If nil, use the value of `print-level' instead."
+ :type '(choice (integer :tag "A number")
+ (const :tag "Use `print-level'" nil)))
(defcustom edebug-print-circle t
"If non-nil, default value of `print-circle' for printing results in Edebug."
:type 'boolean)
diff --git a/lisp/format-spec.el b/lisp/format-spec.el
index cf34017b994..73f9fccd793 100644
--- a/lisp/format-spec.el
+++ b/lisp/format-spec.el
@@ -38,7 +38,7 @@ For instance:
(?l . \"ls\")))
Each %-spec may contain optional flag, width, and precision
-modifiers, as follows:
+specifiers, as follows:
%<flags><width><precision>character
@@ -51,7 +51,7 @@ The following flags are allowed:
* ^: Convert to upper case.
* _: Convert to lower case.
-The width and truncation modifiers behave like the corresponding
+The width and precision specifiers behave like the corresponding
ones in `format' when applied to %s.
For example, \"%<010b\" means \"substitute into the output the
@@ -145,7 +145,7 @@ is returned, where each format spec is its own element."
"Return STR formatted according to FLAGS, WIDTH, and TRUNC.
FLAGS is a list of keywords as returned by
`format-spec--parse-flags'. WIDTH and TRUNC are either nil or
-string widths corresponding to `format-spec' modifiers."
+string widths corresponding to `format-spec' specifiers."
(let (diff str-width)
;; Truncate original string first, like `format' does.
(when trunc
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 18114d08528..9782eb443f2 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -495,9 +495,12 @@ compilation and evaluation time conflicts."
(unless (eq (char-after) ?{)
(ignore-errors (backward-up-list 1 t t)))
(save-excursion
- ;; 'new' should be part of the line
+ ;; 'new' should be part of the line, but should not trigger if
+ ;; statement has already ended, like for 'var x = new X();'.
+ ;; Also, deal with the possible end of line obscured by a
+ ;; trailing comment.
(goto-char (c-point 'iopl))
- (looking-at ".*new.*")))
+ (looking-at "^[^//]*new[^//]*;$")))
;; Line should not already be terminated
(save-excursion
(goto-char (c-point 'eopl))
diff --git a/lisp/term.el b/lisp/term.el
index 3a0ecc041ca..c15f6cf2e9f 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -658,7 +658,8 @@ executed once, when the buffer is created."
["Forward Output Group" term-next-prompt t]
["Kill Current Output Group" term-kill-output t]))
map)
- "Keymap for Term mode.")
+ "Keymap for \"line mode\" in Term mode. For custom keybindings purposes
+please note there is also `term-raw-map'")
(defvar term-escape-char nil
"Escape character for char sub-mode of term mode.
@@ -961,7 +962,9 @@ underlying shell."
(dotimes (key 21)
(keymap-set map (format "<f%d>" key) #'term-send-function-key)))
map)
- "Keyboard map for sending characters directly to the inferior process.")
+ "Keyboard map for sending characters directly to the inferior process.
+For custom keybindings purposes please note there is also
+`term-mode-map'")
(easy-menu-define term-terminal-menu
(list term-mode-map term-raw-map term-pager-break-map)
@@ -1122,6 +1125,10 @@ particular subprocesses. This can be done by setting the hooks
and the variable `term-prompt-regexp' to the appropriate regular
expression.
+If you define custom keybindings, make sure to assign them to the
+correct keymap (or to both): use `term-raw-map' in raw mode and
+`term-mode-map' in line mode.
+
Commands in raw mode:
\\{term-raw-map}
diff --git a/test/lisp/progmodes/csharp-mode-resources/indent.erts b/test/lisp/progmodes/csharp-mode-resources/indent.erts
new file mode 100644
index 00000000000..a676ecc9728
--- /dev/null
+++ b/test/lisp/progmodes/csharp-mode-resources/indent.erts
@@ -0,0 +1,19 @@
+Code:
+ (lambda ()
+ (csharp-mode)
+ (indent-region (point-min) (point-max)))
+
+Point-Char: |
+
+Name: Don't consider closed statements as object initializers. (bug#69571)
+
+=-=
+public class Foo {
+ void Bar () {
+ var x = new X(); // [1]
+ for (;;) {
+ x();
+ } // [2]
+ }
+}
+=-=-=
diff --git a/test/lisp/progmodes/csharp-mode-tests.el b/test/lisp/progmodes/csharp-mode-tests.el
new file mode 100644
index 00000000000..f50fabf5836
--- /dev/null
+++ b/test/lisp/progmodes/csharp-mode-tests.el
@@ -0,0 +1,30 @@
+;;; csharp-mode-tests.el --- Tests for CC Mode C# mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'csharp-mode)
+
+(ert-deftest csharp-mode-test-indentation ()
+ (ert-test-erts-file (ert-resource-file "indent.erts")))
+
+(provide 'csharp-mode-tests)
+;;; csharp-mode-tests.el ends here