diff --git a/.emacs b/.emacs index 6f542bf..6377dda 100644 --- a/.emacs +++ b/.emacs @@ -400,10 +400,14 @@ ;; - Info mode: C-left+C-right history keys ;; - added loader for el2markdown ;; - removed smart-forward, it annoys me +;; - made tvd-outshine-jump more portable, do not use hardcoded +;; regexps anymore, use outshine functions ;; ** TODO +;; - fix C-c C-j to work in non-elisp buffers too, see FIXMEs there +;; and make it recursive like a path or the like ;; - check helpful https://github.com/wilfred/helpful ;; - check no-littering https://github.com/tarsius/no-littering ;; - submit novel + mark-copy-yank-things-mode to MELPA @@ -929,7 +933,7 @@ to next buffer otherwise." (with-current-buffer occur-b (occur-mode-clean-buffer) (setq occur-c (current-buffer)) - (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) ())) + (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) ())) (while (re-search-forward "[0-9]*:" nil t) (replace-match "")) (beginning-of-buffer) @@ -1702,7 +1706,7 @@ col1, col2" "Create tags file." (interactive "DDirectory: ") (let* ((ctags "/usr/bin/ctags-exuberant") - (odir (directory-file-name dir-name)) + (odir (directory-file-name dir-name)) (ofile (concat odir "/TAGS")) (langs "lisp,python,perl,c,c++,shell") (shell-command @@ -1739,7 +1743,7 @@ col1, col2" (setq sgml-omittag-transparent nil) (setq sgml-auto-insert-required-elements t) -(setq sgml-markup-faces +(setq sgml-markup-faces '((start-tag . font-lock-function-name-face) (end-tag . font-lock-function-name-face) (comment . font-lock-comment-face) @@ -1968,9 +1972,8 @@ col1, col2" ;; for config-general-mode (which inherits from conf-mode). (add-hook 'config-general-mode-hook 'electric-indent-mode) -;; empty for now -(add-hook 'config-general-mode-hook '(lambda () - t)) +;; enable outshine +(add-hook 'config-general-mode-hook 'outline-minor-mode) ;; -------------------------------------------------------------------------------- ;; ** Text Manupilation @@ -2098,7 +2101,7 @@ in between will be killed. If INS is non-nil, it will be inserted then." 'mcyt-end-of-quote)) (defun tvd-ci-word () - "\"change inner\" a word (like cw in vi)." + "\"change inner\" a word (like cw in vi)." (interactive) (tvd-ci 'mcyt-beginning-of-symbol 'mcyt-end-of-symbol)) @@ -2474,7 +2477,7 @@ a list symbol describing the command." (let ( ;; save region and buffer (partb (buffer-substring-no-properties (region-beginning) (region-end))) (whole (buffer-substring-no-properties (point-min) (point-max))) - ) + ) (if (> (length partb) 0) partb whole @@ -2485,7 +2488,7 @@ a list symbol describing the command." (defun tvd-send-region-to-repl () "put region or buffer into elisp repl and eval" - (interactive) + (interactive) (let ( ;; fetch region or buffer contents (code (tvd-get-code))) (progn @@ -2493,12 +2496,12 @@ a list symbol describing the command." ;; ielm not yet running, start it in split window but stay here (progn (split-window-horizontally) - (other-window 1) + (other-window 1) (ielm) (other-window 1))) ;; finially, paste content into ielm and evaluate it ;; still we stay where we are - (with-current-buffer "*ielm*" + (with-current-buffer "*ielm*" (goto-char (point-max)) (insert code) (ielm-return))))) @@ -2722,7 +2725,6 @@ down and unfold it, otherwise jump paragraph as usual." org-fontify-done-headline t org-pretty-entities t org-confirm-babel-evaluate nil) - ; shortcuts (setq org-speed-commands-user (quote ( @@ -2738,19 +2740,18 @@ down and unfold it, otherwise jump paragraph as usual." ("z" . org-refile) ; archive the (sub-)tree ("a" . org-attach) ; manage attachments ))) - ; same as toggle (local-set-key (kbd "C-t") 'org-todo) ; alt-enter = insert new subheading below current (local-set-key (kbd "") 'org-insert-subheading) - + ; search for tags (ends up in agenda view) (local-set-key (kbd "C-f") 'org-tags-view) ; run presenter, org-present must be installed and loadedwhite (local-set-key (kbd "C-p") 'org-present) - + ; todo colors (setq org-todo-keyword-faces '( ("TODO" . (:foreground "#b70101" :weight bold)) @@ -2782,7 +2783,7 @@ down and unfold it, otherwise jump paragraph as usual." ; use nicer bullets (org-bullets-mode 1)) - + (org-babel-do-load-languages 'org-babel-load-languages '((python . t) @@ -2802,7 +2803,7 @@ down and unfold it, otherwise jump paragraph as usual." ;; I always want to be able to capture, even if no ORG is running (global-set-key (kbd "C-n") (lambda () (interactive) (org-capture))) -;; must be global since code edit sub buffers run their own major mode, not org +;; must be global since code edit sub buffers run their own major mode, not org (global-set-key (kbd "C-c C-#") 'org-edit-src-exit) ;; some org mode vars must be set globally @@ -2814,10 +2815,10 @@ down and unfold it, otherwise jump paragraph as usual." (setq org-capture-templates '(("n" "Project" entry (file+headline tvd-org-file "Unsorted Tasks") "* TODO %^{title}\n%u\n** Kostenstelle\n** Contact Peer\n**Contact Customer\n**ARS\n**Daten\n** Notizen\n %i%?\n") - + ("j" "Journal" entry (file+headline tvd-org-file "Kurznotizen") "* TODO %^{title}\n%u\n %i%?\n" :prepend t) - + ("c" "Copy/Paste" entry (file+headline tvd-org-file "Kurznotizen") "* TODO %^{title}\n%u\n %x\n" :immediate-finish t :prepend t))) @@ -3057,7 +3058,7 @@ specify another regex for cell splitting." (org-display-inline-images) (org-present-hide-cursor) (org-present-read-only) - + ;; some opticals (setq org-hide-emphasis-markers t) (font-lock-add-keywords 'org-mode @@ -3105,7 +3106,7 @@ specify another regex for cell splitting." | C-c r | enter window resize mode, use cursor keys, to finish | | C-- | (CTRL and minus) shrink font size | | C-+ | (CTRL and plus) increase font size | - + "))) @@ -3127,22 +3128,21 @@ specify another regex for cell splitting." (add-hook 'emacs-lisp-mode-hook '(lambda () (outline-minor-mode))) -;; I do have my own outshine parser here. It generates an alist of all -;; headings with each position in buffer. +;; Generate an alist of all headings with each position in buffer and +;; use this later to jump to those positions with IDO. (make-variable-buffer-local 'tvd-headings) -(defun tvd-outshine-is-heading-p (&optional line) - "return t if current line or LINE is a heading" - (tvd-starts-with (or line (tvd-get-line)) ";; *")) - (defun tvd-outshine-get-level (heading) - "return level of HEADING as number, or nil" - (if (string-match ";; \\(*+\\)" heading) - (length (match-string 1 heading)))) + "Return level of HEADING as number, or nil" + (if (string-match " \\(*+\\) " heading) ; normal outline heading + (length (match-string 1 heading)) + (when (string-match "^;;\\(;+\\) " heading) ; else look for elisp heading + (length (match-string 1 heading))))) (defun tvd-outshine-cl-heading (heading) - "clean HEADING" - (replace-regexp-in-string ";; \\*+ " "" heading)) + (let ((regex (cadar outshine-imenu-preliminary-generic-expression))) + (when (string-match regex heading) + (match-string-no-properties 1 heading)))) (defun tvd-outshine-parse-headings () "extract outshine headings of current buffer" @@ -3153,7 +3153,7 @@ specify another regex for cell splitting." (beginning-of-buffer) (while (not (eobp)) (setq line (tvd-get-line)) - (when (tvd-outshine-is-heading-p line) + (when (outline-on-heading-p t) (add-to-list 'tvd-headings (cons (tvd-outshine-cl-heading line) (point)))) (forward-line))))) @@ -3169,15 +3169,12 @@ specify another regex for cell splitting." (setq l (tvd-outshine-get-level (tvd-get-line))) (add-to-list 'tree (list (point) l)) (when (eq l 1) - (setq done t)) - ) + (setq done t))) (outline-hide-other) (dolist (pos tree) (goto-char (car pos)) (outline-cycle)))) -;; Using the functions above I now can just hit C-c C-j and IDO to -;; some heading, which is damn fast and great. (defun tvd-outshine-jump () "jump to an outshine heading with IDO prompt, update heading list if neccessary." @@ -3210,6 +3207,11 @@ update heading list if neccessary." ("q" . widen) ))))))) +;; Narrowing now works within the headline rather than requiring to be on it +(advice-add 'outshine-narrow-to-subtree :before + (lambda (&rest args) (unless (outline-on-heading-p t) + (outline-previous-visible-heading 1)))) + ;; convert outshine buffer to org buffer using outorg, which is part ;; of outshine. (defun outshine-to-org () @@ -3659,7 +3661,7 @@ last kbd-macro will be executed." (if (not (get-buffer "macros.el")) (find-file tvd-macro-file)) (with-current-buffer "macros.el" - (goto-char (point-max)) + (goto-char (point-max)) (newline) (insert ";;") (newline) @@ -3768,7 +3770,7 @@ defun." ;; *** Help Mode -;; I even customize help windows! ... at least a little :) +;; I even customize help windows! ... at least a little :) (eval-after-load "Help" '(progn @@ -3982,7 +3984,7 @@ defun." (insert "~/") (call-interactively 'self-insert-command)))))) -;; by howardism: [re]open non-writable file with sudo +;; by howardism: [re]open non-writable file with sudo (defadvice ido-find-file (after find-file-sudo activate) "Find file as root if necessary." (unless (and buffer-file-name @@ -4039,7 +4041,7 @@ defun." '(("\t" . 'extra-whitespace-face))) (add-something-to-mode-hooks '(c c++ vala cperl emacs-lisp python shell-script) - (lambda () (font-lock-add-keywords nil tvd-extra-keywords))) + (lambda () (font-lock-add-keywords nil tvd-extra-keywords))) ;; -------------------------------------------------------------------------------- @@ -4318,7 +4320,7 @@ converted to PDF at the same location." "[REC]" "") 'face 'rec-face)) - + mode-line-end-spaces)) ;; -------------------------------------------------------------------------------- diff --git a/emacs.html b/emacs.html index 827cdd8..285ce56 100644 --- a/emacs.html +++ b/emacs.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -232,173 +232,173 @@ for the JavaScript code in this tag.

