From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daniela-spit@gmx.it Newsgroups: gmane.emacs.help Subject: Re: Removing line and column number settings from some buffers Date: Fri, 4 Dec 2020 06:58:11 +0100 Message-ID: References: <87sg8mbkpt.fsf@web.de> <87czzq9xq5.fsf@web.de> 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="13713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 04 06:58:38 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 1kl474-0003U3-Bj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 06:58:38 +0100 Original-Received: from localhost ([::1]:41924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kl473-0005Fs-EP for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 00:58:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kl46i-0005FW-HM for help-gnu-emacs@gnu.org; Fri, 04 Dec 2020 00:58:16 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:35983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kl46g-0004jL-Gn for help-gnu-emacs@gnu.org; Fri, 04 Dec 2020 00:58:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607061492; bh=oKRD73hevPHdgS0ofhSHdoCFPo+9WtWO/JKmp5m1kg4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Pq9FfSYAwRcaJLlMomMosx17m4tRPEbY1sajhCg5Xj60eWbd4ZPOYljqLVKPntgHF VQ8I9inFQppy1IUX7XJKGSRZgumzIaOaHWIUdTbpkTysXHf9b5A5CWIWT+Jilcpy0B 9SFBq1LTZhgcg2ehOiqEZz2bOfQRTaKB6VFGwiTM= 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-bs11.server.lan [172.19.170.179]) (via HTTP); Fri, 4 Dec 2020 06:58:11 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:ZuqL9D6DUF7RwjAEPTg80AFxct8XyJT0w1g9uoTrE9yjSAUhIn2OCHjtpWNtKkKnwBlM5 3N0N2fQl227qBOQVZUQxD43trGmNxiadZXD9hK/hlX23ZvA2SPLnCf9UF4k46uw+OeTxtXmQ9LmL C3/VpZxlg2Zyd35tHL7fwSJlmsK3mOBN+3vARHA4uRJcfg48R4hxSsaeq0cM+mSf5973XZ7/bj1M NWhNJw6ZBxtWdD3qHI1V5HcanDp/4Fv0+Kiy9Wsm3zV9pZMsq1cc4b5fMsYgWn57pKXns4/j9qNy dw= X-UI-Out-Filterresults: notjunk:1;V03:K0:kEvnluPA30s=:NDdAvZCNkXuNMAoZBCdb72 OHi6ibrxBI4VTqcxyQbrfMg7T0QA8uGZu5XAkmD6EW20XnlfEBEg6Yq6XFmIaXlgz0ieVOWXt T7Y1FUzaJBoEAKiWXFgVGiDpWQlfwdHzndmSwZvGrODT3STOd41DaALV/SZ6xe+74hCv1cTOv 4+FaERT94MnowA9DD9u8uUTOxZEOX7NWUlQGQ1WmodyiE/tH6dd7WdzPXopdx8kXmVb5PfKt1 IZr38kInBZByFsZeBYrDoBW9DlCuEJq56fCW/Egp1o4YjSgOVXnI0m9MBpMA4J34535x2XgVz StsnavN+9vhJhLLUCS66YbV5zw2FJQCFoJPKAT67croHB6XR6HEEi0sKtRAucOteXSbDdUHpt dsX654o7PaCJMuLYIU97BhnCqA58w/dPWpZgh7e64pJP4O35rDp2bJNPwbw1B7j0Sr3lZY9l8 lrkh4GCFA8H5QaumjQjTOdQ2kyNFZXBj7igyyGdXGH/MOP1VvwQa039lzqtkS5fsSje26Npot Pdmpd2Xev0msbiLMWHVIu1cj745SQUgQ92/EBBmHdnz2jGDfF2yzmeVn8npGUoOjQCKfoZZh1 /VtoY3QS3+CEo= Received-SPF: pass client-ip=212.227.17.21; envelope-from=daniela-spit@gmx.it; 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:125951 Archived-At: There is something wrong in resetting the mode line, after trying to save = the original value. Michael has said that code only works if evaluated in a b= uffer. Would there be some other call to use? (defun toggle-mode-line (n) "Changes Mode Line Information." (make-local-variable 'mode-line-position) (make-local-variable 'line-number-mode) (make-local-variable 'column-number-mode) (make-local-variable 'mode-line-modes) (make-local-variable 'mode-line-format) (make-local-variable 'original-mode-line-format) (make-local-variable 'mode-line-format) (cond ((=3D n 1) ;; Store current value of mode-line-format (setq original-mode-line-format mode-line-format) (setq mode-line-position nil) (setq line-number-mode nil) (setq column-number-mode nil) (setq mode-line-modes nil) ;; Set format and discard System Load Averages indicator (setq display-time-format "W%W %H:%M") (make-local-variable 'display-time-default-load-average) (setq display-time-default-load-average nil) (display-time)) ((=3D n 2) (setq display-time-format "W%W %H:%M %a %b %d %Y") (display-time)) ((=3D n 3) ;; Put original mode-line-format (setq mode-line-position t) (setq line-number-mode t) (setq column-number-mode t) (setq mode-line-modes t) (setq mode-line-format original-mode-line-format) (force-mode-line-update)) )) (make-local-variable 'toggle-mode-line) > Sent: Friday, December 04, 2020 at 5:36 AM > From: daniela-spit@gmx.it > To: "Christopher Dimech" > Cc: "Michael Heerdegen" , help-gnu-emacs@gnu.o= rg > Subject: Re: Removing line and column number settings from some buffers > > One problem is how to store (get 'time-frmt-cycle 'state) in a variable= . > > > > Sent: Friday, December 04, 2020 at 5:16 AM > > From: daniela-spit@gmx.it > > To: "Christopher Dimech" > > Cc: "Michael Heerdegen" , help-gnu-emacs@gnu= .org > > Subject: Re: Removing line and column number settings from some buffer= s > > > > Can somebody help me make a key binding that cycles > > through a function (appt-mode-line n) where 'n' can > > be 1, 2 or 3. > > > > Thank you > > Daniela > > > > > Sent: Friday, December 04, 2020 at 3:10 AM > > > From: daniela-spit@gmx.it > > > To: "Christopher Dimech" > > > Cc: "Michael Heerdegen" , help-gnu-emacs@g= nu.org > > > Subject: Re: Removing line and column number settings from some buff= ers > > > > > > > > > > > > > Sent: Friday, December 04, 2020 at 2:33 AM > > > > From: "Christopher Dimech" > > > > To: "Michael Heerdegen" , daniela-spit@g= mx.it > > > > Cc: help-gnu-emacs@gnu.org > > > > Subject: Re: Removing line and column number settings from some bu= ffers > > > > > > > > > > > > > > > > > > > > > Sent: Friday, December 04, 2020 at 2:16 AM > > > > > From: "Michael Heerdegen" > > > > > To: help-gnu-emacs@gnu.org > > > > > Subject: Re: Removing line and column number settings from some = buffers > > > > > > > > > > Christopher Dimech writes: > > > > > > > > > > > > > > (setq mode-line-format > > > > > > > > > (list > > > > > > > > > "%e" > > > > > > > > > " " > > > > > > > > > " " > > > > > > > > > 'mode-line-modes 'mode-line-misc-info > > > > > > > > > 'mode-line-end-spaces) ) > > > > > > > > > > > > > > > > > > (force-mode-line-update) > > > > > > > > > > > > Have put the code in my init, and the mode line is also not be= ing > > > > > > updated. Even after firing new Emacs Sessions. > > > > > > > > > > This does only modify the mode-line of the buffer that is curren= t when > > > > > that code is loaded, so this is expected. > > > > > > > > I see. Have put it in a file and hit "M-x eval-region". And then= the change > > > > happens. > > > > > > At least I say things changing. > > > > > > What I want to do is to change the Mode Line, but then revert back t= o how it > > > was in that buffer, by continue pressing same keybinding. Can I sto= re the > > > old setup and then put it back again. > > > > > > > > > > > > Michael. > > > > > > > > > > > > > > > > > > > > > > > --------------------- > > > > Christopher Dimech > > > > General Administrator - Naiad Informatics - GNU Project (Geocomput= ation) > > > > - Geophysical Simulation > > > > - Geological Subsurface Mapping > > > > - Disaster Preparedness and Mitigation > > > > - Natural Resource Exploration and Production > > > > - Free Software Advocacy > > > > > > > > > > > > > >