Emacs: Use 'M-.' to jump to symbol definition

master
Pierre Neidhardt 2016-06-09 18:25:18 +02:00
parent 133b9f821f
commit a58b6dd186
2 changed files with 13 additions and 0 deletions

View File

@ -164,6 +164,14 @@ parameters."
(error (message "Invalid expression")
(insert (current-kill 0)))))
(defun find-symbol-at-point ()
"Find directly the symbol at point in the other window."
(interactive)
(let ((sym (symbol-at-point)))
(if (boundp sym)
(find-variable-at-point)
(find-function-at-point))))
;; Fix forward-page. Previously, when the point was at the end of the page,
;; going forward would skip 1 page. Changed:
;;

View File

@ -104,6 +104,11 @@
(setq indent-tabs-mode nil))))
'(lisp-mode-hook emacs-lisp-mode-hook))
(add-hook
'emacs-lisp-mode-hook
(lambda ()
(local-set-key (kbd "M-.") 'find-symbol-at-point)))
(add-hook
'change-log-mode-hook
(lambda ()