emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mac os x: how do you run emacs in-place?


From: Sam Steingold
Subject: Re: mac os x: how do you run emacs in-place?
Date: Fri, 28 Nov 2014 01:09:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin)

> * Jan D. <address@hidden> [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 <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]