emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacement for `aput' from obsolete assoc.el?


From: Stefan Monnier
Subject: Re: Replacement for `aput' from obsolete assoc.el?
Date: Tue, 05 Jun 2012 18:52:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>> Using side-effects on alists is often a bad idea.
> Why?  I do this very often in my .emacs.  For example:

Because a lot of code assumes alists are used in a "pure" way.

> --8<---------------cut here---------------start------------->8---
> (aput 'find-constituents 'readable (list 0))
> (eval-after-load "linkd"
>   '(aput 'minor-mode-alist 'linkd-mode '(" Ld")))
> (aput 'default-frame-alist 'width 104)
> (aput 'warning-suppress-types 'undo '(discard-info))
> (aput 'auto-mode-alist "\\.v?dired\\'" 'dired-virtual-mode)
> (aput 'org-show-siblings 'org-goto t)
> (aput 'w3m-search-engine-alist
>           "duckduckgo" '("http://duckduckgo.com/?q=%s";))
> --8<---------------cut here---------------end--------------->8---

> Is it a bad idea in these cases?

AFAICT, (push (cons key val) foo) would work just as well in those cases.

> Will it be ok to require cl-lib at run-time in third-party packages?

Requiring `cl' has been allowed for ever in third party packages (as if
we could disallow it, anyway).
What is new is that require `cl-lib' is OK in non-third-party packages.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]