From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Updating defcustoms of a loaded library Date: Fri, 21 Jul 2017 19:25:58 +0200 Message-ID: <87shhpsnvd.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500658005 14434 195.159.176.226 (21 Jul 2017 17:26:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2017 17:26:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 21 19:26:40 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYbhH-0003P8-K8 for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2017 19:26:39 +0200 Original-Received: from localhost ([::1]:44190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYbhN-0005nd-CV for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2017 13:26:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYbgl-0005nV-4z for emacs-devel@gnu.org; Fri, 21 Jul 2017 13:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYbgg-0000Bx-1Y for emacs-devel@gnu.org; Fri, 21 Jul 2017 13:26:07 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:49735) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYbgf-0000Ak-Nv for emacs-devel@gnu.org; Fri, 21 Jul 2017 13:26:01 -0400 Original-Received: from rosalinde ([83.135.9.167]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lxu7U-1deGZ836Oa-015GoT for ; Fri, 21 Jul 2017 19:25:58 +0200 X-Provags-ID: V03:K0:vIf5HwyPxLpAcPCcyfI9NxUNqVtwu+osIqVzxOvBJW8WpaxVgNK oVFCq9YqOXl6IctTThvi9DAIFYQZ5ADiywaORw82+dKPrP0vCGmJ2AycI4GDz1h/sF4rroi d/1uoi13Gb1miIjaxM43xo3Z895feiRtNz/VPbbFTPXYubcbAR8wEDRyJdqsr/QAVt2T1p4 FnJyR0s8LMjInHSPuDWnA== X-UI-Out-Filterresults: notjunk:1;V01:K0:g1Z9gSubMl4=:Vvnaxq8o4VRR1RbjiMzSuX +mtsNRzqKzDist/2sm9dI8/t/0n65UnQIzFsO+9QJnwfSV0M8tPRBE9AlvSF1k4w797mm8Dbp rf6a3qLxWJhfgQdoqwKkRLtx5TcOizAqgq85bsnuOEYBkIF8r+2kSuBdsbKU54sibZH/1+uJ0 WPIDvc1u6ZSERjkyTxkc5zmhE/V+ZAnMiladVAel2huuO6Qwfqv16u+eVn1xLWNkBXnCna2kD V12g+YOo7mye1NJ2ItCcks/4g5czwVzxG20aRyEpf3cM6M+GOX9CMxd0vNFKlSVbPbOAS92y+ dxd8afoDc5M+udzwlkrXRz/UzSiZY/0SEMEFBzNt+0MycDWUeB+iXELjBo2QXECzNbmgJi674 bUJZt/PkLMbCj4pHY/0an19RnndRhjUBWNvgvFN0qGyMa4ufGNcC8Z9kXUpGvmIvV6QvRVdpy pDtT7S9y4pYILP/adIXNIa15vUFhD2B/c8we1ht8HFx/8x3pDXLiKzbBvrLXQ6ojOd1X0X9rl F4PUb6cYTaD093nTFHMNVtELZwgIGy5YzubhOW67BpwlDUz6Lylx9y2MG5lxQGHxRiyCwZip1 OkSeeiixefpzfkSXobZWJKepdpJe6TxK0lLk3YYA6HqFS2hTltehKk++CdSP+RsxURkV4//Ix HyDmYdpXXbMJh/PDPPiAYZHvrANIzW//xroc6RRwcDNmVVfIDk1ygZ3+JOpiVXe/kJPE3DAFe H7yJtibdimn0KyrMeqAdtb5LCVTqj46NEwmWQrM2hZo/cFlX/81qo1n3Z9LxfdZeRjez98j9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216921 Archived-At: In todo-mode.el there are several defcustoms whose value can be one or more of the files operated on by todo-mode. These operations include adding new file and deleting existing files, which hence can change the possible customizable values. In order to update the defcustoms while using todo-mode, I defined several functions, which are called after adding or deleting a todo file, that simple call `eval' on the defcustom forms, e.g.: (defun todo-reevaluate-filter-files-defcustom () "Reevaluate defcustom of `todo-filter-files'. Called after adding or deleting a todo file." (eval (defcustom todo-filter-files nil "List of files for multifile item filtering." :type `(set ,@(todo--files-type-list)) :group 'todo))) An insightful reviewer of the code had this to say about these functions: ;; FIXME: This is hideous! I don't know enough about Custom to ;; offer something better, but please ask on emacs-devel! So I'm asking, is there a better way? Steve Berman