From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: is it bad to have both org and org-plus-contrib installed? Date: Tue, 11 Apr 2017 22:38:37 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1142c3765756e9054cebc11c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cy4R1-0004dZ-RU for emacs-orgmode@gnu.org; Tue, 11 Apr 2017 18:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cy4R0-0007QG-7b for emacs-orgmode@gnu.org; Tue, 11 Apr 2017 18:38:51 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:35728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cy4Qz-0007Ov-Rm for emacs-orgmode@gnu.org; Tue, 11 Apr 2017 18:38:50 -0400 Received: by mail-lf0-x22a.google.com with SMTP id 75so5628014lfs.2 for ; Tue, 11 Apr 2017 15:38:49 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Thomas S. Dye" , Alan Schmitt Cc: emacs-orgmode --001a1142c3765756e9054cebc11c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, I just discovered a bug in this advice that I suggested earlier in this thread.. I needed to fix the order of packages in the new-ret list that is returned. The bug was that the order of pkgs in new-ret was flipped compared to that in orig-ret.. so I needed to flip it back using reverse. So just for record, here is the fixed function: ;; http://emacs.stackexchange.com/a/26513/115 (defun modi/package-dependency-check-ignore (orig-ret) "Remove the `black listed packages' from ORIG-RET. Packages listed in the let-bound `pkg-black-list' will not be auto-installe= d even if they are found as dependencies. It is known that this advice is not effective when installed packages asynchronously using `paradox'. Below is effective on synchronous package installations." (let ((pkg-black-list '(org)) new-ret pkg-name) (dolist (pkg-struct orig-ret) (setq pkg-name (package-desc-name pkg-struct)) (if (member pkg-name pkg-black-list) (message (concat "Package `%s' will not be installed. " "See `modi/package-dependency-check-ignore'.") pkg-name) (push pkg-struct new-ret))) ;; Tue Apr 11 17:48:16 EDT 2017 - kmodi ;; It's *very* critical that the order of packages stays the same in NEW-RET ;; as in ORIG-RET. The `push' command flips the order, so use `reverse' ;; to flip the order back to the original. ;; Without this step, you will get errors like below when installing ;; packages with dependencies: ;; Debugger entered--Lisp error: (error "Unable to activate package =E2=80=98nim-mode=E2=80=99. ;; Required package =E2=80=98flycheck-28=E2=80=99 is unavailable") (setq new-ret (reverse new-ret)) new-ret)) (advice-add 'package-compute-transaction :filter-return #'modi/package-dependency-check-ignore) On Tue, Jan 24, 2017 at 11:28 AM Thomas S. Dye wrote: > > Alan Schmitt writes: > > > Thank you for the suggestion, but I use Spacemacs, which in turn uses > > paradox. > > > > Why couldn't there be an org-contrib package, depending on org? So that > > way org would not be duplicated in two packages. > > I've run into the same problem with Spacemacs and would welcome a > solution. > > All the best, > Tom > > -- > Thomas S. Dye > http://www.tsdye.com > --=20 Kaushal Modi --001a1142c3765756e9054cebc11c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I just discovered a = bug in this advice that I suggested earlier in this thread.. I needed to fi= x the order of packages in the new-ret list that is returned. The bug was t= hat the order of pkgs in new-ret was flipped compared to that in orig-ret..= so I needed to flip it back using reverse.

So just for record= , here is the fixed function:

(defun modi/package-dependency-check-ignore (orig-ret)
=C2=A0 "Remove the `black listed packages&#= 39; from ORIG-RET.

Packages listed in the let-bound `pkg-blac= k-list' will not be auto-installed
even if they are found as dependencies.

It is known t= hat this advice is not effective when installed packages
<= font face=3D"monospace">asynchronously using `paradox'. Below is effect= ive on synchronous
package instal= lations."
=C2=A0 (let ((pkg-= black-list '(org))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 new-ret
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 pkg-name)
= =C2=A0 =C2=A0 (dolist (pkg-struct orig-ret)
=C2=A0 =C2=A0 =C2=A0 (setq pkg-name (package-desc-name pkg-s= truct))
=C2=A0 =C2=A0 =C2=A0 (if = (member pkg-name pkg-black-list)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message (concat "Package `%s' = will not be installed. "
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0"See `modi/package-dependency-check-ignore'.&q= uot;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkg-name)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (push pkg-struct new-ret)))<= br>
=C2=A0 =C2=A0 ;; Tue Apr 11 1= 7:48:16 EDT 2017 - kmodi
=C2=A0 = =C2=A0 ;; It's *very* critical that the order of packages stays the sam= e in NEW-RET
=C2=A0 =C2=A0 ;; as = in ORIG-RET. The `push' command flips the order, so use `reverse'
=C2=A0 =C2=A0 ;; to flip the order= back to the original.
=C2=A0 =C2= =A0 ;; =C2=A0 Without this step, you will get errors like below when instal= ling
=C2=A0 =C2=A0 ;; packages wi= th dependencies:
=C2=A0 =C2=A0 ;;= =C2=A0 Debugger entered--Lisp error: (error "Unable to activate packa= ge =E2=80=98nim-mode=E2=80=99.
= =C2=A0 =C2=A0 ;; =C2=A0 Required package =E2=80=98flycheck-28=E2=80=99 is u= navailable")
=C2=A0 =C2=A0 (= setq new-ret (reverse new-ret))
= =C2=A0 =C2=A0 new-ret))
(advice-add 'package-compute-transaction :filter-return #'modi/pac= kage-dependency-check-ignore)

On Tue, Jan 24, 2017 at 11:28 AM Thomas S. Dye <tsd@tsdye.com> wrote:

Alan Schmitt writes:

> Thank you for the suggestion, but I use Spacemacs, which in turn uses<= br class=3D"gmail_msg"> > paradox.
>
> Why couldn't there be an org-contrib package, depending on org? So= that
> way org would not be duplicated in two packages.

I've run into the same problem with Spacemacs and would welcome a
solution.

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com
--

Kaushal Modi

--001a1142c3765756e9054cebc11c--