feat(emacs): filter out <.*> from tab name

This commit is contained in:
Pavel Korytov 2021-04-26 16:33:34 +03:00
parent c0c9bdb65e
commit 7f38639fc4
2 changed files with 19 additions and 4 deletions

View file

@ -607,7 +607,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(let ((project-name (projectile-project-name)))
(if (string= "-" project-name)
(tab-bar-tab-name-current-with-count)
(concat "[" (my/shorten-project-name project-name) "] " (tab-bar-tab-name-current-with-count)))))
(concat "[" (my/shorten-project-name project-name) "] "
(replace-regexp-in-string "<.*>" "" (tab-bar-tab-name-current-with-count))))))
(setq tab-bar-tab-name-function #'my/tab-bar-name-function)
@ -1054,6 +1055,19 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(start-process "jupyter-qtconsole" nil "setsid" "jupyter" "qtconsole" "--existing"
(file-name-nondirectory (my/select-jupyter-kernel))))
(defun my/jupyter-cleanup-kernels ()
(interactive)
(let* ((ports (my/get-open-ports))
(files (my/list-jupyter-kernel-files))
(to-delete (seq-filter
(lambda (file)
(not (member (cdr file) ports)))
files)))
(when (and (length> to-delete 0)
(y-or-n-p (format "Delete %d files?" (length to-delete))))
(dolist (file to-delete)
(delete-file (car file))))))
(use-package org-latex-impatient
:straight (:repo "yangsheng6810/org-latex-impatient"
:branch "master"

View file

@ -104,7 +104,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [[#python][Python]]
- [[#view-html-in-browser][View HTML in browser]]
- [[#setup][Setup]]
- [[#managing-jupyter-kernels][Managing Jupyter kernels]]
- [[#select-active-jupyter-kernel][Select active Jupyter kernel]]
- [[#ui][UI]]
- [[#instant-equations-preview][Instant equations preview]]
- [[#latex-fragments][LaTeX fragments]]
@ -114,7 +114,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [[#hugo][Hugo]]
- [[#jupyter-notebook][Jupyter Notebook]]
- [[#html-export][Html export]]
- [[#latex][LaTeX]]
- [[#off-latex][(OFF) LaTeX]]
- [[#keybindings--stuff][Keybindings & stuff]]
- [[#copy-a-link][Copy a link]]
- [[#presentations][Presentations]]
@ -1172,7 +1172,8 @@ Prepend tab name with the shortened projectile project title
(let ((project-name (projectile-project-name)))
(if (string= "-" project-name)
(tab-bar-tab-name-current-with-count)
(concat "[" (my/shorten-project-name project-name) "] " (tab-bar-tab-name-current-with-count)))))
(concat "[" (my/shorten-project-name project-name) "] "
(replace-regexp-in-string "<.*>" "" (tab-bar-tab-name-current-with-count))))))
(setq tab-bar-tab-name-function #'my/tab-bar-name-function)
#+end_src