[Top][All Lists]
[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
- Replacement for `aput' from obsolete assoc.el?, Michael Heerdegen, 2012/06/04
- Re: Replacement for `aput' from obsolete assoc.el?, Christopher Schmidt, 2012/06/04
- Re: Replacement for `aput' from obsolete assoc.el?, Stefan Monnier, 2012/06/05
- Re: Replacement for `aput' from obsolete assoc.el?, Michael Heerdegen, 2012/06/05
- Re: Replacement for `aput' from obsolete assoc.el?,
Stefan Monnier <=
- Re: Replacement for `aput' from obsolete assoc.el?, Vitalie Spinu, 2012/06/08
- Re: Replacement for `aput' from obsolete assoc.el?, Stephen J. Turnbull, 2012/06/08
- Re: Replacement for `aput' from obsolete assoc.el?, Stefan Monnier, 2012/06/08
- Re: Replacement for `aput' from obsolete assoc.el?, Stephen J. Turnbull, 2012/06/09
- Re: Replacement for `aput' from obsolete assoc.el?, Andreas Schwab, 2012/06/09
- Re: Replacement for `aput' from obsolete assoc.el?, Thien-Thi Nguyen, 2012/06/09
- Re: Replacement for `aput' from obsolete assoc.el?, Stephen J. Turnbull, 2012/06/10
- RE: Replacement for `aput' from obsolete assoc.el?, Drew Adams, 2012/06/09
- RE: Replacement for `aput' from obsolete assoc.el?, Drew Adams, 2012/06/09
- Re: Replacement for `aput' from obsolete assoc.el?, Vitalie Spinu, 2012/06/09