Skip to content

Commit 5d5d5d4

Browse files
committed
Merge from origin/emacs-27
d66331a (origin/emacs-27) Don't build the Gnulib 'utimens' module ... f2351a6 Add Harfbuzz dependency 8944310 Don't signal during backtrace unrewind (Bug#40088) 8709aad Fix a couple of problems in changelog generating functions 9ab85f0 Fix cl-concatenate (Bug#40180) 561e9fb Improve documentation of project.el commands b28a9a6 Make svg images with links valid 7515252 * lisp/tab-line.el (tab-line-new-button-show): New defcustom. # Conflicts: # etc/NEWS # nt/gnulib-cfg.mk
2 parents 7832e61 + d66331a commit 5d5d5d4

File tree

15 files changed

+159
-50
lines changed

15 files changed

+159
-50
lines changed

admin/nt/dist-build/build-dep-zips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# This list derives from the features we want Emacs to compile with.
3232
PKG_REQ='''mingw-w64-x86_64-giflib
3333
mingw-w64-x86_64-gnutls
34+
mingw-w64-x86_64-harfbuzz
3435
mingw-w64-x86_64-lcms2
3536
mingw-w64-x86_64-libjpeg-turbo
3637
mingw-w64-x86_64-libpng

doc/emacs/emacs.texi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ GDB Graphical Interface
785785
Maintaining Large Programs
786786
787787
* Version Control:: Using version control systems.
788+
* Projects:: Commands for handling source files in a project.
788789
* Change Log:: Maintaining a change history for your program.
789790
* Xref:: Find definitions and references of any function,
790791
method, struct, macro, @dots{} in your program.

doc/emacs/maintaining.texi

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ large-size programs and packages. These features include:
1313
Unified interface to Support for Version Control Systems
1414
(@acronym{VCS}) that record the history of changes to source files.
1515

16+
@item
17+
Commands for handling programming projects.
18+
1619
@item
1720
A specialized mode for maintaining @file{ChangeLog} files that provide
1821
a chronological log of program changes.
@@ -38,6 +41,7 @@ Lisp Regression Testing}).
3841

3942
@menu
4043
* Version Control:: Using version control systems.
44+
* Projects:: Commands for handling source files in a project.
4145
* Change Log:: Maintaining a change history for your program.
4246
* Xref:: Find definitions and references of any function,
4347
method, struct, macro, @dots{} in your program.
@@ -1630,6 +1634,77 @@ different revision with @kbd{C-u C-x v v}.
16301634
@include vc1-xtra.texi
16311635
@end ifnottex
16321636

1637+
@node Projects
1638+
@section Working with Projects
1639+
@cindex projects
1640+
1641+
@cindex project root
1642+
A @dfn{project} is a collection of files used for producing one or
1643+
more programs. Files that belong to a project are typically stored in
1644+
a hierarchy of directories; the top-level directory of the hierarchy
1645+
is known as the @dfn{project root}.
1646+
1647+
@cindex project back-end
1648+
Whether a given directory is a root of some project is determined by
1649+
the project-specific infrastructure, known as @dfn{project back-end}.
1650+
Emacs currently supports two such back-ends: VC (@pxref{Version
1651+
Control}), whereby a VCS repository is considered a project; and EDE
1652+
(@pxref{EDE}). This is expected to be extended in the future to
1653+
support additional types of projects.
1654+
1655+
Which files do or don't belong to a project is also determined by
1656+
the project back-end. For example, the VC back-end doesn't consider
1657+
``ignored'' files (@pxref{VC Ignore}) to be part of the project.
1658+
1659+
Emacs provides commands for handling project files conveniently.
1660+
This section describes these commands.
1661+
1662+
@cindex current project
1663+
All of the commands described here share the notion of the
1664+
@dfn{current project}. The current project is determined by the
1665+
@code{default-directory} (@pxref{File Names}) of the buffer that is
1666+
the current buffer when the command is invoked. If that directory
1667+
doesn't seem to belong to a recognizable project, these commands
1668+
prompt you for the project directory.
1669+
1670+
@findex project-find-file
1671+
The command @code{project-find-file} is a convenient way of visiting
1672+
files (@pxref{Visiting}) that belong to the current project. Unlike
1673+
@kbd{C-x C-f}, this command doesn't require to type the full file name
1674+
of the file to visit, you can type only the file's base name (i.e.,
1675+
omit the leading directories). In addition, the completion candidates
1676+
considered by the command include only the files belonging to the
1677+
current project, and nothing else. If there's a file name at point,
1678+
this command offers that file as the default to visit.
1679+
1680+
@findex project-find-regexp
1681+
The command @code{project-find-regexp} is similar to @code{rgrep}
1682+
(@pxref{Grep Searching}), but it searches only the files that belong
1683+
to the current project. The command prompts for the regular
1684+
expression to search, and pops up an Xref mode buffer with the search
1685+
results, where you can select a match using the Xref mode commands
1686+
(@pxref{Xref Commands}). When invoked with a prefix argument, this
1687+
command additionally prompts for the base directory from which to
1688+
start the search; this allows, for example, to limit the search only
1689+
to project files under a certain subdirectory of the project root.
1690+
1691+
@findex project-search
1692+
@kbd{M-x project-search} is an interactive variant of
1693+
@code{project-find-regexp}. It prompts for a regular expression to
1694+
search in the current project's files, but instead of finding all the
1695+
matches and displaying them, it stops when it finds a match and visits
1696+
the matched file at the locus of the match, allowing you to edit the
1697+
matched file. To find the rest of the matches, type @w{@kbd{M-x
1698+
fileloop-continue @key{RET}}}.
1699+
1700+
@findex project-query-replace-regexp
1701+
@kbd{M-x project-query-replace-regexp} is similar to
1702+
@code{project-search}, but it prompts you for whether to replace each
1703+
match it finds, like @code{query-replace} does (@pxref{Query
1704+
Replace}), and continues to the next match after you respond. If your
1705+
response causes Emacs to exit the query-replace loop, you can later
1706+
continue with @w{@kbd{M-x fileloop-continue @key{RET}}}.
1707+
16331708
@node Change Log
16341709
@section Change Logs
16351710

etc/NEWS.27

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ The mode is automatically enabled in files that start with the
978978

979979
** project.el
980980

981+
+++
981982
*** New commands 'project-search' and 'project-query-replace-regexp'.
983+
984+
---
982985
*** New user option 'project-read-file-name-function'.
983986

984987
** Etags

lisp/emacs-lisp/cl-extra.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ too large if positive or too small if negative)."
555555
(defun cl-concatenate (type &rest sequences)
556556
"Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
557557
\n(fn TYPE SEQUENCE...)"
558-
(seq-concatenate type sequences))
558+
(apply #'seq-concatenate type sequences))
559559

560560
;;; List functions.
561561

lisp/progmodes/project.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ triggers completion when entering a pattern, including it
437437
requires quoting, e.g. `\\[quoted-insert]<space>'."
438438
(interactive (list (project--read-regexp)))
439439
(require 'xref)
440+
(require 'grep)
440441
(let* ((pr (project-current t))
441442
(files
442443
(if (not current-prefix-arg)
@@ -606,17 +607,19 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in
606607
(defun project-search (regexp)
607608
"Search for REGEXP in all the files of the project.
608609
Stops when a match is found.
609-
To continue searching for next match, use command \\[fileloop-continue]."
610+
To continue searching for the next match, use the
611+
command \\[fileloop-continue]."
610612
(interactive "sSearch (regexp): ")
611613
(fileloop-initialize-search
612614
regexp (project-files (project-current t)) 'default)
613615
(fileloop-continue))
614616

615617
;;;###autoload
616618
(defun project-query-replace-regexp (from to)
617-
"Search for REGEXP in all the files of the project.
618-
Stops when a match is found.
619-
To continue searching for next match, use command \\[fileloop-continue]."
619+
"Query-replace REGEXP in all the files of the project.
620+
Stops when a match is found and prompts for whether to replace it.
621+
If you exit the query-replace, you can later continue the query-replace
622+
loop using the command \\[fileloop-continue]."
620623
(interactive
621624
(pcase-let ((`(,from ,to)
622625
(query-replace-read-args "Query replace (regexp)" t t)))

lisp/svg.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ any further elements added."
7070
(height . ,height)
7171
(version . "1.1")
7272
(xmlns . "http://www.w3.org/2000/svg")
73-
,@(svg--arguments nil args))))
73+
(xmlns:xlink . "http://www.w3.org/1999/xlink")
74+
,@(svg--arguments nil args))))
7475

7576
(defun svg-gradient (svg id type stops)
7677
"Add a gradient with ID to SVG.

lisp/tab-line.el

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,19 @@
142142
(defcustom tab-line-new-tab-choice t
143143
"Defines what to show in a new tab.
144144
If t, display a selection menu with all available buffers.
145-
If the value is a function, call it with no arguments.
146-
If nil, don't show the new tab button."
145+
If the value is a function, call it with no arguments."
147146
:type '(choice (const :tag "Buffer menu" t)
148-
(function :tag "Function")
149-
(const :tag "No button" nil))
147+
(function :tag "Function"))
148+
:group 'tab-line
149+
:version "27.1")
150+
151+
(defcustom tab-line-new-button-show t
152+
"If non-nil, show the \"New tab\" button in the tab line."
153+
:type 'boolean
154+
:initialize 'custom-initialize-default
155+
:set (lambda (sym val)
156+
(set-default sym val)
157+
(force-mode-line-update))
150158
:group 'tab-line
151159
:version "27.1")
152160

@@ -211,7 +219,8 @@ If nil, don't show it at all."
211219
'help-echo "Click to scroll right")
212220
"Button for scrolling horizontally to the right.")
213221

214-
(defvar tab-line-separator nil)
222+
(defvar tab-line-separator nil
223+
"String that delimits tabs.")
215224

216225

217226
(defcustom tab-line-tab-name-function #'tab-line-tab-name-buffer
@@ -455,7 +464,8 @@ variable `tab-line-tabs-function'."
455464
(if hscroll (nthcdr (truncate hscroll) strings) strings)
456465
(list separator)
457466
(when (and (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
458-
tab-line-new-tab-choice)
467+
tab-line-new-button-show
468+
tab-line-new-button)
459469
(list tab-line-new-button)))))
460470

461471
(defvar tab-line-auto-hscroll)

lisp/vc/diff-mode.el

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,29 +2247,32 @@ The elements of the alist are of the form (FILE . (DEFUN...)),
22472247
where DEFUN... is a list of function names found in FILE."
22482248
(save-excursion
22492249
(goto-char (point-min))
2250-
(let ((defuns nil)
2251-
(hunk-end nil)
2252-
(hunk-mismatch-files nil)
2253-
(make-defun-context-follower
2254-
(lambda (goline)
2255-
(let ((eodefun nil)
2256-
(defname nil))
2257-
(list
2258-
(lambda () ;; Check for end of current defun.
2259-
(when (and eodefun
2260-
(funcall goline)
2261-
(>= (point) eodefun))
2262-
(setq defname nil)
2263-
(setq eodefun nil)))
2264-
(lambda (&optional get-current) ;; Check for new defun.
2265-
(if get-current
2266-
defname
2267-
(when-let* ((def (and (not eodefun)
2268-
(funcall goline)
2269-
(add-log-current-defun)))
2270-
(eof (save-excursion (end-of-defun) (point))))
2271-
(setq eodefun eof)
2272-
(setq defname def)))))))))
2250+
(let* ((defuns nil)
2251+
(hunk-end nil)
2252+
(hunk-mismatch-files nil)
2253+
(make-defun-context-follower
2254+
(lambda (goline)
2255+
(let ((eodefun nil)
2256+
(defname nil))
2257+
(list
2258+
(lambda () ;; Check for end of current defun.
2259+
(when (and eodefun
2260+
(funcall goline)
2261+
(>= (point) eodefun))
2262+
(setq defname nil)
2263+
(setq eodefun nil)))
2264+
(lambda (&optional get-current) ;; Check for new defun.
2265+
(if get-current
2266+
defname
2267+
(when-let* ((def (and (not eodefun)
2268+
(funcall goline)
2269+
(add-log-current-defun)))
2270+
(eof (save-excursion
2271+
(condition-case ()
2272+
(progn (end-of-defun) (point))
2273+
(scan-error hunk-end)))))
2274+
(setq eodefun eof)
2275+
(setq defname def)))))))))
22732276
(while
22742277
;; Might need to skip over file headers between diff
22752278
;; hunks (e.g., "diff --git ..." etc).

lisp/vc/log-edit.el

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -788,18 +788,20 @@ This command will generate a ChangeLog entries listing the
788788
functions. You can then add a description where needed, and use
789789
\\[fill-paragraph] to join consecutive function names."
790790
(interactive)
791-
(let* ((diff-buf nil)
792-
;; Unfortunately, `log-edit-show-diff' doesn't have a NO-SHOW
793-
;; option, so we try to work around it via display-buffer
794-
;; machinery.
795-
(display-buffer-overriding-action
796-
`(,(lambda (buf alist)
797-
(setq diff-buf buf)
798-
(display-buffer-no-window buf alist))
799-
. ((allow-no-window . t)))))
800-
(change-log-insert-entries
801-
(with-current-buffer (progn (log-edit-show-diff) diff-buf)
802-
(diff-add-log-current-defuns)))))
791+
(change-log-insert-entries
792+
(with-current-buffer
793+
(let* ((diff-buf nil)
794+
;; Unfortunately, `log-edit-show-diff' doesn't have a
795+
;; NO-SHOW option, so we try to work around it via
796+
;; display-buffer machinery.
797+
(display-buffer-overriding-action
798+
`(,(lambda (buf alist)
799+
(setq diff-buf buf)
800+
(display-buffer-no-window buf alist))
801+
. ((allow-no-window . t)))))
802+
(log-edit-show-diff)
803+
diff-buf)
804+
(diff-add-log-current-defuns))))
803805

804806
(defun log-edit-insert-changelog (&optional use-first)
805807
"Insert a log message by looking at the ChangeLog.

0 commit comments

Comments
 (0)