0

I am using emacs to read man pages.

macsman() {
    emacsclient -nw -e "(let ((Man-notify-method 'bully)) (man \"$1\"))"
}
alias man=macsman

(define-key Man-mode-map "q" 'save-buffers-kill-emacs)

While man buffer is opened, when I press q it usually exits.

It is bound to If the current frame has no client, kill Emacs itself using ‘save-buffers-kill-emacs’.

After running ex: man ls and pressing "q" in order to exit and get back to my shell, I find myself in *Messages* buffer, than pressing q again opens the man page again, and finally pressing q exits emacs. What may be the reason of this?

Would it be possible to exit right away by preventing opening *Messages* buffer?

alper
  • 1,238
  • 11
  • 30

1 Answers1

1

If you're just popping in and out for the man page, you don't need the save-buffers-kill-emacs because there are no buffers to save. Just unconditionally kill Emacs.

Command: kill-emacs &optional exit-data

This command calls the hook kill-emacs-hook, then exits the Emacs 
process and kills it.

If exit-data is an integer, that is used as the exit status of the       
Emacs process. (This is useful primarily in batch operation; see Batch   
Mode.)

If exit-data is a string, its contents are stuffed into the terminal 
input buffer so that the shell (or whatever program next reads input)  
can read them.

If exit-data is neither an integer nor a string, or is omitted, that 
means to use the (system-specific) exit status which indicates 
successful program termination. 
naugiedoggie
  • 334
  • 1
  • 8