GNU bug report logs - #51830
29.0.50; tab-line-mode will override (setq-default tab-line-format "xxx")

Previous Next

Package: emacs;

Reported by: "Feng Shu" <tumashu <at> 163.com>

Date: Sun, 14 Nov 2021 06:06:01 UTC

Severity: normal

Tags: moreinfo

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51830 in the body.
You can then email your comments to 51830 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 06:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Feng Shu" <tumashu <at> 163.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Nov 2021 06:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Feng Shu" <tumashu <at> 163.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; tab-line-mode will override (setq-default tab-line-format
 "xxx")
Date: Sun, 14 Nov 2021 14:05:11 +0800
(setq tab-line-format "xxx")
(global-tab-line-mode 1)

value "xxx"  will lost.



In GNU Emacs 29.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-11-14 built on tumashu
Repository revision: 370d4038c5a671d3b9e3a4d28d849948c1a96f53
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-native-compilation --with-xwidgets --with-modules'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: zh_CN.UTF-8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
  global-undo-tree-mode: t
  undo-tree-mode: t
  projectile-mode: t
  global-git-commit-mode: t
  mml-mode: t
  magit-auto-revert-mode: t
  emms-playing-time-display-mode: t
  emms-playing-time-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  company-posframe-mode: t
  global-company-mode: t
  org-super-agenda-mode: t
  shell-dirtrack-mode: t
  pyim-isearch-mode: t
  vertico-mode: t
  savehist-mode: t
  global-tab-line-mode: t
  tab-line-mode: t
  global-so-long-mode: t
  electric-pair-mode: t
  recentf-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: yas--auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
/home/feng/.emacs.d/elpa-29/transient-20211105.100/transient hides /home/feng/project/emacs/lisp/transient

