[Emacs Lisp] Personal ~/.emacs.d/ configuration folder.
Buffer beautification.
smart-documents.org
@@ -1463,9 +1463,9 @@
1463
1463
major-mode)))))
1464
1464
#+END_SRC
1465
1465
1466
Removed:
** Whole buffer
1466
Added:
** Operate on whole buffer
1467
1467
1468
Removed:
*** Indent
1468
Added:
*** Fix indentation
1469
1469
1470
1470
#+BEGIN_SRC emacs-lisp :tangle yes
1471
1471
(defun sd-indent-buffer ()
@@ -1477,6 +1477,8 @@
1477
1477
1478
1478
*** Beautify
1479
1479
1480
Added:
**** All types of buffers
1481
Added:
1480
1482
#+BEGIN_SRC emacs-lisp :tangle yes
1481
1483
(defun sd-beautify-buffer ()
1482
1484
"Clean up buffer in the most general sense.
@@ -1488,9 +1490,27 @@
1488
1490
As well as a couple other things."
1489
1491
(interactive)
1490
1492
(sd-indent-buffer)
1491
Removed:
(delete-trailing-whitespace))
1493
Added:
(delete-trailing-whitespace)
1494
Added:
(when (string-equal
1495
Added:
major-mode "org-mode")
1496
Added:
(sd-org-fix-headlines-spacing)))
1497
Added:
1498
Added:
1492
1499
#+END_SRC
1493
1500
1501
Added:
**** COMMENT For Org mode, specifically
1502
Added:
1503
Added:
#+BEGIN_SRC emacs-lisp :tangle yes
1504
Added:
(defun sd-org-fix-headlines-spacing ()
1505
Added:
"Insert the proper amount of newlines between Org headlines."
1506
Added:
(save-excursion
1507
Added:
(progn
1508
Added:
(goto-char (point-min))
1509
Added:
(mark-whole-buffer)
1510
Added:
(delete-blank-lines)
1511
Added:
(org-next-visible-heading)
1512
Added:
(re-search-backward "^$")))
1513
Added:
#+END_SRC
1494
1514
1495
1515
** Smart quitting
1496
1516