From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: mac os x: how do you run emacs in-place? Date: Fri, 28 Nov 2014 01:09:06 -0500 Organization: disorganization Message-ID: References: <49674948-99E1-4A5B-AC53-EC1F092EB2E5@gmail.com> <5477044B.3080300@swipnet.se> Reply-To: sds@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417154974 12313 80.91.229.3 (28 Nov 2014 06:09:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2014 06:09:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 28 07:09:30 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XuEkD-0005Kq-TS for ged-emacs-devel@m.gmane.org; Fri, 28 Nov 2014 07:09:30 +0100 Original-Received: from localhost ([::1]:42647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuEkD-0001kf-CD for ged-emacs-devel@m.gmane.org; Fri, 28 Nov 2014 01:09:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuEk6-0001jz-4U for emacs-devel@gnu.org; Fri, 28 Nov 2014 01:09:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuEk1-0005rJ-Uc for emacs-devel@gnu.org; Fri, 28 Nov 2014 01:09:22 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:34289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuEk1-0005rD-Nf for emacs-devel@gnu.org; Fri, 28 Nov 2014 01:09:17 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XuEk0-0005FK-Cb for emacs-devel@gnu.org; Fri, 28 Nov 2014 07:09:16 +0100 Original-Received: from c-24-60-113-1.hsd1.ma.comcast.net ([24.60.113.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Nov 2014 07:09:16 +0100 Original-Received: from sds by c-24-60-113-1.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Nov 2014 07:09:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-60-113-1.hsd1.ma.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Cancel-Lock: sha1:DwsBRywgRnEJ2ef04tRtoUdIOJE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178396 Archived-At: > * Jan D. [2014-11-27 12:00:27 +0100]: > > David Reitter skrev den 2014-11-26 22:36: >> On Nov 26, 2014, at 4:25 PM, Sam Steingold wrote: >> >>> and I don't want to use that, mostly because clicking on file names in >>> *Help* buffer finds the installed "el.gz" files instead of the files >>> under version control. >> > I use this: > > (defadvice find-lisp-object-file-name (after my-find-in-source) > (if (stringp ad-return-value) > (let* ((str ad-return-value) > (idx (string-match "/lisp/" str)) > (nfile (if idx (concat source-directory > (substring str idx)) nil))) > (if (and nfile (file-exists-p nfile)) > (setq ad-return-value nfile))))) > (ad-activate 'find-lisp-object-file-name) Thanks for the idea. Here is my version (uses the "modern" advice): (when (eq system-type 'darwin) (defun sds-ns-find-in-source (f &rest args) "Find lisp objects in sources and not installation." (let* ((value (apply f args)) (nfile (and value (string-match "/nextstep/Emacs.app/Contents/Resources/" value) (concat source-directory (substring value (match-end 0)))))) (if (and nfile (file-exists-p nfile)) nfile value))) (advice-add 'find-lisp-object-file-name :around 'sds-ns-find-in-source)) -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1343 http://www.childpsy.net/ http://honestreporting.com http://ffii.org http://www.dhimmitude.org http://islamexposedonline.com Linux - find out what you've been missing while you've been rebooting Windows.