James K. Lowden
unread,Oct 27, 2021, 11:59:50 AM10/27/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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