From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Re: display line and column numbers together with ruler and whitespace highlighting Date: Sun, 31 Jan 2021 01:24:11 +0100 Message-ID: References: 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="29462"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: michael-franzese@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 31 01:24:47 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 1l60Xn-0007Xd-Ce for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 31 Jan 2021 01:24:47 +0100 Original-Received: from localhost ([::1]:59284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l60Xm-0003K4-Eq for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 19:24:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l60XI-0003Jq-I5 for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 19:24:16 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:43701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l60XF-0003I7-Qy for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 19:24:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612052651; bh=eK2+RS3BIMTgGJ5YhmN6b8Ybp4aduxBHP/H2yPQn280=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=KX3tmKvIuXhsOU99xmvGSGjCy88b9TDtnI/5ey5cOd1OEjALm+9+gpZGqkAl/UuVu ei6nUN8GgFUR9VchPtv0nlLtL+xBZq9707aTNfFCS2xAKXkHB7de7AmTF6j34VpUQx Ce6hNl0PLaOmP0WiI2xfHbjdzKAONASmkU6YmYqQ= 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-bs16.server.lan [172.19.170.184]) (via HTTP); Sun, 31 Jan 2021 01:24:11 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:oeCLIX7kH/3MnIWh/kXsfTpBxU+BGrZrl1WWb3rgWMxexNi6ScxETbIFuQ1GVVIliAwMe fUfmuQsqyRQJOqR8cun+bZFDaPXLfHr7/a5R5iwytxX0oytrcy3mCz2xKEfGmoXhIZFEuZNh73af 6roUV1nbvm8JqnEXFrlHeKHgn8dKwoIDJarQ1jHesxYLFaveUJHJtcxQFXfXEnz9G8qHklUyRDe4 4wnjWBP8GS0VRbi4YPLfUxp9lSSRLHnUqfcDePPHlFPWIzxYr+ZjNzDkxHGNnSR29v9R+yEWbJZQ AM= X-UI-Out-Filterresults: notjunk:1;V03:K0:2R9QfZyu50A=:tLVSqkyhR2gvg2xdPBLF9C DZCUv2nUZOLtRuL6Hdfw/wc4fTYxP5apIm/kKIMcqURXKNwsY27q/+4ohvfi5SRsaqIQ0bAdQ 0iqEKXF74qOUAYvl2hWUPkMEcwr4hfjA6RkwpauPDr9kf05OoU9bSskpnf7oJ47LkU7PqDZuw BnVVDdHDmXgUK8aWYpWCayJaeU0cfGegWWUttlOzcL/MmkdjsOG+b+AWS2eaqQkIauXihNsE8 uNYYPqWZI+rhxpaFE7H/NFU652sv5P3wObbO0XjZQZ+xu3ZI8Xv/Jrf7kJGlkDpu9sjUbmwpC ig15PmMBIgYi0Uao1LQf/iTeiNFB1AuiQexEOG+aSYZDJ7Uvb2jdIQxAYRflmebErFlzPIFsl pjzc+D6G6U7KVgy8iSFcpIX2r+az3AZw9hZzWej5swDNxzPf9pyx+UxVswt0YApqG1A0wLcEY WliZpwoQbX5XFq3xQvighJrTq3xHxSyDZzmWffEjGhFV9j9GzflY8SgwxJayMEqYn9XpGafFi lWaeD8LLIx0WFOnWNhbPejvpq2aBX4+Ipw55fUWnDUqSrYF3nFjj6k6JaQdAi3v0R2rh2XoxG V5Ll/2wy8DsYrSuRqfcKI53LpkAo7s2RVO Received-SPF: pass client-ip=212.227.17.21; envelope-from=michael-franzese@gmx.com; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:127463 Archived-At: I have re-coded my function cycle-posn-cursor-spaces The funny thing is that calling posn-cursor-spaces does not enable ruler-mode, yet (setq line-number-mode t) and (setq column-number-mode t) are executed correctly. (require 'whitespace) (setq whitespace-style '(face tab-mark tabs trailing)) (defvar dfv-posn-cursor-spaces-state nil) (defun cycle-posn-cursor-spaces () "Cycle though character highlighting (tabs and trailing spaces)." (interactive) ;; (pcase dfv-posn-cursor-spaces-state ;; (1 (ruler-mode 1) (setq line-number-mode t) (setq column-number-mode t) (whitespace-mode 1) (message "%s" "Enable: Show position of cursor and spaces") (setq dfv-posn-cursor-spaces-state 2)) ;; (2 (setq line-number-mode nil) (setq column-number-mode nil) (whitespace-mode 0) (message "%s" "Enable: Show position of cursor") (setq dfv-posn-cursor-spaces-state 0)) ;; (_ (ruler-mode 0) (setq line-number-mode nil) (setq column-number-mode nil) (whitespace-mode 0) (message "%s" "Disable: Show position of cursor and spaces") (setq dfv-posn-cursor-spaces-state 1)) )) (defun posn-cursor-spaces () "Shows position of cursor and spaces." (interactive) (setq dfv-posn-cursor-spaces-state 1) (cycle-posn-cursor-spaces)) > Sent: Sunday, January 31, 2021 at 9:15 AM > From: michael-franzese@gmx.com > To: "Help Gnu Emacs" > Subject: display line and column numbers together with ruler and whitesp= ace highlighting > > I have a problem on the correct way to display line and column numbers > together with a ruler and whitespace highlighting, with the ability to > cycle through the different options. > > > (defvar dfv-highlight-spaces-state nil) > > (defun cycle-highlight-spaces () > "Cycle though character highlighting (tabs and trailing spaces)." > (interactive) > > (pcase dfv-highlight-spaces-state > (2 (display-line-numbers-mode 0) > (setq line-number-mode nil) > (setq column-number-mode nil) > (ruler-mode 1) > (whitespace-mode 0) > (message "%s" "Enable: Ruler only") > (setq dfv-highlight-spaces-state 3)) > > (3 (ruler-mode 0) > (setq line-number-mode nil) > (setq column-number-mode nil) > (display-line-numbers-mode 0) > (whitespace-mode 0) > (message "%s" "Disable: Show spaces & cursor position") > (setq dfv-highlight-spaces-state 1)) > > (_ (ruler-mode 1) > (setq line-number-mode t) > (setq column-number-mode t) > (display-line-numbers-mode 1) > (whitespace-mode 1) > (message "%s" "Enable: Show spaces & cursor position") > (setq dfv-highlight-spaces-state 2)) )) > > > > > >