unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Unnecessary variable shr-start
@ 2016-12-02 18:35 Hong Xu
  2016-12-02 22:26 ` Michael Heerdegen
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2016-12-02 18:35 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]


In the current master branch, it seems that the variable shr-start has
never been used in any sensible way: Every time its value is referred,
it is bound to nil. Should it be considered to be removed?

Hong

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-02 18:35 Unnecessary variable shr-start Hong Xu
@ 2016-12-02 22:26 ` Michael Heerdegen
  2016-12-03  6:54   ` Matthew Carter
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2016-12-02 22:26 UTC (permalink / raw)
  To: Hong Xu; +Cc: emacs-devel

Hong Xu <hong@topbug.net> writes:

> In the current master branch, it seems that the variable shr-start has
> never been used in any sensible way: Every time its value is referred,
> it is bound to nil. Should it be considered to be removed?

Are you sure it is always bound to nil when referenced in `shr-tag-a'?
I would expect it can be changed by side effect in the body, and the
let-binding is there to make that change temporary.


Michael.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-02 22:26 ` Michael Heerdegen
@ 2016-12-03  6:54   ` Matthew Carter
  2016-12-04 20:01     ` Hong Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Carter @ 2016-12-03  6:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel, Hong Xu

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hong Xu <hong@topbug.net> writes:
>
>> In the current master branch, it seems that the variable shr-start has
>> never been used in any sensible way: Every time its value is referred,
>> it is bound to nil. Should it be considered to be removed?
>
> Are you sure it is always bound to nil when referenced in `shr-tag-a'?
> I would expect it can be changed by side effect in the body, and the
> let-binding is there to make that change temporary.
>
>
> Michael.
>

It looks like it's bound at the top defvar level (and changed via setq
in the img function), so those let's to nil in certain functions are
likely to inhibit the current setting when those functions begin to
run.

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-03  6:54   ` Matthew Carter
@ 2016-12-04 20:01     ` Hong Xu
  2016-12-05  8:25       ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2016-12-04 20:01 UTC (permalink / raw)
  To: Matthew Carter; +Cc: Michael Heerdegen, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]


On 2016-12-02 Fri 22:54 GMT-0800, Matthew Carter <m@ahungry.com> wrote:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> Hong Xu <hong@topbug.net> writes:
>>
>>> In the current master branch, it seems that the variable shr-start has
>>> never been used in any sensible way: Every time its value is referred,
>>> it is bound to nil. Should it be considered to be removed?
>>
>> Are you sure it is always bound to nil when referenced in `shr-tag-a'?
>> I would expect it can be changed by side effect in the body, and the
>> let-binding is there to make that change temporary.
>>
>>
>> Michael.
>>
>
> It looks like it's bound at the top defvar level (and changed via setq
> in the img function), so those let's to nil in certain functions are
> likely to inhibit the current setting when those functions begin to
> run.

That's exactly what I meant: Every time it is referred, it is bound to
nil by a let.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-04 20:01     ` Hong Xu
@ 2016-12-05  8:25       ` Katsumi Yamaoka
  2016-12-05  8:32         ` Hong Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2016-12-05  8:25 UTC (permalink / raw)
  To: Hong Xu; +Cc: Michael Heerdegen, Matthew Carter, emacs-devel

On Sun, 04 Dec 2016 12:01:57 -0800, Hong Xu wrote:
> That's exactly what I meant: Every time it is referred, it is bound to
> nil by a let.

`shr-tag-a' binds `shr-start' to nil, runs `shr-generic' that
sets non-nil value to `shr-start' in the following way, and
refers to `shr-start'.

`shr-generic' runs `shr-descend'
`shr-descend' runs `shr-tag-img'
`shr-tag-img' sets non-nil value to `shr-start'

;-)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-05  8:25       ` Katsumi Yamaoka
@ 2016-12-05  8:32         ` Hong Xu
  2016-12-05 12:11           ` Tino Calancha
  0 siblings, 1 reply; 7+ messages in thread
From: Hong Xu @ 2016-12-05  8:32 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Michael Heerdegen, Matthew Carter, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]


On 2016-12-05 Mon 00:25 GMT-0800, Katsumi Yamaoka <yamaoka@jpl.org> wrote:

> On Sun, 04 Dec 2016 12:01:57 -0800, Hong Xu wrote:
>> That's exactly what I meant: Every time it is referred, it is bound to
>> nil by a let.
>
> `shr-tag-a' binds `shr-start' to nil, runs `shr-generic' that
> sets non-nil value to `shr-start' in the following way, and
> refers to `shr-start'.
>
> `shr-generic' runs `shr-descend'
> `shr-descend' runs `shr-tag-img'
> `shr-tag-img' sets non-nil value to `shr-start'
>
> ;-)

Such a complicated story! Thank you for pointing it out!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unnecessary variable shr-start
  2016-12-05  8:32         ` Hong Xu
@ 2016-12-05 12:11           ` Tino Calancha
  0 siblings, 0 replies; 7+ messages in thread
From: Tino Calancha @ 2016-12-05 12:11 UTC (permalink / raw)
  To: Hong Xu; +Cc: Michael Heerdegen, Katsumi Yamaoka, Matthew Carter, emacs-devel



On Mon, 5 Dec 2016, Hong Xu wrote:

>
> On 2016-12-05 Mon 00:25 GMT-0800, Katsumi Yamaoka <yamaoka@jpl.org> wrote:
>
>> On Sun, 04 Dec 2016 12:01:57 -0800, Hong Xu wrote:
>>> That's exactly what I meant: Every time it is referred, it is bound to
>>> nil by a let.
>>
>> `shr-tag-a' binds `shr-start' to nil, runs `shr-generic' that
>> sets non-nil value to `shr-start' in the following way, and
>> refers to `shr-start'.
>>
>> `shr-generic' runs `shr-descend'
>> `shr-descend' runs `shr-tag-img'
>> `shr-tag-img' sets non-nil value to `shr-start'
>>
>> ;-)
>
> Such a complicated story! Thank you for pointing it out!
Yeah! It sounds amazing.  We should call it `shr-super-start'.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-05 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 18:35 Unnecessary variable shr-start Hong Xu
2016-12-02 22:26 ` Michael Heerdegen
2016-12-03  6:54   ` Matthew Carter
2016-12-04 20:01     ` Hong Xu
2016-12-05  8:25       ` Katsumi Yamaoka
2016-12-05  8:32         ` Hong Xu
2016-12-05 12:11           ` Tino Calancha

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).