Function: edt-electric-helpify

edt-electric-helpify is a byte-compiled function defined in edt.el.gz.

Signature

(edt-electric-helpify FUN)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/edt.el.gz
(defun edt-electric-helpify (fun)
  (let ((name "*Help*"))
    (if (save-window-excursion
          (let* ((p (symbol-function 'help-print-return-message))
                 (b (get-buffer name))
                 (m (buffer-modified-p b)))
            (and b (not (get-buffer-window b))
                 (setq b nil))
            (unwind-protect
                (progn
                  (message "%s..." (capitalize (symbol-name fun)))
                  (and b
                       (with-current-buffer b
                         (set-buffer-modified-p t)))
                  (fset 'help-print-return-message #'ignore)
                  (call-interactively fun)
                  (and (get-buffer name)
                       (get-buffer-window (get-buffer name))
                       (or (not b)
                           (not (eq b (get-buffer name)))
                           (not (buffer-modified-p b)))))
              (fset 'help-print-return-message p)
              (and b (buffer-name b)
                   (with-current-buffer b
                     (set-buffer-modified-p m))))))
        (with-electric-help 'delete-other-windows name t))))