Function: projectile-session--on-tab-close

projectile-session--on-tab-close is a byte-compiled function defined in projectile.el.

Signature

(projectile-session--on-tab-close TAB &optional LAST)

Documentation

Re-simplify survivor tab names after project TAB is closed.

Wired onto tab-bar-tab-pre-close-functions, so a project tab that was disambiguated only because of TAB (e.g. "work/foo" beside TAB's
"home/foo") reverts to its plain name once TAB goes away.

That hook fires while TAB is still in the tab list, so TAB is bound as projectile-session--closing-tab to exclude it from the recomputation. It is used rather than a post-close hook because Emacs has no post-close tab hook at Projectile's 28.1 floor (tab-bar-tab-pre-close-functions dates to 27.1; tab-bar-tab-post-close-functions does not exist), which keeps this 28.1-safe.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-session--on-tab-close (tab &optional _last)
  "Re-simplify survivor tab names after project TAB is closed.
Wired onto `tab-bar-tab-pre-close-functions', so a project tab that was
disambiguated only because of TAB (e.g. \"work/foo\" beside TAB's
\"home/foo\") reverts to its plain name once TAB goes away.

That hook fires while TAB is still in the tab list, so TAB is bound as
`projectile-session--closing-tab' to exclude it from the recomputation.
It is used rather than a post-close hook because Emacs has no post-close
tab hook at Projectile's 28.1 floor (`tab-bar-tab-pre-close-functions'
dates to 27.1; `tab-bar-tab-post-close-functions' does not exist), which
keeps this 28.1-safe."
  (when (projectile-session--tab-root tab)
    (let ((projectile-session--closing-tab tab))
      ;; never let a naming error (e.g. a custom `projectile-session-tab-name-function'
      ;; that signals) escape this pre-close hook and abort the tab close
      (ignore-errors
        (projectile-session--refresh-tab-names)))))