all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 44764@debbugs.gnu.org
Subject: bug#44764: 28.0.50; Wrong menu binding for file in tree fileset
Date: Fri, 20 Nov 2020 12:56:04 -0300	[thread overview]
Message-ID: <CABczVwckJAwoRpUjEvy1iNJshV0osp671GB=V7nbx448uYpsPw@mail.gmail.com> (raw)
In-Reply-To: <CABczVwfBVRLA8v2-87xLQc7wV1vuXftDkJC18HMW6KK5E+zTYA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1452 bytes --]

tags 44764 patch
quit

Mauro Aranda <maurooaranda@gmail.com> writes:

> To reproduce:
> 0) Setup a directory with subdirectories and files, for later definition
> of a tree fileset:
> mkdir fileset-test
> cd fileset-test
> touch file.el
> mkdir subdir
> cd subdir
> touch file1.el file2.el file3.el file4.el file5.el
>
> 5 files seems kinda arbitrary, but it's needed so that one of the files
> is left alone as a menu item.
>
> 1) Start Emacs: emacs -Q
>
> 2) Eval: (filesets-init)
>
> 3) M-x set-variable RET filesets-max-submenu-length RET 3
>
> This is so I don't bore you with creating more than 25 files.
>
> 4) M-x filesets-edit
>
> Add a new entry to filesets-data, like so:
> Name: test
> In Data, select the Directory Tree option and then:
> Dir: /path/to/fileset-test
> Pattern: ^.+\.el$
>
> Set for current session.
>
> Now data should look like this:
> (("test (:tree "path/to/fileset-test" "^.+\\.el$")))
>
> 5) Click the File menu, and follow the Filesets entry, then the test
> entry and finally the subdir entry.
>
> You should see that file1.el and file2.el are grouped.  Also, file3.el
> and file4.el got grouped, while file5.el is left alone.  This is OK.
>
> Clicking any file but file5.el works fine.  But clicking file5.el raises
> an error:
> Invalid function: (filesets-file-open nil
'"/path/to/fileset-test/subdir/file5.el" '"test")
>
> The menu entry for file5.el is wrong.

The attached patch should fix it.  OK to install?

[-- Attachment #1.2: Type: text/html, Size: 1913 bytes --]

[-- Attachment #2: 0001-Fix-menu-binding-for-files-in-fileset.patch --]
[-- Type: text/x-patch, Size: 965 bytes --]

From 6f5012d7cc7cb1bf3e650366b14fc367261c186f Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Fri, 20 Nov 2020 12:52:56 -0300
Subject: [PATCH] Fix menu binding for files in fileset

* lisp/filesets.el (filesets-remake-shortcut): We want the callback of
the menu item, not a list that contains the callback.  (Bug#44764)
---
 lisp/filesets.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/filesets.el b/lisp/filesets.el
index c7ec3f77f4..cddaccbb2a 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1878,8 +1878,7 @@ filesets-remake-shortcut
 		       (substring (elt submenu 0) 2))))
     (if (listp submenu)
 	(cons name (cdr submenu))
-      (apply 'vector (list name (cdr (append submenu nil)))))))
-;      (vconcat `[,name] (subseq submenu 1)))))
+      (apply 'vector (list name (cadr (append submenu nil)))))))
 
 (defun filesets-wrap-submenu (submenu-body)
   "Split long submenus."
-- 
2.29.2


  reply	other threads:[~2020-11-20 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 15:45 bug#44764: 28.0.50; Wrong menu binding for file in tree fileset Mauro Aranda
2020-11-20 15:56 ` Mauro Aranda [this message]
2020-11-24  6:45   ` Lars Ingebrigtsen
2020-11-24 11:51     ` Mauro Aranda

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

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

  git send-email \
    --in-reply-to='CABczVwckJAwoRpUjEvy1iNJshV0osp671GB=V7nbx448uYpsPw@mail.gmail.com' \
    --to=maurooaranda@gmail.com \
    --cc=44764@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.