Created
August 29, 2016 15:02
-
-
Save danlamanna/ffb900fe399ab272270c28eeac2c54e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice Man-quit(after maybe-close-frame activate) | |
"`delete-frame-on-man-quit' is defined by an external script which | |
launches an emacs frame for a specific man page. After being launched, | |
this allows the `Man-quit' function to close the frame." | |
(if delete-frame-on-man-quit | |
(delete-frame))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MAN_PAGE=$(man -k . | cut -d\( -f1 | sed 's/\s*$//' | sort --unique | rofi -dmenu -levenshtein-sort -p "man:") | |
if [[ ! -z $MAN_PAGE ]]; then | |
emacsclient --create-frame \ | |
--eval \ | |
"(progn | |
(make-variable-frame-local 'delete-frame-on-man-quit) | |
(modify-frame-parameters (selected-frame) '((delete-frame-on-man-quit . t))) | |
(man \"$MAN_PAGE\") | |
(switch-to-buffer \"*Man $MAN_PAGE*\") | |
(delete-other-windows))" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment