diff options
| author | Jesús <heckyel@hyperbola.info> | 2019-01-22 15:45:41 -0500 |
|---|---|---|
| committer | Jesús <heckyel@hyperbola.info> | 2019-01-22 15:45:41 -0500 |
| commit | ced0fe8f9ef7cd16ade900bb34393c627f6d0c69 (patch) | |
| tree | 350d3a0cbb87b12a36c0dc12537c56a75a2668ae /modules/lib/sachachua.el | |
| parent | d0f44d85466d7211d54e30970f29815842ff4180 (diff) | |
| download | emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.lz emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.xz emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.zip | |
Change directory lisp/ to modules/
FS #2
Diffstat (limited to 'modules/lib/sachachua.el')
| -rw-r--r-- | modules/lib/sachachua.el | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/lib/sachachua.el b/modules/lib/sachachua.el new file mode 100644 index 0000000..c862223 --- /dev/null +++ b/modules/lib/sachachua.el @@ -0,0 +1,39 @@ +;; Increase-decrease functions from Sacha Chua +(defun sacha/increase-font-size () + (interactive) + (set-face-attribute 'default + nil + :height + (ceiling (* 1.10 + (face-attribute 'default :height))))) +(defun sacha/decrease-font-size () + (interactive) + (set-face-attribute 'default + nil + :height + (floor (* 0.9 + (face-attribute 'default :height))))) + +;; Not original from Sacha. Taken from: http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/ +(defun sacha/smarter-move-beginning-of-line (arg) + "Move point back to indentation of beginning of line. + +Move point to the first non-whitespace character on this line. +If point is already there, move to the beginning of the line. +Effectively toggle between the first non-whitespace character and +the beginning of the line. + +If ARG is not nil or 1, move forward ARG - 1 lines first. If +point reaches the beginning or end of the buffer, stop there." + (interactive "^p") + (setq arg (or arg 1)) + + ;; Move lines first + (when (/= arg 1) + (let ((line-move-visual nil)) + (forward-line (1- arg)))) + + (let ((orig-point (point))) + (back-to-indentation) + (when (= orig-point (point)) + (move-beginning-of-line 1)))) |
