bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#702: with-help-window returns nil


From: martin rudalics
Subject: bug#702: with-help-window returns nil
Date: Wed, 13 Aug 2008 07:52:14 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

> with-help-window returns nil, rather than the last value of BODY.
> This causes, eg, describe-function to return nil, rather than the
> description.

Do I get away with the attached patch?

martin
*** help.el.~1.341.~    2008-06-06 22:02:42.000000000 +0200
--- help.el     2008-08-13 07:45:02.796875000 +0200
***************
*** 1207,1213 ****
  (defmacro with-help-window (buffer-name &rest body)
    "Display buffer BUFFER-NAME in a help window evaluating BODY.
  Select help window if the actual value of the user option
! `help-window-select' says so."
    (declare (indent 1) (debug t))
    ;; Bind list-of-frames to `frame-list' and list-of-window-tuples to a
    ;; list of one <window window-buffer window-start window-point> tuple
--- 1207,1213 ----
  (defmacro with-help-window (buffer-name &rest body)
    "Display buffer BUFFER-NAME in a help window evaluating BODY.
  Select help window if the actual value of the user option
! `help-window-select' says so.  Return last value in BODY."
    (declare (indent 1) (debug t))
    ;; Bind list-of-frames to `frame-list' and list-of-window-tuples to a
    ;; list of one <window window-buffer window-start window-point> tuple
***************
*** 1221,1244 ****
                           (window-start window) (window-point window))
                     list))
             'no-mini t)
!           list)))
!      ;; We set `help-window' to t in order to trigger `help-mode-finish'
!      ;; to set `help-window' to the actual help window.
       (setq help-window t)
       ;; Make `help-window-point-marker' point nowhere (the only place
       ;; where this should be set to a buffer position is within BODY).
       (set-marker help-window-point-marker nil)
! 
!      (with-output-to-temp-buffer ,buffer-name
!        (progn ,@body))
! 
       (when (windowp help-window)
         ;; Set up help window.
         (help-window-setup list-of-frames list-of-window-tuples))
- 
       ;; Reset `help-window' to nil to avoid confusing future calls of
!      ;; `help-mode-finish' by "plain" `with-output-to-temp-buffer'.
!      (setq help-window nil)))
  
  (provide 'help)
  
--- 1221,1246 ----
                           (window-start window) (window-point window))
                     list))
             'no-mini t)
!           list))
!        value)
!      ;; Setting `help-window' to t shall trigger `help-mode-finish' to
!      ;; set `help-window' to the actual help window.
       (setq help-window t)
       ;; Make `help-window-point-marker' point nowhere (the only place
       ;; where this should be set to a buffer position is within BODY).
       (set-marker help-window-point-marker nil)
!      ;; Save value returned by `with-output-to-temp-buffer'.
!      (setq value
!          (with-output-to-temp-buffer ,buffer-name
!            (progn ,@body)))
       (when (windowp help-window)
         ;; Set up help window.
         (help-window-setup list-of-frames list-of-window-tuples))
       ;; Reset `help-window' to nil to avoid confusing future calls of
!      ;; `help-mode-finish' with "plain" `with-output-to-temp-buffer'.
!      (setq help-window nil)
!      ;; Return value returned by `with-output-to-temp-buffer'.
!      value))
  
  (provide 'help)
  

reply via email to

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