From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christian Seberino Newsgroups: gmane.emacs.help 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 Message-ID: <54CB109E.1030802@gmail.com> References: <90b92a22-d34c-4f7e-953e-74444f42e767@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1422594231 27278 80.91.229.3 (30 Jan 2015 05:03:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 05:03:51 +0000 (UTC) To: Drew Adams , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 30 06:03:51 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YH3kE-0004VT-SE for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 06:03:51 +0100 Original-Received: from localhost ([::1]:34772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH3kD-0008U8-RK for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 00:03:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH3jz-0008U3-Ug for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 00:03:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YH3jv-00025X-0D for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 00:03:35 -0500 Original-Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:56891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH3ju-00025T-S3 for help-gnu-emacs@gnu.org; Fri, 30 Jan 2015 00:03:30 -0500 Original-Received: by mail-ob0-f172.google.com with SMTP id nt9so989823obb.3 for ; Thu, 29 Jan 2015 21:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=rpNsqn1IBJRm6pGDfIZ0Yidc8gwg9KeGH7ySZaKSB7c=; b=icHSIYGolDzifKfOw6bTl9snWBcdVuHRGK0P9JYhUcBrXIUAJ9qmei5VCgypOgSUyl wNQE1iYPIZgSz8er+UlPjNG8+VfN13ycOB3E+LJJ4NCxocPmoGnA9l9u8szGlKGH6PYn vzZQaMK+QQeqssQ9nfN6SCY+PRmx8kfd2DYL19MD55sFmIiWomufzsh7SrWqUzbiiKD2 RpYxJx2/weWLC9UFST+l9an5kRopnoMFzO2E36BWpHkG0A+dCgX66rkrmjZJ3vf2/9+j hx6zaatkqL5O95Yz0BGsRZFsf8XZi23Pc7t7CIjP1abmpxfPmJViIfO/dOdQYjUIpLpw TOZw== X-Received: by 10.202.66.7 with SMTP id p7mr2472007oia.33.1422594209350; Thu, 29 Jan 2015 21:03:29 -0800 (PST) Original-Received: from [192.168.1.104] (r74-193-13-167.cnrocmta01.conrtx.tl.dh.suddenlink.net. [74.193.13.167]) by mx.google.com with ESMTPSA id g2sm4718433oem.11.2015.01.29.21.03.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2015 21:03:28 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22c X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102379 Archived-At: 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.