[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#655754: marked as done (emacs-goodies-el: `diminished-minor-modes' setting doesn't "just work" (with fix))



Your message dated Thu, 28 Jun 2018 07:27:25 -0300
with message-id <87woujurxu.fsf@tethera.net>
and subject line Re: Bug#655754: please check against elpa-diminish
has caused the Debian Bug report #655754,
regarding emacs-goodies-el: `diminished-minor-modes' setting doesn't "just work" (with fix)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
655754: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655754
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: emacs-goodies-el
Version: 35.2
Severity: normal

So, I noticed that the `diminished-minor-modes' setting is really
finicky at the moment; at first, I thought this was just because of a
missing ":require 'diminish" in the defcustom, but I found (as you say
in your comments) that things are a bit trickier than that.

Thankfully, I also found that things aren't nearly as tricky as you
seemed to suppose, and came up with fix below, which does not require
any foreknowledge of what minor modes are defined where.  I think it
does add an O(n^2) cost to any command that ends up loading elisp
somehow, but it looks like that's probably not really a problem unless
you use a *lot* of diminished minor modes.

Maybe you should send this (combined with 50_diminish-defcustom.diff)
upstream?

,----[ 51_diminish-defcustom-just-work.diff ]
| Index: emacs-goodies-el-35.2/elisp/emacs-goodies-el/diminish.el
| ===================================================================
| --- emacs-goodies-el-35.2.orig/elisp/emacs-goodies-el/diminish.el	2012-01-13 14:45:39.000000000 -0500
| +++ emacs-goodies-el-35.2/elisp/emacs-goodies-el/diminish.el	2012-01-13 14:45:39.000000000 -0500
| @@ -8,7 +8,7 @@
|  ;; Version: 0.45, 18 Jun 2003
|  ;; Keywords: extensions, diminish, minor, codeprose
|  
| -;; This file is part of GNU Emacs.
| +;; This file is NOT part of GNU Emacs.
|  
|  ;; This program is free software; you can redistribute it and/or modify
|  ;; it under the terms of the GNU General Public License as published by
| @@ -123,6 +123,17 @@
|  ;;    files perhaps, and then add an eval-after-load?  Seems like a kludge
|  ;;    because it relies on outside information remaining constant, but it
|  ;;    would help.
| +;;
| +;; 2011-01-12 Samuel J. J. Bronson <naesten@gmail.com>
| +;;
| +;;  - Make `diminished-minor-modes' (probably) Just Work.  It should
| +;;    no longer be necessary ot do anything special in elisp; instead
| +;;    of trying to minimize computation, we simply redo everything
| +;;    after any elisp gets loaded.  (If this turns out to be too slow,
| +;;    there are some relatively straightforward improvements that
| +;;    could be made without having to rely on foreknowledge of what
| +;;    gets defined where.  For example, by keeping track of "pending"
| +;;    diminished modes and only trying to diminish those.)
|  
|  ;;; Code:
|  
| @@ -252,7 +263,7 @@
|    (if (eq mode 'diminished-modes)
|        (let ((diminished-modes diminished-mode-alist))
|          (while diminished-modes
| -          (diminish-undo (caar diminished-modes))
| +          (diminish-undo (caar diminished-modes) annotate-flag)
|            (callf cdr diminished-modes)))
|      (let ((minor      (assq mode      minor-mode-alist))
|            (diminished (assq mode diminished-mode-alist)))
| @@ -321,10 +332,28 @@
|  ;; in line with the ducks and geese at the espresso counter, gazing placidly
|  ;; out on the world through loon-red eyes, thinking secret thoughts.
|  
| +;;;###autoload
| +(defun diminish-maybe-refresh ()
| +  "Should redo `diminish'ing only if something has changed.
| +Right now, do it regardless and hope this isn't too slow."
| +  (interactive)
| +  (diminish-undo 'diminished-modes t)
| +  (mapcar #'(lambda (x) (diminish (car x) (cdr x) t))
| +	  diminished-minor-modes))
| +
| +(defun diminish-oneshot-post-command-hook ()
| +  (diminish-maybe-refresh)
| +  (remove-hook 'post-command-hook 'diminish-oneshot-post-command-hook))
| +
| +(defun diminish-after-load-hook (file)
| +  (add-hook 'post-command-hook 'diminish-oneshot-post-command-hook))
| +(add-hook 'after-load-functions 'diminish-after-load-hook)
| +
|  (defgroup diminish nil
|    "Diminished modes are minor modes with no modeline display."
|    :group 'convenience)
|  
| +;;;###autoload
|  (defcustom diminished-minor-modes nil
|    "List of minor modes to diminish and their mode line display strings.
|  The display string can be the empty string if you want the name of the mode
| @@ -340,11 +369,9 @@
|  		:value-type (string :tag "Title"))
|    :options (mapcar 'car minor-mode-alist)
|    :set (lambda (symbol value)
| -         (if (and (boundp 'diminished-minor-modes) diminished-minor-modes)
| -             (mapcar 
| -              (lambda (x) (diminish-undo (car x) t)) diminished-minor-modes))
|           (set-default symbol value)
| -         (mapcar (lambda (x) (diminish (car x) (cdr x) t)) value)))
| +	 (diminish-maybe-refresh))
| +  :require 'diminish)
|  
|  (provide 'diminish)
|  
`----

Thanks,
-- SamB

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages emacs-goodies-el depends on:
ii  bash                      3.2-4          The GNU Bourne Again SHell
ii  dpkg                      1.16.1.2       Debian package management system
ii  emacs23-lucid [emacsen]   23.3+1-4       The GNU Emacs editor
ii  install-info              4.13a.dfsg.1-4 Manage installed documentation in 

Versions of packages emacs-goodies-el recommends:
ii  dict                      1.10.11.dfsg-2 Dictionary Client
ii  perl-doc                  5.14.2-6       Perl documentation
ii  wget                      1.11.4-4       retrieves files from the web

emacs-goodies-el suggests no packages.

-- no debconf information

-- debsums errors found:
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 10719 package 'jhcore':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 17431 package 'docbook-mathml':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 22418 package 'apt-show-source':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 35617 package 'tads2-mode':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 38692 package 'lambdamoo':
 missing architecture

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!



--- End Message ---
--- Begin Message ---
Lev Lamberov <dogsleg@debian.org> writes:

> Чт 28 июн 2018 @ 06:42 David Bremner <david@tethera.net>:
>
>> Can someone verify if the issue is present in elpa-diminish? If so
>> please reassign. This file will be gone from emacs-goodies-el in the
>> next upload.
>
> As I can see this functionality was removed at some point, there's no
> code related to diminished-minor-modes in 0.45 (which is shipped in
> Debian).

Thanks Lev. So I'll close the bug for now.

d

--- End Message ---

Reply to: