summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-06-18 22:21:21 +0100
committerSean Whitton <spwhitton@spwhitton.name>2017-06-18 22:21:21 +0100
commitc4ec5cc0ef2f0a6cee4662d2bb5a1da85ef171b2 (patch)
treed7b8a665171de8aa4283997076e933fd65b4a4e6
parent335bf167879593d238a3ff85999d43684bb43741 (diff)
parent78b1bb3d44ca92d1b3653af3e10989a2da960792 (diff)
Updated version 1.0.5 from '1.0.5'
with Debian dir d6293975f9c09d155f8dfd701015e0005916643d
-rw-r--r--let-alist.el30
1 files changed, 21 insertions, 9 deletions
diff --git a/let-alist.el b/let-alist.el
index dbf31e0..43973c2 100644
--- a/let-alist.el
+++ b/let-alist.el
@@ -1,14 +1,17 @@
;;; let-alist.el --- Easily let-bind values of an assoc-list by their names -*- lexical-binding: t; -*-
-;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
-;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
-;; Maintainer: Artur Malabarba <bruce.connor.am@gmail.com>
-;; Version: 1.0.4
+;; Author: Artur Malabarba <emacs@endlessparentheses.com>
+;; Package-Requires: ((emacs "24.1"))
+;; Version: 1.0.5
;; Keywords: extensions lisp
;; Prefix: let-alist
;; Separator: -
+;; This is an Elpa :core package. Don't use functionality that is not
+;; compatible with Emacs 24.1.
+
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
@@ -73,6 +76,11 @@ symbol, and each cdr is the same symbol without the `.'."
;; with other results in the clause below.
(list (cons data (intern (replace-match "" nil nil name)))))))
((not (consp data)) nil)
+ ((eq (car data) 'let-alist)
+ ;; For nested ‘let-alist’ forms, ignore symbols appearing in the
+ ;; inner body because they don’t refer to the alist currently
+ ;; being processed. See Bug#24641.
+ (let-alist--deep-dot-search (cadr data)))
(t (append (let-alist--deep-dot-search (car data))
(let-alist--deep-dot-search (cdr data))))))
@@ -117,10 +125,10 @@ For instance, the following code
essentially expands to
- (let ((.title (cdr (assq 'title alist)))
- (.body (cdr (assq 'body alist)))
- (.site (cdr (assq 'site alist)))
- (.site.contents (cdr (assq 'contents (cdr (assq 'site alist))))))
+ (let ((.title (cdr (assq \\='title alist)))
+ (.body (cdr (assq \\='body alist)))
+ (.site (cdr (assq \\='site alist)))
+ (.site.contents (cdr (assq \\='contents (cdr (assq \\='site alist))))))
(if (and .title .body)
.body
.site
@@ -134,11 +142,15 @@ displayed in the example above."
(let ((var (make-symbol "alist")))
`(let ((,var ,alist))
(let ,(mapcar (lambda (x) `(,(car x) ,(let-alist--access-sexp (car x) var)))
- (delete-dups (let-alist--deep-dot-search body)))
+ (delete-dups (let-alist--deep-dot-search body)))
,@body))))
;;;; ChangeLog:
+;; 2015-12-01 Artur Malabarba <bruce.connor.am@gmail.com>
+;;
+;; packages/let-alist: Define it as a :core package
+;;
;; 2015-06-11 Artur Malabarba <bruce.connor.am@gmail.com>
;;
;; * let-alist (let-alist--deep-dot-search): Fix cons