On Tue, Dec 09 2003, Stephen J. Turnbull wrote:
>>>>> "Reiner" == Reiner Steib
<4.uce.03.r.s(a)nurfuerspam.de> writes:
Reiner> From the manual (info "(xemacs)Regexps"), I don't
Reiner> understand why the expression "\\(x\\)?" should not be
Reiner> valid.
The regexp is valid, but it matches the empty string; ie, it always
immediately matches at point.
Thanks for your explanation.
XEmacs is displaying correct behavior.
Probably (query-replace-regexp "\\(x\\)?" "") should inf-loop too?
;-)
Maybe `replace-in-string' isn't the right tool for what I'm trying to
do. I want to find out the name of the current info manual. In GNU
Emacs, (file-name-nondirectory Info-current-file) is what I want:
because `Info-current-file' gives the "basename" of the file without
any ".info" or ".gz" extension. In XEmacs, I may get
"viper.info.gz",
"foo.info" or "bar" (w/o extension).
Therefore, I tried...
(let* (;; [ ... other stuff ... ]
(Info-current-file ;; only for this test
;; "/usr/share/xemacs/xemacs-packages/info/foo.gz"
"/usr/share/xemacs/xemacs-packages/info/viper.info.gz")
(fileurl (file-name-nondirectory Info-current-file))
;; XEmacs doesn't strip extensions in `Info-current-file': [1]
(fileurl
(replace-in-string fileurl "\\(\\.info\\)?\\(\\.gz\\)?\\'" "")))
fileurl)
... which lead to the inf-loop. Is there a better way than calling
`replace-in-string' twice?
(let* ((Info-current-file ;; only for this test
"/usr/share/xemacs/xemacs-packages/info/viper.info.gz")
(fileurl (file-name-nondirectory Info-current-file))
(fileurl (replace-in-string fileurl "\\.gz\\'" ""))
(fileurl (replace-in-string fileurl "\\.info\\'" "")))
fileurl)
Bye, Reiner.
[1] Instead of `replace-in-string' I use a compatibility function
similar to `gnus-replace-in-string' (XEmacs `replace-in-string'
vs. `replace-regexp-in-string' in GNU Emacs 21).
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW
http://rsteib.home.pages.de/