unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Relating Symbols
@ 2009-11-30  9:28 Nordlöw
  2009-11-30 11:35 ` Juanma Barranquero
  2009-11-30 11:57 ` Pascal J. Bourguignon
  0 siblings, 2 replies; 8+ messages in thread
From: Nordlöw @ 2009-11-30  9:28 UTC (permalink / raw)
  To: help-gnu-emacs

Every time I discover an obscurely named elisp function solving a
common problem I'm looking for I always add an alias (defalias)
connecting personal keywords I had in mind when search for the
function, variable, face etc with the symbol that does the job.

Once in a while I also find existing functions that I somehow want to
relate so I have a package which contains lots of dual put-calls like:

(put 'trace-function :related 'debug-on-entry)
(put 'debug-on-entry :related 'trace-function)

I know would like to this information to be displayed (at the end
preferrably) when I do describe-... on that symbol. Any tips on
realizing this using hooks or advices to the help functions?

Thanks in advance,
Nordlöw


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30  9:28 Relating Symbols Nordlöw
@ 2009-11-30 11:35 ` Juanma Barranquero
  2009-11-30 11:57 ` Pascal J. Bourguignon
  1 sibling, 0 replies; 8+ messages in thread
From: Juanma Barranquero @ 2009-11-30 11:35 UTC (permalink / raw)
  To: Nordlöw; +Cc: help-gnu-emacs

On Mon, Nov 30, 2009 at 10:28, Nordlöw <per.nordlow@gmail.com> wrote:

> I know would like to this information to be displayed (at the end
> preferrably) when I do describe-... on that symbol. Any tips on
> realizing this using hooks or advices to the help functions?

This is a crude first cut at implementing it:

(defadvice describe-function (after related activate compile)
  (let ((related (get (ad-get-arg 0) :related)))
    (when related
      (with-current-buffer (get-buffer "*Help*")
        (let ((buffer-read-only nil)
              (inhibit-changing-match-data t))
          (goto-char (point-max))
          (re-search-backward "\\[back\\]")
          (insert (format "Related: %s\n\n" related)))))))

though, if you want to allow related to be a list, or the inserted
function names to be links, you'll have to dig deeper.

    Juanma




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30  9:28 Relating Symbols Nordlöw
  2009-11-30 11:35 ` Juanma Barranquero
@ 2009-11-30 11:57 ` Pascal J. Bourguignon
  2009-11-30 14:25   ` harven
  1 sibling, 1 reply; 8+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-30 11:57 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> Every time I discover an obscurely named elisp function solving a
> common problem I'm looking for I always add an alias (defalias)
> connecting personal keywords I had in mind when search for the
> function, variable, face etc with the symbol that does the job.
>
> Once in a while I also find existing functions that I somehow want to
> relate so I have a package which contains lots of dual put-calls like:
>
> (put 'trace-function :related 'debug-on-entry)
> (put 'debug-on-entry :related 'trace-function)
>
> I know would like to this information to be displayed (at the end
> preferrably) when I do describe-... on that symbol. Any tips on
> realizing this using hooks or advices to the help functions?

Use the source!

Same as your previous function.  Do you think we remember all these
answers?  It's always the same thing. You want something about
next-error, ok, C-h f next-error RET C-x o TAB RET and read the
source!

Idem here, C-h f describe-function RET C-x o TAB RET and read the doc
and the source!

In my emacs instance, the doc of describe-function  note that it is
adviced.  Perhaps you could do the same, and add an advice to add the
descriptions you want?  (See defadvise).


-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30 11:57 ` Pascal J. Bourguignon
@ 2009-11-30 14:25   ` harven
  2009-11-30 14:47     ` Renaud Casenave-Péré
                       ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: harven @ 2009-11-30 14:25 UTC (permalink / raw)
  To: help-gnu-emacs

pjb@informatimago.com (Pascal J. Bourguignon) writes:

> Nordlöw <per.nordlow@gmail.com> writes:

> Use the source!
>
> Same as your previous function.  Do you think we remember all these
> answers?  It's always the same thing. You want something about
> next-error, ok, C-h f next-error RET C-x o TAB RET and read the
> source!

I recently used a linux debian system and it seems that the elisp
sources are not shipped with a standard install on this distribution.
In fact there are only compiled .elc files on the system. This is a
pity IMHO.

I can grab the .el files from the emacs site, but I'm not sure where
to put them, so that they become available through the help bindings.
Besides that, they probably will be wipped out by the next automatic
upgrade.

