help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy/Possible to globally change prompt strings of messages? e.g. ch


From: Christian Seberino
Subject: Re: Easy/Possible to globally change prompt strings of messages? e.g. changing find-file's prompt string from "Find file:" to "open file:" ?
Date: Thu, 29 Jan 2015 23:03:26 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Drew

Thanks! As a consolation prize...what if I only wanted to change the prompt string when I called wrapper functions *myself*
with a shortcut key?

e.g. I could write my own function called my-find-file that had whatever prompt string I wanted, and, then have it call find-file internally. I actually went down that route. The problem I had was that I rely on the TAB completion and abbreviation features of find-file for Tramp and other stuff with long path names.

Perhaps it would be feasible/easier to somehow add all those wonderful features (TAB completion and abbreviations)
to my own wrapper functions? How hard is *that* by comparision?

cs








On 01/29/2015 10:19 PM, Drew Adams wrote:
Is it easy/possible to change the prompt strings of various Emacs commands?

For example, what Emacs calls find-file I think of as "opening a file"
and hence would like to change the prompt from "Find file:" to "open file:".

Are global changes like that possible/easy?  Perhaps it would require
an Lisp style macro or something?
Generally speaking, no.  Typically, a general function that reads
input is called by a command, and it is passed a literal string as
the prompt to use.

Anything is possible, of course.  You can replace, for example, the
standard definition of `find-file-read-args' (which reads the file
name for `find-file' and similar commands), so that it uses your
preferred prompt.

But there is a reason that such functions take a PROMPT argument:
so that they can be called by different commands or in different
contexts, using different prompts.  For `find-file-read-args',
for example:

files.el:1433:   (find-file-read-args "Find file: "
files.el:1453:   (find-file-read-args "Find file in other window: "
files.el:1476:   (find-file-read-args "Find file in other frame: "
files.el:1490:   (interactive (nbutlast (find-file-read-args "Find existing file: 
" t)))
files.el:1513:   (find-file-read-args "Find file read-only: "
files.el:1522:   (find-file-read-args "Find file read-only other window: "
files.el:1531:   (find-file-read-args "Find file read-only other frame: "
menu-bar.el:206:         (filename (car (find-file-read-args "Find file: " 
mustmatch))))
files.el:1433:   (find-file-read-args "Find file: "
files.el:1453:   (find-file-read-args "Find file in other window: "
files.el:1476:   (find-file-read-args "Find file in other frame: "
files.el:1490:   (interactive (nbutlast (find-file-read-args "Find existing file: 
" t)))
files.el:1513:   (find-file-read-args "Find file read-only: "
files.el:1522:   (find-file-read-args "Find file read-only other window: "
files.el:1531:   (find-file-read-args "Find file read-only other frame: "
menu-bar.el:206:         (filename (car (find-file-read-args "Find file: " 
mustmatch))))

Alternatively, you could replace not the utility functions that read
input but the commands that call the utility functions.  In that case,
you would have even more to change. ;-)

In sum, don't bother to try.  Just learn to live with "Find file" etc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]