emacs-devel
[Top][All Lists]
Advanced

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

Re: The source linke in the help buffer


From: Lennart Borgman
Subject: Re: The source linke in the help buffer
Date: Wed, 24 Sep 2008 14:53:37 +0200

On 9/24/08, martin rudalics <address@hidden> wrote:
> > The source link in the help buffer now includes th whole path. Is this
> > the intention now?
>
> It was _my_ intention in reaction to bug#587 you filed.

Hi Martin, thanks for fixing it. I did not follow the discussion that
closely. I remembered that someone said that the directory was
stripped to early, but maybe the full path is not needed if the file
belongs to Emacs?


> > What happened with the possibility to go to a checked out source file
> > instead of the file in the installed elisp tree?
>
> How would Emacs reliably know where the "checked out" file is?  Where
> would you want to go after an update from the repository but before you
> remade or recompiled?  And where would you want to go when you redefine
> a function from a checked-out file and evaluated that definition?

I was more thinking about a way to go to the checked out elisp source
file from the elisp file you are visiting. That is pretty useful for
me at least. This is what I use now:

  (defun find-emacs-source-file ()
    "Find checked out Emacs source corresponding to buffer file.
  Display it in other window."
    (interactive)
    (let* ((install-directory
           (file-name-as-directory (expand-file-name
                                    ".." exec-directory)))
           (relative-install
            (file-relative-name (buffer-file-name)
                                install-directory))
           source-file)
      (when (string= ".." (substring relative-install
                                     0 2))
        (error "This file is not in Emacs lisp tree"))
      (setq source-file (expand-file-name
                         relative-install
                         source-directory))
      (find-file-other-window source-file)))

Maybe it could go to the same line etc.

> If people think that's useful we can introduce variables like
> `emacs-lisp-source-directory' and `emacs-C-source-directory' and have
> help go find them there if these are non-nil.  We can also make an
> optional, second link for this in the help-buffer, let `find-function'
> use the same approach (obsoleting
> `find-function-C-source-directory'),
> and many more.
>
> martin
>




reply via email to

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