Any solution to recover the sources, without recompiling everything ?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30 14:25   ` harven
@ 2009-11-30 14:47     ` Renaud Casenave-Péré
       [not found]     ` <mailman.11844.1259592486.2239.help-gnu-emacs@gnu.org>
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Renaud Casenave-Péré @ 2009-11-30 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

From: harven <harven@free.fr>
Subject: Re: Relating Symbols
Date: Mon, 30 Nov 2009 15:25:00 +0100

> pjb@informatimago.com (Pascal J. Bourguignon) writes:
> 
>> Nordlöw <per.nordlow@gmail.com> writes:
> 
>> Use the source!
>>
>> Same as your previous function.  Do you think we remember all these
>> answers?  It's always the same thing. You want something about
>> next-error, ok, C-h f next-error RET C-x o TAB RET and read the
>> source!
> 
> I recently used a linux debian system and it seems that the elisp
> sources are not shipped with a standard install on this distribution.
> In fact there are only compiled .elc files on the system. This is a
> pity IMHO.
> 
> I can grab the .el files from the emacs site, but I'm not sure where
> to put them, so that they become available through the help bindings.
> Besides that, they probably will be wipped out by the next automatic
> upgrade.
> 
> Any solution to recover the sources, without recompiling everything ?

`aptitude install emacs23-el' ?

the elisp sources files are shipped within a different package.

-- 
Renaud Casenave-Péré

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
       [not found]     ` <mailman.11844.1259592486.2239.help-gnu-emacs@gnu.org>
@ 2009-11-30 15:14       ` harven
  0 siblings, 0 replies; 8+ messages in thread
From: harven @ 2009-11-30 15:14 UTC (permalink / raw)
  To: help-gnu-emacs

Renaud Casenave-Péré <renaud@casenave-pere.fr> writes:
>>> Nordlöw <per.nordlow@gmail.com> writes:
>> 
>>> Use the source!
>>>
>>> Same as your previous function.  Do you think we remember all these
>>> answers?  It's always the same thing. You want something about
>>> next-error, ok, C-h f next-error RET C-x o TAB RET and read the
>>> source!
>> 
>> I recently used a linux debian system and it seems that the elisp
>> sources are not shipped with a standard install on this distribution.
>> In fact there are only compiled .elc files on the system. This is a
>> pity IMHO.
>> 
>> I can grab the .el files from the emacs site, but I'm not sure where
>> to put them, so that they become available through the help bindings.
>> Besides that, they probably will be wipped out by the next automatic
>> upgrade.
>> 
>> Any solution to recover the sources, without recompiling everything ?
>
> `aptitude install emacs23-el' ?
>
> the elisp sources files are shipped within a different package.

Thanks !


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30 14:25   ` harven
  2009-11-30 14:47     ` Renaud Casenave-Péré
       [not found]     ` <mailman.11844.1259592486.2239.help-gnu-emacs@gnu.org>
@ 2009-11-30 19:06     ` Pascal J. Bourguignon
  2009-11-30 21:45     ` Tim X
  3 siblings, 0 replies; 8+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-30 19:06 UTC (permalink / raw)
  To: help-gnu-emacs

harven <harven@free.fr> writes:
> Any solution to recover the sources, without recompiling everything ?

Downloading and compiling emacs is a five minute affair.


-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Relating Symbols
  2009-11-30 14:25   ` harven
                       ` (2 preceding siblings ...)
  2009-11-30 19:06     ` Pascal J. Bourguignon
@ 2009-11-30 21:45     ` Tim X
  3 siblings, 0 replies; 8+ messages in thread
From: Tim X @ 2009-11-30 21:45 UTC (permalink / raw)
  To: help-gnu-emacs

harven <harven@free.fr> writes:

> pjb@informatimago.com (Pascal J. Bourguignon) writes:
>
>> Nordlöw <per.nordlow@gmail.com> writes:
>
>> Use the source!
>>
>> Same as your previous function.  Do you think we remember all these
>> answers?  It's always the same thing. You want something about
>> next-error, ok, C-h f next-error RET C-x o TAB RET and read the
>> source!
>
> I recently used a linux debian system and it seems that the elisp
> sources are not shipped with a standard install on this distribution.
> In fact there are only compiled .elc files on the system. This is a
> pity IMHO.
>
> I can grab the .el files from the emacs site, but I'm not sure where
> to put them, so that they become available through the help bindings.
> Besides that, they probably will be wipped out by the next automatic
> upgrade.
>
> Any solution to recover the sources, without recompiling everything ?

Yep, The sources are in their own package. Just install it.

Tim

-- 
tcross (at) rapttech dot com dot au


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-30 21:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30  9:28 Relating Symbols Nordlöw
2009-11-30 11:35 ` Juanma Barranquero
2009-11-30 11:57 ` Pascal J. Bourguignon
2009-11-30 14:25   ` harven
2009-11-30 14:47     ` Renaud Casenave-Péré
     [not found]     ` <mailman.11844.1259592486.2239.help-gnu-emacs@gnu.org>
2009-11-30 15:14       ` harven
2009-11-30 19:06     ` Pascal J. Bourguignon
2009-11-30 21:45     ` Tim X

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).