From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: add-hook and remove-hook for outlines Date: Tue, 11 May 2021 16:18:59 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8606"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 11 16:20:13 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgTF7-00029f-Dd for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 16:20:13 +0200 Original-Received: from localhost ([::1]:36994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgTF6-0004qH-5Q for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 10:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgTEB-0004p1-Gf for help-gnu-emacs@gnu.org; Tue, 11 May 2021 10:19:15 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:60085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgTDz-0006mJ-Pq for help-gnu-emacs@gnu.org; Tue, 11 May 2021 10:19:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620742740; bh=+ujhKeGg7I8R2TLmmB1upgnROqcDoa1zW5nQ2se6zaE=; h=X-UI-Sender-Class:From:To:Subject:Date; b=jTJlwe6zcvFVxfFXxHglNdkQP0hnuepzqfSQvTpXFe/q09Ll4xbxLkcowlvnMNIwS PgoshPQ3E61nhsn4ApB5VSJkhbvSa2ERpuTKNJyx6I+vjAMYT4dGwrsMnciGvVsLz3 yb/awmdpk0x85kZKCvK3awmoxnSsFp7Co197QwqU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs13.server.lan [172.19.170.181]) (via HTTP); Tue, 11 May 2021 16:18:59 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:wBVjb60rHpHmM8JWPYOR4rb/SZcRK98U4XauhlyZrB8nBEnDCsmO6s8/KKRWVhfhly+d0 wH7U+rnDDXfz7lDRO5GMz752LsBXRPdZOWiS4S7OIpKMx1vDCi10tn1wC+iEe2JaOhn5epzv2DjN Zhujt/CtWD+NNB0eoCT8zlUWQckoaKWe0zqJnYPvlgnccQA7O+KXdxoDLPCg0Co4Cj6c8vgAiNq/ 6AHdD+KBkODBM52IRJRqHxQAt3T/cIBii/qI6sYaNHSHBfQxOzcoFBYsie188jrkhYFucpgqhsmJ Ng= X-UI-Out-Filterresults: notjunk:1;V03:K0:q6yUScRU73g=:KsKaBHLBSufX6GYAIMGwrt Ywx4XxrxjViu9tLIhbeeTDA53uz5E400TtJwnd8XIDcEbQQA922+pzAtJNtzccjt9fVq1nHP2 dvW4W0N5ijRVMJVSu5lnJV8dTZgHoay4WaEX7Ev1dQCZpspTyQvxTxlQ3URpRC6JaYopHsskh QvWePo9CGlepAeKRN5DC7HnqaH6BEttvd5BY8OEOuIIqwAPQJW9sQE1tCsI5WFDDUNldZpYwY GJY88NgekQyCdrUOTua4c3kTexekbOn3NRUA2mTulf4S3JSzunEzKNbgDJWWuD1XKCxGMpGVi uDGZXzL5fwskrfShuDX7NQJjYLkSISPGrkGWCjAQA00jLqVMH6ncsTuVv/foy+Nmi17PtxPas MxJKyBq42c3piqnz0Vr+yys+gXPaXU6LuvaG1VyBn5JEPHfeW9xUbqD1501mA8Xd7+eh7OoqH uzUauKx/gu+tJUxb+2nzPcHg9kEk48zhFvMwGhweBzU0vnfr+ooT0iRtbq06SK/uAUmT33s9p NMPL2uI/y0+dXwnz9WaKsjYHqIVOsyiU/khdwr1zHvYCoucF+j6SFscLuxkdGKpivXFHEJqph yEfKoWtyQvJvSrrQMPOQ5ubf6SpGYk3eEU2LLFLyVngy5y8sqnn1adMAhfj+Y7YhsaU4QXV+o +fshGsF3nU9nIVFzlYUo8NuGaD2BRykdxSy6NGQodkN30/aL1GnfvW8pSP4Zac+7c4Ic0ki6A 0yKKoIlRvqOSTGx8Bsy9HMebvG5rW+ESHiv+M+W6dlgFveXgPr+YhatbKtfmgFZFfULGrky+ Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129697 Archived-At: I would like to have a toggle function that can change the deadline type. This would necessarily mean that I would need to remove the hook before setting the new one (e.g. from org-like to roman-like headings). But I am struggling on the implementation. ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (defvar rgc-elisp " ") (defun gilgamesh-make-outline-regexp () "todo" (set (make-local-variable 'outline-regexp) rgc-elisp) ) ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (defvar rgc-elisp-kondor 2) (defun gilgamesh-headline-elisp () "todo" (interactive) (message "gilgamesh-headline-elisp") (pcase rgc-elisp-kondor ; sets regularity condition rgc (1 ;; org-like headings (setq rgc-elisp ";;; \\*+ ") (setq rgc-elisp-kondor 2) (message "org-like headings")) (_ ;; roman-like headings (setq rgc-elisp ";;; \\([A-Za-z]\\|[IVXLCDMivxlcdm0-9]+\\) | ") (setq rgc-elisp-kondor 1) (message "roman-like headings")) ) (add-hook 'emacs-lisp-mode-hook #'gilgamesh-make-outline-regexp))