Move functions to the functions file.

This commit is contained in:
KJ 2024-04-18 05:32:51 -04:00
parent 887255253d
commit f48e747299
2 changed files with 15 additions and 14 deletions

View File

@ -66,5 +66,20 @@ Saves to a temp file and puts the filename in the kill ring."
(delete-window (git-gutter:popup-buffer-window)) (delete-window (git-gutter:popup-buffer-window))
(git-gutter:popup-hunk))) (git-gutter:popup-hunk)))
;; Obtener el nombre del proyecto desde project.el
(defun kj/project-name (&optional project)
"Return the name for PROJECT.
If PROJECT is not specified, assume current project root."
(when-let (root (or project (kj/project-root)))
(file-name-nondirectory
(directory-file-name
(file-name-directory root)))))
;; Obtener la raíz del proyecto desde project.el
(defun kj/project-root ()
"Return the current project root."
(when-let (project (project-current))
(project-root project)))
(provide 'init-functions) (provide 'init-functions)
;;; init-functions.el ends here. ;;; init-functions.el ends here.

View File

@ -266,20 +266,6 @@
:defer t :defer t
:ensure nil :ensure nil
:config :config
(defun kj/project-name (&optional project)
"Return the name for PROJECT.
If PROJECT is not specified, assume current project root."
(when-let (root (or project (kj/project-root)))
(file-name-nondirectory
(directory-file-name
(file-name-directory root)))))
(defun kj/project-root ()
"Return the current project root."
(when-let (project (project-current))
(project-root project)))
;; Colocamos un título del frame más bonito y útil que el por defecto ;; Colocamos un título del frame más bonito y útil que el por defecto
(setq frame-title-format (setq frame-title-format
'( '(