unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#75290: Fwd: remove-pos-from-symbol and bare-symbol
       [not found] <E1rjVZT-0007Ko-8Q@fencepost.gnu.org>
@ 2025-01-02 17:22 ` Stefan Kangas
  2025-01-05 16:08   ` Alan Mackenzie
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kangas @ 2025-01-02 17:22 UTC (permalink / raw)
  To: 75290; +Cc: rms, acm

Severity: wishlist

I'm forwarding this to the bug tracker so that we don't lose track of
it.  Alan, any comments here?

-------------------- Start of forwarded message --------------------
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Subject: remove-pos-from-symbol and bare-symbol
Date: Sun, 10 Mar 2024 22:39:23 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

The doc string of remove-pos-from-symbol says to compare it with
bare-symbol.  The doc strings are too sketchy to make clear what the
difference is.  Someone who knows should make that clear.

Is the difference what they do to an argument that is not a symbol?
If so, it would be good to state that explicitly in the doc string
of bare-symbol.  "If need be" is not explicit, not concrete.

I tried looking at the macros they call, which are in lisp.h.  But
those don't have doc strings and just call other functions that have
no comments to say what they do.

The macros and inline functions in lisp.h need to be documented there.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)



-------------------- End of forwarded message --------------------





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

* bug#75290: Fwd: remove-pos-from-symbol and bare-symbol
  2025-01-02 17:22 ` bug#75290: Fwd: remove-pos-from-symbol and bare-symbol Stefan Kangas
@ 2025-01-05 16:08   ` Alan Mackenzie
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Mackenzie @ 2025-01-05 16:08 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: acm, 75290, rms

Hello, Stefan.

Thanks for the Cc:.

On Thu, Jan 02, 2025 at 11:22:44 -0600, Stefan Kangas wrote:
> Severity: wishlist

> I'm forwarding this to the bug tracker so that we don't lose track of
> it.  Alan, any comments here?

Yes.  I remember vaguely having some difficulty formulating these doc
strings.  Making them accurate would have made them less readable.  So I
erred on the side of sketchy rather than unreadable.  I underestimated
the amount of difficulty this would cause.

> -------------------- Start of forwarded message --------------------
> From: Richard Stallman <rms@gnu.org>
> To: emacs-devel@gnu.org
> Subject: remove-pos-from-symbol and bare-symbol
> Date: Sun, 10 Mar 2024 22:39:23 -0400

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]

> The doc string of remove-pos-from-symbol says to compare it with
> bare-symbol.  The doc strings are too sketchy to make clear what the
> difference is.  Someone who knows should make that clear.

> Is the difference what they do to an argument that is not a symbol?

Yes.  bare-symbol signals an error, remove-pos-from-symbol returns a
non-symbol argument unchanged.

> If so, it would be good to state that explicitly in the doc string
> of bare-symbol.  "If need be" is not explicit, not concrete.

OK.  The current doc string for bare-symbol is:

    Extract, if need be, the bare symbol from SYM.
    SYM is either a symbol or a symbol with position.
    Ignore `symbols-with-pos-enabled'.

How about the following replacement?

    Extract and return the bare symbol from SYM, when it is a symbol
    with position.  Return SYM unchanged when it is a symbol.  Otherwise
    signal an error.  Ignore `symbols-with-pos-enable'.

    Compare with `remove-pos-from-symbol'.

> I tried looking at the macros they call, which are in lisp.h.  But
> those don't have doc strings and just call other functions that have
> no comments to say what they do.

> The macros and inline functions in lisp.h need to be documented there.

I agree, this is bad and needs rectifying.  The time taken to fix this
would be less than the time wasted by people reading it and having to
figure out for themselves what each macro/function does.

When I added symbols with position to this part of lisp.h, I just did so
in the style of the existing code, i.e. undocumented.

I think somebody should fix it now.

> -- 
> Dr Richard Stallman (https://stallman.org)
> Chief GNUisance of the GNU Project (https://gnu.org)
> Founder, Free Software Foundation (https://fsf.org)
> Internet Hall-of-Famer (https://internethalloffame.org)



> -------------------- End of forwarded message --------------------

-- 
Alan Mackenzie (Nuremberg, Germany).





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

end of thread, other threads:[~2025-01-05 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1rjVZT-0007Ko-8Q@fencepost.gnu.org>
2025-01-02 17:22 ` bug#75290: Fwd: remove-pos-from-symbol and bare-symbol Stefan Kangas
2025-01-05 16:08   ` Alan Mackenzie

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