From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Johansson Newsgroups: gmane.emacs.devel Subject: Is there a reason why abbrev-table properties are not saved in file Date: Tue, 26 Jun 2018 15:51:32 +0200 Message-ID: <87sh597j17.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530022543 9100 195.159.176.226 (26 Jun 2018 14:15:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2018 14:15:43 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 26 16:15:39 2018 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 1fXokp-0002DU-HX for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 16:15:35 +0200 Original-Received: from localhost ([::1]:52989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXomv-0006wN-0o for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 10:17:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXoNt-0004vo-JA for emacs-devel@gnu.org; Tue, 26 Jun 2018 09:51:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXoNo-0006w8-RR for emacs-devel@gnu.org; Tue, 26 Jun 2018 09:51:53 -0400 Original-Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:42085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXoNo-0006uF-KP for emacs-devel@gnu.org; Tue, 26 Jun 2018 09:51:48 -0400 Original-Received: by mail-lf0-x22f.google.com with SMTP id u202-v6so5286685lff.9 for ; Tue, 26 Jun 2018 06:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UFdab96hieykXVB8SvsbhL25QoCAW+PbrUnc4hfEjog=; b=IHke21qNuTAQNvjZRo+P2/OY+ogJifuP53HKpE6gYo5LYlHawuOJWE1cZpSooFeQ3J E9Pr2o79+IL94pCnqlwjFyUCl/KaQTSFAodKKThvT7RzSo+hd+BuY/kgkE9Gsu9Pvimv MD/2Ftixa2LLtQksUzEOH4bGoylSBfnum1lAbQUb7p/yiT+JlrRxXkp/l0LEA3DqqJj6 xxizufKIZhgzpRclB8H6DH69n3Tq/cDKWERLii2G6JoFHVGRcZlZZQx0jdWa/s0L74QD 6IHReRxSJtNuHK+oDEFxCmcLeVBPocAGiYchv7PSx/Xy9bQ4tLmEOg+sAfoGbY2xxIfn coag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=UFdab96hieykXVB8SvsbhL25QoCAW+PbrUnc4hfEjog=; b=SJgPJVcBD4zLhjQf1rBMfvW4zPiLWu6sRxlJJx7muFeAFKFi+xQg7maG8E3MgCCJmB Kf3rstoYH1UJnRLmARfya5KcqH/OrU4umBweo8TGCHf0qQp7NHqYEZqBiHxthbW7Lil6 2CfuarPKsrxJXqGQqfL05dnSqGy0qfIYtW+Gw5CzebEvjkMWOaKo4CoTYkMZNYfcAs1/ goPipYULma5Fw0vaPSOJZSuvJgYyyGSG5gBES8POxNbI9uD/yLgdZrCbauki1r6xMlTf 2r4jw0XokOT+PaW86UBu2U/aXaoGvDN3gwvQoAg5UkR+HCW19MDSCsxDqwd5e+70z38t Djqg== X-Gm-Message-State: APt69E3alQC1f7m+whh0Fkhgt/CDXfKvMPwXmttQ4nWxAHPqVY4iWGPM R/miNgYSp96R/PRLZWIz9HhdZg== X-Google-Smtp-Source: AAOMgpe3MU8ggv9d1rwNwCIxexr/Or1ZkBFKYq82NjuFK6x+OR760cgDmnjaSJTWUKl6tMt9dOx/5w== X-Received: by 2002:a19:7d84:: with SMTP id y126-v6mr1343482lfc.94.1530021106529; Tue, 26 Jun 2018 06:51:46 -0700 (PDT) Original-Received: from ajjb (h-158-174-22-36.NA.cust.bahnhof.se. [158.174.22.36]) by smtp.gmail.com with ESMTPSA id i21-v6sm360552lfb.52.2018.06.26.06.51.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 06:51:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22f X-Mailman-Approved-At: Tue, 26 Jun 2018 10:16:51 -0400 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:226737 Archived-At: Hi, I recently wrote up some code for using different abbrev-tables=20 for different languages. It boils down to two custom abbrev-tables in my abbrev file and=20 using some functions to determine if a language is active=20 (essentially checking ispell-local-dictionary) as enable-functions=20 for these tables. However, this means I have to put properties on the tables every=20 time I load the abbrev file: (with-eval-after-load abbrev-file-name (abbrev-table-put aj/english-abbrevs :enable-function=20 #'aj/writing-english-p) (abbrev-table-put aj/swedish-abbrevs :enable-function=20 #'aj/writing-swedish-p) (abbrev-table-put text-mode-abbrev-table :parents (list aj/english-abbrevs=20 aj/swedish-abbrevs))) I initially did try to store these properties in the abbrev file,=20 but that was overwritten whenever abbrevs were edited and saved. Apparently write-abbrev-file doesn=E2=80=99t include properties for=20 neither abbrev-tables nor individual abbrevs. With my quick check through abbrev.el it appears that this could=20 be easily added at the end of insert-abbrev-table-description and=20 for individual symbols. Since both define-abbrev and define-abbrev-table supports adding=20 properties as &rest arguments this shouldn=E2=80=99t be so complicated. I guess this would involve filtering out the relevant properties=20 to store from what is returned by symbol-plist. But perhaps there is a good reason for the present state that I=20 missed? By the way, the last form in my code above would have to remain,=20 as the :parent property has to be a list of abbrev-tables (which=20 are themselves loaded from the file) and not only their names. --=20 Anders Johansson