unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* define-minor-mode: Suppressing warning
@ 2021-05-16 16:44 T.V Raman
  2021-05-16 17:00 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: T.V Raman @ 2021-05-16 16:44 UTC (permalink / raw)
  To: emacs-devel

When compiling code released for emacs 27.2 with emacs 28, you
presently get this warning:

emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated
positional arguments to `define-minor-mode'

I'm unable to suppress this warning  --- and I cant update my code
   to use the recommended keyword argument form until emacs 28 is
   released.

What's the solution (I dont want to add version checks  in my code)
-- 

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮



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

* Re: define-minor-mode: Suppressing warning
  2021-05-16 16:44 T.V Raman
@ 2021-05-16 17:00 ` Stefan Monnier
  2021-05-16 19:52   ` T.V Raman
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2021-05-16 17:00 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

T.V Raman [2021-05-16 09:44:54] wrote:

> When compiling code released for emacs 27.2 with emacs 28, you
> presently get this warning:
>
> emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated
> positional arguments to `define-minor-mode'
>
> I'm unable to suppress this warning  --- and I cant update my code
>    to use the recommended keyword argument form until emacs 28 is
>    released.

Why?  The recommended syntax is the one that was introduced back in
Emacs-21!


        Stefan




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

* Re: define-minor-mode: Suppressing warning
  2021-05-16 17:00 ` Stefan Monnier
@ 2021-05-16 19:52   ` T.V Raman
  2021-05-16 21:41     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: T.V Raman @ 2021-05-16 19:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 808 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Really? I looked at define-minor-mode in emacs 27.1 and it does not
appear to take the keyword argument, unless that is I'm very confused.

> T.V Raman [2021-05-16 09:44:54] wrote:
>
>> When compiling code released for emacs 27.2 with emacs 28, you
>> presently get this warning:
>>
>> emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated
>> positional arguments to `define-minor-mode'
>>
>> I'm unable to suppress this warning  --- and I cant update my code
>>    to use the recommended keyword argument form until emacs 28 is
>>    released.
>
> Why?  The recommended syntax is the one that was introduced back in
> Emacs-21!
>
>
>         Stefan
>

-- 

Thanks,

--Raman
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* define-minor-mode: Suppressing warning
@ 2021-05-16 20:04 T.V Raman
  0 siblings, 0 replies; 5+ messages in thread
From: T.V Raman @ 2021-05-16 20:04 UTC (permalink / raw)
  To: emacs-devel


Apologies, as Stefan pointed out, I was *very* confused.


When compiling code released for emacs 27.2 with emacs 28, you
presently get this warning:

emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated
positional arguments to `define-minor-mode'

I'm unable to suppress this warning  --- and I cant update my code
   to use the recommended keyword argument form until emacs 28 is
   released.

What's the solution (I dont want to add version checks  in my code)
-- 

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮



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

* Re: define-minor-mode: Suppressing warning
  2021-05-16 19:52   ` T.V Raman
@ 2021-05-16 21:41     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2021-05-16 21:41 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> Really? I looked at define-minor-mode in emacs 27.1 and it does not
> appear to take the keyword argument, unless that is I'm very confused.

The Emacs-21 version of the docstring says (among other things):

    The above three arguments can be skipped if keyword arguments are
    used (see below).
    
    BODY contains code that will be executed each time the mode is (dis)activated.
      It will be executed after any toggling but before running the hooks.
      BODY can start with a list of CL-style keys specifying additional arguments.
      The following keyword arguments are supported:
    :group   Followed by the group name to use for any generated `defcustom'.
    :global  If non-nil specifies that the minor mode is not meant to be
             buffer-local.  By default, the variable is made buffer-local.
    :init-value  Same as the INIT-VALUE argument.
    :lighter  Same as the LIGHTER argument.

The end of the docstring on Emacs-24 additionally says:

    For example, you could write
      (define-minor-mode foo-mode "If enabled, foo on you!"
        :lighter " Foo" :require 'foo :global t :group 'hassle :version "27.5"
        ...BODY CODE...)

Do you believe me now?  ;-)


        Stefan


>> T.V Raman [2021-05-16 09:44:54] wrote:
>>
>>> When compiling code released for emacs 27.2 with emacs 28, you
>>> presently get this warning:
>>>
>>> emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated
>>> positional arguments to `define-minor-mode'
>>>
>>> I'm unable to suppress this warning  --- and I cant update my code
>>>    to use the recommended keyword argument form until emacs 28 is
>>>    released.
>>
>> Why?  The recommended syntax is the one that was introduced back in
>> Emacs-21!
>>
>>
>>         Stefan
>>




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

end of thread, other threads:[~2021-05-16 21:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-16 20:04 define-minor-mode: Suppressing warning T.V Raman
  -- strict thread matches above, loose matches on Subject: below --
2021-05-16 16:44 T.V Raman
2021-05-16 17:00 ` Stefan Monnier
2021-05-16 19:52   ` T.V Raman
2021-05-16 21:41     ` 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).