summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2013-09-18 15:28:57 (GMT)
committer Jaromil <jaromil@dyne.org>2013-09-18 15:28:57 (GMT)
commite77e20f5a9e7b4861fa71abe4139bca5796fe4ae (patch)
treeef0de68bab31e686f0cb30f0e93032fee6652af2
parent3c46b605ee2f4da3bc2262db434d4456c056d411 (diff)
reorganization of keymap include and activation of figlet and word-count
-rw-r--r--elisp/autorg.el129
-rwxr-xr-xelisp/compile_on_ubuntu.sh5
-rw-r--r--elisp/figlet.el8
-rw-r--r--elisp/keymap.el84
4 files changed, 129 insertions, 97 deletions
diff --git a/elisp/autorg.el b/elisp/autorg.el
index 1a361e1..a34b568 100644
--- a/elisp/autorg.el
+++ b/elisp/autorg.el
@@ -85,6 +85,12 @@ org-crypt org-remember org-agenda org-export org-beamer)))
(setq tramp-default-method "ssh2")
(setq tramp-auto-save-directory "~/.emacs-backups")
+; word count mode
+(require 'word-count)
+
+; figlet ascii art
+(require 'figlet)
+
; enables semantic mode
; (semantic-mode t)
;
@@ -120,75 +126,6 @@ org-crypt org-remember org-agenda org-export org-beamer)))
ad-do-it))
-; ===========================
-;; setup our keyboard mappings
-
-;; cursor movement a la vim
-(global-set-key (kbd "M-h") 'backward-char) ; was indent-new-comment-line
-(global-set-key (kbd "M-l") 'forward-char) ; was downcase-word
-(global-set-key (kbd "M-k") 'previous-line) ; was tab-to-tab-stop
-(global-set-key (kbd "M-j") 'next-line) ; was kill-sentence
-
-(global-set-key (kbd "M-SPC") 'set-mark-command) ; was just-one-space
-
-;; less painfull window switching
-(global-set-key (kbd "C-o") 'other-window)
-;; faster file open
-(global-set-key (kbd "C-f") 'find-file)
-
-
-;; sloppy goto line with both command and alt
-(global-set-key [(meta g)] `goto-line)
-(global-set-key (kbd "s-g") `goto-line)
-
-;;;;;;;;;;;;;;;
-; switch buffer
-(global-set-key (kbd "s-=") 'ido-switch-buffer)
-(global-set-key (kbd "s-`") 'next-multiframe-window)
-
-
-;;;;;;;;;;;
-; scrolling
-(global-set-key (kbd "s-<up>") 'backward-paragraph)
-(global-set-key (kbd "s-<down>") 'forward-paragraph)
-(global-set-key (kbd "M-<up>") 'backward-page)
-(global-set-key (kbd "M-<down>") 'forward-page)
-
-;;;;;;;;;;;;;
-; cut & paste
-(global-set-key (kbd "s-c") 'kill-ring-save)
-(global-set-key (kbd "s-v") 'yank)
-(global-set-key (kbd "s-y") 'yank-pop)
-; sloppy hyper - alt swap
-
-
-; Compat with sloppy and swap of hyper - alt
-
-(global-set-key (kbd "s-w") 'kill-ring-save)
-
-;;;;;;;;;;;;
-; completion
-
-; completion
-(global-set-key (kbd "M-/") 'complete-symbol)
-(global-set-key (kbd "s-/") 'complete-symbol)
-(global-set-key (kbd "M-\\") 'complete-symbol)
-(global-set-key (kbd "s-\\") 'complete-symbol)
-
-
-(defun switch-to-other-buffer () (interactive) (switch-to-buffer (other-buffer)))
-(global-set-key [(meta control ?l)] `switch-to-other-buffer)
- ; (global-set-key [(control tab)] `other-window)
-(global-set-key [(meta O) ?H] 'beginning-of-line)
-(global-set-key [home] 'beginning-of-line)
-(global-set-key [(meta O) ?F] 'end-of-line)
-(global-set-key [end] 'end-of-line)
-(setq next-line-add-newlines nil)
-; C-c c to either comment out a region or uncomment it depending on context.
-(global-set-key (kbd "C-c c") 'comment-dwim)
-
-
-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@@ -228,16 +165,8 @@ org-crypt org-remember org-agenda org-export org-beamer)))
(global-set-key [(control insert)]
'(lambda () (interactive)
(x-own-selection (buffer-substring (point) (mark)))))
-; M-g to go to specified line in buffer.
-; Useful for emacs 21.x users where the keybinding is not yet standard.
-(global-set-key (kbd "\M-g") 'goto-line)
-; remap ctrl-z to undo (common behaviour)
-(global-set-key (kbd "\C-z") 'undo)
-; remap ctrl-x ctrl-m to ESC-x (alt-x)
-(global-set-key "\C-x\C-m" 'execute-extended-command)
-(global-set-key "\C-c\C-m" 'execute-extended-command)
-(global-set-key "\C-xm" 'execute-extended-command)
-(global-set-key "\C-cm" 'execute-extended-command)
+
+
; enables deleting an highlighted block
(delete-selection-mode)
@@ -316,19 +245,41 @@ org-crypt org-remember org-agenda org-export org-beamer)))
(require 'color-theme)
(color-theme-initialize)
(color-theme-classic)
-; (color-theme-gray30)
-; (color-theme-matrix)
-; (color-theme-blippblopp)
-; (color-theme-dark-laptop)
-;; set our favourite: Anonymous!
-;(set-face-font
-;'default "-*-Terminus-normal-normal-normal-*-13-*-*-*-*-*-*")
+(defun justify-toggle-block ()
+ "Remove or add line ending chars on current paragraph.
+This command is similar to a toggle of `fill-paragraph'.
+When there is a text selection, act on the region."
+ (interactive)
-; transparency (thanks dreamer!)
-(set-frame-parameter (selected-frame) 'alpha '(95 50))
-(add-to-list 'default-frame-alist '(alpha 95 50))
+ ;; This command symbol has a property ā€œ'stateIsCompact-pā€.
+ (let (currentStateIsCompact (bigFillColumnVal 90002000) (deactivate-mark nil))
+ ;; 90002000 is just random. you can use `most-positive-fixnum'
+
+ (save-excursion
+ ;; Determine whether the text is currently compact.
+ (setq currentStateIsCompact
+ (if (eq last-command this-command)
+ (get this-command 'stateIsCompact-p)
+ (if (> (- (line-end-position) (line-beginning-position)) fill-column) t nil) ) )
+
+ (if (region-active-p)
+ (if currentStateIsCompact
+ (fill-region (region-beginning) (region-end))
+ (let ((fill-column bigFillColumnVal))
+ (fill-region (region-beginning) (region-end))) )
+ (if currentStateIsCompact
+ (fill-paragraph nil)
+ (let ((fill-column bigFillColumnVal))
+ (fill-paragraph nil)) ) )
+
+ (put this-command 'stateIsCompact-p (if currentStateIsCompact nil t)) ) ) )
+
+
+; transparency not working anymore
+; (set-frame-parameter (selected-frame) 'alpha '(95 50))
+; (add-to-list 'default-frame-alist '(alpha 95 50))
; start listening to commandline invokations
(server-start)
diff --git a/elisp/compile_on_ubuntu.sh b/elisp/compile_on_ubuntu.sh
index 919c724..cfd0de9 100755
--- a/elisp/compile_on_ubuntu.sh
+++ b/elisp/compile_on_ubuntu.sh
@@ -6,7 +6,8 @@ TMP="/tmp/autorg"
mkdir -p $TMP
files=()
-for i in `find . -name '*.el'`; do files+=($i); done
+for i in `find . -maxdepth 1 -type f -name '*.el'`; do files+=($i); done
+for i in `find themes -maxdepth 1 -type f -name '*.el'`; do files+=($i); done
cat <<EOF > $TMP/.emacs
(setq default-directory "$HOME" )
@@ -18,4 +19,4 @@ cat <<EOF > $TMP/.emacs
EOF
# EMACSLOADPATH=/usr/share/emacs/site-lisp:/usr/share/emacs/23.4/lisp/:/home/jrml/devel/autorg/elisp/:/home/jrml/devel/autorg/elisp/org-mode/lisp \
HOME=$TMP emacs \
- --debug-init --batch -f batch-byte-compile $files
+ --batch -f batch-byte-compile $files
diff --git a/elisp/figlet.el b/elisp/figlet.el
index f7ecc96..dc4175b 100644
--- a/elisp/figlet.el
+++ b/elisp/figlet.el
@@ -57,12 +57,12 @@
(defun figlet (s &optional font)
(interactive
- (if current-prefix-arg
+ ; (if current-prefix-arg
(let
((font (read-figlet-font "Font: "))
(text (read-string "FIGlet Text: ")))
- (list text font))
- (list (read-string "FIGlet Text: ") nil)))
+ (list text font)))
+; (list (read-string "FIGlet Text: ") nil)))
(save-excursion
(call-figlet font s)
(figlet-block-comment-region)
@@ -71,3 +71,5 @@
(defun banner (s)
(interactive "sBanner Text: ")
(figlet s "banner"))
+
+(provide 'figlet)
diff --git a/elisp/keymap.el b/elisp/keymap.el
index 0c2785d..357c904 100644
--- a/elisp/keymap.el
+++ b/elisp/keymap.el
@@ -1,7 +1,85 @@
-;; genering key mappping
+;; autorg key mappping
(provide 'keymap)
+; ===========================
+;; setup our keyboard mappings
+
+;; cursor movement a la vim
+(global-set-key (kbd "M-h") 'backward-char) ; was indent-new-comment-line
+(global-set-key (kbd "M-l") 'forward-char) ; was downcase-word
+(global-set-key (kbd "M-k") 'previous-line) ; was tab-to-tab-stop
+(global-set-key (kbd "M-j") 'next-line) ; was kill-sentence
+
+(global-set-key (kbd "M-SPC") 'set-mark-command) ; was just-one-space
+
+;; less painfull window switching
+(global-set-key (kbd "C-o") 'other-window)
+;; faster file open
+(global-set-key (kbd "C-f") 'find-file)
+
+
+;; sloppy goto line with both command and alt
+(global-set-key [(meta g)] `goto-line)
+(global-set-key (kbd "s-g") `goto-line)
+
+;;;;;;;;;;;;;;;
+; switch buffer
+(global-set-key (kbd "s-=") 'ido-switch-buffer)
+(global-set-key (kbd "s-`") 'next-multiframe-window)
+
+
+
+
+;;;;;;;;;;;
+; scrolling
+(global-set-key (kbd "s-<up>") 'backward-paragraph)
+(global-set-key (kbd "s-<down>") 'forward-paragraph)
+(global-set-key (kbd "M-<up>") 'backward-page)
+(global-set-key (kbd "M-<down>") 'forward-page)
+
+;;;;;;;;;;;;;
+; cut & paste
+(global-set-key (kbd "s-c") 'kill-ring-save)
+(global-set-key (kbd "s-v") 'yank)
+(global-set-key (kbd "s-y") 'yank-pop)
+; sloppy hyper - alt swap
+(global-set-key (kbd "s-w") 'kill-ring-save)
+
+
+; M-g to go to specified line in buffer.
+; Useful for emacs 21.x users where the keybinding is not yet standard.
+(global-set-key (kbd "\M-g") 'goto-line)
+; remap ctrl-z to undo (common behaviour)
+(global-set-key (kbd "\C-z") 'undo)
+; remap ctrl-x ctrl-m to ESC-x (alt-x)
+(global-set-key "\C-x\C-m" 'execute-extended-command)
+(global-set-key "\C-c\C-m" 'execute-extended-command)
+(global-set-key "\C-xm" 'execute-extended-command)
+(global-set-key "\C-cm" 'execute-extended-command)
+
+;;;;;;;;;;;;
+; completion
+
+(global-set-key (kbd "M-/") 'complete-symbol)
+(global-set-key (kbd "s-/") 'complete-symbol)
+(global-set-key (kbd "M-\\") 'complete-symbol)
+(global-set-key (kbd "s-\\") 'complete-symbol)
+
+
+(defun switch-to-other-buffer () (interactive) (switch-to-buffer (other-buffer)))
+(global-set-key [(meta control ?l)] `switch-to-other-buffer)
+ ; (global-set-key [(control tab)] `other-window)
+(global-set-key [(meta O) ?H] 'beginning-of-line)
+(global-set-key [home] 'beginning-of-line)
+(global-set-key [(meta O) ?F] 'end-of-line)
+(global-set-key [end] 'end-of-line)
+(setq next-line-add-newlines nil)
+; C-c c to either comment out a region or uncomment it depending on
+; context.
+(global-set-key (kbd "C-c c") 'comment-dwim)
+
+
; justify paragraph keys
-(global-set-key (kbd "A-q") 'fill-paragraph)
-(global-set-key (kbd "C-j") 'fill-paragraph)
+(global-set-key (kbd "M-q") 'justify-toggle-block)
+(global-set-key (kbd "C-j") 'justify-toggle-block)