* bug#35579: Add example of setting view-exit-action to a "function with one argument"
@ 2019-05-05 12:26 積丹尼 Dan Jacobson
2019-05-07 0:37 ` Noam Postavsky
0 siblings, 1 reply; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-05-05 12:26 UTC (permalink / raw)
To: 35579
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#35579: Add example of setting view-exit-action to a "function with one argument"
2019-05-05 12:26 bug#35579: Add example of setting view-exit-action to a "function with one argument" 積丹尼 Dan Jacobson
@ 2019-05-07 0:37 ` Noam Postavsky
2019-05-07 0:49 ` 積丹尼 Dan Jacobson
2019-10-14 20:50 ` Lars Ingebrigtsen
0 siblings, 2 replies; 6+ messages in thread
From: Noam Postavsky @ 2019-05-07 0:37 UTC (permalink / raw)
To: 積丹尼 Dan Jacobson; +Cc: 35579
積丹尼 Dan Jacobson <jidanni@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#35579: Add example of setting view-exit-action to a "function with one argument"
2019-05-07 0:37 ` Noam Postavsky
@ 2019-05-07 0:49 ` 積丹尼 Dan Jacobson
2019-05-07 8:15 ` martin rudalics
2019-10-14 20:50 ` Lars Ingebrigtsen
1 sibling, 1 reply; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-05-07 0:49 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 35579
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#35579: Add example of setting view-exit-action to a "function with one argument"
2019-05-07 0:49 ` 積丹尼 Dan Jacobson
@ 2019-05-07 8:15 ` martin rudalics
2019-05-08 3:51 ` 積丹尼 Dan Jacobson
0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2019-05-07 8:15 UTC (permalink / raw)
To: 積丹尼 Dan Jacobson, Noam Postavsky; +Cc: 35579
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#35579: Add example of setting view-exit-action to a "function with one argument"
2019-05-07 8:15 ` martin rudalics
@ 2019-05-08 3:51 ` 積丹尼 Dan Jacobson
0 siblings, 0 replies; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-05-08 3:51 UTC (permalink / raw)
To: martin rudalics; +Cc: 35579, Noam Postavsky
>>>>> "mr" == martin rudalics <rudalics@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#35579: Add example of setting view-exit-action to a "function with one argument"
2019-05-07 0:37 ` Noam Postavsky
2019-05-07 0:49 ` 積丹尼 Dan Jacobson
@ 2019-10-14 20:50 ` Lars Ingebrigtsen
1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-14 20:50 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 35579, 積丹尼 Dan Jacobson
Noam Postavsky <npostavs@gmail.com> writes:
> 積丹尼 Dan Jacobson <jidanni@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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-10-14 20:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-05 12:26 bug#35579: Add example of setting view-exit-action to a "function with one argument" 積丹尼 Dan Jacobson
2019-05-07 0:37 ` Noam Postavsky
2019-05-07 0:49 ` 積丹尼 Dan Jacobson
2019-05-07 8:15 ` martin rudalics
2019-05-08 3:51 ` 積丹尼 Dan Jacobson
2019-10-14 20:50 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.