aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-12-16 15:31:45 -0500
committerMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-12-16 15:31:45 -0500
commitf33d45e4ec7280ab31b5a55b7c9b636622751ca4 (patch)
treec77d7888a27f60c597815ddb89b9eb6eb198b863
parentStop dired opening so many buffers (diff)
downloadmmosmacs-f33d45e4ec7280ab31b5a55b7c9b636622751ca4.tar.gz
mmosmacs-f33d45e4ec7280ab31b5a55b7c9b636622751ca4.tar.bz2
mmosmacs-f33d45e4ec7280ab31b5a55b7c9b636622751ca4.zip
Disable rename org buffers to `#+TITLE:`
-rw-r--r--init.el42
1 files 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 @@
1014 1014
1015;; Set buffer name to #+TITLE 1015;; Set buffer name to #+TITLE
1016;; Credit to SE user "Tobias" 1016;; Credit to SE user "Tobias"
1017(defun mm/org-buffer-name-to-title (&optional end) 1017;; (defun mm/org-buffer-name-to-title (&optional end)
1018 "Rename buffer to value of #+TITLE:. 1018 ;; "Rename buffer to value of #+TITLE:.
1019if END if non-nil, search for #+TITLE: at `point' and 1019;; if END if non-nil, search for #+TITLE: at `point' and
1020delimit it to END. Start an unlimited search at 1020;; delimit it to END. Start an unlimited search at
1021`point-min' otherwise." 1021;; `point-min' otherwise."
1022 (interactive) 1022 ;; (interactive)
1023 (let ((beg (or (and end (point)) 1023 ;; (let ((beg (or (and end (point))
1024 (point-min)))) 1024 ;; (point-min))))
1025 (save-excursion 1025 ;; (save-excursion
1026 (when end 1026 ;; (when end
1027 (goto-char end) 1027 ;; (goto-char end)
1028 (setq end (line-end-position))) 1028 ;; (setq end (line-end-position)))
1029 (goto-char beg) 1029 ;; (goto-char beg)
1030 (when (re-search-forward "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$" end t) 1030 ;; (when (re-search-forward "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$" end t)
1031 (rename-buffer (match-string 1))))) 1031 ;; (rename-buffer (match-string 1)))))
1032 nil) 1032 ;; nil)
1033 1033;; (defun mm/org-buffer-name-to-title-config ()
1034(defun mm/org-buffer-name-to-title-config () 1034 ;; "Configure Org to rename buffer to value of #+TITLE:."
1035 "Configure Org to rename buffer to value of #+TITLE:." 1035 ;; (font-lock-add-keywords nil '(mm/org-buffer-name-to-title)))
1036 (font-lock-add-keywords nil '(mm/org-buffer-name-to-title))) 1036;; (add-hook 'org-mode-hook #'mm/org-buffer-name-to-title-config)
1037
1038(add-hook 'org-mode-hook #'mm/org-buffer-name-to-title-config)
1039 1037
1040;; Make org heading bullets look nicer 1038;; Make org heading bullets look nicer
1041(use-package org-bullets 1039(use-package org-bullets