GNU bug report logs - #35579
Add example of setting view-exit-action to a "function with one argument"

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 5 May 2019 12:33:03 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35579 in the body.
You can then email your comments to 35579 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Sun, 05 May 2019 12:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 May 2019 12:33:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Add example of setting view-exit-action to a "function with one
 argument"
Date: Sun, 05 May 2019 20:26:55 +0800
   view-exit-action is a variable defined in ‘view.el’.
   Its value is nil

     Automatically becomes buffer-local when set.

   Documentation:
   If non-nil, a function with one argument (a buffer) called when finished viewing.

Better add an example of how to set "a function with one argument". Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Tue, 07 May 2019 00:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 35579 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35579 <at> debbugs.gnu.org
Subject: Re: bug#35579: Add example of setting view-exit-action to a "function
 with one argument"
Date: Mon, 06 May 2019 20:37:05 -0400
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

>    view-exit-action is a variable defined in ‘view.el’.
>    Its value is nil
>
>      Automatically becomes buffer-local when set.
>
>    Documentation:
>    If non-nil, a function with one argument (a buffer) called when finished viewing.
>
> Better add an example of how to set "a function with one argument". Thanks.

I don't see why we should add an example of how to use setq or customize
in an otherwise unrelated docstring.  Or did you mean an example of how
to write a function with one argument?  I'd say that belongs in the
elisp manual.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Tue, 07 May 2019 00:50:01 GMT) Full text and rfc822 format available.

Message #11 received at 35579 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35579 <at> debbugs.gnu.org
Subject: Re: bug#35579: Add example of setting view-exit-action to a "function
 with one argument"
Date: Tue, 07 May 2019 08:49:41 +0800
I finally found an example:
(setq view-exit-action
      (lambda (buffer)
        (or (window-minibuffer-p (selected-window))
            (when (eq (window-buffer) (get-buffer "*Help*"))
              (if (one-window-p t)
                  (delete-frame)
                (delete-window))))))
So I think view-exit-action's docstring should have and example of what
they are expecting.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Tue, 07 May 2019 08:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 35579 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 Noam Postavsky <npostavs <at> gmail.com>
Cc: 35579 <at> debbugs.gnu.org
Subject: Re: bug#35579: Add example of setting view-exit-action to a "function
 with one argument"
Date: Tue, 7 May 2019 10:15:52 +0200
> I finally found an example:
> (setq view-exit-action
>        (lambda (buffer)
>          (or (window-minibuffer-p (selected-window))
>              (when (eq (window-buffer) (get-buffer "*Help*"))
>                (if (one-window-p t)
>                    (delete-frame)
>                  (delete-window))))))
> So I think view-exit-action's docstring should have and example of what
> they are expecting.

To me this example is confusing since the BUFFER argument is nowhere
used within the lambda.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Wed, 08 May 2019 06:23:01 GMT) Full text and rfc822 format available.

Message #17 received at 35579 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 35579 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#35579: Add example of setting view-exit-action to a "function
 with one argument"
Date: Wed, 08 May 2019 11:51:41 +0800
>>>>> "mr" == martin rudalics <rudalics <at> gmx.at> writes:
mr> To me this example is confusing since the BUFFER argument is nowhere
mr> used within the lambda.

That's what I'm saying: without a proper example users will only dig up
wrong examples from the net/web.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35579; Package emacs. (Mon, 14 Oct 2019 20:51:03 GMT) Full text and rfc822 format available.

Message #20 received at 35579 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 35579 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#35579: Add example of setting view-exit-action to a
 "function with one argument"
Date: Mon, 14 Oct 2019 22:50:46 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

> 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
>
>>    view-exit-action is a variable defined in ‘view.el’.
>>    Its value is nil
>>
>>      Automatically becomes buffer-local when set.
>>
>>    Documentation:
>>    If non-nil, a function with one argument (a buffer) called when finished viewing.
>>
>> Better add an example of how to set "a function with one argument". Thanks.
>
> I don't see why we should add an example of how to use setq or customize
> in an otherwise unrelated docstring.  Or did you mean an example of how
> to write a function with one argument?  I'd say that belongs in the
> elisp manual.

I agree, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 35579 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Oct 2019 20:51:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 12 Nov 2019 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.