Table of Contents

@@ -407,8 +407,8 @@ for the JavaScript code in this tag.

Toms Emacs Config - portable - version (20170628.01) -*-emacs-lisp-*-

-
-

1 Introduction

+
+

1 Introduction

This is my emacs config, it is more than twenty years old. It @@ -462,11 +462,11 @@ outshine-to-html, written by myself, see below.

-
-

2 Config Log, Trivia, Notes, Changes

+
+

2 Config Log, Trivia, Notes, Changes

-
-

2.1 Changelog

+
+

2.1 Changelog

20160420.03: @@ -1226,15 +1226,19 @@ or inserts a % if not on a paren. Better than C-5, haha.

  • Info mode: C-left+C-right history keys
  • added loader for el2markdown
  • removed smart-forward, it annoys me
  • +
  • made tvd-outshine-jump more portable, do not use hardcoded +regexps anymore, use outshine functions
  • -
    -

    2.2 TODO

    +
    +

    2.2 TODO

    -
    -

    2.3 .emacs config version

    +
    +

    2.3 .emacs config version

    My emacs config has a version (consisting of a timestamp with a @@ -1262,11 +1266,11 @@ I'm using an outdated config somewhere.

    -
    -

    3 System Specifics

    +
    +

    3 System Specifics

    -
    -

    3.1 Global init file+dir vars, portable

    +
    +

    3.1 Global init file+dir vars, portable

    since I always use ~/.emacs as my init file, this results in the @@ -1300,8 +1304,8 @@ all modes and extensions are located here


    -
    -

    3.2 Fontlock-mode - use syntax highlighting on graphical displays

    +
    +

    3.2 Fontlock-mode - use syntax highlighting on graphical displays

    look: emacswiki @@ -1318,8 +1322,8 @@ look: emacswiki


    -
    -

    3.3 line-cursor in console

    +
    +

    3.3 line-cursor in console

    better visibility of cursor in console sessions @@ -1335,8 +1339,8 @@ better visibility of cursor in console sessions


    -
    -

    3.4 Backup Config

    +
    +

    3.4 Backup Config

    I save backup files in a central location below the init dir, that @@ -1407,8 +1411,8 @@ This is system specific and only matches special host names.


    -
    -

    3.5 console backspace fix

    +
    +

    3.5 console backspace fix

    make backspace work in console sessions @@ -1421,8 +1425,8 @@ make backspace work in console sessions


    -
    -

    3.6 hide menu- and tool-bar

    +
    +

    3.6 hide menu- and tool-bar

    I prefer a bare bones emacs window without any distractions, so turn them off. @@ -1438,8 +1442,8 @@ I prefer a bare bones emacs window without any distractions, so turn them off.


    -
    -

    3.7 stay silent on startup

    +
    +

    3.7 stay silent on startup

    (setq initial-scratch-message "")
    @@ -1452,8 +1456,8 @@ I prefer a bare bones emacs window without any distractions, so turn them off.
     
    -
    -

    3.8 y means yes

    +
    +

    3.8 y means yes

    y is shorter than yes and less error prone. @@ -1466,8 +1470,8 @@ y is shorter than yes and less error prone.


    -
    -

    3.9 show col in modeline

    +
    +

    3.9 show col in modeline

    very useful to know current column @@ -1480,8 +1484,8 @@ very useful to know current column


    -
    -

    3.10 file or buffer in title

    +
    +

    3.10 file or buffer in title

    this can be seen in xmobar @@ -1495,8 +1499,8 @@ this can be seen in xmobar


    -
    -

    3.11 avoid invalid files

    +
    +

    3.11 avoid invalid files

    (setq require-final-newline t)
    @@ -1506,8 +1510,8 @@ this can be seen in xmobar
     
    -
    -

    3.12 prepare load-path

    +
    +

    3.12 prepare load-path

    where to look for extensions: @@ -1534,8 +1538,8 @@ modules


    -
    -

    3.13 byte-compile all of them, if needed

    +
    +

    3.13 byte-compile all of them, if needed

    handy function to recompile all lisp files @@ -1550,8 +1554,8 @@ handy function to recompile all lisp files


    -
    -

    3.14 increase fontsize with ctrl-+ and ctrl--

    +
    +

    3.14 increase fontsize with ctrl-+ and ctrl--

    I use those bindings everywhere (firefox, terminal, etc), and in @@ -1577,11 +1581,11 @@ emacs as well.


    -
    -

    3.15 WINDOW management stuff

    +
    +

    3.15 WINDOW management stuff

    -
    -

    3.15.1 resize windows by keyboard

    +
    +

    3.15.1 resize windows by keyboard

    Very practical: resize windows easily. @@ -1598,8 +1602,8 @@ hit C-c C-r then use cursor keys to resize, <ret> to finish

    -
    -

    3.15.2 switch windows with MS-WINDOWS key

    +
    +

    3.15.2 switch windows with MS-WINDOWS key

    (require 'windmove)
    @@ -1610,8 +1614,8 @@ hit C-c C-r then use cursor keys to resize, <ret> to finish
     
    -
    -

    3.15.3 M-o switch window or buffer

    +
    +

    3.15.3 M-o switch window or buffer

    via mbork @@ -1691,8 +1695,8 @@ Use only in X11 emacs - setting M-O inside console causes <up> and

    -
    -

    3.16 re-read a modified buffer

    +
    +

    3.16 re-read a modified buffer

    F5 == reload file if it has been modified by another process, shift @@ -1717,8 +1721,8 @@ because Xmonad


    -
    -

    3.17 global TAB/Indent config

    +
    +

    3.17 global TAB/Indent config

    I use spaces everywhere but Makefiles. If I encounter TABs I @@ -1758,8 +1762,8 @@ Use normal tabs in makefiles


    -
    -

    3.18 handy aliases

    +
    +

    3.18 handy aliases

    M-x q r <ret> is short enough for me, no need for key bindings for @@ -1791,8 +1795,8 @@ those


    -
    -

    3.19 various settings

    +
    +

    3.19 various settings

    point stays while scrolling @@ -1845,8 +1849,8 @@ I'm grown up!


    -
    -

    3.20 load imenu

    +
    +

    3.20 load imenu

    (define-key global-map [C-down-mouse-2] 'imenu)
    @@ -1856,8 +1860,8 @@ I'm grown up!
     
    -
    -

    3.21 copy/paste Config

    +
    +

    3.21 copy/paste Config

    Related: @@ -1924,8 +1928,8 @@ marked region automatically copied, also on win


    -
    -

    3.22 use more mem

    +
    +

    3.22 use more mem

    are you from the past? @@ -1938,8 +1942,8 @@ are you from the past?


    -
    -

    3.23 better file name completion

    +
    +

    3.23 better file name completion

    Complete filenames case insensitive and ignore certain files during completion. @@ -1969,8 +1973,8 @@ via -

    3.24 abbreviations

    +
    +

    3.24 abbreviations

    Do I really need those anymore? Added ca 1999… @@ -1992,8 +1996,8 @@ Do I really need those anymore? Added ca 1999…

    -
    -

    3.25 meaningful names for buffers with the same name

    +
    -
    -

    3.26 packages

    +
    +

    3.26 packages

    I dont need it all the time and only for experimentation, so lets @@ -2035,8 +2039,8 @@ only use melpa on demand


    -
    -

    3.27 My own global variables

    +
    +

    3.27 My own global variables

    narrowed fringe background @@ -2049,8 +2053,8 @@ narrowed fringe background


    -
    -

    3.28 More scratch space

    +
    +

    3.28 More scratch space

    Sometimes I need a text mode scratch buffer while scratch is @@ -2066,13 +2070,13 @@ already in use. So let's prepare one

    -
    -

    4 Global Key Bindings

    +
    +

    4 Global Key Bindings


    -
    -

    4.1 c-h != delete

    +
    +

    4.1 c-h != delete

    (keyboard-translate ?\C-h ?\C-?)
    @@ -2087,8 +2091,8 @@ already in use. So let's prepare one
     
    -
    -

    4.2 general keys (re-)mappings

    +
    +

    4.2 general keys (re-)mappings

    (global-set-key (kbd "C-x C-4")         'set-selective-display-to-current-column)
    @@ -2115,8 +2119,8 @@ already in use. So let's prepare one
     
    -
    -

    4.3 display a list of my own global key bindings and aliases

    +
    +

    4.3 display a list of my own global key bindings and aliases

    via emacswiki @@ -2160,7 +2164,7 @@ more help with: describe-function occur-mode (with-current-buffer occur-b (occur-mode-clean-buffer) (setq occur-c (current-buffer)) - (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) ())) + (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) ())) (while (re-search-forward "[0-9]*:" nil t) (replace-match "")) (beginning-of-buffer) @@ -2193,13 +2197,13 @@ more help with: describe-function occur-mode

    -
    -

    5 Productivity Functions

    +
    +

    5 Productivity Functions


    -
    -

    5.1 goto line with tmp line numbers

    +
    +

    5.1 goto line with tmp line numbers

    I stole this somewhere, as far as I remember, emacswiki, however, I @@ -2223,8 +2227,8 @@ always had F7 for goto-line


    -
    -

    5.2 invert fore- and background

    +
    +

    5.2 invert fore- and background

    Sometimes when sitting in a very dark enviroment, my usual light @@ -2267,8 +2271,8 @@ fast


    -
    -

    5.3 Some useful bindings for Home and End keys Hit the key once to

    +
    +

    5.3 Some useful bindings for Home and End keys Hit the key once to

    Go to the beginning/end of a line, hit it twice in a row to go to @@ -2332,8 +2336,8 @@ This is the most natural use for those keys


    -
    -

    5.4 percent function

    +
    +

    5.4 percent function

    by Jens Heunemann: jump to percent position into current buffer @@ -2354,8 +2358,8 @@ by Jens Heunemann: jump to percent position into current buffer


    -
    -

    5.5 Simulate vi's % function

    +
    +

    5.5 Simulate vi's % function

    There's not a lot about vi[m] I like, but jumping with % to a @@ -2387,8 +2391,8 @@ just insert a literal ?%. Only make sense if bound to %.


    -
    -

    5.6 Move region

    +
    +

    5.6 Move region

    Mark a region, then use M-up|down to move it around @@ -2487,8 +2491,8 @@ code from -

    5.7 comment-uncomment region with one key binding

    + -
    -

    5.8 search for symbol at point

    +
    +

    5.8 search for symbol at point

    Simulate the # function of vi, marks the symbol at point, C-s then @@ -2555,8 +2559,8 @@ via ergomacs


    -
    -

    5.9 Window Margin

    +
    +

    5.9 Window Margin

    Kinda screen reader for the poor. I use this sometimes with info @@ -2582,8 +2586,8 @@ left+right margin on demand (but nothing else)


    -
    -

    5.10 Fill and justify a paragraph

    +
    +

    5.10 Fill and justify a paragraph

    this is just a shortcut for: @@ -2612,8 +2616,8 @@ idea via: -

    5.11 Make a read-only copy of the current buffer

    +
    +

    5.11 Make a read-only copy of the current buffer

    I just create a new read-only buffer and copy the contents of the @@ -2662,8 +2666,8 @@ a file is not maintained via VC anyway.


    -
    -

    5.12 Cleanup, close all windows and kill all buffers

    +
    +

    5.12 Cleanup, close all windows and kill all buffers

    From time to time I get annoyed by the many dozen buffers @@ -2694,8 +2698,8 @@ setup accidentally.


    -
    -

    5.13 Cleanup current buffer

    +
    -
    -

    5.14 Better newline(s)

    +
    -
    -

    5.15 Mouse Rectangle

    +
    -
    -

    5.16 DOS <=> UNIX conversion helpers

    +
    +

    5.16 DOS <=> UNIX conversion helpers

    (defun dos2unix ()
    @@ -2810,8 +2814,8 @@ via stackoverflow
     
    -
    -

    5.17 helper do add the same thing to multiple mode hooks

    +
    +

    5.17 helper do add the same thing to multiple mode hooks

    via stackoverflow @@ -2829,8 +2833,8 @@ usage samples below.

    -
    -

    5.18 helper to catch load errors

    +
    +

    5.18 helper to catch load errors

    Try to eval 'fn, catch errors, if any but make it possible for @@ -2852,8 +2856,8 @@ emacs to continue undisturbed, used with SMEX, see below.


    -
    -

    5.19 Alignment Wrappers

    +
    +

    5.19 Alignment Wrappers

    align-regexp is already a very usefull tool, however, sometimes I @@ -2903,8 +2907,8 @@ wrappers to make this easier.

    -
    -

    5.20 String Helpers

    +
    +

    5.20 String Helpers

    Some helper functions I use here and there. @@ -2943,14 +2947,14 @@ Some helper functions I use here and there.

    -
    -

    6 Modes

    +
    +

    6 Modes

    -
    -

    6.1 Programming Languages

    +
    +

    6.1 Programming Languages

    -
    -

    6.1.1 VALA

    +
    +

    6.1.1 VALA

    (autoload 'vala-mode "vala-mode" "Major mode for editing Vala code." t)
    @@ -2965,8 +2969,8 @@ Some helper functions I use here and there.
     
    -
    -

    6.1.2 python mode

    +
    +

    6.1.2 python mode

    Not much configured for python, I'm happy with the defaults as it seems :) @@ -2994,8 +2998,8 @@ Not much configured for python, I'm happy with the defaults as it seems :)

    -
    -

    6.1.3 cperl mode

    +
    +

    6.1.3 cperl mode

    I am a perl addict. I love it, therefore, emacs must be prepared @@ -3142,8 +3146,8 @@ and hook them into cperl

    -
    -

    6.1.4 Paredit for lisp only

    +
    +

    6.1.4 Paredit for lisp only

    I use paredit in lisp a lot, but are mostly happy with the defaults. @@ -3186,8 +3190,8 @@ sometimes I need to be able to turn it off fast:

    -
    -

    6.1.5 ETAGS

    +
    +

    6.1.5 ETAGS

    I use ETAGS for some projects. With etags I can easily jump to the @@ -3217,7 +3221,7 @@ generate TAGS and load it "Create tags file." (interactive "DDirectory: ") (let* ((ctags "/usr/bin/ctags-exuberant") - (odir (directory-file-name dir-name)) + (odir (directory-file-name dir-name)) (ofile (concat odir "/TAGS")) (langs "lisp,python,perl,c,c++,shell") (shell-command @@ -3264,11 +3268,11 @@ some handy aliases

    -
    -

    6.2 Text Modes

    +
    +

    6.2 Text Modes

    -
    -

    6.2.1 sgml

    +
    +

    6.2.1 sgml

    Used for XML and the likes. @@ -3280,7 +3284,7 @@ Used for XML and the likes. (setq sgml-omittag-transparent nil) (setq sgml-auto-insert-required-elements t) -(setq sgml-markup-faces +(setq sgml-markup-faces '((start-tag . font-lock-function-name-face) (end-tag . font-lock-function-name-face) (comment . font-lock-comment-face) @@ -3295,8 +3299,8 @@ Used for XML and the likes.

    -
    -

    6.2.2 web-mode (JS, HTML, CSS combined)

    +
    +

    6.2.2 web-mode (JS, HTML, CSS combined)

    Web development is shit. Tech involved is a mess, and in most cases @@ -3390,8 +3394,8 @@ convert a text list into a html list.

    -
    -

    6.2.3 Cisco Mode

    +
    +

    6.2.3 Cisco Mode

    Written by myself many years ago, but I'm still using it daily to @@ -3409,8 +3413,8 @@ view and prepare cisco configs.

    -
    -

    6.2.4 Markdown

    +
    +

    6.2.4 Markdown

    I rarely use markdown, but sometimes I stumble upon such a file and @@ -3446,8 +3450,8 @@ parens and quotes constraints check on save

    -
    -

    6.2.5 POD mode

    +
    +

    6.2.5 POD mode

    I LOVE POD! POD is the documentation format of perl and there's a @@ -3556,8 +3560,8 @@ pod mode config


    -
    -

    6.2.6 conf-mode

    +
    +

    6.2.6 conf-mode

    conf-mode annoyingly overwrites the global keybinding C-c C-c with @@ -3578,8 +3582,8 @@ configs. Applies for derivates as well.

    -
    -

    6.2.7 Config::General mode

    +
    +

    6.2.7 Config::General mode

    config-general-mode (also on Melpa). @@ -3608,11 +3612,10 @@ for config-general-mode (which inherits from conf-mode).

    -empty for now +enable outshine

    -
    (add-hook 'config-general-mode-hook '(lambda ()
    -                                       t))
    +
    (add-hook 'config-general-mode-hook 'outline-minor-mode)
     
    @@ -3620,11 +3623,11 @@ empty for now
    -
    -

    6.3 Text Manupilation

    +
    +

    6.3 Text Manupilation

    -
    -

    6.3.1 expand-region

    +
    +

    6.3.1 expand-region

    One of the best modes I ever discovered. Press C-= multiple times @@ -3643,8 +3646,8 @@ related to ER:

    -
    -

    6.3.2 Mark, Copy, Yank Things

    +
    +

    6.3.2 Mark, Copy, Yank Things

    For a long time this stuff was located here in my emacs config. As @@ -3747,8 +3750,8 @@ it appears as NNN,NN.

    -
    -

    6.3.3 change-inner

    +
    +

    6.3.3 change-inner

    I use change-inner with a prefix key and some wrappers around @@ -3797,7 +3800,7 @@ first some functions: 'mcyt-end-of-quote)) (defun tvd-ci-word () - "\"change inner\" a word (like cw in vi)." + "\"change inner\" a word (like cw in vi)." (interactive) (tvd-ci 'mcyt-beginning-of-symbol 'mcyt-end-of-symbol)) @@ -3870,8 +3873,8 @@ typing the prefix key twice calls the real change-inner


    -
    -

    6.3.4 Rotate text

    +
    +

    6.3.4 Rotate text

    This one is great as well, I use it to toggle flags and such stuff @@ -3927,8 +3930,8 @@ short command anymore, so C-t would be free now, wouldn't it?

    -
    -

    6.3.5 Word wrapping

    +
    +

    6.3.5 Word wrapping

    same as word-wrap but without the fringe which I hate the most! @@ -3950,8 +3953,8 @@ overwritten by visual-line-mode above for specifics

    -
    -

    6.3.6 Viking Mode

    +
    +

    6.3.6 Viking Mode

    Delete stuff fast. Press the key multiple times - delete more @@ -3969,8 +3972,8 @@ things. Inspired by expand-region. Written by myself.

    -
    -

    6.3.7 HTMLize

    +
    +

    6.3.7 HTMLize

    extracted from debian package emacs-goodies-el-35.2+nmu1, since @@ -3987,8 +3990,8 @@ the current buffer, however it looks.

    -
    -

    6.3.8 iEdit (inline edit multiple searches)

    +
    +

    6.3.8 iEdit (inline edit multiple searches)

    Edit all occurences of something at once. Great for re-factoring. @@ -4029,11 +4032,11 @@ behavior, so, I modify it myself using defadvice.

    -
    -

    6.4 Interactives

    +
    +

    6.4 Interactives

    -
    -

    6.4.1 eShell stuff, or if interactive stuff is needed, use ansi-term

    +
    +

    6.4.1 eShell stuff, or if interactive stuff is needed, use ansi-term

    I am a hardcore bash user, but from time to time eshell is good @@ -4313,8 +4316,8 @@ no need for less or more, this is emacs, isn't it?

    -
    -

    6.4.2 Emacs LISP interactive

    +
    +

    6.4.2 Emacs LISP interactive

    General configuration for all things elisp. @@ -4334,7 +4337,7 @@ REPL where it will be evaluated (let ( ;; save region and buffer (partb (buffer-substring-no-properties (region-beginning) (region-end))) (whole (buffer-substring-no-properties (point-min) (point-max))) - ) + ) (if (> (length partb) 0) partb whole @@ -4345,7 +4348,7 @@ REPL where it will be evaluated (defun tvd-send-region-to-repl () "put region or buffer into elisp repl and eval" - (interactive) + (interactive) (let ( ;; fetch region or buffer contents (code (tvd-get-code))) (progn @@ -4353,12 +4356,12 @@ REPL where it will be evaluated ;; ielm not yet running, start it in split window but stay here (progn (split-window-horizontally) - (other-window 1) + (other-window 1) (ielm) (other-window 1))) ;; finially, paste content into ielm and evaluate it ;; still we stay where we are - (with-current-buffer "*ielm*" + (with-current-buffer "*ielm*" (goto-char (point-max)) (insert code) (ielm-return))))) @@ -4481,8 +4484,8 @@ same applies for quoted symbols


    -
    -

    6.4.3 el2markdown

    +
    +

    6.4.3 el2markdown

    el2markdown is a module which @@ -4506,8 +4509,8 @@ README.md. Take care though: it doesn't convert the META section.

    -
    -

    6.4.4 tramp mode

    +
    +

    6.4.4 tramp mode

    Edit remote files, one of the best things in emacs. I use it every day heavily. @@ -4529,8 +4532,8 @@ doku: gnu.org

    -
    -

    6.4.5 org mode

    +
    +

    6.4.5 org mode

    I use org mode to take notes mostly at work. I also track projects @@ -4679,7 +4682,6 @@ org-mode specific config, after load org-fontify-done-headline t org-pretty-entities t org-confirm-babel-evaluate nil) - ; shortcuts (setq org-speed-commands-user (quote ( @@ -4695,7 +4697,6 @@ org-mode specific config, after load ("z" . org-refile) ; archive the (sub-)tree ("a" . org-attach) ; manage attachments ))) - ; same as toggle (local-set-key (kbd "C-t") 'org-todo) @@ -4777,7 +4778,7 @@ I always want to be able to capture, even if no ORG is running

    -must be global since code edit sub buffers run their own major mode, not org +must be global since code edit sub buffers run their own major mode, not org

    (global-set-key (kbd "C-c C-#")         'org-edit-src-exit)
    @@ -4833,8 +4834,8 @@ is in the outline section.
     
    -
    -

    6.4.6 org table mode

    +
    +

    6.4.6 org table mode

    I'm so used to lovely org mode tables, I need them everywhere! @@ -5080,8 +5081,8 @@ tables as well

    -
    -

    6.4.7 org mode slideshows

    +
    +

    6.4.7 org mode slideshows

    Making presentations within emacs with org mode is cool as well. @@ -5189,8 +5190,8 @@ Will be inserted as first help slide in a slide show


    -
    -

    6.4.8 outshine mode

    +
    +

    6.4.8 outshine mode

    I maintain my emacs config with outshine mode. It works a lot like @@ -5223,24 +5224,23 @@ use it for .emacs:

    -I do have my own outshine parser here. It generates an alist of all -headings with each position in buffer. +Generate an alist of all headings with each position in buffer and +use this later to jump to those positions with IDO.

    (make-variable-buffer-local 'tvd-headings)
     
    -(defun tvd-outshine-is-heading-p (&optional line)
    -  "return t if current line or LINE is a heading"
    -  (tvd-starts-with (or line (tvd-get-line)) ";; *"))
    -
     (defun tvd-outshine-get-level (heading)
    -  "return level of HEADING as number, or nil"
    -  (if (string-match ";; \\(*+\\)" heading)
    -      (length (match-string 1 heading))))
    +  "Return level of HEADING as number, or nil"
    +  (if (string-match " \\(*+\\) " heading) ; normal outline heading
    +      (length (match-string 1 heading))
    +    (when (string-match "^;;\\(;+\\) " heading) ; else look for elisp heading
    +      (length (match-string 1 heading)))))
     
     (defun tvd-outshine-cl-heading (heading)
    -  "clean HEADING"
    -  (replace-regexp-in-string ";; \\*+ " "" heading))
    +  (let ((regex (cadar outshine-imenu-preliminary-generic-expression)))
    +    (when (string-match regex heading)
    +      (match-string-no-properties 1 heading))))
     
     (defun tvd-outshine-parse-headings ()
       "extract outshine headings of current buffer"
    @@ -5251,7 +5251,7 @@ headings with each position in buffer.
           (beginning-of-buffer)
           (while (not (eobp))
             (setq line (tvd-get-line))
    -        (when (tvd-outshine-is-heading-p line)
    +        (when (outline-on-heading-p t)
               (add-to-list 'tvd-headings (cons (tvd-outshine-cl-heading line) (point))))
             (forward-line)))))
     
    @@ -5267,21 +5267,13 @@ headings with each position in buffer.
           (setq l (tvd-outshine-get-level (tvd-get-line)))
           (add-to-list 'tree (list (point) l))
           (when (eq l 1)
    -        (setq done t))
    -      )
    +        (setq done t)))
         (outline-hide-other)
         (dolist (pos tree)
           (goto-char (car pos))
           (outline-cycle))))
    -
    -
    -

    -Using the functions above I now can just hit C-c C-j and IDO to -some heading, which is damn fast and great. -

    -
    -
    (defun tvd-outshine-jump ()
    +(defun tvd-outshine-jump ()
       "jump to an outshine heading with IDO prompt,
     update heading list if neccessary."
       (interactive)
    @@ -5320,6 +5312,16 @@ outshine mode config (inside outline mode)
     
    +

    +Narrowing now works within the headline rather than requiring to be on it +

    +
    +
    (advice-add 'outshine-narrow-to-subtree :before
    +            (lambda (&rest args) (unless (outline-on-heading-p t)
    +                                   (outline-previous-visible-heading 1))))
    +
    +
    +

    convert outshine buffer to org buffer using outorg, which is part of outshine. @@ -5361,8 +5363,8 @@ posting online, which makes it way easier to read.

    -
    -

    6.4.9 outline mode

    +
    +

    6.4.9 outline mode

    I use the very same cycle style as in org mode: when on a heading, @@ -5459,8 +5461,8 @@ orange fringe when narrowed


    -
    -

    6.4.10 narrowing (no mode but fits here)

    +
    +

    6.4.10 narrowing (no mode but fits here)

    I use narrowing quite frequently, so here are some enhancements. @@ -5500,8 +5502,8 @@ via -

    6.4.11 ANSI-TERM (inferior shells/interpreters and REPLs)

    +
    +

    6.4.11 ANSI-TERM (inferior shells/interpreters and REPLs)

    I use ansi term for inferior shells only. @@ -5617,8 +5619,8 @@ finally the inferior REPLs:

    -
    -

    6.4.12 Puppet

    +
    +

    6.4.12 Puppet

    adds hook for .pp files @@ -5632,8 +5634,8 @@ adds hook for .pp files

    -
    -

    6.4.13 Novel Mode - Screen Reader

    +
    +

    6.4.13 Novel Mode - Screen Reader

    my own emacs screen reader, very handy to read docs on the road. @@ -5649,8 +5651,8 @@ my own emacs screen reader, very handy to read docs on the road.

    -
    -

    6.4.14 Macro Math

    +
    +

    6.4.14 Macro Math

    see macro-math @@ -5673,8 +5675,8 @@ mark something and hit C-x C-0 (which is a reminder to C-x C-= w/o the shift)

    -
    -

    6.4.15 Common-Lisp (SLIME)

    +
    +

    6.4.15 Common-Lisp (SLIME)

    I'm learing CL with slime, start with M-x slime. @@ -5707,8 +5709,8 @@ INSTALL: (see: -

    6.4.16 INFO Mode

    +
    +

    6.4.16 INFO Mode

    open an info file somewhere outside %infodir% with info-mode @@ -5740,8 +5742,8 @@ easier navigation in Info mode, intuitive history back and forth.

    -
    -

    6.4.17 calc et al.

    +
    +

    6.4.17 calc et al.

    emacs provides 4 ways to calculate: @@ -5791,8 +5793,8 @@ or, inferior perl calc: M-x icalc, see above

    -
    -

    6.4.18 MACROs

    +
    +

    6.4.18 MACROs

    help: emacswiki macro tricks. @@ -5969,7 +5971,7 @@ but only load if in use (if (not (get-buffer "macros.el")) (find-file tvd-macro-file)) (with-current-buffer "macros.el" - (goto-char (point-max)) + (goto-char (point-max)) (newline) (insert ";;") (newline) @@ -6005,8 +6007,8 @@ but only load if in use


    -
    -

    6.4.19 EWW browser stuff

    +
    +

    6.4.19 EWW browser stuff

    Emacs has a builtin browser, which is not too bad. @@ -6074,8 +6076,8 @@ hides menus and distractions! Update emacs.


    -
    -

    6.4.20 Firestarter

    +
    +

    6.4.20 Firestarter

    experimental: do things on save buffer etc. @@ -6084,8 +6086,8 @@ Source: firestarter

    -
    -

    6.4.21 Tabulated List Mode

    +
    +

    6.4.21 Tabulated List Mode

    built-in, used by many interactive major modes @@ -6133,11 +6135,11 @@ we need to kill tablist's binding in order to have ours run (see below)

    -
    -

    6.4.22 Help Mode

    +
    +

    6.4.22 Help Mode

    -I even customize help windows! … at least a little :) +I even customize help windows! … at least a little :)

    @@ -6158,11 +6160,11 @@ I even customize help windows! … at least a little :)
    -
    -

    6.5 Emacs Interface

    +
    +

    6.5 Emacs Interface

    -
    -

    6.5.1 Parens

    +
    +

    6.5.1 Parens

    display matching braces @@ -6183,8 +6185,8 @@ display matching braces

    -
    -

    6.5.2 highlight todo keywords (such as FIXME)

    +
    +

    6.5.2 highlight todo keywords (such as FIXME)

    Absolutely needed! @@ -6199,8 +6201,8 @@ Absolutely needed!


    -
    -

    6.5.3 UNDO Tree Mode

    +
    +

    6.5.3 UNDO Tree Mode

    Better undo, with redo support. @@ -6243,8 +6245,8 @@ M-_ catched by Xmonad


    -
    -

    6.5.4 Smarter M-x Mode (smex)

    +
    +

    6.5.4 Smarter M-x Mode (smex)

    This is really cool and I don't know how I could ever live without it. @@ -6267,8 +6269,8 @@ fails @win, so wrap it

    -
    -

    6.5.5 Which Func

    +
    +

    6.5.5 Which Func

    display current function - if any - in mode line @@ -6283,8 +6285,8 @@ display current function - if any - in mode line


    -
    -

    6.5.6 Show current-line in the Fringe

    +
    +

    6.5.6 Show current-line in the Fringe

    (require 'fringe-current-line)
    @@ -6303,8 +6305,8 @@ also change the color (matching the mode line
     
    -
    -

    6.5.7 Recent Files

    +
    +

    6.5.7 Recent Files

    You know the file you edited yesterday had "kri" in its name, but @@ -6392,8 +6394,8 @@ exclude some auto generated files

    -
    -

    6.5.8 IDO mode

    +
    +

    6.5.8 IDO mode

    There are other completion enhancement packages available like ivy @@ -6500,7 +6502,7 @@ via whattheemacs.d

    -by howardism: [re]open non-writable file with sudo +by howardism: [re]open non-writable file with sudo

    (defadvice ido-find-file (after find-file-sudo activate)
    @@ -6522,8 +6524,8 @@ by howardism: [re]open non-writable file with sudo
     
    -
    -

    6.5.9 Save cursor position

    +
    +

    6.5.9 Save cursor position

    So the next time I start emacs and open a file I were editing @@ -6544,8 +6546,8 @@ before.

    -
    -

    6.5.10 DoReMi experimentation

    +
    +

    6.5.10 DoReMi experimentation

    I'm not using it a lot, sometimes I tune the background color though. @@ -6574,8 +6576,8 @@ cool ones: doremi-buffers, doremi-all-faces-fg+ [s, h]


    -
    -

    6.5.11 Hightligt TABs

    +
    +

    6.5.11 Hightligt TABs

    not a mode, but however: higlight TABs in certain modes @@ -6598,8 +6600,8 @@ not a mode, but however: higlight TABs in certain modes

    -
    -

    6.5.12 Browse kill-ring

    +
    +

    6.5.12 Browse kill-ring

    when active use n and p to browse, <ret> to select, it's the same @@ -6617,8 +6619,8 @@ as <M-y> and I never really use it…

    -
    -

    6.5.13 goto-last-change

    +
    +

    6.5.13 goto-last-change

    Very handy, jump to last change[s]. @@ -6635,8 +6637,8 @@ Very handy, jump to last change[s].

    -
    -

    6.5.14 Bookmarks

    +
    +

    6.5.14 Bookmarks

    I use the builtin bookmark feature quite a lot and am happy with @@ -6668,8 +6670,8 @@ I use the same aliases as in apparix for bash (since I'm used to them)

    -
    -

    6.5.15 which-key

    +
    +

    6.5.15 which-key

    One of the best unobstrusive modes for key help ever. Just start @@ -6689,8 +6691,8 @@ press from there along with the associated functions.

    -
    -

    6.5.16 iBuffer mode

    +
    +

    6.5.16 iBuffer mode

    iBuffer is a great interactive buffer management tool included with @@ -6900,8 +6902,8 @@ override ibuffer M-o binding

    -
    -

    6.5.17 Printing

    +
    +

    6.5.17 Printing

    overwrites printing default menu, access via menu File => Print @@ -6946,8 +6948,8 @@ via -

    6.5.18 Beacon mode (pointer blink)

    +
    +

    6.5.18 Beacon mode (pointer blink)

    Source: beacon mode @@ -6977,8 +6979,8 @@ editing position.

    -
    -

    6.6 mode-line setup (must be the last mode)

    +
    +

    6.6 mode-line setup (must be the last mode)

    I just append the current version of my emacs config and leave out @@ -7043,13 +7045,13 @@ custom modeline

    -
    -

    7 Emacs Autoconfig / Customizegroup stuff

    +
    +

    7 Emacs Autoconfig / Customizegroup stuff


    -
    -

    7.1 font faces

    +
    +

    7.1 font faces

    Font color config, must always be the last thing so all hook faces are loaded. @@ -7127,8 +7129,8 @@ unless we're on windoze


    -
    -

    7.2 variables

    +
    +

    7.2 variables

    If I ever use custom-group to customize a mode, then I create a @@ -7149,8 +7151,8 @@ here. So, in normal times this should be empty, but needs to exist.

    -
    -

    7.3 done

    +
    +

    7.3 done

    Finally, this message is being displayed. If this isn't the case I @@ -7167,7 +7169,7 @@ know easily that something went wrong.

    Author: Tom

    -

    Created: 2017-07-01 Sa 12:14

    +

    Created: 2017-07-02 So 19:14

    Validate