emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introduce eldoc support in minibuffer


From: Thierry Volpiatto
Subject: Re: Introduce eldoc support in minibuffer
Date: Sun, 03 Jul 2011 08:03:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> It's not hard to do, just create a help function for isearch and bind it
> in isearch map.
This is the code of anything.el adapted for isearch:

#+BEGIN_SRC lisp
(defun isearch-help-internal (bufname insert-content-fn)
  (save-window-excursion
    (switch-to-buffer (get-buffer-create bufname))
    (delete-other-windows)
    (erase-buffer)
    (funcall insert-content-fn)
    (setq mode-line-format "%b (SPC,C-v:NextPage  b,M-v:PrevPage  other:Exit)")
    (setq cursor-type nil)
    (goto-char 1)
    (isearch-help-event-loop)))

(defun isearch-help-event-loop ()
  (ignore-errors
    (catch 'exit-isearch-help
      (loop for event = (read-key) do
           (case event
             ((?\C-v ? )  (scroll-up))
             ((?\M-v ?b) (scroll-down))
             (t (throw 'exit-isearch-help (isearch-update))))))))

(defun isearch-help ()
  (interactive)
  (isearch-help-internal
   " *Isearch Help*"
   (lambda ()
     (insert (substitute-command-keys isearch-help-message)))))

(defvar isearch-help-message "\\{isearch-mode-map}")
(define-key isearch-mode-map (kbd "C-?") 'isearch-help)


#+END_SRC

Improve isearch-help-message as needed, and provide a minimal help in
mode-line:

C-?: Help, C-s: Do_this, C-r: Do_that etc...
 
-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]