unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
@ 2022-06-08 16:56 Drew Adams
  2022-06-09 13:22 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2022-06-08 16:56 UTC (permalink / raw)
  To: 55853

See https://stackoverflow.com/q/72547221/729907.

Users see this #f(...) syntax.  They should be able to consult the doc
in some way to find out what it is/means.  Please consider documenting
it in the Elisp manual.  Thx.

In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
 of 2022-04-21 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.1706)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

(NATIVE_COMP present but libgccjit not available)





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-06-08 16:56 bug#55853: 28.1; Please document f#(...) syntax in Elisp manual Drew Adams
@ 2022-06-09 13:22 ` Lars Ingebrigtsen
  2022-06-09 14:04   ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-09 13:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: 55853

Drew Adams <drew.adams@oracle.com> writes:

> See https://stackoverflow.com/q/72547221/729907.
>
> Users see this #f(...) syntax.  They should be able to consult the doc
> in some way to find out what it is/means.  Please consider documenting
> it in the Elisp manual.  Thx.

From the URL:

The syntax in question is in the following expression

((remote . emacs)
 (system . #f(compiled-function
          (file path)
          #<bytecode -0x47e8150df949387>))
 (t . #f(compiled-function
     (file path)
     #<bytecode -0x47e8150df949387>)))

It's from:

(cl-defmethod cl-print-object ((object compiled-function) stream)
  (unless stream (setq stream standard-output))
  ;; We use "#f(...)" rather than "#<...>" so that pp.el gives better results.
  (princ "#f(compiled-function " stream)

I.e., it's from the "pretty" version of prin1, and is not meant to be
readable by the Lisp reader.

I've now mentioned this in the Special Read Syntax node in the lispref
manual in Emacs 28.2.

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





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-06-09 13:22 ` Lars Ingebrigtsen
@ 2022-06-09 14:04   ` Drew Adams
  2022-07-05 15:11     ` Michael Heerdegen
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2022-06-09 14:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 55853@debbugs.gnu.org

