unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fix interactive spec for kill-region
@ 2012-09-02 14:33 T.V. Raman
  2012-09-02 14:52 ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: T.V. Raman @ 2012-09-02 14:33 UTC (permalink / raw)
  To: emacs-devel

Saw an unexplained bytecomp warning in the emacspeak build and
traced it down the following:

The definition of kill-region appears not to match its
interactive spec --- the  optional third arg  does not appear in
the interactive spec.
See
(defun kill-region (beg end &optional yank-handler)
vs
(interactive (list (point) (mark)))

-- 
Best Regards,
--raman



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

* Re: fix interactive spec for kill-region
  2012-09-02 14:33 fix interactive spec for kill-region T.V. Raman
@ 2012-09-02 14:52 ` Andreas Schwab
  2012-09-04  0:01   ` T.V. Raman
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2012-09-02 14:52 UTC (permalink / raw)
  To: T.V. Raman; +Cc: emacs-devel

"T.V. Raman" <tv.raman.tv@gmail.com> writes:

> The definition of kill-region appears not to match its
> interactive spec --- the  optional third arg  does not appear in
> the interactive spec.
> See
> (defun kill-region (beg end &optional yank-handler)
> vs
> (interactive (list (point) (mark)))

Why is that a problem?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* fix interactive spec for kill-region
  2012-09-02 14:52 ` Andreas Schwab
@ 2012-09-04  0:01   ` T.V. Raman
  2012-09-04  3:45     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: T.V. Raman @ 2012-09-04  0:01 UTC (permalink / raw)
  To: Andreas Schwab, emacs-devel

The signature doesn't match, and you get byte compiler warnings.
-- 

-- 


On 9/2/12, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "T.V. Raman" <tv.raman.tv@gmail.com> writes:
>
>> The definition of kill-region appears not to match its
>> interactive spec --- the  optional third arg  does not appear in
>> the interactive spec.
>> See
>> (defun kill-region (beg end &optional yank-handler)
>> vs
>> (interactive (list (point) (mark)))
>
> Why is that a problem?
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>



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

* Re: fix interactive spec for kill-region
  2012-09-04  0:01   ` T.V. Raman
@ 2012-09-04  3:45     ` Stefan Monnier
  2012-09-07 16:00       ` T.V. Raman
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2012-09-04  3:45 UTC (permalink / raw)
  To: T.V. Raman; +Cc: Andreas Schwab, emacs-devel

> The signature doesn't match, and you get byte compiler warnings.

Please report the actual byte-compilation warnings instead, then.
I have a strong feeling you're confused about the source of the problem
(which probably comes from the fact that the 3 optional argument was
made obsolete and is hidden by an advertised signature).


        Stefan



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

* fix interactive spec for kill-region
  2012-09-04  3:45     ` Stefan Monnier
@ 2012-09-07 16:00       ` T.V. Raman
  2012-09-07 19:37         ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: T.V. Raman @ 2012-09-07 16:00 UTC (permalink / raw)
  To: Stefan Monnier, Andreas Schwab, emacs-devel

Here is the byte-compiler warning:

emacs -batch -q -no-site-file   -eval '(setq vc-handled-backends nil
byte-compile-warnings t)'  -l ".."/lisp/emacspeak-load-path.el -l
".."/lisp/emacspeak-loaddefs.el -l ".."/lisp/emacspeak-cus-load.el -l
".."/lisp/g-client/g-load-path.el  -f batch-byte-compile
emacspeak-advice.el
Warning: Unknown defun property special in emacspeak-should-i-fix-interactive-p

In toplevel form:
emacspeak-advice.el:1607:52:Warning: ad-Orig-kill-region called with 3
    arguments, but accepts only 2

Line 1607 is the last line of this advice form:

(defadvice kill-region (around emacspeak pre act)
  "Indicate region has been killed.
Use an auditory icon if possible."
  (cond
   ((ems-interactive-p )
    (let ((count (count-lines (region-beginning) (region-end))))
      ad-do-it
      (emacspeak-auditory-icon 'delete-object )
      (message "Killed region containing %s lines" count)))
   (t ad-do-it))
  ad-return-value)

 I'll attach just the advice form that triggers the error:
-- 

-- 


On 9/3/12, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> The signature doesn't match, and you get byte compiler warnings.
>
> Please report the actual byte-compilation warnings instead, then.
> I have a strong feeling you're confused about the source of the problem
> (which probably comes from the fact that the 3 optional argument was
> made obsolete and is hidden by an advertised signature).
>
>
>         Stefan
>



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

* Re: fix interactive spec for kill-region
  2012-09-07 16:00       ` T.V. Raman
@ 2012-09-07 19:37         ` Stefan Monnier
  2012-09-08 15:00           ` T.V. Raman
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2012-09-07 19:37 UTC (permalink / raw)
  To: T.V. Raman; +Cc: Andreas Schwab, emacs-devel

> emacspeak-advice.el:1607:52:Warning: ad-Orig-kill-region called with 3
>     arguments, but accepts only 2

The warning is in error here: while we want to discourage the use of the
3rd arg (hence this warning), its use is correct here, since the advice
just takes the 3 args and passes them further untouched.
I'm not sure how best to explain this to the byte-compiler, tho.

        Stefan



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

* fix interactive spec for kill-region
  2012-09-07 19:37         ` Stefan Monnier
@ 2012-09-08 15:00           ` T.V. Raman
  2012-09-08 16:14             ` Andreas Schwab
  2012-10-26 18:02             ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: T.V. Raman @ 2012-09-08 15:00 UTC (permalink / raw)
  To: Stefan Monnier, Andreas Schwab, emacs-devel

Hmm  would doing a require of simple.el fix it?

-- 
Best Regards,
--raman


On 9/7/12, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> emacspeak-advice.el:1607:52:Warning: ad-Orig-kill-region called with 3
>>     arguments, but accepts only 2
>
> The warning is in error here: while we want to discourage the use of the
> 3rd arg (hence this warning), its use is correct here, since the advice
> just takes the 3 args and passes them further untouched.
> I'm not sure how best to explain this to the byte-compiler, tho.
>
>         Stefan
>



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

* Re: fix interactive spec for kill-region
  2012-09-08 15:00           ` T.V. Raman
@ 2012-09-08 16:14             ` Andreas Schwab
  2012-10-26 18:02             ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Schwab @ 2012-09-08 16:14 UTC (permalink / raw)
  To: T.V. Raman; +Cc: Stefan Monnier, emacs-devel

"T.V. Raman" <tv.raman.tv@gmail.com> writes:

> Hmm  would doing a require of simple.el fix it?

Since simple is preloaded it is always provided already.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: fix interactive spec for kill-region
  2012-09-08 15:00           ` T.V. Raman
  2012-09-08 16:14             ` Andreas Schwab
@ 2012-10-26 18:02             ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2012-10-26 18:02 UTC (permalink / raw)
  To: T.V. Raman; +Cc: Andreas Schwab, emacs-devel

> Hmm  would doing a require of simple.el fix it?

No.  We can either live with the incorrect warning, or disable it with
`with-no-warnings' (which I dislike), or deploy significant efforts in
bytecomp.el to try and make the bye-compiler understand what's going on.

I've installed a patch which uses with-no-warnings.


        Stefan



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

end of thread, other threads:[~2012-10-26 18:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-02 14:33 fix interactive spec for kill-region T.V. Raman
2012-09-02 14:52 ` Andreas Schwab
2012-09-04  0:01   ` T.V. Raman
2012-09-04  3:45     ` Stefan Monnier
2012-09-07 16:00       ` T.V. Raman
2012-09-07 19:37         ` Stefan Monnier
2012-09-08 15:00           ` T.V. Raman
2012-09-08 16:14             ` Andreas Schwab
2012-10-26 18:02             ` Stefan Monnier

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