unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* remove-hook creates a symbol if it doesn't exist
@ 2008-10-21 18:26 Seb
  2008-10-21 22:13 ` Stefan Monnier
  2008-10-22  2:48 ` Kevin Rodgers
  0 siblings, 2 replies; 5+ messages in thread
From: Seb @ 2008-10-21 18:26 UTC (permalink / raw)
  To: emacs-devel

Hi,

The function remove-hook creates a symbol if its HOOK arg doesn't exist
as such:

(remove-hook 'non-existent-hook 'some-function)


,-----[ C-h v non-existent-hook RET ]
| non-existent-hook's value is nil
| 
| Documentation:
| Not documented as a variable.
| 
| [back]
`-----


Cheers,

-- 
Seb





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

* Re: remove-hook creates a symbol if it doesn't exist
  2008-10-21 18:26 remove-hook creates a symbol if it doesn't exist Seb
@ 2008-10-21 22:13 ` Stefan Monnier
  2008-10-22  2:48 ` Kevin Rodgers
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2008-10-21 22:13 UTC (permalink / raw)
  To: Seb; +Cc: emacs-devel

> The function remove-hook creates a symbol if its HOOK arg doesn't exist
> as such:

> (remove-hook 'non-existent-hook 'some-function)


> ,-----[ C-h v non-existent-hook RET ]
> | non-existent-hook's value is nil
> | 
> | Documentation:
> | Not documented as a variable.
> | 
> | [back]
> `-----

Indeed.  Any other piece of trivia you want to share with us?


        Stefan


PS: I don't consider the above as a bug.




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

* Re: remove-hook creates a symbol if it doesn't exist
  2008-10-21 18:26 remove-hook creates a symbol if it doesn't exist Seb
  2008-10-21 22:13 ` Stefan Monnier
@ 2008-10-22  2:48 ` Kevin Rodgers
  2008-10-22  2:54   ` Drew Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2008-10-22  2:48 UTC (permalink / raw)
  To: emacs-devel

Seb wrote:
> Hi,
> 
> The function remove-hook creates a symbol if its HOOK arg doesn't exist
> as such:
> 
> (remove-hook 'non-existent-hook 'some-function)
> 
> 
> ,-----[ C-h v non-existent-hook RET ]
> | non-existent-hook's value is nil
> | 
> | Documentation:
> | Not documented as a variable.
> | 
> | [back]
> `-----

Actually, the read function interned the symbol.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* RE: remove-hook creates a symbol if it doesn't exist
  2008-10-22  2:48 ` Kevin Rodgers
@ 2008-10-22  2:54   ` Drew Adams
  2008-10-24  3:12     ` Kevin Rodgers
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2008-10-22  2:54 UTC (permalink / raw)
  To: 'Kevin Rodgers', emacs-devel

> > The function remove-hook creates a symbol if its HOOK arg 
> > doesn't exist as such:
> > 
> > (remove-hook 'non-existent-hook 'some-function)
> > 
> > ,-----[ C-h v non-existent-hook RET ]
> > | non-existent-hook's value is nil
> > | 
> > | Documentation:
> > | Not documented as a variable.
> > | 
> > | [back]
> > `-----
> 
> Actually, the read function interned the symbol.

`read', on its own, doesn't assign a value. It interns a name, creating a
symbol, but it doesn't give it a nil value.





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

* Re: remove-hook creates a symbol if it doesn't exist
  2008-10-22  2:54   ` Drew Adams
@ 2008-10-24  3:12     ` Kevin Rodgers
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2008-10-24  3:12 UTC (permalink / raw)
  To: emacs-devel

Drew Adams wrote:
>>> The function remove-hook creates a symbol if its HOOK arg 
>>> doesn't exist as such:
>>>
>>> (remove-hook 'non-existent-hook 'some-function)
>>>
>>> ,-----[ C-h v non-existent-hook RET ]
>>> | non-existent-hook's value is nil
>>> | 
>>> | Documentation:
>>> | Not documented as a variable.
>>> | 
>>> | [back]
>>> `-----
>> Actually, the read function interned the symbol.
> 
> `read', on its own, doesn't assign a value. It interns a name, creating a
> symbol, but it doesn't give it a nil value.

Good point.  So I tried to replicate the OP's error in Emacs 22.3, but:

emacs -Q --eval "(progn (remove-hook 'non-existent-hook 'some-function) 
non-existant-hook)"

results in this error:

Symbol's value as variable is void: non-existant-hook

And:

emacs -Q --eval "(progn (remove-hook 'non-existent-hook 'some-function) 
(describe-variable 'non-existant-hook))"

results in this *Help* buffer:

non-existant-hook is void as a variable.


Documentation:
Not documented as a variable.


-- 
Kevin Rodgers
Denver, Colorado, USA





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

end of thread, other threads:[~2008-10-24  3:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21 18:26 remove-hook creates a symbol if it doesn't exist Seb
2008-10-21 22:13 ` Stefan Monnier
2008-10-22  2:48 ` Kevin Rodgers
2008-10-22  2:54   ` Drew Adams
2008-10-24  3:12     ` Kevin Rodgers

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).