> > See https://urldefense.com/v3/__https://stackoverflow.com/q/72547221/729907
> __;!!ACWV5N9M2RV99hQ!Js5VF7KbuZreJUFSLAH2FrOVle2g3oyTYcFXS7qlnAwG8QAl9v
> GcS1skzoz2U2AgbNowlTxv7NJQ$ .
> >
> > Users see this #f(...) syntax.  They should be able to consult the
> > doc in some way to find out what it is/means.  Please consider
> > documenting it in the Elisp manual.  Thx.
> 
> From the URL:
> 
> The syntax in question is in the following expression
> 
> ((remote . emacs)
>  (system . #f(compiled-function
>           (file path)
>           #<bytecode -0x47e8150df949387>))
>  (t . #f(compiled-function
>      (file path)
>      #<bytecode -0x47e8150df949387>)))
> 
> It's from:
> 
> (cl-defmethod cl-print-object ((object compiled-function) stream)
>   (unless stream (setq stream standard-output))
>   ;; We use "#f(...)" rather than "#<...>" so that pp.el gives better
> results.
>   (princ "#f(compiled-function " stream)
> 
> I.e., it's from the "pretty" version of prin1, and is not meant to be
> readable by the Lisp reader.
> 
> I've now mentioned this in the Special Read Syntax node in the lispref
> manual in Emacs 28.2.

Thanks, that's a start (and all that the bug report
requested: document in the manual).

But is there any chance this "pretty"-printing itself
can be made more human-friendly / communicative?

Aside from (I guess) naming the formal parameters, it
looks like it just says "BLAT$%@#(*&{}:"|?><(/.,!!".

https://stackoverflow.com/a/72561466/729907





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-06-09 14:04   ` Drew Adams
@ 2022-07-05 15:11     ` Michael Heerdegen
  2022-07-05 15:23       ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2022-07-05 15:11 UTC (permalink / raw)
  To: Drew Adams; +Cc: 55853@debbugs.gnu.org, Lars Ingebrigtsen

Drew Adams <drew.adams@oracle.com> writes:

> But is there any chance this "pretty"-printing itself
> can be made more human-friendly / communicative?
>
> Aside from (I guess) naming the formal parameters, it
> looks like it just says "BLAT$%@#(*&{}:"|?><(/.,!!".

Well, that's what byte code looks like.  Apart from that, "it" is a
clickable button that will disassemble that code for you if you click
it.  Not good enough?

Michael.





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-07-05 15:11     ` Michael Heerdegen
@ 2022-07-05 15:23       ` Drew Adams
  2022-07-05 18:55         ` Michael Heerdegen
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2022-07-05 15:23 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 55853@debbugs.gnu.org, Lars Ingebrigtsen

> > But is there any chance this "pretty"-printing itself
> > can be made more human-friendly / communicative?
> >
> > Aside from (I guess) naming the formal parameters, it
> > looks like it just says "BLAT$%@#(*&{}:"|?><(/.,!!".
> 
> Well, that's what byte code looks like.  Apart from that, "it" is a
> clickable button that will disassemble that code for you if you click
> it.  Not good enough?

Dunno whether it's good enough.  Depends on why someone
might want to understand what's printed.

From the original thread:

  this is apparently "special read syntax", i.e., Lisp
  reader syntax that's not readable by the Lisp reader
  but is meant to communicate something to humans. ...

  What the source code for the function is; what the
  function does (e.g., it's doc); or where it's defined
  -- nothing like that is conveyed in the "pretty"-print.
  And whether "compiled" there means byte-compiled or
  "native"-compiled also isn't made clear.

(Dunno whether any of those missing things has now been
added as part of the bug fix.)

Maybe instead of (or in addition to) a disassembly, a
user could be pointed - a least in some cases - to the
original source code (Lisp or C)?





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-07-05 15:23       ` Drew Adams
@ 2022-07-05 18:55         ` Michael Heerdegen
  2022-07-05 19:06           ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2022-07-05 18:55 UTC (permalink / raw)
  To: Drew Adams; +Cc: 55853@debbugs.gnu.org, Lars Ingebrigtsen

Drew Adams <drew.adams@oracle.com> writes:

> Maybe instead of (or in addition to) a disassembly, a
> user could be pointed - a least in some cases - to the
> original source code (Lisp or C)?

Are there such cases?  The place is not always well defined.

In the cited original thread, when you see

  org-file-apps-windowsnt is a variable defined in `org.el'.

in the C-h v popup you just click on the "org.el" button and are
directly guided to the source of the byte-code function.  We can't get
much better I guess since we don't save the exact position of every
lambda expression when compiling.

If the byte-code function is named, you can click on the name that will
likely be around.  And if it has not, it's probably not trivial to find
a related place of a definition (if there is one).

So, hard to answer without a real-life example where this would actually
be a real improvement.

Michael.





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

* bug#55853: 28.1; Please document f#(...) syntax in Elisp manual
  2022-07-05 18:55         ` Michael Heerdegen
@ 2022-07-05 19:06           ` Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2022-07-05 19:06 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 55853@debbugs.gnu.org, Lars Ingebrigtsen

> > Maybe instead of (or in addition to) a disassembly, a
> > user could be pointed - a least in some cases - to the
> > original source code (Lisp or C)?
> 
> Are there such cases?  The place is not always well defined.
> 
> In the cited original thread, when you see
> 
>   org-file-apps-windowsnt is a variable defined in `org.el'.
> 
> in the C-h v popup you just click on the "org.el" button and are
> directly guided to the source of the byte-code function.  We can't get
> much better I guess since we don't save the exact position of every
> lambda expression when compiling.
> 
> If the byte-code function is named, you can click on the name that will
> likely be around.  And if it has not, it's probably not trivial to find
> a related place of a definition (if there is one).
> 
> So, hard to answer without a real-life example where this would
> actually be a real improvement.

Certainly there are cases where there's no reasonable
way to locate where the thing was defined.  But when
there is a reasonable way it's good to point to the
definition/source code.

For cases where the name is displayed and you can
click it to go to some text with a link to the source,
there's no great problem (but perhaps getting there
could be more direct).

My point was that getting to the source code is what
a user wants more often than getting a disassembled
representation.





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

end of thread, other threads:[~2022-07-05 19:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-08 16:56 bug#55853: 28.1; Please document f#(...) syntax in Elisp manual Drew Adams
2022-06-09 13:22 ` Lars Ingebrigtsen
2022-06-09 14:04   ` Drew Adams
2022-07-05 15:11     ` Michael Heerdegen
2022-07-05 15:23       ` Drew Adams
2022-07-05 18:55         ` Michael Heerdegen
2022-07-05 19:06           ` Drew Adams

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