aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2018-09-15 09:20:32 -0700
committerGlenn Morris2018-09-15 09:20:32 -0700
commit9e79d59790809387707852e6d1b691d1bfbf2327 (patch)
treeb18125d7befbcdad78f2cafb805d0db45c030318
parentffbe561ee5acb0b9edc5f4c995c287fb2485c315 (diff)
parente133b630625d6e5791c8b491c1cf3252cdb97080 (diff)
downloademacs-9e79d59790809387707852e6d1b691d1bfbf2327.tar.gz
emacs-9e79d59790809387707852e6d1b691d1bfbf2327.zip
Merge from origin/emacs-26
e133b63 (origin/emacs-26) Avoid adverse side effects of fixing bug#21824 cc8f334 Document changes called out in NEWS 20ecc52 ; * etc/NEWS: Document recent change in 'thing-at-point'. 1fc5283 ; INSTALL: Fix a typo in the last commit. 24f240d Tiny doc updates re yum/dnf etc 41c2d25 Remove unused variable 1e3b3fa Fix (thing-at-point 'list) regression (Bug#31772) 219893a Clarify meaning of '*' 41cdda2 * etc/PROBLEMS: Document Ubuntu 16.04 issue. 1c22f03 Increase default value for imenu-auto-rescan-maxout ee84389 Improve recent change to ELisp manual ff374e4 * doc/lispref/display.texi (SVG Images): Improve wording. 3a0caf6 * doc/lispref/display.texi (SVG Images): Fix a typo. (Bug#32... Conflicts: doc/lispref/lists.texi etc/NEWS
-rw-r--r--INSTALL5
-rw-r--r--doc/emacs/programs.texi4
-rw-r--r--doc/lispref/commands.texi7
-rw-r--r--doc/lispref/display.texi48
-rw-r--r--doc/lispref/lists.texi2
-rw-r--r--doc/lispref/minibuf.texi55
-rw-r--r--doc/misc/dired-x.texi3
-rw-r--r--doc/misc/efaq.texi5
-rw-r--r--etc/NEWS.266
-rw-r--r--etc/PROBLEMS9
-rw-r--r--lisp/imenu.el8
-rw-r--r--lisp/progmodes/prolog.el6
-rw-r--r--lisp/thingatpt.el27
-rw-r--r--src/buffer.c24
-rw-r--r--test/lisp/thingatpt-tests.el72
-rw-r--r--test/src/buffer-tests.el19
16 files changed, 192 insertions, 108 deletions
diff --git a/INSTALL b/INSTALL
index ab2e800e676..0c56fff6d4a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -202,8 +202,9 @@ The names of the packages that you need varies according to the
202GNU/Linux distribution that you use, and the options that you want to 202GNU/Linux distribution that you use, and the options that you want to
203configure Emacs with. On Debian-based systems, you can install all the 203configure Emacs with. On Debian-based systems, you can install all the
204packages needed to build the installed version of Emacs with a command 204packages needed to build the installed version of Emacs with a command
205like 'apt-get build-dep emacs24'. On Red Hat systems, the 205like 'apt-get build-dep emacs' (on older systems, replace 'emacs' with
206corresponding command is 'yum-builddep emacs'. 206eg 'emacs25'). On Red Hat-based systems, the corresponding command is
207'dnf builddep emacs' (on older systems, use 'yum-builddep' instead).
207 208
208 209
209DETAILED BUILDING AND INSTALLATION: 210DETAILED BUILDING AND INSTALLATION:
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index c72558ce9a7..cfeb61e44d4 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -274,6 +274,10 @@ Rescanning happens automatically if you set @code{imenu-auto-rescan} to
274a non-@code{nil} value. There is no need to rescan because of small 274a non-@code{nil} value. There is no need to rescan because of small
275changes in the text. 275changes in the text.
276 276
277@vindex imenu-auto-rescan-maxout
278 @code{imenu-auto-rescan} will be disabled in buffers that are larger
279than @code{imenu-auto-rescan-maxout} in bytes.
280
277@vindex imenu-sort-function 281@vindex imenu-sort-function
278 You can customize the way the menus are sorted by setting the 282 You can customize the way the menus are sorted by setting the
279variable @code{imenu-sort-function}. By default, names are ordered as 283variable @code{imenu-sort-function}. By default, names are ordered as
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 3e74f05e4c8..49c839a8971 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1075,12 +1075,13 @@ the current Emacs session. If a symbol has not yet been so used,
1075@subsection Keyboard Events 1075@subsection Keyboard Events
1076@cindex keyboard events 1076@cindex keyboard events
1077 1077
1078@cindex character event
1078There are two kinds of input you can get from the keyboard: ordinary 1079There are two kinds of input you can get from the keyboard: ordinary
1079keys, and function keys. Ordinary keys correspond to (possibly 1080keys, and function keys. Ordinary keys correspond to (possibly
1080modified) characters; the events they generate are represented in Lisp 1081modified) characters; the events they generate are represented in Lisp
1081as characters. The event type of a character event is the character 1082as characters. The event type of a @dfn{character event} is the
1082itself (an integer), which might have some modifier bits set; see 1083character itself (an integer), which might have some modifier bits
1083@ref{Classifying Events}. 1084set; see @ref{Classifying Events}.
1084 1085
1085@cindex modifier bits (of input character) 1086@cindex modifier bits (of input character)
1086@cindex basic code (of input character) 1087@cindex basic code (of input character)
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index ea9a305ae2a..9a6fb422f01 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -5442,7 +5442,8 @@ Specifies a rotation angle in degrees.
5442 5442
5443SVG (Scalable Vector Graphics) is an XML format for specifying images. 5443SVG (Scalable Vector Graphics) is an XML format for specifying images.
5444If your Emacs build has SVG support, you can create and manipulate 5444If your Emacs build has SVG support, you can create and manipulate
5445these images with the following functions. 5445these images with the following functions from the @file{svg.el}
5446library.
5446 5447
5447@defun svg-create width height &rest args 5448@defun svg-create width height &rest args
5448Create a new, empty SVG image with the specified dimensions. 5449Create a new, empty SVG image with the specified dimensions.
@@ -5456,8 +5457,11 @@ The default width (in pixels) of any lines created.
5456The default stroke color on any lines created. 5457The default stroke color on any lines created.
5457@end table 5458@end table
5458 5459
5459This function returns an SVG structure, and all the following functions 5460@cindex SVG object
5460work on that structure. 5461This function returns an @dfn{SVG object}, a Lisp data structure that
5462specifies an SVG image, and all the following functions work on that
5463structure. The argument @var{svg} in the following functions
5464specifies such an SVG object.
5461@end defun 5465@end defun
5462 5466
5463@defun svg-gradient svg id type stops 5467@defun svg-gradient svg id type stops
@@ -5501,8 +5505,8 @@ gradient object.
5501@end table 5505@end table
5502 5506
5503@defun svg-rectangle svg x y width height &rest args 5507@defun svg-rectangle svg x y width height &rest args
5504Add a rectangle to @var{svg} where the upper left corner is at 5508Add to @var{svg} a rectangle whose upper left corner is at
5505position @var{x}/@var{y} and is of size @var{width}/@var{height}. 5509position @var{x}/@var{y} and whose size is @var{width}/@var{height}.
5506 5510
5507@lisp 5511@lisp
5508(svg-rectangle svg 100 100 500 500 :gradient "gradient1") 5512(svg-rectangle svg 100 100 500 500 :gradient "gradient1")
@@ -5510,24 +5514,24 @@ position @var{x}/@var{y} and is of size @var{width}/@var{height}.
5510@end defun 5514@end defun
5511 5515
5512@defun svg-circle svg x y radius &rest args 5516@defun svg-circle svg x y radius &rest args
5513Add a circle to @var{svg} where the center is at @var{x}/@var{y} 5517Add to @var{svg} a circle whose center is at @var{x}/@var{y} and whose
5514and the radius is @var{radius}. 5518radius is @var{radius}.
5515@end defun 5519@end defun
5516 5520
5517@defun svg-ellipse svg x y x-radius y-radius &rest args 5521@defun svg-ellipse svg x y x-radius y-radius &rest args
5518Add a circle to @var{svg} where the center is at @var{x}/@var{y} and 5522Add to @var{svg} an ellipse whose center is at @var{x}/@var{y}, and
5519the horizontal radius is @var{x-radius} and the vertical radius is 5523whose horizontal radius is @var{x-radius} and the vertical radius is
5520@var{y-radius}. 5524@var{y-radius}.
5521@end defun 5525@end defun
5522 5526
5523@defun svg-line svg x1 y1 x2 y2 &rest args 5527@defun svg-line svg x1 y1 x2 y2 &rest args
5524Add a line to @var{svg} that starts at @var{x1}/@var{y1} and extends 5528Add to @var{svg} a line that starts at @var{x1}/@var{y1} and extends
5525to @var{x2}/@var{y2}. 5529to @var{x2}/@var{y2}.
5526@end defun 5530@end defun
5527 5531
5528@defun svg-polyline svg points &rest args 5532@defun svg-polyline svg points &rest args
5529Add a multiple segment line to @var{svg} that goes through 5533Add to @var{svg} a multiple-segment line (a.k.a.@: ``polyline'') that
5530@var{points}, which is a list of X/Y position pairs. 5534goes through @var{points}, which is a list of X/Y position pairs.
5531 5535
5532@lisp 5536@lisp
5533(svg-polyline svg '((200 . 100) (500 . 450) (80 . 100)) 5537(svg-polyline svg '((200 . 100) (500 . 450) (80 . 100))
@@ -5541,12 +5545,12 @@ that describe the outer circumference of the polygon.
5541 5545
5542@lisp 5546@lisp
5543(svg-polygon svg '((100 . 100) (200 . 150) (150 . 90)) 5547(svg-polygon svg '((100 . 100) (200 . 150) (150 . 90))
5544 :stroke-color "blue" :fill-color "red"") 5548 :stroke-color "blue" :fill-color "red")
5545@end lisp 5549@end lisp
5546@end defun 5550@end defun
5547 5551
5548@defun svg-text svg text &rest args 5552@defun svg-text svg text &rest args
5549Add a text to @var{svg}. 5553Add the specified @var{text} to @var{svg}.
5550 5554
5551@lisp 5555@lisp
5552(svg-text 5556(svg-text
@@ -5565,9 +5569,9 @@ Add a text to @var{svg}.
5565 5569
5566@defun svg-embed svg image image-type datap &rest args 5570@defun svg-embed svg image image-type datap &rest args
5567Add an embedded (raster) image to @var{svg}. If @var{datap} is 5571Add an embedded (raster) image to @var{svg}. If @var{datap} is
5568@code{nil}, @var{IMAGE} should be a file name; if not, it should be a 5572@code{nil}, @var{image} should be a file name; otherwise it should be a
5569binary string containing the image data. @var{image-type} should be a 5573string containing the image data as raw bytes. @var{image-type} should be a
5570@acronym{MIME} image type, for instance @samp{"image/jpeg"}. 5574@acronym{MIME} image type, for instance @code{"image/jpeg"}.
5571 5575
5572@lisp 5576@lisp
5573(svg-embed svg "~/rms.jpg" "image/jpeg" nil 5577(svg-embed svg "~/rms.jpg" "image/jpeg" nil
@@ -5580,10 +5584,14 @@ binary string containing the image data. @var{image-type} should be a
5580Remove the element with identifier @code{id} from the @code{svg}. 5584Remove the element with identifier @code{id} from the @code{svg}.
5581@end defun 5585@end defun
5582 5586
5583Finally, the @code{svg-image} takes an SVG object as its parameter and 5587@defun svg-image svg
5588Finally, the @code{svg-image} takes an SVG object as its argument and
5584returns an image object suitable for use in functions like 5589returns an image object suitable for use in functions like
5585@code{insert-image}. Here's a complete example that creates and 5590@code{insert-image}.
5586inserts an image with a circle: 5591@end defun
5592
5593Here's a complete example that creates and inserts an image with a
5594circle:
5587 5595
5588@lisp 5596@lisp
5589(let ((svg (svg-create 400 400 :stroke-width 10))) 5597(let ((svg (svg-create 400 400 :stroke-width 10)))
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index b7bb3cf6be1..1548dd49b2f 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1755,7 +1755,7 @@ alist
1755@defun assoc-delete-all key alist &optional test 1755@defun assoc-delete-all key alist &optional test
1756This function is like @code{assq-delete-all} except that it accepts 1756This function is like @code{assq-delete-all} except that it accepts
1757an optional argument @var{test}, a predicate function to compare the 1757an optional argument @var{test}, a predicate function to compare the
1758keys in @var{alist}. If omitted or @code{nil}, @var{test} defaults to 1758keys in @var{alist}. If omitted or @code{nil}, @var{test} defaults to
1759@code{equal}. As @code{assq-delete-all}, this function often modifies 1759@code{equal}. As @code{assq-delete-all}, this function often modifies
1760the original list structure of @var{alist}. 1760the original list structure of @var{alist}.
1761@end defun 1761@end defun
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index da3ebd89aa2..55fde747592 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -26,7 +26,7 @@ argument.
26* Initial Input:: Specifying initial contents for the minibuffer. 26* Initial Input:: Specifying initial contents for the minibuffer.
27* Completion:: How to invoke and customize completion. 27* Completion:: How to invoke and customize completion.
28* Yes-or-No Queries:: Asking a question with a simple answer. 28* Yes-or-No Queries:: Asking a question with a simple answer.
29* Multiple Queries:: Asking a series of similar questions. 29* Multiple Queries:: Asking complex questions.
30* Reading a Password:: Reading a password from the terminal. 30* Reading a Password:: Reading a password from the terminal.
31* Minibuffer Commands:: Commands used as key bindings in minibuffers. 31* Minibuffer Commands:: Commands used as key bindings in minibuffers.
32* Minibuffer Windows:: Operating on the special minibuffer windows. 32* Minibuffer Windows:: Operating on the special minibuffer windows.
@@ -2090,9 +2090,12 @@ Do you really want to remove everything? (yes or no)
2090@end defun 2090@end defun
2091 2091
2092@node Multiple Queries 2092@node Multiple Queries
2093@section Asking Multiple Y-or-N Questions 2093@section Asking Multiple-Choice Questions
2094@cindex multiple yes-or-no questions 2094
2095 This section describes facilities for asking the user more complex
2096questions or several similar questions.
2095 2097
2098@cindex multiple yes-or-no questions
2096 When you have a series of similar questions to ask, such as ``Do you 2099 When you have a series of similar questions to ask, such as ``Do you
2097want to save this buffer?'' for each buffer in turn, you should use 2100want to save this buffer?'' for each buffer in turn, you should use
2098@code{map-y-or-n-p} to ask the collection of questions, rather than 2101@code{map-y-or-n-p} to ask the collection of questions, rather than
@@ -2186,6 +2189,52 @@ The return value of @code{map-y-or-n-p} is the number of objects acted on.
2186@c FIXME An example of this would be more useful than all the 2189@c FIXME An example of this would be more useful than all the
2187@c preceding examples of simple things. 2190@c preceding examples of simple things.
2188 2191
2192If you need to ask the user a question that might have more than just
21932 answers, use @code{read-answer}.
2194
2195@defun read-answer question answers
2196@vindex read-answer-short
2197This function prompts the user with text in @var{question}, which
2198should end in the @samp{SPC} character. The function includes in the
2199prompt the possible responses in @var{answers} by appending them to
2200the end of @var{question}. The possible responses are provided in
2201@var{answers} as an alist whose elements are of the following form:
2202
2203@lisp
2204(@var{long-answer} @var{short-answer} @var{help-message})
2205@end lisp
2206
2207@noindent
2208where @var{long-answer} is the complete text of the user response, a
2209string; @var{short-answer} is a short form of the same response, a
2210single character; and @var{help-message} is the text that describes
2211the meaning of the answer. If the variable @code{read-answer-short}
2212is non-@code{nil}, the prompt will show the short variants of the
2213possible answers and the user is expected to type the single
2214characters shown in the prompt; otherwise the prompt will show the
2215long variants of the answers, and the user is expected to type the
2216full text of one of the answers and end by pressing @key{RET}. If
2217@code{use-dialog-box} is non-@code{nil}, and this function was invoked
2218by mouse events, the question and the answers will be displayed in a
2219GUI dialog box.
2220
2221The function returns the text of the @var{long-answer} selected by the
2222user, regardless of whether long or short answers were shown in the
2223prompt and typed by the user.
2224
2225Here is an example of using this function:
2226
2227@lisp
2228(let ((read-answer-short t))
2229 (read-answer "Foo "
2230 '(("yes" ?y "perform the action")
2231 ("no" ?n "skip to the next")
2232 ("all" ?! "perform for the rest without more questions")
2233 ("help" ?h "show help")
2234 ("quit" ?q "exit"))))
2235@end lisp
2236@end defun
2237
2189@node Reading a Password 2238@node Reading a Password
2190@section Reading a Password 2239@section Reading a Password
2191@cindex passwords, reading 2240@cindex passwords, reading
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 36179200f4e..1ff2b73512a 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -521,8 +521,7 @@ where each @var{command} can either be a string or a Lisp expression
521that evaluates to a string. If several commands are given, all of 521that evaluates to a string. If several commands are given, all of
522them will temporarily be pushed onto the history. 522them will temporarily be pushed onto the history.
523 523
524If @samp{*} in the shell command, that means to substitute the file 524A @samp{*} in the shell command is replaced by the file name.
525name.
526 525
527You can set this variable in your @file{~/.emacs}. For example, 526You can set this variable in your @file{~/.emacs}. For example,
528to add rules for @samp{.foo} and @samp{.bar} file extensions, write 527to add rules for @samp{.foo} and @samp{.bar} file extensions, write
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 5b432d5b2fb..26d9c82b219 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -3392,8 +3392,9 @@ and binaries, and how to install Emacs on those systems.
3392 3392
3393Most GNU/Linux distributions provide pre-built Emacs packages. 3393Most GNU/Linux distributions provide pre-built Emacs packages.
3394If Emacs is not installed already, you can install it by running (as 3394If Emacs is not installed already, you can install it by running (as
3395root) a command such as @samp{yum install emacs} (Red Hat and 3395root) a command such as @samp{dnf install emacs} (Red Hat and
3396derivatives) or @samp{apt-get install emacs} (Debian and derivatives). 3396derivatives; use @samp{yum} in older distributions) or
3397@samp{apt-get install emacs} (Debian and derivatives).
3397 3398
3398If you want to compile Emacs yourself, read the file @file{INSTALL} in 3399If you want to compile Emacs yourself, read the file @file{INSTALL} in
3399the source distribution. In brief: 3400the source distribution. In brief:
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index 97222705e61..19dd433cda4 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -37,6 +37,11 @@ in its NEWS.)
37 37
38* Changes in Specialized Modes and Packages in Emacs 26.2 38* Changes in Specialized Modes and Packages in Emacs 26.2
39 39
40** Imenu
41
42---
43*** The value for 'imenu-auto-rescan-maxout' has been increased to 600000.
44
40** Gnus 45** Gnus
41 46
42--- 47---
@@ -60,6 +65,7 @@ in its NEWS.)
60 65
61** VC 66** VC
62 67
68---
63*** VC support for Mercurial was improved. 69*** VC support for Mercurial was improved.
64Emacs now avoids invoking 'hg' as much as possible, for faster operation. 70Emacs now avoids invoking 'hg' as much as possible, for faster operation.
65(This and the following changes were actually made in Emacs 26.1, but 71(This and the following changes were actually made in Emacs 26.1, but
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index b863572e040..eba3420fcb8 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2957,6 +2957,15 @@ as a macro. If the definition (in both unex*.c and malloc.c) is wrong,
2957it can cause problems like this. You might be able to find the correct 2957it can cause problems like this. You might be able to find the correct
2958value in the man page for a.out(5). 2958value in the man page for a.out(5).
2959 2959
2960* 'make check' failures
2961
2962** emacs-module-tests fail on Ubuntu 16.04
2963
2964This is due to a bug in GCC that was fixed in 2015; see
2965<https://lists.gnu.org/r/emacs-devel/2018-09/msg00548.html>.
2966You can work around the problem by using a later version of GCC or of
2967Ubuntu, or by configuring without modules.
2968
2960* Problems on legacy systems 2969* Problems on legacy systems
2961 2970
2962This section covers bugs reported on very old hardware or software. 2971This section covers bugs reported on very old hardware or software.
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 7285b105748..09d50daacc2 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -96,11 +96,11 @@ This might not yet be honored by all index-building functions."
96 :type 'boolean 96 :type 'boolean
97 :group 'imenu) 97 :group 'imenu)
98 98
99(defcustom imenu-auto-rescan-maxout 60000 99(defcustom imenu-auto-rescan-maxout 600000
100 "Imenu auto-rescan is disabled in buffers larger than this size (in bytes). 100 "Imenu auto-rescan is disabled in buffers larger than this size (in bytes)."
101This variable is buffer-local."
102 :type 'integer 101 :type 'integer
103 :group 'imenu) 102 :group 'imenu
103 :version "26.2")
104 104
105(defcustom imenu-use-popup-menu 'on-mouse 105(defcustom imenu-use-popup-menu 'on-mouse
106 "Use a popup menu rather than a minibuffer prompt. 106 "Use a popup menu rather than a minibuffer prompt.
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index a895a777968..3bcc9bebcda 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -480,12 +480,6 @@ Legal values:
480 480
481;; Keyboard 481;; Keyboard
482 482
483(defcustom prolog-hungry-delete-key-flag nil
484 "Non-nil means delete key consumes all preceding spaces."
485 :version "24.1"
486 :group 'prolog-keyboard
487 :type 'boolean)
488
489(defcustom prolog-electric-dot-flag nil 483(defcustom prolog-electric-dot-flag nil
490 "Non-nil means make dot key electric. 484 "Non-nil means make dot key electric.
491Electric dot appends newline or inserts head of a new clause. 485Electric dot appends newline or inserts head of a new clause.
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 679401eef15..5f9de9abbb2 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -222,17 +222,15 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
222 222
223(defun thing-at-point-bounds-of-list-at-point () 223(defun thing-at-point-bounds-of-list-at-point ()
224 "Return the bounds of the list at point. 224 "Return the bounds of the list at point.
225Prefer the enclosing list with fallback on sexp at point.
225\[Internal function used by `bounds-of-thing-at-point'.]" 226\[Internal function used by `bounds-of-thing-at-point'.]"
226 (save-excursion 227 (save-excursion
227 (let* ((st (parse-partial-sexp (point-min) (point))) 228 (if (ignore-errors (up-list -1))
228 (beg (or (and (eq 4 (car (syntax-after (point)))) 229 (ignore-errors (cons (point) (progn (forward-sexp) (point))))
229 (not (nth 8 st)) 230 (let ((bound (bounds-of-thing-at-point 'sexp)))
230 (point)) 231 (and bound
231 (nth 1 st)))) 232 (<= (car bound) (point)) (< (point) (cdr bound))
232 (when beg 233 bound)))))
233 (goto-char beg)
234 (forward-sexp)
235 (cons beg (point))))))
236 234
237;; Defuns 235;; Defuns
238 236
@@ -636,8 +634,13 @@ Signal an error if the entire string was not used."
636 634
637(put 'number 'thing-at-point 'number-at-point) 635(put 'number 'thing-at-point 'number-at-point)
638;;;###autoload 636;;;###autoload
639(defun list-at-point () 637(defun list-at-point (&optional ignore-comment-or-string)
640 "Return the Lisp list at point, or nil if none is found." 638 "Return the Lisp list at point, or nil if none is found.
641 (form-at-point 'list 'listp)) 639If IGNORE-COMMENT-OR-STRING is non-nil comments and strings are
640treated as white space."
641 (let ((ppss (and ignore-comment-or-string (syntax-ppss))))
642 (save-excursion
643 (goto-char (or (nth 8 ppss) (point)))
644 (form-at-point 'list 'listp))))
642 645
643;;; thingatpt.el ends here 646;;; thingatpt.el ends here
diff --git a/src/buffer.c b/src/buffer.c
index 878844dd020..1f18dbd11a8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4516,23 +4516,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after,
4516 Lisp_Object *copy; 4516 Lisp_Object *copy;
4517 ptrdiff_t i; 4517 ptrdiff_t i;
4518 4518
4519 if (size)
4520 {
4521 Lisp_Object ovl
4522 = XVECTOR (last_overlay_modification_hooks)->contents[1];
4523
4524 /* If the buffer of the first overlay in the array doesn't
4525 match the current buffer, then these modification hooks
4526 should not be run in this buffer. This could happen when
4527 some code calls some insdel functions, such as del_range_1,
4528 with the PREPARE argument false -- in that case this
4529 function is never called to record the overlay modification
4530 hook functions in the last_overlay_modification_hooks
4531 array, so anything we find there is not ours. */
4532 if (XMARKER (OVERLAY_START (ovl))->buffer != current_buffer)
4533 return;
4534 }
4535
4536 USE_SAFE_ALLOCA; 4519 USE_SAFE_ALLOCA;
4537 SAFE_ALLOCA_LISP (copy, size); 4520 SAFE_ALLOCA_LISP (copy, size);
4538 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, 4521 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents,
@@ -4543,7 +4526,12 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after,
4543 Lisp_Object prop_i, overlay_i; 4526 Lisp_Object prop_i, overlay_i;
4544 prop_i = copy[i++]; 4527 prop_i = copy[i++];
4545 overlay_i = copy[i++]; 4528 overlay_i = copy[i++];
4546 call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3); 4529 /* It is possible that the recorded overlay has been deleted
4530 (which makes it's markers' buffers be nil), or that (due to
4531 some bug) it belongs to a different buffer. Only run this
4532 hook if the overlay belongs to the current buffer. */
4533 if (XMARKER (OVERLAY_START (overlay_i))->buffer == current_buffer)
4534 call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3);
4547 } 4535 }
4548 4536
4549 SAFE_FREE (); 4537 SAFE_FREE ();
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index b4a5fd90ce4..aa29924ac1a 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -87,41 +87,43 @@ position to retrieve THING.")
87 (goto-char (nth 1 test)) 87 (goto-char (nth 1 test))
88 (should (equal (thing-at-point (nth 2 test)) (nth 3 test)))))) 88 (should (equal (thing-at-point (nth 2 test)) (nth 3 test))))))
89 89
90;; These tests reflect the actual behavior of 90;; See bug#24627 and bug#31772.
91;; `thing-at-point-bounds-of-list-at-point'. 91(ert-deftest thing-at-point-bounds-of-list-at-point ()
92(ert-deftest thing-at-point-bug24627 () 92 (cl-macrolet ((with-test-buffer (str &rest body)
93 "Test for https://debbugs.gnu.org/24627 ." 93 `(with-temp-buffer
94 (let ((string-result '(("(a \"b\" c)" . (a "b" c)) 94 (emacs-lisp-mode)
95 (";(a \"b\" c)") 95 (insert ,str)
96 ("(a \"b\" c\n)" . (a "b" c)) 96 (search-backward "|")
97 ("\"(a b c)\"") 97 (delete-char 1)
98 ("(a ;(b c d)\ne)" . (a e)) 98 ,@body)))
99 ("(foo\n(a ;(b c d)\ne) bar)" . (a e)) 99 (let ((tests1
100 ("(foo\na ;(b c d)\ne bar)" . (foo a e bar)) 100 '(("|(a \"b\" c)" (a "b" c))
101 ("(foo\n(a \"(b c d)\"\ne) bar)" . (a "(b c d)" e)) 101 (";|(a \"b\" c)" (a "b" c) nil)
102 ("(b\n(a ;(foo c d)\ne) bar)" . (a e)) 102 ("|(a \"b\" c\n)" (a "b" c))
103 ("(princ \"(a b c)\")" . (princ "(a b c)")) 103 ("\"|(a b c)\"" (a b c) nil)
104 ("(defun foo ()\n \"Test function.\"\n ;;(a b)\n nil)" . (defun foo nil "Test function." nil)))) 104 ("|(a ;(b c d)\ne)" (a e))
105 (file 105 ("(foo\n|(a ;(b c d)\ne) bar)" (foo (a e) bar))
106 (expand-file-name "lisp/thingatpt.el" source-directory)) 106 ("(foo\n|a ;(b c d)\ne bar)" (foo a e bar))
107 buf) 107 ("(foo\n|(a \"(b c d)\"\ne) bar)" (foo (a "(b c d)" e) bar))
108 ;; Test for `thing-at-point'. 108 ("(b\n|(a ;(foo c d)\ne) bar)" (b (a e) bar))
109 (when (file-exists-p file) 109 ("(princ \"|(a b c)\")" (a b c) (princ "(a b c)"))
110 (unwind-protect 110 ("(defun foo ()\n \"Test function.\"\n ;;|(a b)\n nil)"
111 (progn 111 (defun foo nil "Test function." nil)
112 (setq buf (find-file file)) 112 (defun foo nil "Test function." nil))))
113 (goto-char (point-max)) 113 (tests2
114 (forward-line -1) 114 '(("|list-at-point" . "list-at-point")
115 (should-not (thing-at-point 'list))) 115 ("list-|at-point" . "list-at-point")
116 (kill-buffer buf))) 116 ("list-at-point|" . nil)
117 ;; Tests for `list-at-point'. 117 ("|(a b c)" . "(a b c)")
118 (dolist (str-res string-result) 118 ("(a b c)|" . nil))))
119 (with-temp-buffer 119 (dolist (test tests1)
120 (emacs-lisp-mode) 120 (with-test-buffer (car test)
121 (insert (car str-res)) 121 (should (equal (list-at-point) (cl-second test)))
122 (re-search-backward "\\((a\\|^a\\)") 122 (when (cddr test)
123 (should (equal (list-at-point) 123 (should (equal (list-at-point t) (cl-third test))))))
124 (cdr str-res))))))) 124 (dolist (test tests2)
125 (with-test-buffer (car test)
126 (should (equal (thing-at-point 'list) (cdr test))))))))
125 127
126(ert-deftest thing-at-point-url-in-comment () 128(ert-deftest thing-at-point-url-in-comment ()
127 (with-temp-buffer 129 (with-temp-buffer
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index d115e668178..0e4fd3655ae 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -45,6 +45,25 @@ with parameters from the *Messages* buffer modification."
45 (should (eq buf (current-buffer)))) 45 (should (eq buf (current-buffer))))
46 (when msg-ov (delete-overlay msg-ov)))))) 46 (when msg-ov (delete-overlay msg-ov))))))
47 47
48(ert-deftest overlay-modification-hooks-deleted-overlay ()
49 "Test for bug#30823."
50 (let ((check-point nil)
51 (ov-delete nil)
52 (ov-set nil))
53 (with-temp-buffer
54 (insert "abc")
55 (setq ov-set (make-overlay 1 3))
56 (overlay-put ov-set 'modification-hooks
57 (list (lambda (_o after &rest _args)
58 (and after (setq check-point t)))))
59 (setq ov-delete (make-overlay 1 3))
60 (overlay-put ov-delete 'modification-hooks
61 (list (lambda (o after &rest _args)
62 (and (not after) (delete-overlay o)))))
63 (goto-char 2)
64 (insert "1")
65 (should (eq check-point t)))))
66
48(ert-deftest test-generate-new-buffer-name-bug27966 () 67(ert-deftest test-generate-new-buffer-name-bug27966 ()
49 (should-not (string-equal "nil" 68 (should-not (string-equal "nil"
50 (progn (get-buffer-create "nil") 69 (progn (get-buffer-create "nil")