emacs-devel
[Top][All Lists]
Advanced

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

Re: table.el


From: Tak Ota
Subject: Re: table.el
Date: Mon, 03 Dec 2001 22:03:12 -0800 (PST)

Mon, 3 Dec 2001 01:46:54 -0700 (MST): Richard Stallman <address@hidden> wrote:

>     The reason why I needed wrapper mechanism was that I was advised by
>     you not to use advice in table.el, and that was because
>     `describe-function' of those advised functions mislead novice users to
>     table.el where there is no real information about the original
>     functions.  I personally dislike this shortcoming of
>     `describe-function'.
> 
> This could be a bug in advice.el.  Could you provide a simple test case?
> Perhaps advice.el should do something better to construct the doc string
> of the combined function.

I think the problem is rather in help.el or combination with
advice.el.


Normally C-h f `newline' says:

newline is an interactive compiled Lisp function in `simple'.

Now create a file ~/test.el which contents the following three lines.

(defadvice newline (around newline-wrapper last activate compile)
  "wrapps newline"
  ad-do-it)

Do M-x load-file ~/test.el and C-h f `newline' again.

Now the help message says:

newline is an interactive compiled Lisp function in `~/test.el'.


Same thing happens with table.el.  Before loading table.el

kill-region is an interactive compiled Lisp function in `simple'.

After loading table.el

kill-region is an interactive compiled Lisp function in `table'.


I've asked a question regarding this issue about a year ago on
address@hidden and didn't seem to get sufficient attention to
change anything.  See the attached messages.

-Tak
--- Begin Message --- Subject: a weakness in help.el? Date: Mon, 20 Nov 2000 14:14:53 -0800 (PST)
Under Emacs 20.7 `help-follow' fails.

How to reproduce:

1. Make a test file say "test.el" which content is:

;; test.el begins here
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'advice)
(require 'tabify)

(defadvice untabify (around advised-untabify last activate compile)
  ad-do-it
  (message "executed original `untabify'"))

(defmacro test-advice (func)
  (`
   (defadvice (, func) (around advised-tabify last activate compile)
     ad-do-it
     (message "executed original `tabify'"))))

(test-advice tabify)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test.el ends here


2. Start a fresh Emacs by "emacs -q -no-site-file".

3. M-x describe-function "tabify"

4. help-follow (hit RET) on the file name on the first line.

5. Get an error "Cannot find definition of `tabify' in library ..."

While

6. M-x describe-function "untabify"

7. help-follow (hit RET) on the file name on the first line.

8. test.el opens in a buffer and point goes to where `untabify' is
   advised.


Is this an expected limitation in help.el?  How difficult is it to
find an advice made by a macro?

-Tak

--- End Message ---
--- Begin Message --- Subject: Re: a weakness in help.el? Date: 22 Nov 2000 22:27:36 +0000 User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.92
Things are somewhat different in the current development code, but
there are known problem with the load history and advice.  We didn't
think they were important enough to work on, but we'd be happy to see
someone else contribute a clean solution.

--- End Message ---

reply via email to

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