Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

function spoiling search-replace

8 views
Skip to first unread message

James K. Lowden

unread,
Oct 27, 2021, 11:59:50 AM10/27/21
to
I recently installed emacs on a headless Ubuntu 20.04 LTS virtual
machine, and copied my favorite .emacs file there. A function that
works on every other machine causes a pecualiar problem on this one:
query-replace fails with an "argument out of range" error.

When I remove this function from .emacs, all is well:

(setq frame-title-format
'("%*" (:eval (short-host-name)) ": " (:eval (if (buffer-file-name)
(abbreviate-file-name (buffer-file-name))
"%b")) " @" server-name ))

It references short-host-name, defined as follows:

;; short host name, like `hostname -s`, remote shell likes this better
(defun short-host-name ()
(string-match "[^\.]+" system-name)
(substring system-name (match-beginning 0) (match-end 0)))

Calling short-host-name causes no subsequent problem.

Can anyone explain why frame-title-format would break query-replace?

--jk

HASM

unread,
Oct 28, 2021, 9:28:59 AM10/28/21
to

> A function that works on every other machine causes a pecualiar
> problem on this one: query-replace fails with an "argument out of
> range" error.

From a very quick scan of the posted code, I don't "see" where
query-replace is called. Have you tried setting debug-on-error and get
a back-trace?

-- HASM
0 new messages