GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    ZeStig (zstg@fedia.social)'s status on Thursday, 26-Dec-2024 17:09:03 JSTZeStigZeStig

    I'm using general.el and evil-mode in #Emacs. I'm trying to write a basic man pager.
    (defun open-man-page (program) "Open the man page for the specified PROGRAM in the terminal." (progn ;; Close any existing man page buffers (with the pattern *Man *). (dolist (buf (buffer-list)) (when (string-match-p "^\\*Man " (buffer-name buf)) ;; Match any *Man * buffer (kill-buffer buf))) ;; Open the man page without interactive prompts (man program))) (defun quit-man-page () "Quit the *Man * buffer if it exists." (interactive) (let ((man-buffer (cl-find-if (lambda (buf) (string-match-p "^\\*Man " (buffer-name buf))) ;; Match any *Man buffer (buffer-list)))) ;; Check all buffers (if man-buffer (progn ;; (kill-buffer man-buffer) ;; Kill the *Man * buffer (Man-kill) (execute-kbd-macro (kbd "C-x C-c"))) (message "No man page buffer found")))) (add-hook 'Man-mode-hook #'center-document-mode)
    This is what I have so far. I want to bind q to close the pager (i.e execute quit-man-page). No matter how I try to bind it, q is set to quit-window.

    Any ideas? How do i get this working?

    In conversationabout 5 months ago from fedia.socialpermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.