From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jai-bholeki Newsgroups: gmane.emacs.help Subject: Re: Toggle between read-only-mode Date: Fri, 06 Nov 2020 12:23:14 +0000 Message-ID: References: Reply-To: jai-bholeki 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="40470"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: jai-bholeki Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 06 13:24:16 2020 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 1kb0mu-000ARv-BP for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 06 Nov 2020 13:24:16 +0100 Original-Received: from localhost ([::1]:52154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb0mt-0004by-Aw for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 06 Nov 2020 07:24:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0m6-0004bd-9s for help-gnu-emacs@gnu.org; Fri, 06 Nov 2020 07:23:26 -0500 Original-Received: from mail-40140.protonmail.ch ([185.70.40.140]:44886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0m3-0002la-Ts for help-gnu-emacs@gnu.org; Fri, 06 Nov 2020 07:23:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1604665401; bh=+Ii4z2Qpf6stHjqoZRs6jB8Z3J6LXeVjL3vFHheOycY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=iWRALfG+OJt98nATWcu/u8VsS5vS4AqlnzLYN5jZCbpm6xJ4RF4+5QnM2n+l73Lvj Usq6PqNyGvmCXGcmCzYHKrV0nkYXnGajyRcYNnAXURa3uKBFiAiEYAlcrX0H0OTIGl kXlaOYryMg25W2YeKgfdvVJoOCVYD7ki65z9Wy/U= In-Reply-To: Received-SPF: pass client-ip=185.70.40.140; envelope-from=jai-bholeki@protonmail.com; helo=mail-40140.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 07:23:21 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=1.029 autolearn=no 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:125065 Archived-At: Have done as follows, and it works (defun parenhl-cycle () "Toggles the highlighting of parenthetical regions." (interactive) ;; Use the property 'state' to cycle between parenthetical styles (if (get 'paren-expr 'state) (progn (setq show-paren-style 'parenthesis) (put 'paren-expr 'state nil)) (progn (setq show-paren-style 'expression) (put 'paren-expr 'state t)))) (global-set-key (kbd "H-z") 'parenhl-cycle) =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, 6 November 2020 11:53, jai-bholeki via Users list for the GNU Em= acs text editor wrote: > Have made two functions to set paren-style-parenthesis. > > Now I am trying to make a keybinding that toggles through the two setting= s. > Have checked around and have not found examples on how it can be done. > > > (defun parenhl-paren () > > "paren-style-parenthesis sets highlighting for parenthetical marks" > > (interactive) > > (setq show-paren-style 'parenthesis) > > ) > > (defun parenhl-expr () > > "paren-style-parenthesis sets highlighting for parenthetical marks" > > (interactive) > > (setq show-paren-style 'expression) > > ) > > Sent withProtonMail Secure Email.