From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 17 06:35:25 2022 Received: (at submit) by debbugs.gnu.org; 17 Dec 2022 11:35:25 +0000 Received: from localhost ([127.0.0.1]:55382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6VTQ-0003Hm-9m for submit@debbugs.gnu.org; Sat, 17 Dec 2022 06:35:24 -0500 Received: from lists.gnu.org ([209.51.188.17]:33324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6VTN-0003Hg-Ru for submit@debbugs.gnu.org; Sat, 17 Dec 2022 06:35:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6VTN-0007r4-Mq for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 06:35:21 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6VTK-0006WF-Or for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 06:35:21 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 77829240104 for ; Sat, 17 Dec 2022 12:35:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671276916; bh=Cq1vRCHU9U+Edatz1+RSnBaT1G3msbIwjOIbYT4dVb4=; h=From:To:Subject:Date:From; b=axBjet2ljUXvirWFzDdW8evqapPJL2iSmCf5uxuyXKQHFf4inWjPjEFbBTBfJ4kwo 2Fu1QTkcqN3a+0Yd+XUCCXEMf7dWaDz0XJL34ZgjlR4fyrNfTivBr3lzRbs5OQEA5z 6eNWz8mPDzhIeYs8+0Bw/HId8Rw7kk1kSvluAPdKsHW+1cmSsRU69PbTOz1EJFsPmN A8ihsd8Gi9lymUKsiNl5xn390ILztraKOKn8U+mcb2MohChbUE9aBDo8vNleqAdyxB CUXSu7Oir+7CRlUUqPCggVgu9OJrjM2jTvzpkFhW88KjiHoOVSFBMHpOdFvi5Ng0XQ l4kNXtPfad34Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NZ3mh03zNz9rxD for ; Sat, 17 Dec 2022 12:35:15 +0100 (CET) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: 29.0.60; package-vc doesn't detect subdirectories when installing from repositories Date: Sat, 17 Dec 2022 11:35:18 +0000 Message-ID: <87ilia4615.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain M-x package-vc-install RET https://codeberg.org/martianh/mastodon.el RET This will fetch the package sources, but since the actual code is located in a "lisp" subdirectory, none of the actual files will be added to the load-path, making it appear as tough nothing were installed. This could be fixed by adding a heuristic to package-vc--unpack-1 that checks if there is a ./lisp/ directory (with .el files?) and that would add that to the load-path. Are there any other directory names or structures that should be considered as well? Is it common for packages to have loadable files in both the root directory of a repository and a sub-directory? I could imagine that this would be enough to resolve the issue: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 8f0eedd2f8..eea5ad6c26 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -443,6 +443,12 @@ package-vc--unpack-1 (auto-name (format "%s-autoloads.el" name)) (extras (package-desc-extras pkg-desc)) (lisp-dir (alist-get :lisp-dir extras))) + ;; Heuristic to guess a sub-directory with lisp files. + (when-let (((null lisp-dir)) + (dir (expand-file-name "lisp" pkg-dir)) + ((file-directory-p dir))) + (setq lisp-dir dir)) + (package-generate-autoloads name (file-name-concat pkg-dir lisp-dir)) (when lisp-dir --=-=-= Content-Type: text/plain But I can also imagine that this could cause issues in some other edge-cases. In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-14 built on quetzal Repository revision: 622838b957e240d700585050e9ddbd036e690513 Repository branch: emacs-29 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --with-pgtk --with-imagemagick' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Magit Log Minor modes in effect: global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t rcirc-color-mode: t rcirc-track-minor-mode: t editorconfig-mode: t repeat-mode: t display-battery-mode: t display-time-mode: t diff-hl-flydiff-mode: t winner-mode: t windmove-mode: t corfu-history-mode: t vertico-multiform-mode: t vertico-mode: t electric-pair-mode: t recentf-mode: t save-place-mode: t savehist-mode: t pixel-scroll-precision-mode: t pixel-scroll-mode: t xterm-mouse-mode: t which-function-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/philip/.config/emacs/site-lisp/sbbs-pld/sbbs hides /home/philip/.config/emacs/site-lisp/sbbs/sbbs /home/philip/.config/emacs/site-lisp/flymake-proselint/flymake-proselint hides /home/philip/.config/emacs/elpa/flymake-proselint-0.3.0/flymake-proselint /home/philip/.config/emacs/site-lisp/writegood-mode/writegood-mode hides /home/philip/.config/emacs/elpa/writegood-mode-2.2.0/writegood-mode /home/philip/.config/emacs/site-lisp/writegood-mode/writegood-mode-autoloads hides /home/philip/.config/emacs/elpa/writegood-mode-2.2.0/writegood-mode-autoloads /home/philip/.config/emacs/site-lisp/writegood-mode/writegood-mode-pkg hides /home/philip/.config/emacs/elpa/writegood-mode-2.2.0/writegood-mode-pkg /home/philip/.config/emacs/elpa/transient-0.3.7/transient hides /home/philip/Source/emacs/lisp/transient Features: (shadow emacsbug goto-addr bug-reference magit-extras face-remap magit-submodule magit-obsolete 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 magit-diff git-commit log-edit add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete server magit-mode transient edmacro kmacro magit-git magit-section magit-utils crm dash vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs vc-svn grep xref rcirc-color rcirc vc-git package-vc inline url-cache url-http url-auth url-gw display-line-numbers shortdoc eudc-capf eudc cus-start eudc-vars cl-print debug backtrace find-func smerge-mode jka-compr mm-archive qp char-fold misearch multi-isearch mailalias smtpmail orderless vertico-directory vertico-flat ffap buffer-env compat compat-macs ecomplete mule-util sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg gnus-ml disp-table nndraft nnmh utf-7 nnfolder vc-backup copyright time-stamp epa-file network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig nntp gnus-cache gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message yank-media puny dired-x dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win noutline outline checkdoc flymake-proc flymake yasnippet-snippets warnings yasnippet editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch flyspell ispell init repeat project format-spec battery dbus xml shell-command+ thingatpt time sendmail rfc2047 rfc2045 ietf-drums gnus nnheader gnus-util time-date mail-utils range mm-util mail-prsvr finder-inf diff-hl-flydiff diff diff-hl log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode hippie-exp winner windmove corfu-history corfu vertico-multiform vertico cl-extra elec-pair recentf tree-widget saveplace savehist pixel-scroll cua-base xt-mouse modus-operandi-theme modus-themes which-func imenu cus-edit pp cus-load icons wid-edit 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 cl-seq eieio eieio-core password-cache json subr-x map byte-opt url-vars setup site-lisp auto-site compile easy-mmode files-x cl-macs gv pcase rx text-property-search comint ansi-osc ansi-color bytecomp byte-compile loaddefs-gen generate-lisp-file lisp-mnt info consult-autoloads flymake-proselint-autoloads corfu-autoloads diff-hl-autoloads focus-autoloads haskell-mode-autoloads buffer-env-autoloads avy-autoloads yasnippet-snippets-autoloads magit-autoloads geiser-mit-autoloads inspector-autoloads bash-completion-autoloads ef-themes-autoloads auctex-autoloads tex-site git-commit-autoloads with-editor-autoloads geiser-guile-autoloads geiser-impl help-fns radix-tree help-mode cl-loaddefs cl-lib geiser-custom geiser-base ring geiser-autoloads transient-autoloads magit-section-autoloads vertico-autoloads 0x0-autoloads debbugs-autoloads compat-autoloads editorconfig-autoloads rcirc-color-autoloads orderless-autoloads yasnippet-autoloads markdown-mode-autoloads slime-autoloads macrostep-autoloads writegood-mode-autoloads go-mode-autoloads dash-autoloads rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-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 nadvice seq simple cl-generic indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 739347 76383) (symbols 48 33750 18) (strings 32 159911 10527) (string-bytes 1 4359661) (vectors 16 93122) (vector-slots 8 1939887 121376) (floats 8 555 2277) (intervals 56 25166 3922) (buffers 984 36)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 05:22:28 2022 Received: (at 60155-done) by debbugs.gnu.org; 25 Dec 2022 10:22:28 +0000 Received: from localhost ([127.0.0.1]:47593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9O9E-0007Cn-90 for submit@debbugs.gnu.org; Sun, 25 Dec 2022 05:22:28 -0500 Received: from mout02.posteo.de ([185.67.36.66]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9O9C-0007CV-8Y for 60155-done@debbugs.gnu.org; Sun, 25 Dec 2022 05:22:27 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 3C1BF2402EA for <60155-done@debbugs.gnu.org>; Sun, 25 Dec 2022 11:22:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671963740; bh=egWnh0uh0hAPjhFtxON44xpa6vTm99sJmOHANrOiHi0=; h=From:To:Subject:Date:From; b=I3IrnTaqJmNdhRFvaM8B4RMe6s2PRG72LNMx6iZHnanCA2tD2noQ2k63/v6U2AuZd WrfxPx9jtPWg29JvLUakzL1fTYgC39XuGxDJk1xApVuU7golGS1RuFG89B3tmn6GYi wVwCLvJwbw0bD9FsxprYyHXWoR/Dp2j2lwnU2/CRo4t/id6bN3WhJGjb/Jadxpekqk mD65lmbeLo0kqXafUG0nmB6UUmH+63g+JPOAgSjsFVr0yk4zrL++Gp+s4F7RjigZqh d8toG9JqA0cTIKDTcLdZK2rS6+Zwh8gOKVx3MI1j4DZldth9ivKI6J2N1sfR9FyJx1 3nv1GVd+w+kZA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Nfxmq57Mvz6tmV for <60155-done@debbugs.gnu.org>; Sun, 25 Dec 2022 11:22:18 +0100 (CET) From: Philip Kaludercic To: 60155-done@debbugs.gnu.org Subject: Re: bug#60155: 29.0.60; package-vc doesn't detect subdirectories when installing from repositories In-Reply-To: <87ilia4615.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 17 Dec 2022 11:35:18 +0000") References: <87ilia4615.fsf@posteo.net> Date: Sun, 25 Dec 2022 10:22:24 +0000 Message-ID: <87y1qvye8v.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60155-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > M-x package-vc-install RET https://codeberg.org/martianh/mastodon.el RET > > This will fetch the package sources, but since the actual code is > located in a "lisp" subdirectory, none of the actual files will be added > to the load-path, making it appear as tough nothing were installed. > > This could be fixed by adding a heuristic to package-vc--unpack-1 that > checks if there is a ./lisp/ directory (with .el files?) and that would > add that to the load-path. Are there any other directory names or > structures that should be considered as well? Is it common for packages > to have loadable files in both the root directory of a repository and a > sub-directory? > > I could imagine that this would be enough to resolve the issue: > > diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el > index 8f0eedd2f8..eea5ad6c26 100644 > --- a/lisp/emacs-lisp/package-vc.el > +++ b/lisp/emacs-lisp/package-vc.el > @@ -443,6 +443,12 @@ package-vc--unpack-1 > (auto-name (format "%s-autoloads.el" name)) > (extras (package-desc-extras pkg-desc)) > (lisp-dir (alist-get :lisp-dir extras))) > + ;; Heuristic to guess a sub-directory with lisp files. > + (when-let (((null lisp-dir)) > + (dir (expand-file-name "lisp" pkg-dir)) > + ((file-directory-p dir))) > + (setq lisp-dir dir)) > + > (package-generate-autoloads > name (file-name-concat pkg-dir lisp-dir)) > (when lisp-dir I have installed a variation upon this diff in n06368fef. Please report if this heuristic is too aggressive. From unknown Sun Jul 27 00:27:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Jan 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator