@ -128,7 +128,6 @@
( setq compilation-scroll-output t
compilation-window-height 12 )
( transient-mark-mode 0 )
( tool-bar-mode 0 )
( scroll-bar-mode -1 )
( setq-default show-trailing-whitespace t )
@ -162,9 +161,10 @@
( load " init-org.el " )
( load " init-c++.el " )
( load " init-elisp.el " )
( load " init-kde-integration.el " )
;; KDE stuff
;;
( add-to-list 'load-path " ~/kde-emacs " )
( load " qml-mode.el " nil t t )
( add-to-list 'auto-mode-alist ' ( " \\ .qml \\ ' " . qml-mode ) )
@ -180,9 +180,10 @@
;; create the autosave dir if necessary, since emacs won't.
( make-directory " ~/.emacs.d/autosaves/ " t )
( make-directory " ~/.emacs.d/backup/ " t )
( require 'linum )
( add-hook 'text-mode-hook 'flyspell-mode )
( require 'linum )
( add-hook 'text-mode-hook 'linum-mode )
( add-hook 'qml-mode-hook 'linum-mode )
@ -204,43 +205,6 @@
( global-set-key ( kbd " M-[ " ) 'previous-buffer )
( global-set-key ( kbd " M-] " ) 'next-buffer )
;; kde activity stuff -- move to other file when stabilized
( defun kde-current-activity ( )
" Returns the current KDE activity "
( substring ( shell-command-to-string " qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity " ) 0 -1 )
)
( defun kde-current-activity-name ( )
" Returns the name of the current KDE activity "
( substring ( shell-command-to-string ( concat " qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName " ( kde-current-activity ) ) ) 0 -1 ) )
( defun X-window-id-belongs-to-activity ( window-id activity )
( = ( shell-command ( concat " xprop -id " window-id " | grep _KDE_NET_WM_ACTIVITIES | grep " activity " >/dev/null " ) ) 0 )
)
( defun select-frame-on-activity ( activity )
( setq framelist ( frame-list ) )
( setq done nil )
( while ( and framelist ( not done ) )
( setq cur ( car framelist ) )
( setq cur-id ( cdr ( assq 'window-id ( frame-parameters cur ) ) ) )
( if cur-id ( if ( X-window-id-belongs-to-activity cur-id activity ) ( progn ;
( setq done 't ) ( select-frame cur ) ) ) )
( setq framelist ( cdr framelist ) ) )
done
)
( defun select-X-frame ( )
( setq framelist ( frame-list ) )
( setq done nil )
( while ( and framelist ( not done ) )
( setq cur ( car framelist ) )
( setq cur-id ( cdr ( assq 'window-id ( frame-parameters cur ) ) ) )
( if cur-id ( progn ;
( setq done 't ) ( raise-frame cur ) ) )
( setq framelist ( cdr framelist ) ) )
done
)
( defun select-frame-on-current-activity ( )
( select-frame-on-activity ( kde-current-activity ) )
@ -252,7 +216,7 @@
;; (no-easy-keys 1)
;; conflicts a bit with org-mode
;;Keyboard is faster than mouse
;; Keyboard is faster than mouse
( global-unset-key ( kbd " <mouse-1> " ) )
( global-unset-key ( kbd " <down-mouse-1> " ) )
( global-unset-key ( kbd " <drag-mouse-1> " ) )
@ -265,35 +229,31 @@
( global-unset-key ( kbd " <M-f4> " ) ) ; rly?
;; Change some global bindings:
( global-set-key ( kbd " C-M-d " ) 'kill-sexp )
( global-unset-key ( kbd " C-M-u " ) )
( global-unset-key ( kbd " C-M-d " ) )
( global-set-key ( kbd " C-M-i " ) 'down-list ) ;; -i stands for /in/
( global-set-key ( kbd " C-M-o " ) 'up-list ) ;; -o stands for /out/
( global-unset-key ( kbd " C-M-u " ) )
( global-set-key ( kbd " C-M-d " ) 'kill-sexp )
;; experimental: try to force myself to use the buffer commands
( global-unset-key ( kbd " M-[ " ) )
( global-unset-key ( kbd " M-] " ) )
( require 'visible-mark )
( visible-mark-mode t )
( global-visible-mark-mode t )
;(delete 'Git vc-handled-backends)
;; * magit
( require 'magit )
( global-set-key ( kbd " C-x C-g " ) 'magit-status ) ;; relates to C-x C-f and C-x C-s
;; * iy-go-to char (broken)
;; (require 'iy-go-to-char)
;; (global-set-key (kbd "M-m") 'iy-go-up-to-char)
;; (global-set-key (kbd "M-M") 'iy-go-up-to-char-backward)
;; Comment out since it does not work reliably
( require 'iy-go-to-char )
( global-set-key ( kbd " M-m " ) 'iy-go-up-to-char )
( global-set-key ( kbd " M-M " ) 'iy-go-up-to-char-backward )
;; * smart-tab-mode
( require 'smart-tab )
( global-smart-tab-mode 1 )
;;
;; ace jump mode major function
;;
;; * ace jump mode
( autoload
'ace-jump-mode
" ace-jump-mode "
@ -303,9 +263,7 @@
( define-key global-map ( kbd " C-c SPC " ) 'ace-jump-mode )
;;
;; enable a more powerful jump back function from ace jump mode
;;
( autoload
'ace-jump-mode-pop-mark
" ace-jump-mode "
@ -315,6 +273,7 @@
' ( ace-jump-mode-enable-mark-sync ) )
( define-key global-map ( kbd " C-x SPC " ) 'ace-jump-mode-pop-mark )
;; * redefine line-beginning to handle indentation properly
( defun smart-line-beginning ( )
" Move point to the beginning of text on the current line; if that is already
the current position of point, then move it to the beginning of the line. "
@ -325,22 +284,12 @@ the current position of point, then move it to the beginning of the line."
( beginning-of-line ) ) ) )
( global-set-key ( kbd " C-a " ) 'smart-line-beginning )
;; (defun smart-delete-backward-char ()
;; "try to be smart to delete indentation"
;; (interactive)
;; (let ((pt (point)))
;; (beginning-of-line-text)
;; (if (eq pt (point))
;; (delete-indentation)
;; (progn
;; (goto-char pt)
;; (call-interactively 'delete-backward-char)))))
;; (global-set-key "\d" 'smart-delete-backward-char)
;; * load expand-region
( add-to-list 'load-path " ~/tmp/expand-region.el " )
( require 'expand-region )
( global-set-key ( kbd " H-SPC " ) 'er/expand-region )
;; * construct emacs-session so with session-id
( defun emacs-session-filename ( session-id )
" Construct a filename to save the session in based on SESSION-ID.
If the directory ~/.emacs.d exists, we make a filename in there, otherwise
@ -367,14 +316,11 @@ a file in the home directory."
( global-set-key ( kbd " <f13> " ) 'set-mark-command )
;; * clever mark stuff
( defun push-mark-no-activate ( )
" Pushes `point' to `mark-ring' and does not activate the region
Equivalent to \\ [ set-mark-command ] when \\ [ transient-mark-mode ] is disabled "
( interactive )
( push-mark ( point ) t nil )
( message " Pushed mark to ring " ) )
( global-set-key ( kbd " <C-f13> " ) 'push-mark-no-activate )
( require 'visible-mark )
( visible-mark-mode t )
( global-visible-mark-mode t )
( transient-mark-mode 0 )
;; ** stuff that works
( defun jump-to-mark ( )
" Jumps to the local mark, respecting the `mark-ring' order.
This is the same as using \\ [ set-mark-command ] with the prefix argument. "
@ -395,7 +341,16 @@ This is the same as using \\[set-mark-command] with the prefix argument."
;; (deactivate-mark nil))
;; (define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate)
;; * Wordnik stuff - does not work anymore
;; ** This function is not needed since we are not using transient mode anymore
;; (defun push-mark-no-activate ()
;; "Pushes `point' to `mark-ring' and does not activate the region
;; Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
;; (interactive)
;; (push-mark (point) t nil)
;; (message "Pushed mark to ring"))
;; (global-set-key (kbd "<C-f13>") 'push-mark-no-activate)
;; * Wordnik :fixme:
( require 'wordnik-synonym )
( global-set-key ( kbd " H-= " ) 'wn/synonym-at-point )
;; * kill annoying completion buffer
@ -422,7 +377,7 @@ This is the same as using \\[set-mark-command] with the prefix argument."
;; first day of the week is monday instead of sunday:
( setq calendar--week--start--day 1 )
;; * Misc --- sort thme out
;; * toorg
( require 'highlight-sexps )
( setq echo-keystrokes 0.10 )
@ -455,14 +410,14 @@ This is the same as using \\[set-mark-command] with the prefix argument."
( ibuffer-switch-to-saved-filter-groups " default " ) ) )
;; * This used to set my patched version of terminus
;; * Use patched terminus :fixme:
;; (set-face-font 'default "-xos4-TerminusPlus-Medium-R-Normal--12-120-72-72-C-60-ISO10646-1")
;; (mapc
;; (lambda (face)
;; (set-face-attribute face nil :weight 'normal))
;; (face-list))
;; * mode-line setting
;; * mode-line setup
( setq-default mode-line-modified ' ( :eval ( if ( buffer-modified-p ) " ● " " · " ) ) ) ;still needs some improvements, does not report Readonly state
( setq-default mode-line-remote ' ( :eval ( let ( ( s ( format-mode-line " %@ " ) ) )
( cond
@ -498,7 +453,7 @@ This is the same as using \\[set-mark-command] with the prefix argument."
mode-line-misc-info
mode-line-end-spaces ) )
;; * Organize differently
;; * toorg
( require 'outshine )
( add-hook 'outline-minor-mode-hook 'outshine-hook-function )
( setq outshine-use-speed-commands t )
@ -510,6 +465,4 @@ This is the same as using \\[set-mark-command] with the prefix argument."
' ( " melpa-stable " . " http://stable.melpa.org/packages/ " ) t )
;; * start server named after kde activity id
( setq server-name ( kde-current-activity ) )
( menu-bar-mode -99 )
( server-start )
( setq server-name ( kde-current-