From f33d45e4ec7280ab31b5a55b7c9b636622751ca4 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sat, 16 Dec 2023 15:31:45 -0500 Subject: Disable rename org buffers to `#+TITLE:` --- init.el | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/init.el b/init.el index 80328eb..78dd553 100644 --- a/init.el +++ b/init.el @@ -1014,28 +1014,26 @@ ;; Set buffer name to #+TITLE ;; Credit to SE user "Tobias" -(defun mm/org-buffer-name-to-title (&optional end) - "Rename buffer to value of #+TITLE:. -if END if non-nil, search for #+TITLE: at `point' and -delimit it to END. Start an unlimited search at -`point-min' otherwise." - (interactive) - (let ((beg (or (and end (point)) - (point-min)))) - (save-excursion - (when end - (goto-char end) - (setq end (line-end-position))) - (goto-char beg) - (when (re-search-forward "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$" end t) - (rename-buffer (match-string 1))))) - nil) - -(defun mm/org-buffer-name-to-title-config () - "Configure Org to rename buffer to value of #+TITLE:." - (font-lock-add-keywords nil '(mm/org-buffer-name-to-title))) - -(add-hook 'org-mode-hook #'mm/org-buffer-name-to-title-config) +;; (defun mm/org-buffer-name-to-title (&optional end) + ;; "Rename buffer to value of #+TITLE:. +;; if END if non-nil, search for #+TITLE: at `point' and +;; delimit it to END. Start an unlimited search at +;; `point-min' otherwise." + ;; (interactive) + ;; (let ((beg (or (and end (point)) + ;; (point-min)))) + ;; (save-excursion + ;; (when end + ;; (goto-char end) + ;; (setq end (line-end-position))) + ;; (goto-char beg) + ;; (when (re-search-forward "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$" end t) + ;; (rename-buffer (match-string 1))))) + ;; nil) +;; (defun mm/org-buffer-name-to-title-config () + ;; "Configure Org to rename buffer to value of #+TITLE:." + ;; (font-lock-add-keywords nil '(mm/org-buffer-name-to-title))) +;; (add-hook 'org-mode-hook #'mm/org-buffer-name-to-title-config) ;; Make org heading bullets look nicer (use-package org-bullets -- cgit v1.2.3