Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#12096: 24.1; Several documented functions in URL package are not defined

0 views
Skip to first unread message

Bastien

unread,
Aug 1, 2012, 9:35:36 AM8/1/12
to Aurélien Aptel, 12...@debbugs.gnu.org
Aur�lien Aptel <aurelie...@gmail.com> writes:

> From the info page:
>> The library functions typically operate on "parsed" versions of URLs.
>> These are actually vectors of the form:
>>
>> [TYPE USER PASSWORD HOST PORT FILE TARGET ATTRIBUTES FULL]
>>
> ...
>> These attributes have accessors named `url-PART', where PART is the
>> name of one of the elements above, e.g., `url-host'. Similarly, there
>> are setters of the form `url-set-PART'.
>
> There are some exceptions which are not documented:
>
> `url-file' is not the FILE attribute accessor. The accessor is actually
> `url-filename'.
>
> `url-full' is actually `url-fullness'.
>
> And most importantly none of the setters are defined, as this little
> snippet shows:
>
> (let (funlist)
> (require 'url)
> (require 'url-parse)
> (mapatoms (lambda (a)
> (when (and (fboundp a)
> (string-match "^url-set-" (symbol-name a)))
> (push a funlist))))
> funlist)
> ;; => (url-set-mime-charset-string)

Can you submit a patch for this?

Thanks,

--
Bastien



Stefan Monnier

unread,
Aug 4, 2012, 3:44:37 AM8/4/12
to Aurélien Aptel, Bastien, 12...@debbugs.gnu.org
> I've updated the doc (update-doc.diff) and removed a useless
> constructor in url-parse.el (url-parse-cleanup.diff).
[...]
> (cl-defstruct (url
> - (:constructor nil)
> (:constructor url-parse-make-urlobj
> (&optional type user password host portspec filename
> target attributes fullness))

This does not remove a useless constructor, but instead adds a useless
contructor (the ":constructor nil" thingy is there to disable the
automatic creation of a default constructor).


Stefan



Aurélien Aptel

unread,
Aug 4, 2012, 4:34:21 PM8/4/12
to Stefan Monnier, Bastien, 12...@debbugs.gnu.org
On Sat, Aug 4, 2012 at 9:44 AM, Stefan Monnier <mon...@iro.umontreal.ca> wrote:
> This does not remove a useless constructor, but instead adds a useless
> contructor (the ":constructor nil" thingy is there to disable the
> automatic creation of a default constructor).

Are you sure?

(progn
(require 'cl)
(fmakunbound 'make-foo)
(fmakunbound 'cake)
(defstruct (foo (:constructor cake)) a b c)
(mapcar 'fboundp '(make-foo cake)))

=> (nil t)



Stefan Monnier

unread,
Aug 6, 2012, 5:43:27 PM8/6/12
to Aurélien Aptel, Bastien, 12...@debbugs.gnu.org
>> This does not remove a useless constructor, but instead adds a useless
>> contructor (the ":constructor nil" thingy is there to disable the
>> automatic creation of a default constructor).

> Are you sure?

Yes. Try it.

> (progn
> (require 'cl)
> (fmakunbound 'make-foo)
> (fmakunbound 'cake)
> (defstruct (foo (:constructor cake)) a b c)
> (mapcar 'fboundp '(make-foo cake)))

There's a difference between (:constructor cake) and (:constructor cake
(foo bar)) where the first just gives the name to use for the default
constructor, whereas the second defines an additional constructor.


Stefan



Stefan Monnier

unread,
Aug 6, 2012, 5:52:40 PM8/6/12
to Aurélien Aptel, Bastien, 12096...@debbugs.gnu.org
> I've updated the doc (update-doc.diff) and removed a useless
> constructor in url-parse.el (url-parse-cleanup.diff).

Thanks, I installed your patch to url.texi.

> Btw, I've made my change (and commited them) to my local copy of the
> bazaar repo. I'm just sending you the diff of the changes. Is there a
> better way to do this?

That's the right way to do it, merci.

> A way to send commits, maybe?

We can give you write access.


Stefan



0 new messages