From: Stefan Bund Date: Fri, 20 May 2016 09:28:15 +0000 (+0200) Subject: config updates X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=d44024a9086ffc06430329b40841aa0015668e21;p=emacs-init.git config updates --- diff --git a/emacsstuff b/emacsstuff index 3d37060..f3930bf 160000 --- a/emacsstuff +++ b/emacsstuff @@ -1 +1 @@ -Subproject commit 3d370602ea891fbc150d425a9e1eb4d4c3b38763 +Subproject commit f3930bf63b68cc0150429d60ce1dbed410a594aa diff --git a/python/init_python.el b/python/init_python.el index ca60d06..e66e6a1 100644 --- a/python/init_python.el +++ b/python/init_python.el @@ -35,7 +35,7 @@ nil) (defun python-init-auto-cleanup-imports-on-save () - (add-hook 'write-file-functions 'write-file-py-cleanup-imports nil t)) + (add-hook 'write-contents-functions 'write-file-py-cleanup-imports nil t)) (defun my-flymake-error-at-point () (condition-case nil diff --git a/setup/bindings.el b/setup/bindings.el index f890c47..63fab0d 100644 --- a/setup/bindings.el +++ b/setup/bindings.el @@ -22,6 +22,8 @@ ) (whitespace-mode 1) ;(develock-mode 1) - )) + ) + ; for some reason, the font-lock information is only updated when running normal-mode again + (normal-mode)) (global-set-key "\C-c' " 'toggle-whitespace-modes) diff --git a/setup/copy-paste.el b/setup/copy-paste.el new file mode 100644 index 0000000..7165b32 --- /dev/null +++ b/setup/copy-paste.el @@ -0,0 +1,41 @@ +;; https://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/ +;; I prefer using the "clipboard" selection (the one the +;; typically is used by c-c/c-v) before the primary selection +;; (that uses mouse-select/middle-button-click) +(setq x-select-enable-clipboard t) + +;; If emacs is run in a terminal, the clipboard- functions have no +;; effect. Instead, we use of xsel, see +;; http://www.vergenet.net/~conrad/software/xsel/ -- "a command-line +;; program for getting and setting the contents of the X selection" +(unless window-system + (when (getenv "DISPLAY") + ;; Callback for when user cuts + (defun xsel-cut-function (text &optional push) + ;; Insert text to temp-buffer, and "send" content to xsel stdin + (with-temp-buffer + (insert text) + ;; I prefer using the "clipboard" selection (the one the + ;; typically is used by c-c/c-v) before the primary selection + ;; (that uses mouse-select/middle-button-click) + (call-process-region (point-min) (point-max) "xsel" nil 0 nil "--clipboard" "--input"))) + ;; Call back for when user pastes + (defun xsel-paste-function() + ;; Find out what is current selection by xsel. If it is different + ;; from the top of the kill-ring (car kill-ring), then return + ;; it. Else, nil is returned, so whatever is in the top of the + ;; kill-ring will be used. + (let ((xsel-output (shell-command-to-string "xsel --clipboard --output"))) + (unless (string= (car kill-ring) xsel-output) + xsel-output ))) + (defun xsel-noop-paste-function() + ;; this version will not paste from xsel. This is often not required, since C-S-v or + ;; middle-mouse-click will do the same. + nil) + ;; Attach callbacks to hooks + (setq interprogram-cut-function 'xsel-cut-function) + (setq interprogram-paste-function 'xsel-noop-paste-function) + ;; Idea from + ;; http://shreevatsa.wordpress.com/2006/10/22/emacs-copypaste-and-x/ + ;; http://www.mail-archive.com/help-gnu-emacs@gnu.org/msg03577.html + )) diff --git a/setup/init-org.el b/setup/init-org.el index 3b97e75..1a577dc 100644 --- a/setup/init-org.el +++ b/setup/init-org.el @@ -14,4 +14,12 @@ (require 'org) (require 'org-version) - (setq org-odt-data-dir (concat base "org-mode/etc"))) \ No newline at end of file + (setq org-odt-data-dir (concat base "org-mode/etc"))) + +(defun my-setup-org () + (visual-line-mode 1) + (font-lock-mode 0) + (whitespace-mode 0) + (font-lock-mode 1)) + +(add-hook 'org-mode-hook 'my-setup-org) \ No newline at end of file