unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46909: 27.1; (rx (literal EXPR))
@ 2021-03-03 23:14 Drew Adams
  2021-03-04  0:26 ` Basil L. Contovounesios
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2021-03-03 23:14 UTC (permalink / raw)
  To: 46909

 (elisp) 'Rx Constructs' has this:

'(literal EXPR)'
     Match the literal string that is the result from evaluating the
     Lisp expression EXPR.  The evaluation takes place at call time, in
     the current lexical environment.

But where can that construct be used?  I tried `(rx (literal "abc"))'
(and other EXPRs), and I just get an error saying that `literal' isn't
recognized for RX.  Doc bug?  Code bug?


In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
 of 2020-08-12
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Windowing system distributor `Microsoft Corp.', version 10.0.19041
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static''






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

* bug#46909: 27.1; (rx (literal EXPR))
  2021-03-03 23:14 bug#46909: 27.1; (rx (literal EXPR)) Drew Adams
@ 2021-03-04  0:26 ` Basil L. Contovounesios
  2021-03-04  1:34   ` bug#46909: [External] : " Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Basil L. Contovounesios @ 2021-03-04  0:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: 46909

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

>  (elisp) 'Rx Constructs' has this:
>
> '(literal EXPR)'
>      Match the literal string that is the result from evaluating the
>      Lisp expression EXPR.  The evaluation takes place at call time, in
>      the current lexical environment.
>
> But where can that construct be used?  I tried `(rx (literal "abc"))'
> (and other EXPRs), and I just get an error saying that `literal' isn't
> recognized for RX.  Doc bug?  Code bug?

WFM:

0. emacs -Q
1. (rx (literal "abc")) C-j
   => "abc"

> In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
>  of 2020-08-12
> Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
> Windowing system distributor `Microsoft Corp.', version 10.0.19041
> Configured using:
>  `configure --without-dbus --host=x86_64-w64-mingw32
>  --without-compress-install 'CFLAGS=-O2 -static''

Are you sure you're not actually running this in an older Emacs?

-- 
Basil

In GNU Emacs 27.1.91 (build 5, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-03-04 built on tia
Repository revision: ed2b23ecc10925b5b29ab13949a5d154c7d0cbe6
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O0 -g3 -ggdb -gdwarf-4'
 --config-cache --prefix=/home/blc/.local --program-suffix=-27
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 --with-x-toolkit=lucid --with-file-notification=yes --with-x
 --with-cairo'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT
LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
rx tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)





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

* bug#46909: [External] : Re: bug#46909: 27.1; (rx (literal EXPR))
  2021-03-04  0:26 ` Basil L. Contovounesios
@ 2021-03-04  1:34   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2021-03-04  1:34 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 46909@debbugs.gnu.org

> 0. emacs -Q
> 1. (rx (literal "abc")) C-j
>    => "abc"
> 
> > In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)

Sorry; this is my bad.  I'll close the bug.

I had both Emacs 26.3 and 27.1 open.  I didn't realize
I was trying that in 26.3.  This is the error, FWIW:

Debugger entered--Lisp error: (error "Unknown rx form 'literal'")
  signal(error ("Unknown rx form 'literal'"))
  error("Unknown rx form `%s'" literal)
  rx-form((literal "abc"))
  rx-to-string((literal "abc") t)
  #f(compiled-function (&rest regexps) #<bytecode 0x31a9f25>)((literal "abc"))
  (rx (literal "abc"))
...

There was no doc for `rx' in the 26.3 manuals, but I
somehow mistakenly used a 26.3 window for that test.





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

end of thread, other threads:[~2021-03-04  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 23:14 bug#46909: 27.1; (rx (literal EXPR)) Drew Adams
2021-03-04  0:26 ` Basil L. Contovounesios
2021-03-04  1:34   ` bug#46909: [External] : " 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).