Features:
(gnus-async gnus-bcklg gnus-ml hl-line utf-7 imap rfc2104 qp gnutls
network-stream nsm pop3 epa-file nndraft nnmh nnml eh-gnus-common
gnus-select-account eww xdg url-queue mm-url gnus-demon gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cite
gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-cache gnus-sum
shr kinsoku svg dom gnus-group gnus-undo eh-gnus gnus-start gnus-dbus
dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec
gnus-int gnus-range gnus-win gnus nnheader mailalias mailclient shadow
mail-extr emacsbug sendmail cus-start mule-util vc-mtn vc-hg vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs bug-reference misearch multi-isearch
pyim-dhashcache async magit-extras cursor-sensor citre citre-peek
citre-basic-tools citre-ctags emacs-helper eh-misc undo-tree xwidget
image-mode exif projectile lisp-mnt grep ibuf-ext ibuffer
ibuffer-loaddefs magit-bookmark magit-submodule magit-obsolete
magit-popup magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff diff-mode git-commit log-edit message yank-media rmc
puny rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor server magit-mode transient
edmacro magit-git magit-section magit-utils crm gitpatch
aggressive-indent eh-emms emms-librefm-stream xml emms-librefm-scrobbler
emms-playlist-limit emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-player-xine emms-player-mpd tq emms-lyrics emms-url emms-streams
emms-show-all emms-tag-editor emms-tag-tracktag emms-mark emms-mode-line
emms-info-tinytag emms-info-metaflac emms-info-opusinfo
emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mpv
emms-playing-time emms-player-mplayer emms-player-simple emms-browser
sort emms-playlist-sort emms-last-played emms-volume
emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse
emms-volume-amixer emms-playlist-mode emms-source-playlist
emms-source-file locate emms-cache emms-info-native bindat
emms-info-exiftool emms-info emms-later-do emms-setup emms emms-compat
epg rfc6068 epg-config el2org cnfonts cnfonts-ui cus-edit cus-load
thingatpt yasnippet vterm face-remap compile color term disp-table ehelp
vterm-module term/xterm xterm citre-config citre-lang-fileref citre-util
citre-core citre-tag citre-core-tables citre-common eh-complete
company-posframe company-keywords company-etags etags fileloop xref
project company-gtags company-template company-dabbrev-code
company-dabbrev company-files company-capf company eh-org
org-super-agenda ts ht s org-habit ob-python python tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
parse-time ls-lisp ob-org ob-plantuml ox-extra ox-md ox-org ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda
ox-html table ox-ascii ox-publish ox org-element avl-tree generator
org-protocol autorevert filenotify org-attach org-id org-refile org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete comint ansi-color org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval
org-table oc-basic bibtex iso8601 time-date ol org-keys oc org-compat
advice org-macs org-loaddefs format-spec find-func eh-functions eh-theme
modus-vivendi-theme modus-operandi-theme modus-themes eh-basic
cal-china-x cal-china lunar solar cal-dst holidays hol-loaddefs cal-menu
calendar cal-loaddefs pyim-liberime liberime liberime-core pyim
pyim-hacks pyim-probe pyim-cregexp pcase xr pyim-process pyim-cstring
pyim-autoselector pyim-punctuation pyim-outcome pyim-indicator
pyim-preview pyim-magic pyim-candidates pyim-codes pyim-imobjs
pyim-pinyin pyim-pymap pyim-dcache pyim-dict derived pyim-page
pyim-entered popup posframe pyim-scheme pyim-common dired-ranger ring
dired-hacks-utils dash wdired dired dired-loaddefs vc vc-dispatcher
consult-vertico consult kmacro orderless vertico savehist tab-line
switch-window switch-window-mvborder switch-window-asciiart quail
so-long elec-pair bookmark text-property-search pp recentf tree-widget
wid-edit elpa-mirror finder-inf tex-site kotl-autoloads easy-mmode info
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source eieio eieio-core eieio-loaddefs password-cache
json map url-vars comp comp-cstr warnings rx cl-seq cl-macs cl-extra seq
gv subr-x byte-opt bytecomp byte-compile cconv help-mode cl-loaddefs
cl-lib china-util iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 965648 91089)
 (symbols 48 53999 79)
 (strings 32 288858 21235)
 (string-bytes 1 7954868)
 (vectors 16 103897)
 (vector-slots 8 13784573 90758)
 (floats 8 1287 697)
 (intervals 56 3070 546)
 (buffers 992 40))

-- 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 06:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 51830 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Feng Shu" <tumashu <at> 163.com>
Cc: 51830 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#51830: 29.0.50; tab-line-mode will override (setq-default
 tab-line-format "xxx")
Date: Sun, 14 Nov 2021 07:33:36 +0100
"Feng Shu" <tumashu <at> 163.com> writes:

> (setq tab-line-format "xxx")
> (global-tab-line-mode 1)
>
> value "xxx"  will lost.

Yes, tab-line-mode resets the variable unconditionally:

