unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
@ 2012-01-03 22:50 Drew Adams
  2012-01-03 23:42 ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2012-01-03 22:50 UTC (permalink / raw)
  To: 10428

Why was this alias defined?  Is there a good reason for it?  This is a
bad precedent to set.  Unless there is a _particular_ reason to do this
for this command (and not for umpteen other Emacs commands), please
remove this seemingly gratuitous alias.

In GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600) of 2011-12-06 on MARVIN
 Windowing system distributor `Microsoft Corp.', version 5.1.2600
 configured using `configure --with-gcc (4.6) --no-opt --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-2.10.1/include --ldflags
 -LD:/devel/emacs/libs/gnutls-2.10.1/lib'
 






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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 22:50 bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode` Drew Adams
@ 2012-01-03 23:42 ` Juanma Barranquero
  2012-01-03 23:48   ` Daniel Colascione
  2012-01-03 23:56   ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-03 23:42 UTC (permalink / raw)
  To: Drew Adams; +Cc: 10428-done

> Why was this alias defined?  Is there a good reason for it?  This is a
> bad precedent to set.  Unless there is a _particular_ reason to do this
> for this command (and not for umpteen other Emacs commands), please
> remove this seemingly gratuitous alias.

2001-06-26  Richard M. Stallman  <rms@gnu.org>

        * which-func.el (which-func-maxout): Increase default to 500000.
        (which-function-mode): This is now the "real" name of the function.
        (which-func-mode): Now an alias.
        (which-func-mode-global): Name deleted.

So the function was called which-func-mode, then renamed to
which-function-mode, and the old name kept for compatibility.

It took me all of a grep in lisp\ChangeLog* to find it ;-)

    Juanma





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:42 ` Juanma Barranquero
@ 2012-01-03 23:48   ` Daniel Colascione
  2012-01-03 23:53     ` Juanma Barranquero
  2012-01-03 23:56   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Colascione @ 2012-01-03 23:48 UTC (permalink / raw)
  To: 10428, lekktu

On 1/3/2012 3:42 PM, Juanma Barranquero wrote:
>> Why was this alias defined?  Is there a good reason for it?  This is a
>> bad precedent to set.  Unless there is a _particular_ reason to do this
>> for this command (and not for umpteen other Emacs commands), please
>> remove this seemingly gratuitous alias.
> 
> 2001-06-26  Richard M. Stallman  <rms@gnu.org>
> 
>         * which-func.el (which-func-maxout): Increase default to 500000.
>         (which-function-mode): This is now the "real" name of the function.
>         (which-func-mode): Now an alias.
>         (which-func-mode-global): Name deleted.
> 
> So the function was called which-func-mode, then renamed to
> which-function-mode, and the old name kept for compatibility.
> 
> It took me all of a grep in lisp\ChangeLog* to find it ;-)

It's still annoying to have which-func-mode show up as an interactive
command.  Is it somehow possible to define an alias to a command that is
not itself a command?





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:48   ` Daniel Colascione
@ 2012-01-03 23:53     ` Juanma Barranquero
  2012-01-03 23:59       ` Daniel Colascione
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-03 23:53 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 10428

On Wed, Jan 4, 2012 at 00:48, Daniel Colascione <dancol@dancol.org> wrote:

> It's still annoying to have which-func-mode show up as an interactive
> command.

Not to the people used to the old name... That's the whole point of
having an obsolete alias, instead of just renaming the function.

> Is it somehow possible to define an alias to a command that is
> not itself a command?

Not currently. The interactivity does not depend of the name. It's a
property of the function itself.

    Juanma





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:42 ` Juanma Barranquero
  2012-01-03 23:48   ` Daniel Colascione
@ 2012-01-03 23:56   ` Lars Magne Ingebrigtsen
  2012-01-04  0:57     ` Juanma Barranquero
  2012-01-05  4:59     ` Stefan Monnier
  1 sibling, 2 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-01-03 23:56 UTC (permalink / raw)
  To: 10428; +Cc: lekktu

Juanma Barranquero <lekktu@gmail.com> writes:

> So the function was called which-func-mode, then renamed to
> which-function-mode, and the old name kept for compatibility.

Perhaps `which-func-mode' should be marked as obsolete, so that it can
be removed in Emacs 24.2?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:53     ` Juanma Barranquero
@ 2012-01-03 23:59       ` Daniel Colascione
  2012-01-04  1:03         ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Colascione @ 2012-01-03 23:59 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 10428

On 1/3/2012 3:53 PM, Juanma Barranquero wrote:
> On Wed, Jan 4, 2012 at 00:48, Daniel Colascione <dancol@dancol.org> wrote:
> 
>> It's still annoying to have which-func-mode show up as an interactive
>> command.
> 
> Not to the people used to the old name... That's the whole point of
> having an obsolete alias, instead of just renaming the function.

I thought the point was to not break existing _code_. Making people
change what they physically type isn't only acceptable, but desired:
this way, we raise awareness of the new name.

>> Is it somehow possible to define an alias to a command that is
>> not itself a command?
> 
> Not currently. The interactivity does not depend of the name. It's a
> property of the function itself.

I thought so. Maybe we should have commandp return nil for obsolete
symbols. (which-func-mode isn't currently marked obsolete, but it can be
easily enough.) make-obsolete already sets the byte-obsolete-info symbol
property, which we could inspect easily enough.





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:56   ` Lars Magne Ingebrigtsen
@ 2012-01-04  0:57     ` Juanma Barranquero
  2012-01-05  4:59     ` Stefan Monnier
  1 sibling, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-04  0:57 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10428

