mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-05-10 23:31:19 -07:00
Merge from origin/emacs-31
2d496b842d; Fix Gregor Schmid's attribution for lua-mode.el.69c50dcb47; package-activate-all: Drop requiring package now not pr...f94637749avc-switch-working-tree: Use project-current again060451d6e0treesit-explore-mode usability improvements (bug#80935)48b064a2aaFix 'vc-dir-resynch-file' again (bug#80967)
This commit is contained in:
commit
876a1db6ee
6 changed files with 163 additions and 81 deletions
44
etc/AUTHORS
44
etc/AUTHORS
|
|
@ -977,7 +977,7 @@ and co-wrote longlines.el tango-dark-theme.el tango-theme.el
|
|||
and changed simple.el display.texi xdisp.c files.el frames.texi
|
||||
cus-edit.el files.texi custom.el subr.el text.texi faces.el keyboard.c
|
||||
startup.el package.el misc.texi emacs.texi modes.texi mouse.el
|
||||
custom.texi image.c window.el and 903 other files
|
||||
custom.texi image.c window.el and 920 other files
|
||||
|
||||
Chris Chase: co-wrote idlw-shell.el idlwave.el
|
||||
|
||||
|
|
@ -1439,7 +1439,7 @@ and changed cedet/semantic.el db.el insert.el semantic/complete.el c.by
|
|||
c.el db-el.el db-file.el db-find.el ede-grammar.el eieio-opt.el
|
||||
eieio.el eieio.texi gnus.texi registry.el srecode/compile.el
|
||||
wisent/python.el analyze.el bovine/el.el bovine/grammar.el
|
||||
decorate/mode.el and 87 other files
|
||||
decorate/mode.el and 88 other files
|
||||
|
||||
Davide Pola: changed comp-cstr.el comp-run.el
|
||||
|
||||
|
|
@ -1811,7 +1811,7 @@ and co-wrote help-tests.el
|
|||
and changed xdisp.c display.texi w32.c msdos.c simple.el w32fns.c
|
||||
files.el fileio.c keyboard.c configure.ac emacs.c text.texi w32term.c
|
||||
dispnew.c frames.texi files.texi w32proc.c xfaces.c process.c window.c
|
||||
dispextern.h and 1437 other files
|
||||
dispextern.h and 1451 other files
|
||||
|
||||
Eliza Velasquez: changed server.el simple.el
|
||||
|
||||
|
|
@ -1914,7 +1914,7 @@ and changed c.srt ede.texi info.el rmail.el speedbspec.el cedet.el
|
|||
ede-autoconf.srt ede-make.srt eieio.texi gud.el sb-dir-minus.xpm
|
||||
sb-dir-plus.xpm sb-dir.xpm sb-mail.xpm sb-pg-minus.xpm sb-pg-plus.xpm
|
||||
sb-pg.xpm sb-tag-gt.xpm sb-tag-minus.xpm sb-tag-plus.xpm
|
||||
and 34 other files
|
||||
and 35 other files
|
||||
|
||||
Eric Schulte: wrote ob-awk.el ob-calc.el ob-comint.el ob-css.el ob-dot.el
|
||||
ob-emacs-lisp.el ob-eval.el ob-forth.el ob-gnuplot.el ob-haskell.el
|
||||
|
|
@ -2313,7 +2313,7 @@ and changed configure.ac Makefile.in src/Makefile.in calendar.el
|
|||
lisp/Makefile.in diary-lib.el files.el make-dist rmail.el
|
||||
progmodes/f90.el bytecomp.el admin.el misc/Makefile.in simple.el
|
||||
authors.el startup.el emacs.texi lib-src/Makefile.in display.texi
|
||||
ack.texi subr.el and 1753 other files
|
||||
ack.texi subr.el and 1771 other files
|
||||
|
||||
Glynn Clements: wrote gamegrid.el snake.el tetris.el
|
||||
|
||||
|
|
@ -2357,8 +2357,9 @@ Gregorio Gervasio, Jr.: changed gnus-sum.el
|
|||
|
||||
Gregor Kappler: changed ox.el
|
||||
|
||||
Gregor Schmid: changed intervals.c intervals.h tcl-mode.el textprop.c
|
||||
dispnew.c indent.c xdisp.c
|
||||
Gregor Schmid: co-wrote lua-mode.el
|
||||
and changed intervals.c intervals.h tcl-mode.el textprop.c dispnew.c
|
||||
indent.c xdisp.c
|
||||
|
||||
Gregory Chernov: changed nnslashdot.el
|
||||
|
||||
|
|
@ -3337,7 +3338,7 @@ and co-wrote help-tests.el keymap-tests.el
|
|||
and changed subr.el desktop.el w32fns.c bs.el faces.el simple.el
|
||||
emacsclient.c files.el server.el help-fns.el xdisp.c org.el w32term.c
|
||||
w32.c buffer.c keyboard.c ido.el image.c window.c eval.c allout.el
|
||||
and 1191 other files
|
||||
and 1206 other files
|
||||
|
||||
Juan Pechiar: changed ob-octave.el
|
||||
|
||||
|
|
@ -3390,7 +3391,7 @@ Juri Linkov: wrote compose.el emoji.el files-x.el misearch.el
|
|||
and changed isearch.el simple.el replace.el info.el dired.el treesit.el
|
||||
minibuffer.el dired-aux.el window.el outline.el progmodes/grep.el
|
||||
subr.el diff-mode.el repeat.el vc.el mouse.el files.el image-mode.el
|
||||
menu-bar.el project.el display.texi and 525 other files
|
||||
menu-bar.el project.el display.texi and 526 other files
|
||||
|
||||
Jussi Lahdenniemi: changed w32fns.c ms-w32.h msdos.texi w32.c w32.h
|
||||
w32console.c w32heap.c w32inevt.c w32term.h
|
||||
|
|
@ -3420,7 +3421,7 @@ and co-wrote longlines.el tramp-sh.el tramp.el
|
|||
and changed message.el gnus-agent.el gnus-sum.el files.el nnmail.el
|
||||
tramp.texi nntp.el gnus.el simple.el ange-ftp.el dired.el paragraphs.el
|
||||
bindings.el files.texi gnus-art.el gnus-group.el man.el INSTALL
|
||||
Makefile.in crisp.el fileio.c and 44 other files
|
||||
Makefile.in crisp.el fileio.c and 45 other files
|
||||
|
||||
Kailash C. Chowksey: changed HELLO ind-util.el kannada.el knd-util.el
|
||||
lisp/Makefile.in loadup.el
|
||||
|
|
@ -3552,7 +3553,7 @@ and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el quail.el
|
|||
and changed coding.c mule-cmds.el mule.el fontset.c charset.c xdisp.c
|
||||
font.c fontset.el xterm.c fileio.c mule-conf.el ftfont.c characters.el
|
||||
fns.c mule-diag.el coding.h charset.h ccl.c xfaces.c editfns.c
|
||||
composite.c and 370 other files
|
||||
composite.c and 385 other files
|
||||
|
||||
Kenichi Okada: co-wrote sasl-cram.el sasl-digest.el
|
||||
|
||||
|
|
@ -3779,7 +3780,7 @@ and co-wrote gnus-kill.el gnus-mh.el gnus-msg.el gnus-score.el
|
|||
and changed subr.el simple.el gnus.texi files.el display.texi process.c
|
||||
help-fns.el text.texi image.c dired.el help.el image.el package.el
|
||||
edebug.el shortdoc.el dired-aux.el gnutls.c minibuffer.el subr-x.el
|
||||
auth-source.el smtpmail.el and 1050 other files
|
||||
auth-source.el smtpmail.el and 1051 other files
|
||||
|
||||
Lars Rasmusson: changed ebrowse.c
|
||||
|
||||
|
|
@ -3915,7 +3916,7 @@ Luc Teirlinck: wrote help-at-pt.el
|
|||
and changed files.el autorevert.el cus-edit.el subr.el simple.el
|
||||
frames.texi startup.el display.texi files.texi dired.el comint.el
|
||||
modes.texi custom.texi emacs.texi fns.c frame.el ielm.el minibuf.texi
|
||||
variables.texi buffers.texi commands.texi and 210 other files
|
||||
variables.texi buffers.texi commands.texi and 211 other files
|
||||
|
||||
Ludovic Courtès: wrote nnregistry.el
|
||||
and changed configure.ac gnus.texi loadup.el
|
||||
|
|
@ -4417,7 +4418,7 @@ Michael Olson: changed erc.el erc-backend.el Makefile erc-track.el
|
|||
erc-log.el erc-stamp.el erc-autoaway.el erc-dcc.el erc-goodies.el
|
||||
erc-list.el erc-compat.el erc-identd.el erc.texi erc-bbdb.el
|
||||
erc-match.el erc-notify.el erc-ibuffer.el erc-services.el remember.el
|
||||
erc-button.el erc-nicklist.el and 53 other files
|
||||
erc-button.el erc-nicklist.el and 54 other files
|
||||
|
||||
Michael Orlitzky: changed tex-mode.el
|
||||
|
||||
|
|
@ -5261,9 +5262,10 @@ Protesilaos Stavrou: wrote modus-operandi-deuteranopia-theme.el
|
|||
modus-vivendi-deuteranopia-theme.el modus-vivendi-theme.el
|
||||
modus-vivendi-tinted-theme.el modus-vivendi-tritanopia-theme.el
|
||||
and changed modus-themes.org eww.el vc-dir.el TUTORIAL.el_GR log-view.el
|
||||
time.el vc-git.el appt.el apropos.el custom.el diff-mode.el flymake.el
|
||||
ibuffer.el language/greek.el log-edit.el minibuffer.el package.el
|
||||
perl-mode.el shortdoc.el shr.el vc-cvs.el and 5 other files
|
||||
modus-themes.texi time.el vc-git.el appt.el apropos.el custom.el
|
||||
diff-mode.el flymake.el ibuffer.el language/greek.el log-edit.el
|
||||
minibuffer.el package.el perl-mode.el shortdoc.el shr.el
|
||||
and 6 other files
|
||||
|
||||
Przemsyław Kryger: wrote package-vc-tests.el
|
||||
|
||||
|
|
@ -5988,7 +5990,7 @@ and co-wrote help-tests.el keymap-tests.el
|
|||
and changed subr.el package.el image-dired.el checkdoc.el efaq.texi
|
||||
cperl-mode.el help.el simple.el progmodes/python.el dired.el files.el
|
||||
bookmark.el browse-url.el gnus.texi keymap.c dired-x.el erc.el image.c
|
||||
cl-macs.el message.el subr-tests.el and 1947 other files
|
||||
cl-macs.el message.el subr-tests.el and 1948 other files
|
||||
|
||||
Stefan Merten: co-wrote rst.el
|
||||
|
||||
|
|
@ -6005,7 +6007,7 @@ and co-wrote font-lock.el gitmerge.el pcvs.el visual-wrap.el
|
|||
and changed subr.el simple.el cl-macs.el bytecomp.el files.el keyboard.c
|
||||
lisp.h vc.el eval.c xdisp.c alloc.c help-fns.el buffer.c sh-script.el
|
||||
package.el tex-mode.el progmodes/compile.el lread.c keymap.c window.c
|
||||
easy-mmode.el and 1743 other files
|
||||
easy-mmode.el and 1744 other files
|
||||
|
||||
Stefano Facchini: changed gtkutil.c
|
||||
|
||||
|
|
@ -6050,7 +6052,7 @@ and changed dired.el wid-edit.el wdired.el dired-tests.el files.el
|
|||
todo-mode.texi dabbrev-tests.el wdired-tests.el diary-lib.el
|
||||
menu-bar.el minibuffer.el dabbrev.el dired-aux.el doc-view.el info.el
|
||||
outline.el simple.el todo-test-1.todo widget.texi INSTALL_BEGIN
|
||||
allout.el and 89 other files
|
||||
allout.el and 90 other files
|
||||
|
||||
Stephen C. Gilardi: changed configure.ac
|
||||
|
||||
|
|
@ -6242,7 +6244,7 @@ and changed spam.el gnus.el nnimap.el gnus.texi gnutls.c gnus-sum.el
|
|||
auth.texi cfengine.el gnus-sync.el gnus-util.el gnus-start.el netrc.el
|
||||
gnutls.h message.el spam-stat.el .gitlab-ci.yml encrypt.el
|
||||
mail-source.el nnir.el nnmail.el auth-source-tests.el
|
||||
and 124 other files
|
||||
and 125 other files
|
||||
|
||||
Terje Rosten: changed xfns.c version.el xterm.c xterm.h
|
||||
|
||||
|
|
|
|||
|
|
@ -451,15 +451,13 @@ The variable `package-load-list' controls which packages to load."
|
|||
(setq package-activated-list nil))
|
||||
(load qs nil 'nomessage)
|
||||
t)))
|
||||
(progn
|
||||
(require 'package)
|
||||
;; Silence the "unknown function" warning when this is compiled
|
||||
;; inside `loaddefs.el'.
|
||||
;; FIXME: We use `with-no-warnings' because the effect of
|
||||
;; `declare-function' is currently not scoped, so if we use
|
||||
;; it here, we end up with a redefinition warning instead :-)
|
||||
(with-no-warnings
|
||||
(package--activate-all))))))
|
||||
;; Silence the "unknown function" warning when this is compiled
|
||||
;; inside `loaddefs.el'.
|
||||
;; FIXME: We use `with-no-warnings' because the effect of
|
||||
;; `declare-function' is currently not scoped, so if we use
|
||||
;; it here, we end up with a redefinition warning instead :-)
|
||||
(with-no-warnings
|
||||
(package--activate-all)))))
|
||||
|
||||
(defun package--activate-all ()
|
||||
(dolist (elt (package--alist))
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
;; 2004 various (support for Lua 5 and byte compilation)
|
||||
;; 2001 Christian Vogler <cvogler@gradient.cis.upenn.edu>
|
||||
;; 1997 Bret Mogilefsky <mogul-lua@gelatinous.com>
|
||||
;; Bret Mogilefsky started from tcl-mode by
|
||||
;; Gregor Schmid <schmid@fb3-s7.math.tu-berlin.de>
|
||||
;; with tons of assistance from Paul Du Bois <pld-lua@gelatinous.com>
|
||||
;; and Aaron Smith <aaron-lua@gelatinous.com>.
|
||||
;; Gregor Schmid <schmid@fb3-s7.math.tu-berlin.de>
|
||||
;; Bret Mogilefsky started from tcl-mode by Gregor Schmid with tons of
|
||||
;; assistance from Paul Du Bois <pld-lua@gelatinous.com>
|
||||
;; and Aaron Smith <aaron-lua@gelatinous.com>.
|
||||
;; Maintainer: emacs-devel@gnu.org
|
||||
;; Keywords: languages, processes, tools
|
||||
|
||||
|
|
|
|||
151
lisp/treesit.el
151
lisp/treesit.el
|
|
@ -5035,6 +5035,10 @@ in the region."
|
|||
(while (and (null (pos-visible-in-window-p pos window))
|
||||
(= (forward-line 4) 0))
|
||||
(set-window-start window (point))))
|
||||
;; Recenter if amenable.
|
||||
(when (< scroll-conservatively 101)
|
||||
(with-selected-window window
|
||||
(recenter)))
|
||||
(set-window-point window pos)))))))
|
||||
|
||||
(defun treesit--explorer-refresh ()
|
||||
|
|
@ -5197,11 +5201,6 @@ leaves point at the end of the last line of NODE."
|
|||
(when (not named)
|
||||
(overlay-put ov 'face 'treesit-explorer-anonymous-node)))))
|
||||
|
||||
(defun treesit--explorer-kill-explorer-buffer ()
|
||||
"Kill the explorer buffer of this buffer."
|
||||
(when (buffer-live-p treesit--explorer-buffer)
|
||||
(kill-buffer treesit--explorer-buffer)))
|
||||
|
||||
(defun treesit--explorer-generate-parser-alist ()
|
||||
"Return an alist of (PARSER-NAME . PARSER) for relevant parsers.
|
||||
Relevant parsers include all global parsers and local parsers that
|
||||
|
|
@ -5210,7 +5209,12 @@ covers point. PARSER-NAME are unique."
|
|||
(local-parsers-at-point
|
||||
(treesit-local-parsers-at (point)))
|
||||
res)
|
||||
(dolist (parser (treesit-parser-list nil nil t))
|
||||
;; Add `treesit-primary-parser' first in the list, if populated.
|
||||
(dolist (parser (delete-dups
|
||||
(delq nil
|
||||
(append
|
||||
(list treesit-primary-parser)
|
||||
(treesit-parser-list nil nil t)))))
|
||||
;; Exclude local parsers that doesn't cover point.
|
||||
(when (or (memq parser local-parsers-at-point)
|
||||
(not (memq parser local-parsers)))
|
||||
|
|
@ -5230,20 +5234,68 @@ covers point. PARSER-NAME are unique."
|
|||
res)))
|
||||
(nreverse res)))
|
||||
|
||||
(defun treesit--explorer-tree-mode-cleanup ()
|
||||
"Clean up `treesit--explorer-tree-mode'.
|
||||
If called from the source buffer, quit the tree buffer window and kill
|
||||
the explorer buffer.
|
||||
If called from the explorer tree buffer, disable `treesit-explore-mode'
|
||||
in the source buffer, quit the tree window and kill its buffer."
|
||||
(cond
|
||||
;; Called from the source buffer.
|
||||
((buffer-live-p treesit--explorer-buffer)
|
||||
(when (window-live-p (get-buffer-window treesit--explorer-buffer))
|
||||
(let ((buf treesit--explorer-buffer))
|
||||
(with-selected-window (get-buffer-window treesit--explorer-buffer)
|
||||
(quit-window))
|
||||
(kill-buffer buf))))
|
||||
;; Called from the tree buffer.
|
||||
((buffer-live-p treesit--explorer-source-buffer)
|
||||
(with-current-buffer treesit--explorer-source-buffer
|
||||
(treesit-explore-mode -1))
|
||||
(when (window-live-p (get-buffer-window (current-buffer)))
|
||||
(with-selected-window (get-buffer-window (current-buffer))
|
||||
(quit-window 'kill))))))
|
||||
|
||||
(defun treesit-explorer-tree-window-select ()
|
||||
"Select the `treesit--explorer-buffer' window.
|
||||
Invoke this command from the source window."
|
||||
(interactive)
|
||||
(if (buffer-live-p treesit--explorer-buffer)
|
||||
(select-window (get-buffer-window treesit--explorer-buffer))
|
||||
(user-error "The `treesit-explorer-mode' tree buffer does not exist")))
|
||||
|
||||
(defun treesit-explorer-source-buffer-window-select ()
|
||||
"Select the `treesit--explorer-buffer' window.
|
||||
Invoke this command from the tree window."
|
||||
(interactive)
|
||||
(if (buffer-live-p treesit--explorer-source-buffer)
|
||||
(select-window (get-buffer-window treesit--explorer-source-buffer))
|
||||
(user-error "The `treesit-explorer-mode' source buffer does not exist")))
|
||||
|
||||
(defvar-keymap treesit-explore-mode-map
|
||||
:doc "Keymap for the treesit explore mode."
|
||||
"C-c C-t o" #'treesit-explorer-tree-window-select
|
||||
"C-c C-t q" #'treesit-explore-quit)
|
||||
|
||||
(defvar-keymap treesit--explorer-tree-mode-map
|
||||
:doc "Keymap for the treesit tree explorer.
|
||||
|
||||
Navigates from button to button."
|
||||
:parent special-mode-map
|
||||
"n" #'forward-button
|
||||
"p" #'backward-button
|
||||
"TAB" #'forward-button
|
||||
"<backtab>" #'backward-button)
|
||||
"n" #'forward-button
|
||||
"p" #'backward-button
|
||||
"q" #'treesit-explore-quit
|
||||
"TAB" #'forward-button
|
||||
"<backtab>" #'backward-button
|
||||
"C-c C-t o" #'treesit-explorer-source-buffer-window-select
|
||||
"C-c C-t q" #'treesit-explore-quit)
|
||||
|
||||
(define-derived-mode treesit--explorer-tree-mode special-mode
|
||||
"TS Explorer"
|
||||
"Mode for displaying syntax trees for `treesit-explore-mode'."
|
||||
nil)
|
||||
;; Clean up `treesit--explorer-tree-mode' when the tree buffer is
|
||||
;; killed.
|
||||
(add-hook 'kill-buffer-hook
|
||||
#'treesit--explorer-tree-mode-cleanup 0 t))
|
||||
|
||||
(defun treesit-explorer-switch-parser (parser)
|
||||
"Switch explorer to use PARSER."
|
||||
|
|
@ -5252,8 +5304,14 @@ Navigates from button to button."
|
|||
(treesit--explorer-generate-parser-alist))
|
||||
(parser-name (if (= (length parser-alist) 1)
|
||||
(car parser-alist)
|
||||
;; Default to the first parser in the
|
||||
;; list which we hope is
|
||||
;; `treesit-primary-parser'.
|
||||
(completing-read
|
||||
"Parser: " (mapcar #'car parser-alist)))))
|
||||
"Parser: "
|
||||
(mapcar #'car parser-alist)
|
||||
nil t nil nil
|
||||
(caar parser-alist)))))
|
||||
(alist-get parser-name parser-alist
|
||||
nil nil #'equal))))
|
||||
(unless treesit-explore-mode
|
||||
|
|
@ -5262,7 +5320,9 @@ Navigates from button to button."
|
|||
(display-buffer treesit--explorer-buffer
|
||||
(cons nil '((inhibit-same-window . t))))
|
||||
(setq-local treesit--explorer-last-node nil)
|
||||
(treesit--explorer-refresh))
|
||||
(treesit--explorer-refresh)
|
||||
;; Signal that `completing-read' did not quit.
|
||||
t)
|
||||
|
||||
(define-minor-mode treesit-explore-mode
|
||||
"Enable exploring the current buffer's syntax tree.
|
||||
|
|
@ -5281,33 +5341,41 @@ window."
|
|||
(buffer-name))))
|
||||
(with-current-buffer treesit--explorer-buffer
|
||||
(treesit--explorer-tree-mode)))
|
||||
;; Select parser.
|
||||
(call-interactively #'treesit-explorer-switch-parser)
|
||||
;; Set up variables and hooks.
|
||||
(add-hook 'post-command-hook
|
||||
#'treesit--explorer-post-command 0 t)
|
||||
(add-hook 'kill-buffer-hook
|
||||
#'treesit--explorer-kill-explorer-buffer 0 t)
|
||||
;; Tell `desktop-save' to not save explorer buffers.
|
||||
(when (boundp 'desktop-modes-not-to-save)
|
||||
(unless (memq 'treesit--explorer-tree-mode
|
||||
desktop-modes-not-to-save)
|
||||
(push 'treesit--explorer-tree-mode
|
||||
desktop-modes-not-to-save)))
|
||||
;; Tell `desktop-save' to not save this minor mode
|
||||
;; that might disrupt loading the desktop
|
||||
;; with the prompt to select a parser.
|
||||
(when (boundp 'desktop-minor-mode-table)
|
||||
(unless (member '(treesit-explore-mode nil)
|
||||
desktop-minor-mode-table)
|
||||
(push '(treesit-explore-mode nil)
|
||||
desktop-minor-mode-table))))
|
||||
;; Select parser. `treesit-explorer-switch-parser' will return
|
||||
;; t if its `completing-read' did not quit.
|
||||
(if (not (condition-case _
|
||||
(call-interactively #'treesit-explorer-switch-parser)
|
||||
(quit)))
|
||||
(setq treesit-explore-mode nil)
|
||||
;; Track the `treesit--explorer-source-buffer' active region.
|
||||
(add-hook 'post-command-hook
|
||||
#'treesit--explorer-post-command 0 t)
|
||||
;; Clean up when the `treesit-explore-mode' buffer is killed.
|
||||
(add-hook 'kill-buffer-hook
|
||||
#'treesit--explorer-tree-mode-cleanup 0 t)
|
||||
;; Tell `desktop-save' to not save explorer buffers.
|
||||
(when (boundp 'desktop-modes-not-to-save)
|
||||
(unless (memq 'treesit--explorer-tree-mode
|
||||
desktop-modes-not-to-save)
|
||||
(push 'treesit--explorer-tree-mode
|
||||
desktop-modes-not-to-save)))
|
||||
;; Tell `desktop-save' to not save this minor mode
|
||||
;; that might disrupt loading the desktop
|
||||
;; with the prompt to select a parser.
|
||||
(when (boundp 'desktop-minor-mode-table)
|
||||
(unless (member '(treesit-explore-mode nil)
|
||||
desktop-minor-mode-table)
|
||||
(push '(treesit-explore-mode nil)
|
||||
desktop-minor-mode-table)))))
|
||||
;; Turn off explore mode.
|
||||
(remove-hook 'post-command-hook
|
||||
#'treesit--explorer-post-command t)
|
||||
(remove-hook 'kill-buffer-hook
|
||||
#'treesit--explorer-kill-explorer-buffer t)
|
||||
(treesit--explorer-kill-explorer-buffer)))
|
||||
#'treesit--explorer-tree-mode-cleanup t)
|
||||
;; Clean up if the user disables `treesit-explore-mode' interactively; e.g.,
|
||||
;; via M-x while leaving the source buffer alive.
|
||||
(when (called-interactively-p 'any)
|
||||
(treesit--explorer-tree-mode-cleanup))))
|
||||
|
||||
(defun treesit-explore ()
|
||||
"Show the explorer."
|
||||
|
|
@ -5317,6 +5385,15 @@ window."
|
|||
(display-buffer treesit--explorer-buffer '(nil (inhibit-same-window . t)))
|
||||
(treesit-explore-mode)))
|
||||
|
||||
(defun treesit-explore-quit ()
|
||||
"Quit and clean up `treesit-explore-mode'.
|
||||
Invoke this command from the source buffer or its tree buffer."
|
||||
(interactive)
|
||||
;; Called from the source buffer.
|
||||
(when (buffer-live-p treesit--explorer-buffer)
|
||||
(treesit-explore-mode -1))
|
||||
(treesit--explorer-tree-mode-cleanup))
|
||||
|
||||
;;; Install & build language grammar
|
||||
|
||||
(defvar treesit-language-source-alist nil
|
||||
|
|
|
|||
|
|
@ -1261,8 +1261,12 @@ that file."
|
|||
(vc-dir-fileinfo->state crt-data)) result))
|
||||
(nreverse result)))
|
||||
|
||||
(defun vc-dir-recompute-file-state (fname def-dir)
|
||||
(let* ((file-short (file-relative-name fname def-dir))
|
||||
(defun vc-dir-recompute-file-state (fname def-dir &optional truename)
|
||||
"Compute state of FNAME known to live inside DEF-DIR.
|
||||
If TRUENAME is non-nil, FNAME is a truename, DEF-DIR not necessarily."
|
||||
(let* ((file-short (file-relative-name
|
||||
fname (if truename (file-truename def-dir) def-dir)))
|
||||
(fname (if truename (expand-file-name file-short def-dir) fname))
|
||||
(_remove-me-when-CVS-works
|
||||
(when (eq vc-dir-backend 'CVS)
|
||||
;; FIXME: Warning: UGLY HACK. The CVS backend caches the state
|
||||
|
|
@ -1330,7 +1334,11 @@ that file."
|
|||
(vc-dir-resync-directory-files file)
|
||||
(ewoc-set-hf vc-ewoc
|
||||
(vc-dir-headers vc-dir-backend ddir) ""))
|
||||
(let* ((complete-state (vc-dir-recompute-file-state file ddir))
|
||||
(let* ((complete-state
|
||||
;; Make sure 'vc-dir-recompute-file-state'
|
||||
;; knows about the truename nature of 'file'
|
||||
;; (bug#80967).
|
||||
(vc-dir-recompute-file-state file ddir t))
|
||||
(state (cadr complete-state)))
|
||||
(vc-dir-update
|
||||
(list complete-state)
|
||||
|
|
|
|||
|
|
@ -5789,14 +5789,11 @@ to the root of this working tree."
|
|||
(let ((backend (or (vc-deduce-backend)
|
||||
(vc-responsible-backend default-directory)
|
||||
(error "No VC backend"))))
|
||||
;; Manually construct VC project objects because `project-current'
|
||||
;; might find a non-VC project within the VC working tree containing
|
||||
;; DIRECTORY, but we should ignore that (bug#80939).
|
||||
;; Skip to the VC root, otherwise `project-current' could find a
|
||||
;; non-VC project between DEFAULT-DIRECTORY and there (bug#80939).
|
||||
(funcall project-find-matching-buffer-function
|
||||
`(vc ,backend ,(vc-root-dir backend))
|
||||
`(vc ,backend
|
||||
,(let ((default-directory directory))
|
||||
(vc-root-dir backend))))))
|
||||
(project-current nil (vc-root-dir backend))
|
||||
(project-current nil directory))))
|
||||
|
||||
;;;###autoload
|
||||
(defun vc-working-tree-switch-project (dir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue