unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sam Steingold <sds@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: mac os x: how do you run emacs in-place?
Date: Fri, 28 Nov 2014 01:09:06 -0500	[thread overview]
Message-ID: <m21tonx3el.fsf@gnu.org> (raw)
In-Reply-To: 5477044B.3080300@swipnet.se

> * Jan D. <wna.u.q@fjvcarg.fr> [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 <sds@gnu.org> 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.




  reply	other threads:[~2014-11-28  6:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 19:01 mac os x: how do you run emacs in-place? Sam Steingold
2014-11-26 20:01 ` Harald Hanche-Olsen
2014-11-26 21:17   ` Sam Steingold
2014-11-26 20:56 ` David Reitter
2014-11-26 21:25   ` Sam Steingold
2014-11-26 21:36     ` David Reitter
2014-11-27 11:00       ` Jan D.
2014-11-28  6:09         ` Sam Steingold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-26 20:18 Angelo Graziosi

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m21tonx3el.fsf@gnu.org \
    --to=sds@gnu.org \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).