On Wed, Jan 4, 2012 at 00:56, Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> Perhaps `which-func-mode' should be marked as obsolete

I suppose that'd be OK.

> so that it can be removed in Emacs 24.2?

Too soon after obsoletion, I think.

    Juanma





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:59       ` Daniel Colascione
@ 2012-01-04  1:03         ` Juanma Barranquero
  2012-01-04  1:27           ` Leo
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-04  1:03 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 10428

On Wed, Jan 4, 2012 at 00:59, Daniel Colascione <dancol@dancol.org> wrote:

> I thought the point was to not break existing _code_.

That's an interactive command. How it is used in lisp code is somewhat
less relevant.

> Making people
> change what they physically type isn't only acceptable, but desired:
> this way, we raise awareness of the new name.

Sometimes two names are just alternatives. And which-func-mode is shorter.

> I thought so. Maybe we should have commandp return nil for obsolete
> symbols.

I think you're thinking of `command-and-not-obsolete-p'... Which is to
say, I don't think changing the semantics of commandp is a good idea.

> make-obsolete already sets the byte-obsolete-info symbol
> property, which we could inspect easily enough.

And which is already done by the code that needs the info, like
`describe-function-1', `semantic-emacs-lisp-obsoleted-doc' and
`mh-make-local-hook'.

    Juanma





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-04  1:03         ` Juanma Barranquero
@ 2012-01-04  1:27           ` Leo
  2012-01-04  1:31             ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Leo @ 2012-01-04  1:27 UTC (permalink / raw)
  To: 10428

On 2012-01-04 09:03 +0800, Juanma Barranquero wrote:
>> change what they physically type isn't only acceptable, but desired:
>> this way, we raise awareness of the new name.
>
> Sometimes two names are just alternatives. And which-func-mode is shorter.

For such a public-facing command, an alias only creates confusion. I
have literally checked out which-func-mode because it showed up in
completion and I was curious how it differs from which-function-mode.

Leo






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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-04  1:27           ` Leo
@ 2012-01-04  1:31             ` Juanma Barranquero
  2012-01-04  1:59               ` Leo
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-04  1:31 UTC (permalink / raw)
  To: Leo; +Cc: 10428

On Wed, Jan 4, 2012 at 02:27, Leo <sdl.web@gmail.com> wrote:

> For such a public-facing command, an alias only creates confusion.

Again: the "alias" was there first.

    Juanma





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-04  1:31             ` Juanma Barranquero
@ 2012-01-04  1:59               ` Leo
  0 siblings, 0 replies; 13+ messages in thread
From: Leo @ 2012-01-04  1:59 UTC (permalink / raw)
  To: 10428

On 2012-01-04 09:31 +0800, Juanma Barranquero wrote:
> Again: the "alias" was there first.

I meant to say it is better to have only one show up in M-x completion.

Leo






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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-03 23:56   ` Lars Magne Ingebrigtsen
  2012-01-04  0:57     ` Juanma Barranquero
@ 2012-01-05  4:59     ` Stefan Monnier
  2012-01-07  0:26       ` Juanma Barranquero
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2012-01-05  4:59 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10428, lekktu

>> So the function was called which-func-mode, then renamed to
>> which-function-mode, and the old name kept for compatibility.
> Perhaps `which-func-mode' should be marked as obsolete, so that it can
> be removed in Emacs 24.2?

It should indeed be marked as obsolete and turned into a non-interactive
function (i.e. not an alias any more).
M-x which-func-mode RET will still work thanks to
partial-completion anyway.


        Stefan





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

* bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode`
  2012-01-05  4:59     ` Stefan Monnier
@ 2012-01-07  0:26       ` Juanma Barranquero
  0 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2012-01-07  0:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10428, Lars Magne Ingebrigtsen

On Thu, Jan 5, 2012 at 05:59, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> It should indeed be marked as obsolete and turned into a non-interactive
> function (i.e. not an alias any more).

Done.

    Juanma





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

end of thread, other threads:[~2012-01-07  0:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 22:50 bug#10428: 24.0.92; Please remove unnecessary alias `which-func-mode` Drew Adams
2012-01-03 23:42 ` Juanma Barranquero
2012-01-03 23:48   ` Daniel Colascione
2012-01-03 23:53     ` Juanma Barranquero
2012-01-03 23:59       ` Daniel Colascione
2012-01-04  1:03         ` Juanma Barranquero
2012-01-04  1:27           ` Leo
2012-01-04  1:31             ` Juanma Barranquero
2012-01-04  1:59               ` Leo
2012-01-03 23:56   ` Lars Magne Ingebrigtsen
2012-01-04  0:57     ` Juanma Barranquero
2012-01-05  4:59     ` Stefan Monnier
2012-01-07  0:26       ` Juanma Barranquero

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