From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3C86C158094 for ; Wed, 17 Aug 2022 00:31:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5F439E09B4; Wed, 17 Aug 2022 00:31:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 40183E09B4 for ; Wed, 17 Aug 2022 00:31:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 13B56341378 for ; Wed, 17 Aug 2022 00:31:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7A497571 for ; Wed, 17 Aug 2022 00:31:43 +0000 (UTC) From: "Maciej Barć" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Maciej Barć" Message-ID: <1660696260.04dc62243b36c185e426df1eb80eadcbb482afb0.xgqt@gentoo> Subject: [gentoo-commits] proj/company-ebuild:master commit in: / X-VCS-Repository: proj/company-ebuild X-VCS-Files: company-ebuild.el X-VCS-Directories: / X-VCS-Committer: xgqt X-VCS-Committer-Name: Maciej Barć X-VCS-Revision: 04dc62243b36c185e426df1eb80eadcbb482afb0 X-VCS-Branch: master Date: Wed, 17 Aug 2022 00:31:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3d7a983a-5599-4ffe-b18f-f087ed3a6828 X-Archives-Hash: e6c96a57d5ecf2341ce8cdde8bd71166 commit: 04dc62243b36c185e426df1eb80eadcbb482afb0 Author: Maciej Barć gentoo org> AuthorDate: Wed Aug 17 00:31:00 2022 +0000 Commit: Maciej Barć gentoo org> CommitDate: Wed Aug 17 00:31:00 2022 +0000 URL: https://gitweb.gentoo.org/proj/company-ebuild.git/commit/?id=04dc6224 company-ebuild.el: change character syntax-table temporarily Signed-off-by: Maciej Barć gentoo.org> company-ebuild.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/company-ebuild.el b/company-ebuild.el index ef4096b..b50900a 100644 --- a/company-ebuild.el +++ b/company-ebuild.el @@ -218,6 +218,14 @@ FILE-PATH is the location from which we start searching for Eclass files." (company-ebuild--regenerate-dynamic-keywords-packages) (company-ebuild--regenerate-dynamic-keywords-licenses)) +(defun company-ebuild--grab-symbol () + "Workaround wrapper for `company-grab-symbol'." + ;; TODO: (Hard mode) write a proper `company-grab-symbol' replacement. + (with-syntax-table (copy-syntax-table (syntax-table)) + (modify-syntax-entry ?/ "w") + (modify-syntax-entry ?@ "w") ; To make Eclass tags work. + (company-grab-symbol))) + ;;;###autoload (defun company-ebuild (command &optional arg &rest ignored) @@ -242,7 +250,7 @@ ARG is the completion argument for annotation and candidates." (kind (cdr (company-ebuild--annotation-and-kind arg))) (prefix - (and (eq major-mode 'ebuild-mode) (company-grab-symbol))) + (and (eq major-mode 'ebuild-mode) (company-ebuild--grab-symbol))) (require-match nil))) @@ -255,10 +263,6 @@ in your config: \(add-hook 'ebuild-mode-hook 'company-ebuild-setup) or `require' Company-Ebuild: \(require 'company-ebuild)" - ;; HACK: Modify syntax to treat "/" as a word constituent. - ;; TODO: (Hard mode) write a proper `company-grab-symbol' replacement. - (modify-syntax-entry ?/ "w") - (modify-syntax-entry ?@ "w") ; To make Eclass tags work. ;; Force-enable `company-mode'. (when (null company-mode) (company-mode +1))