Start work on clickable sidebar.

Commit
8c1c484e875b35e65aae23f8b05687a31c23da49
Author
Blendoit <blendoit@gmail.com>
Author date
Committer
Blendoit <blendoit@gmail.com>
Committer date
Changed files
smart-documents.org
index f7b39a26..a252cf36 100644..100644
@@ -24,7 +24,7 @@
24 24 GNU Emacs is most often used as a text editor. It would be unfair to say it is
25 25 just that, because Emacs is capable of so much more. The utmost level of
26 26 customization is afforded by enabling the user to rewrite /any/ part of the
27 Removed: source code and observe the editor's modified behaviour in real time. Since its
27 Added: source code and observe the editor's modified behavior in real time. Since its
28 28 inception in 1984, GNU Emacs has grown to be much more than a full-featured,
29 29 high-productivity text editor---new /modes/ have been written to interact with
30 30 hundreds of file formats, including =.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip=
@@ -397,18 +397,6 @@
397 397
398 398 ** Windows
399 399
400 Removed: *** Make new window
401 Removed:
402 Removed: #+BEGIN_SRC emacs-lisp :tangle yes
403 Removed: (global-set-key (kbd "C-n") 'make-frame)
404 Removed: #+END_SRC
405 Removed:
406 Removed: *** Make only window
407 Removed:
408 Removed: #+BEGIN_SRC emacs-lisp :tangle yes
409 Removed: (global-set-key (kbd "C-`") 'delete-other-windows)
410 Removed: #+END_SRC
411 Removed:
412 400 *** Close window and quit
413 401
414 402 The following bindings lead to more natural window & frame exit behaviors.
@@ -424,6 +412,21 @@
424 412 (previous-buffer))))
425 413 #+END_SRC
426 414
415 Added: ** Frame
416 Added:
417 Added: *** Make new frame
418 Added:
419 Added: #+BEGIN_SRC emacs-lisp :tangle yes
420 Added: (global-set-key (kbd "C-n") 'make-frame)
421 Added: #+END_SRC
422 Added:
423 Added: *** Make only frame
424 Added:
425 Added: #+BEGIN_SRC emacs-lisp :tangle yes
426 Added: (global-set-key (kbd "C-`") 'delete-other-windows)
427 Added: #+END_SRC
428 Added: *** Delete frame or kill Emacs
429 Added:
427 430 #+NAME: delete-frame-or-kill-emacs
428 431 #+BEGIN_SRC emacs-lisp :tangle yes
429 432 (global-set-key (kbd "C-q")
@@ -435,6 +438,12 @@
435 438 (kill-emacs))))
436 439 #+END_SRC
437 440
441 Added: *** Open sidebar
442 Added:
443 Added: #+BEGIN_SRC emacs-lisp :tangle yes
444 Added: (global-set-key (kbd "<left-margin> <mouse-1>") 'sd-sidebar)
445 Added: #+END_SRC
446 Added:
438 447 ** Text display
439 448
440 449 *** Zoom
@@ -538,6 +547,12 @@
538 547
539 548 #+END_SRC
540 549
550 Added: *** Indent buffer
551 Added:
552 Added: #+BEGIN_SRC emacs-lisp :tangle yes
553 Added: (global-set-key [f12] 'sd-reformat-buffer)
554 Added: #+END_SRC
555 Added:
541 556 * Packages
542 557
543 558 Packages are collections of =.el= files providing added functionality to Emacs.
@@ -722,7 +737,7 @@
722 737
723 738 **** Smartly suggesting interactive search matches
724 739
725 Removed: Wonderful counsellor!
740 Added: Wonderful counsellor!
726 741
727 742 #+BEGIN_SRC emacs-lisp :tangle yes
728 743 (use-package counsel
@@ -825,7 +840,9 @@
825 840 Get inspiration from ~ibuffer-sidebar~ and create a better sidebar.
826 841
827 842 #+BEGIN_SRC emacs-lisp :tangle yes
828 Removed: ;; (load-file)
843 Added: (defun sd-sidebar ()
844 Added: (interactive)
845 Added: (message "Foobius Peter."))
829 846 #+END_SRC
830 847
831 848 # *** Icons
@@ -888,18 +905,15 @@
888 905 #+BEGIN_SRC emacs-lisp :tangle no :results pp :exports both :cache yes
889 906 (save-excursion
890 907 (org-previous-visible-heading 1)
891 Removed: (org-element-at-point))
908 Added: (org-entry-properties))
892 909 #+END_SRC
893 910
894 Removed: #+RESULTS[cf28d310a45fa4e4dcd49882889cd36a2ae3820d]: org-meta-info
895 Removed: : (headline
896 Removed: : (:raw-value "~org-mode~" :begin 15920 :end 23157
897 Removed: : :pre-blank 1 :contents-begin 15935 :contents-end 23156
898 Removed: : :level 2 :priority nil :tags nil
899 Removed: : :todo-keyword nil :todo-type nil
900 Removed: : :post-blank 1 :footnote-section-p nil
901 Removed: : :archivedp nil :commentedp nil
902 Removed: : :post-affiliated 15920 :title "~org-mode~"))
911 Added: #+RESULTS[cf982044956d8f3ec89e7a9da80976b1b19db423]: org-meta-info
912 Added: : (("CATEGORY" . "smart-documents")
913 Added: : ("BLOCKED" . "")
914 Added: : ("FILE" . "/home/blendux/.emacs.d/smart-documents.org")
915 Added: : ("PRIORITY" . "B")
916 Added: : ("ITEM" . "Introduction"))
903 917
904 918 ** Basic customization
905 919
@@ -1149,10 +1163,19 @@
1149 1163
1150 1164 * One-click workflows
1151 1165
1152 Removed: In this section, we'll implement useful one-click workflows.
1166 Added: In this section, we'll implement useful one-click workflows. It comes later
1167 Added: keybinding definitions for two reasons:
1153 1168
1154 Removed: ** TODO Export dialogue
1169 Added: 1. To a new user, keybindings are more important than the precise
1170 Added: implementation of the bound function---it is more important to know how to
1171 Added: drive a car than how a car works.
1172 Added: 2. If the following subsections share the same name as the keybinding
1173 Added: subsection (Section [[Keyboard shortcuts]]), the links will resolve to the
1174 Added: earliest heading in the document, i.e. the keybinding subsection and not the
1175 Added: subsection describing the `one-click workflow'.
1155 1176
1177 Added: ** TODO Export to PDF
1178 Added:
1156 1179 This reimplements the most common Org mode export: Org \rightarrow LaTeX
1157 1180 \rightarrow PDF. The binding is defined in Section [[Export to PDF]].
1158 1181
@@ -1164,6 +1187,19 @@
1164 1187 (org-open-file (org-latex-export-to-pdf)))
1165 1188 #+END_SRC
1166 1189
1190 Added: ** TODO Beautify buffer
1191 Added:
1192 Added: Binding defined in Section [[Indent buffer]].
1193 Added:
1194 Added: #+BEGIN_SRC emacs-lisp :tangle yes
1195 Added: (defun sd-indent-buffer ()
1196 Added: "Indent entire buffer."
1197 Added: (interactive)
1198 Added: (save-excursion
1199 Added: (indent-region (point-min) (point-max) nil)))
1200 Added: #+END_SRC
1201 Added:
1202 Added:
1167 1203 * Editing preferences
1168 1204
1169 1205 These customizations enhance editor usability. They also encompass cosmetic
@@ -1206,7 +1242,7 @@
1206 1242 (defun sd-line-render (left right)
1207 1243 "Return a string of `window-width' length
1208 1244 containing LEFT, and RIGHT aligned respectively."
1209 Removed: (let* ((available-width (- (window-width) (length left) 2)))
1245 Added: (let* ((available-width (- (window-width) (length left) 3)))
1210 1246 (format (format " %%s %%%ds " available-width) left right)))
1211 1247 #+END_SRC
1212 1248
@@ -1216,18 +1252,24 @@
1216 1252 working on currently.
1217 1253
1218 1254 #+BEGIN_SRC emacs-lisp :tangle yes
1219 Removed: (add-hook 'org-mode-hook
1220 Removed: (lambda ()
1221 Removed: "Set the header line to show #+TITLE and #+DATE."
1222 Removed: (setq header-line-format
1223 Removed: '(:eval (sd-line-render
1224 Removed: (save-excursion
1225 Removed: (goto-char (point-min))
1226 Removed: (when (re-search-forward
1227 Removed: "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$"
1228 Removed: nil t)
1229 Removed: (match-string 1)))
1230 Removed: nil)))))
1255 Added: (defun sd-title ()
1256 Added: "Find the #+TITLE property of the SD."
1257 Added: (interactive)
1258 Added: (save-excursion
1259 Added: (goto-char (point-min))
1260 Added: (when (re-search-forward
1261 Added: "^[[:space:]]*#\\+TITLE:[[:space:]]*\\(.*?\\)[[:space:]]*$"
1262 Added: nil t)
1263 Added: (match-string 1))))
1264 Added:
1265 Added: (add-hook 'org-mode-hook
1266 Added: (lambda ()
1267 Added: "Set the header line to show #+TITLE and section name."
1268 Added: (setq header-line-format
1269 Added: '(:eval
1270 Added: (sd-line-render
1271 Added: (sd-title)
1272 Added: (nth 4 (org-heading-components)))))))
1231 1273 #+END_SRC
1232 1274
1233 1275 **** Mode line
@@ -1274,8 +1316,6 @@
1274 1316
1275 1317 #+BEGIN_SRC emacs-lisp :tangle yes
1276 1318 (setq-default left-margin-width 6 right-margin-width 6)
1277 Removed:
1278 Removed: (use-package srefactor)
1279 1319 #+END_SRC
1280 1320
1281 1321 ** Text
smart-documents.pdf
index 6339507f..83afcdc3 100644..100644

Binary files differ