Setting function for using Emacs as manpager.

This commit is contained in:
Derek Taylor
2024-04-17 13:29:27 -05:00
parent 13fa9033e3
commit c818dc7716
3 changed files with 11 additions and 2 deletions

View File

@@ -152,7 +152,8 @@ IFS=$SAVEIFS
# Function for using Emacs as our manpage reader. # Function for using Emacs as our manpage reader.
# Use :q to quit out of Emacs and return to the shell. # Use :q to quit out of Emacs and return to the shell.
macsman() { macsman() {
emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$1\") (define-key Man-mode-map \"q\" 'save-buffers-kill-emacs))" # emacsclient -nw -e "(man \"$1\")"
emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$1\"))"
} }
# navigation # navigation

View File

@@ -136,6 +136,13 @@ function org-search -d "send a search string to org-mode"
printf $output printf $output
end end
# Function for using Emacs as our manpage reader.
# Use :q to quit out of Emacs and return to the shell.
function macsman
# emacsclient -nw -e "(man \"$argv\")"
emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$argv\"))"
end
### END OF FUNCTIONS ### ### END OF FUNCTIONS ###

3
.zshrc
View File

@@ -133,7 +133,8 @@ IFS=$SAVEIFS
# Function for using Emacs as our manpage reader. # Function for using Emacs as our manpage reader.
# Use :q to quit out of Emacs and return to the shell. # Use :q to quit out of Emacs and return to the shell.
macsman() { macsman() {
emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$1\") (define-key Man-mode-map \"q\" 'save-buffers-kill-emacs))" # emacsclient -nw -e "(man \"$1\")"
emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$1\"))"
} }
# navigation # navigation