unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Genovese <genovese@cmu.edu>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 25049@debbugs.gnu.org
Subject: bug#25049: ibuffer bug when saving existing filter, with patches
Date: Tue, 29 Nov 2016 11:09:28 -0500	[thread overview]
Message-ID: <CAPum5Fi1vPM9jj9RL5Rt0ytCQsusyDnvXt54Q_PDOK43uY37oQ@mail.gmail.com> (raw)
In-Reply-To: <8737ianx4s.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4157 bytes --]

> 1) (eval-when-compiler (require 'subr-x)) is missing

Ah, sorry. I went back to master and then added in the changes,
but I missed that this time.  Thanks.

> 3) When `ibuffer-old-saved-filters-warning' is shown i miss
>    that the buffer displaying it has the key binding
>    `TAB' for `forward-button'.
>    It might be a smarter way to do this, but i just put the buffer
>    in help-mode as follows:

That works for me.

> 4) [minor comment] It's not very common in Emacs to
> call a var `old-format-detected?'.  Adding 'p' instead
> of '?' or even not suffix at all looks more usual.

OK, makes sense. I had thought of the -p convention
as being for predicate functions, and I do like the
readability of the '?'.  But I get it.

> 5)
> Please, start sentences in capital letters.  Imperative
> form verb is prefered than pasive.

Understood.


Do you want me to submit a new patch with these changes?

(And I know owe you new patches for the other changes, which I have
not forgotten. I'm just a bit behind but hope to submit those
today.)

Thanks again, Chris



On Tue, Nov 29, 2016 at 10:06 AM, Tino Calancha <tino.calancha@gmail.com>
wrote:

> Christopher Genovese <genovese@cmu.edu> writes:
>
>
> > In at least Emacs 25+, the function 'ibuffer-save-filters'
> > handles saving existing filters and new filters inconsistently.
> Thank you for the bug report and the extensive analysis!
> Below i add some comments.
>
> > There are two immediate paths for fixing this:
> >
> >   1. Change the setcdr to add the extra level of nesting.
> >   2. Change the format of 'ibuffer-saved-filters' to remove
> >      the level of testing, change the push (list->cons) and
> >      the later accesses (cadr->cdr).
> >
> > The first is very simple, but the extra level of nesting
> > is unsightly, inconsistent with the structure of filter groups,
> > and mildly annoying when writing filters by hand.  The
> > second is fairly simple, requiring only a few more small changes,
> > but introduces the complication of changing an existing
> > variable's format. (For what it's worth, I prefer the second.)
> I also prefer the larger fix 2.
>
> > I have attached a patch file with patches for three commits
>
> 1) (eval-when-compiler (require 'subr-x)) is missing
>
> 2) We might want to add :version "26.1" into
>    `ibuffer-saved-filter' definition.
>
> 3) When `ibuffer-old-saved-filters-warning' is shown i miss
>    that the buffer displaying it has the key binding
>    `TAB' for `forward-button'.
>    It might be a smarter way to do this, but i just put the buffer
>    in help-mode as follows:
>
> @@ -11,12 +11,15 @@
>      (let ((fixed (ibuffer-update-saved-filters-format
> ibuffer-saved-filters)))
>        (prog1
>            (setq ibuffer-saved-filters (cdr fixed))
> -        (when-let (old-format-detected? (car fixed))
> +        (when-let ((old-format-detected? (car fixed))
> +                   (buffer-name "*Warnings*"))
> +          (with-current-buffer (get-buffer-create buffer-name)
> +            (help-mode))
>            (let ((warning-series t)
>                  (updated-form
>                   (with-output-to-string
>                     (pp `(setq ibuffer-saved-filters
> ',ibuffer-saved-filters)))))
>              (display-warning
>               'ibuffer
> -             (format ibuffer-old-saved-filters-warning
> updated-form))))))))
> -
> +             (format ibuffer-old-saved-filters-warning updated-form))
> +            nil buffer-name))))))
>
> 4) [minor comment] It's not very common in Emacs to
> call a var `old-format-detected?'.  Adding 'p' instead
> of '?' or even not suffix at all looks more usual.
>
> 5)
> >* lisp/ibuf-ext.el (ibuffer-saved-filters): removed extra
>                                              ^^^^^^^
> >nesting level in the alist values and updated docstring.
> >(ibuffer-save-filters): removed extra level of nesting
>                          ^^^^^^^
> >in saved filter alist values when saving new filters.
> Please, start sentences in capital letters.  Imperative
> form verb is prefered than pasive.
>
> removed extra nesting --> Remove extra nesting
>
> Thank you
> Tino
>

[-- Attachment #2: Type: text/html, Size: 5625 bytes --]

  reply	other threads:[~2016-11-29 16:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28  6:54 bug#25049: ibuffer bug when saving existing filter, with patches Christopher Genovese
2016-11-29 15:06 ` Tino Calancha
2016-11-29 16:09   ` Christopher Genovese [this message]
2016-11-29 23:49     ` Tino Calancha
2016-11-30  5:14       ` Christopher Genovese
2016-11-30  7:02         ` Tino Calancha
2016-11-30 14:07           ` npostavs
2016-11-30 15:03             ` Tino Calancha
2016-11-30 15:11               ` Tino Calancha
2016-11-30 16:31                 ` Christopher Genovese
2016-12-01  2:52                   ` Tino Calancha
2016-12-07 10:56           ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPum5Fi1vPM9jj9RL5Rt0ytCQsusyDnvXt54Q_PDOK43uY37oQ@mail.gmail.com \
    --to=genovese@cmu.edu \
    --cc=25049@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).