summaryrefslogtreecommitdiffstats
path: root/lisp/init-editing.el
diff options
context:
space:
mode:
authorMartin Polden <martin.polden@gmail.com>2016-02-26 13:25:31 +0100
committerMartin Polden <martin.polden@gmail.com>2016-02-26 13:26:59 +0100
commitac52483c9f2f45ab8fe7076856a18cbd46f7f848 (patch)
treeac6a08370a2570a38fe0da384b44a13417793f67 /lisp/init-editing.el
parentac120a5ca6fc8cae92633a2f3e878c901916fc44 (diff)
Use use-package to configure find-func bindings
Diffstat (limited to 'lisp/init-editing.el')
-rw-r--r--lisp/init-editing.el27
1 files changed, 7 insertions, 20 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el
index 9f1ad76..fb1912c 100644
--- a/lisp/init-editing.el
+++ b/lisp/init-editing.el
@@ -27,19 +27,18 @@
:ensure nil ;; package is bundled with emacs
:mode ("z\\(sh[^/]*\\|login\\|logout\\|profile\\|preztorc\\)\\'" . sh-mode))
+;; find function definitions
+(use-package find-func
+ :ensure nil ;; package is bundled with emacs
+
+ :bind (("C-h C-f" . find-function-other-window)
+ ("C-h C-k" . find-function-on-key)))
+
(defun show-file-name ()
"Show the full path file name in the minibuffer."
(interactive)
(message buffer-file-name))
-(defun call-interactively-other-window (function &optional noselect)
- "Call FUNCTION interactively. Restore the current window if
-NOSELECT is non-nil."
- (let ((current-window (selected-window)))
- (call-interactively function)
- (when noselect
- (select-window current-window))))
-
;; source: http://rejeep.github.io/emacs/elisp/2010/03/26/rename-file-and-buffer-in-emacs.html
(defun rename-this-buffer-and-file ()
"Renames current buffer and file it is visiting."
@@ -78,18 +77,6 @@ NOSELECT is non-nil."
;; bind hippie-expand
(global-set-key (kbd "C-c e") 'hippie-expand)
-;; C-h C-f navigates to the source of a function
-(define-key 'help-command (kbd "C-f")
- (lambda ()
- (interactive)
- (call-interactively-other-window 'find-function-other-window t)))
-
-;; C-h C-k navigates to the source of function bound to the given keybinding
-(define-key 'help-command (kbd "C-k")
- (lambda ()
- (interactive)
- (call-interactively-other-window 'find-function-on-key t)))
-
;; join line
(global-set-key (kbd "M-j") (lambda () (interactive) (join-line -1)))