unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Referencing variables beginning with an asterisk in docstrings broken?
@ 2016-08-25 13:56 Nathanael Schweers
  2016-08-25 20:19 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Nathanael Schweers @ 2016-08-25 13:56 UTC (permalink / raw)
  To: help-gnu-emacs

I wanted to include a reference to a global (dynamic) variable in one of
my docstrings.  According to the info page “(elisp) Documentation Tips”
one merely has to reference the variable in question between the
quotation marks ‘ and ’.

As far as I can tell so far, this works, as long as the variable does
not start with an asterisk.  I.e. ‘varname’ works, so does ‘varname*’,
yet not ‘*varname’.  Hence, ‘*varname*’ also does not work.

I’d like to adhere to the Common Lisp convention of naming special
variables in my elisp code, yet if I do so, I cannot seem to reference
them in docstrings.

Is this behaviour a bug?

Best Regards,
Nathanael Schweers
-- 



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

* Referencing variables beginning with an asterisk in docstrings broken?
@ 2016-08-25 14:54 Nathanael Schweers
  2016-08-28  1:55 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Nathanael Schweers @ 2016-08-25 14:54 UTC (permalink / raw)
  To: help-gnu-emacs

I wanted to include a reference to a global (dynamic) variable in one of
my docstrings.  According to the info page “(elisp) Documentation Tips”
one merely has to reference the variable in question between the
quotation marks ‘ and ’.

As far as I can tell so far, this works, as long as the variable does
not start with an asterisk.  I.e. ‘varname’ works, so does ‘varname*’,
yet not ‘*varname’.  Hence, ‘*varname*’ also does not work.

I’d like to adhere to the Common Lisp convention of naming special
variables in my elisp code, yet if I do so, I cannot seem to reference
them in docstrings.

Is this behaviour a bug?

Best Regards,
Nathanael Schweers
-- 



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

* RE: Referencing variables beginning with an asterisk in docstrings broken?
  2016-08-25 13:56 Referencing variables beginning with an asterisk in docstrings broken? Nathanael Schweers
@ 2016-08-25 20:19 ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2016-08-25 20:19 UTC (permalink / raw)
  To: Nathanael Schweers, help-gnu-emacs

> I wanted to include a reference to a global (dynamic) variable in one of
> my docstrings.  According to the info page “(elisp) Documentation Tips”
> one merely has to reference the variable in question between the
> quotation marks ‘ and ’.
> 
> As far as I can tell so far, this works, as long as the variable does
> not start with an asterisk.  I.e. ‘varname’ works, so does ‘varname*’,
> yet not ‘*varname’.  Hence, ‘*varname*’ also does not work.
> 
> I’d like to adhere to the Common Lisp convention of naming special
> variables in my elisp code, yet if I do so, I cannot seem to reference
> them in docstrings.
> 
> Is this behaviour a bug?

Sure sounds like a bug to me.



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

* Re: Referencing variables beginning with an asterisk in docstrings broken?
  2016-08-25 14:54 Nathanael Schweers
@ 2016-08-28  1:55 ` Stefan Monnier
  2016-08-28 23:32   ` Nathanael Schweers
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2016-08-28  1:55 UTC (permalink / raw)
  To: help-gnu-emacs

> I’d like to adhere to the Common Lisp convention of naming special
> variables in my elisp code, yet if I do so, I cannot seem to reference
> them in docstrings.
> Is this behaviour a bug?

Probably a bug, but do note that Elisp is not Common-Lisp, so I strongly
recommend you follow the Elisp convention of using a "<pkg>-" prefix
instead of using asterisks for global variables.


        Stefan




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

* Re: Referencing variables beginning with an asterisk in docstrings broken?
  2016-08-28  1:55 ` Stefan Monnier
@ 2016-08-28 23:32   ` Nathanael Schweers
  2016-08-29  0:32     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Nathanael Schweers @ 2016-08-28 23:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

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

>> I’d like to adhere to the Common Lisp convention of naming special
>> variables in my elisp code, yet if I do so, I cannot seem to reference
>> them in docstrings.
>> Is this behaviour a bug?
>
> Probably a bug, but do note that Elisp is not Common-Lisp, so I strongly
> recommend you follow the Elisp convention of using a "<pkg>-" prefix
> instead of using asterisks for global variables.
>
>
>         Stefan
>
>

I did both.  I also filed a bug, but it seems that this is because of
some heuristic to prevent too many false positives.  I guess I’ll either
change my naming, or just live with it.  Currently I use
*prefix/public-var*, but I guess prefix/*public-var* might be even
better.

Nathanael

-- 



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

* Re: Referencing variables beginning with an asterisk in docstrings broken?
  2016-08-28 23:32   ` Nathanael Schweers
@ 2016-08-29  0:32     ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2016-08-29  0:32 UTC (permalink / raw)
  To: Nathanael Schweers; +Cc: help-gnu-emacs

> I did both.  I also filed a bug, but it seems that this is because of
> some heuristic to prevent too many false positives.  I guess I’ll either
> change my naming, or just live with it.  Currently I use
> *prefix/public-var*, but I guess prefix/*public-var* might be even
> better.

the prefix/ already says that it's a global/dynamic var, so the
asterisks are just added noise at that point.


        Stefan



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

end of thread, other threads:[~2016-08-29  0:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-25 13:56 Referencing variables beginning with an asterisk in docstrings broken? Nathanael Schweers
2016-08-25 20:19 ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2016-08-25 14:54 Nathanael Schweers
2016-08-28  1:55 ` Stefan Monnier
2016-08-28 23:32   ` Nathanael Schweers
2016-08-29  0:32     ` Stefan Monnier

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