emacs - Info mode
[dotfiles.git] / emacs.d / config.org
index f2325bd..11a19dd 100644 (file)
@@ -1725,6 +1725,25 @@ Play Go in Emacs, gnugo xpm refert [[https://github.com/okanotor/dotemacs/blob/f
 ** TODO bookmark
 
 ** TODO Calendar
+** TODO advice info
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+  (defun sd/info-mode ()
+    (interactive)
+    (unless (equal major-mode 'Info-mode)
+      (unless (> (length (window-list)) 1)
+        (split-window-right))
+      (other-window 1)
+      (info)))
+
+  (global-set-key (kbd "C-h i") 'sd/info-mode)
+
+  ;; open Info buffer in other window instead of current window
+  (defadvice Info (before my-info activate)
+    (sd/info-mode))
+
+  (defadvice Info-exit (after my-info-exit activate)
+    (sd/delete-current-window))
+#+END_SRC
 
 * Programming