(define-minor-mode tab-line-mode
  "Toggle display of tab line in the windows displaying the current buffer."
  :lighter nil
  (setq tab-line-format (when tab-line-mode '(:eval (tab-line-format)))))

Perhaps that should be done only when the variable's value is nil?
(I've added Juri to the CCs.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 14 Nov 2021 06:34:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 17:43:02 GMT) Full text and rfc822 format available.

Message #13 received at 51830 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51830 <at> debbugs.gnu.org, Feng Shu <tumashu <at> 163.com>
Subject: Re: bug#51830: 29.0.50; tab-line-mode will override (setq-default
 tab-line-format "xxx")
Date: Sun, 14 Nov 2021 19:40:28 +0200
[Message part 1 (text/plain, inline)]
>> (setq tab-line-format "xxx")
>> (global-tab-line-mode 1)
>>
>> value "xxx"  will lost.
>
> Yes, tab-line-mode resets the variable unconditionally:
>
> (define-minor-mode tab-line-mode
>   "Toggle display of tab line in the windows displaying the current buffer."
>   :lighter nil
>   (setq tab-line-format (when tab-line-mode '(:eval (tab-line-format)))))
>
> Perhaps that should be done only when the variable's value is nil?

This needs also to keep the original value while disabling the mode.
Do you think this should be installed in Emacs 28?

[tab-line-mode.patch (text/x-diff, inline)]
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 5affae7913..110c6e9696 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -893,7 +893,14 @@ tab-line-context-menu
 (define-minor-mode tab-line-mode
   "Toggle display of tab line in the windows displaying the current buffer."
   :lighter nil
-  (setq tab-line-format (when tab-line-mode '(:eval (tab-line-format)))))
+  (let ((default-value '(:eval (tab-line-format))))
+    (if tab-line-mode
+        ;; Preserve the existing tab-line set outside of this mode
+        (unless tab-line-format
+          (setq tab-line-format default-value))
+      ;; Reset only values set by this mode
+      (when (equal tab-line-format default-value)
+        (setq tab-line-format nil)))))
 
 (defcustom tab-line-exclude-modes
   '(completion-list-mode)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 17:46:01 GMT) Full text and rfc822 format available.

Message #16 received at 51830 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 51830 <at> debbugs.gnu.org, Feng Shu <tumashu <at> 163.com>
Subject: Re: bug#51830: 29.0.50; tab-line-mode will override (setq-default
 tab-line-format "xxx")
Date: Sun, 14 Nov 2021 18:45:41 +0100
Juri Linkov <juri <at> linkov.net> writes:

> This needs also to keep the original value while disabling the mode.
> Do you think this should be installed in Emacs 28?

Is this a regression since 27.2?  If not, I'd prefer this go to master
instead.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 17:48:02 GMT) Full text and rfc822 format available.

Message #19 received at 51830 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 51830 <at> debbugs.gnu.org, tumashu <at> 163.com, larsi <at> gnus.org
Subject: Re: bug#51830: 29.0.50;
 tab-line-mode will override (setq-default tab-line-format "xxx")
Date: Sun, 14 Nov 2021 19:46:59 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Sun, 14 Nov 2021 19:40:28 +0200
> Cc: 51830 <at> debbugs.gnu.org, Feng Shu <tumashu <at> 163.com>
> 
> > Yes, tab-line-mode resets the variable unconditionally:
> >
> > (define-minor-mode tab-line-mode
> >   "Toggle display of tab line in the windows displaying the current buffer."
> >   :lighter nil
> >   (setq tab-line-format (when tab-line-mode '(:eval (tab-line-format)))))
> >
> > Perhaps that should be done only when the variable's value is nil?
> 
> This needs also to keep the original value while disabling the mode.
> Do you think this should be installed in Emacs 28?

We had that code since Emacs 27.  Is it really urgent to fix that in
Emacs 28?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51830; Package emacs. (Sun, 14 Nov 2021 18:39:02 GMT) Full text and rfc822 format available.

Message #22 received at 51830 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 51830 <at> debbugs.gnu.org
Cc: Feng Shu <tumashu <at> 163.com>, Eli Zaretskii <eliz <at> gnu.org>,
 Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#51830: 29.0.50; tab-line-mode will override (setq-default
 tab-line-format "xxx")
Date: Sun, 14 Nov 2021 20:36:19 +0200
close 51830 29.0.50
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Is this a regression since 27.2?  If not, I'd prefer this go to master
> instead.

Not a regression, so pushed to master.

Eli Zaretskii <eliz <at> gnu.org> writes:

> We had that code since Emacs 27.  Is it really urgent to fix that in
> Emacs 28?

Not urgent since this is quite non-standard usage of the tab-line.




bug marked as fixed in version 29.0.50, send any further explanations to 51830 <at> debbugs.gnu.org and "Feng Shu" <tumashu <at> 163.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Sun, 14 Nov 2021 18:39:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 Dec 2021 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.