From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: Can I share ~/.emacs.d/elpa with two machines? Date: Mon, 5 Oct 2015 08:46:33 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1444049259 26864 80.91.229.3 (5 Oct 2015 12:47:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Oct 2015 12:47:39 +0000 (UTC) Cc: Help Gnu Emacs mailing list , Stefan Monnier To: Rainer M Krug Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 05 14:47:33 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zj5Ay-00067G-L4 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Oct 2015 14:47:32 +0200 Original-Received: from localhost ([::1]:45623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj5Ax-0005y9-07 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Oct 2015 08:47:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj5Ai-0005xD-Lu for help-gnu-emacs@gnu.org; Mon, 05 Oct 2015 08:47:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zj5Ag-0001w8-IY for help-gnu-emacs@gnu.org; Mon, 05 Oct 2015 08:47:16 -0400 Original-Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:35939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj5Ag-0001vy-AC for help-gnu-emacs@gnu.org; Mon, 05 Oct 2015 08:47:14 -0400 Original-Received: by obcgx8 with SMTP id gx8so127113854obc.3 for ; Mon, 05 Oct 2015 05:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=haWupyuWQBEZbMFNlLGkYY8310wLB2rzb6ZyFxCZaqs=; b=KmwpD1ojAW2WDZwIrRIvbVoVPk0IQ89blVFHy79FsSQ4oxdgIU07KhQZoR/WNc6Y/6 rZUoJU9dICOn40JC726fJAbL4xRJqBFgMHVa8/IJQ01kTzAe01CtP86VMQl8i/o+f2Bv r7D/+oXoj4WgEW5yGkQGXqDjvsRkc06vIeTu/iuDu1NLlcYyGGPO5nRYoYl0VhRE8Knk IC6NLLFLBE4jRv2vT4II3TEXoa7wo6wUI8WoA9Sk8uuXbXNkx4t26Xnf7TzwtAGFC4Ec MDBl6ojwQ/SBt17ryCliKhTRuhh98Ks/BTa9PrC8Vv+mWTtVeT7L9P+I7ejrMXNbaB+Q fRjQ== X-Received: by 10.60.42.197 with SMTP id q5mr16413821oel.52.1444049233453; Mon, 05 Oct 2015 05:47:13 -0700 (PDT) Original-Received: by 10.202.172.205 with HTTP; Mon, 5 Oct 2015 05:46:33 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::229 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107513 Archived-At: > My only question is the contrib directory. I assume I simply also have to copy the files in the same version specific lisp dir? For contrib packages (well, only one package that I use from there), I use the org-plus-contrib package from the Org Elpa (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) I have version-specific package-user-dir, so I have org-plus-contrib installed and compiled for all emacs versions in their own elpa_ directories. ;; Create the package install directory if it doesn't exist (setq package-user-dir (concat user-emacs-directory "elpa_" emacs-version-short "/")) ; default = ~/.emacs.d/elpa/ I prefer to have both the dev version and stable version of org installed. So that if needed, I can switch between the two by toggling a variable and restarting emacs. As the package that I use from contrib does not need to be cutting-edge, I just use it from the already installed stable org-plus-contrib :) I use something like this for org version switching (if you are interested): (when (bound-and-true-p org-load-version-dev) ;; if `org-load-version-dev' is non-nil (add-to-list 'load-path (concat user-emacs-directory "elisp/org-mode/lisp_" emacs-version-short "/"))) If I don't have the org-load-version-dev set to any value or if I have set it to nil in my emacs config, the org-plus-contrib (stable version) installed by the package manager will be used by default. -- Kaushal Modi On Mon, Oct 5, 2015 at 3:54 AM, Rainer M Krug wrote: > Kaushal Modi writes: > > > I also update org via git and faced the compiled code incompatibility > > issue. I resolved it the same way .. using version specific compiled org > > dirs. > > > > Here's the full code gathered from various places in my config: > > > > Part 1: > > > https://github.com/kaushalmodi/.emacs.d/blob/56b84df6ff399ab65c040d4d872dc65fb45515e6/init.el#L9-L13 > > (setq user-home-directory (concat (getenv "HOME") "/")) ; must end > with > > / > > (setq user-emacs-directory (concat user-home-directory ".emacs.d/")) ; > > must end with / > > (setq emacs-version-short (replace-regexp-in-string > > "\\([0-9]+\\)\\.\\([0-9]+\\).*" > > "\\1_\\2" emacs-version)) ; 25.0.50.1 -> > 25_0 > > > > Part 2: > > > https://github.com/kaushalmodi/.emacs.d/blob/56b84df6ff399ab65c040d4d872dc65fb45515e6/setup-files/setup-org.el#L32-L34 > > (add-to-list 'load-path (concat user-emacs-directory > > "elisp/org-mode/lisp_" > > emacs-version-short "/")) > > > > Part 3: The nasty part. > > Use a shell script or script of your preferred flavor to build org-mode > for > > each of the emacs versions you are using and copy the built lisp/ dir to > > the version specific lisp dir. > > > > #!/bin/tcsh -f > > # Build script to compile org mode lisp for different emacs versions > > > > > > # > > # Back up your $PATH > > # > > > > alias get_org_mode_lisp_dir_suffix '\emacs --version | \grep -oE > '"'"'Emacs > > [0-9]+\.[0-9]+'"'"' | \awk '"'"'{print $2}'"'"' | \tr "." "_"' > > > > #** Build for emacs master > > > > # > > # Set the $PATH *here* to use the emacs master (built from latest in git) > > # I use something work proprietary like GNU Modules to do this > > # > > > > echo "\nBuilding for emacs version: "`\emacs --version | \grep -E 'Emacs > > [0-9]+\.[0-9]+'`"\n" > > make clean > > make > > set org_mode_lisp_dir = "lisp_"`get_org_mode_lisp_dir_suffix` > > if ( -d "${org_mode_lisp_dir}" ) then > > \rm -rf ${org_mode_lisp_dir} > > endif > > \cp -rf lisp ${org_mode_lisp_dir} > > > > #** Build for emacs 24.5 > > > > # > > # Set the $PATH *here* to use emacs 24.5 > > # I use something work proprietary like GNU Modules to do this > > # > > > > echo "\nBuilding for emacs version: "`\emacs --version | \grep -E 'Emacs > > [0-9]+\.[0-9]+'`"\n" > > make clean > > make > > set org_mode_lisp_dir = "lisp_"`get_org_mode_lisp_dir_suffix` > > if ( -d "${org_mode_lisp_dir}" ) then > > \rm -rf ${org_mode_lisp_dir} > > endif > > \cp -rf lisp ${org_mode_lisp_dir} > > > > unalias get_org_mode_lisp_dir_suffix > > unset {org_mode_lisp_dir} > > > > # > > # Restore your $PATH to point to your default emacs version > > # > > > > Part 4: Restart any one of the versions of emacs for which you compiled > the > > org files in Part 3. The org stuff will work just fine as it would pick > out > > the org files from the correct lisp_<>/ directory. > > > > I hope all of this makes sense. > > Thanks - makes perfect sense. My only question is the contrib > directory. I assume I simply also have to copy the files in the same > version specific lisp dir? > > Rainer > > > > > > > > > > -- > > Kaushal Modi > > > > On Fri, Oct 2, 2015 at 3:05 PM, Rainer M Krug wrote: > > > >> Kaushal Modi writes: > >> > >> > @Stefan, sharing elpa/ between at least emacs 24.5 and emacs 25.x (git > >> > master) does not work as the complied .elc files are not compatible > >> between > >> > the two versions. > >> > >> Just jumping in as I have the two version problem. > >> > >> I am fine with most of my stuff managed by cask, therefore aware of > >> versions. But how can I manage org, which is via git? Any smart > >> suggestion how I can use this between two versions on one machine? > >> > >> Rainer > >> > >> > >> > > >> > > >> > -- > >> > Kaushal Modi > >> > > >> > On Fri, Oct 2, 2015 at 11:54 AM, Stefan Monnier < > >> monnier@iro.umontreal.ca> > >> > wrote: > >> > > >> >> Yes, of course. > >> >> > >> >> Just like you can share it over NFS or any other file system. > >> >> You can share them even between different systems using different > >> >> Emacs versions, different processor architectures, and/or different > >> OSes. > >> >> > >> >> At least, if that leads to problems, then I'd recommend you file them > >> >> as bugs. > >> >> > >> >> > >> >> Stefan > >> >> > >> >> > >> >> > >> > > >> > >> -- > >> Rainer M. Krug > >> email: Rainerkrugsde > >> PGP: 0x0F52F982 > >> > > > > -- > Rainer M. Krug > email: Rainerkrugsde > PGP: 0x0F52F982 >