From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris 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: Fri, 30 Jan 2015 15:58:40 -0800 (PST) Message-ID: <2f498204-b95b-4870-8f6b-83e43b8584c1@googlegroups.com> References: <90b92a22-d34c-4f7e-953e-74444f42e767@googlegroups.com> <54CB109E.1030802@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1422662419 20277 80.91.229.3 (31 Jan 2015 00:00:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Jan 2015 00:00:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 31 01:00:19 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 1YHLU1-0001nb-8C for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jan 2015 01:00:17 +0100 Original-Received: from localhost ([::1]:39179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHLU0-0007pr-Qv for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 19:00:16 -0500 X-Received: by 10.236.3.106 with SMTP id 70mr7313148yhg.20.1422662320389; Fri, 30 Jan 2015 15:58:40 -0800 (PST) X-Received: by 10.182.231.162 with SMTP id th2mr64765obc.21.1422662320230; Fri, 30 Jan 2015 15:58:40 -0800 (PST) Original-Path: usenet.stanford.edu!v8no4619610qal.1!news-out.google.com!qk8ni19963igc.0!nntp.google.com!hl2no5142426igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=74.193.13.167; posting-account=VkuUtQkAAADKqMjRUmZTNs7a8uCSNNy2 Original-NNTP-Posting-Host: 74.193.13.167 User-Agent: G2/1.0 Injection-Date: Fri, 30 Jan 2015 23:58:40 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:210109 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:102388 Archived-At: Michael I tried using the function below....the advice-add part gave an error.. function definition is void: advice-add (Emacs ver 24.3) When I removed the advice-add part it seems to work!! i.e. this works... (defun my-find-file-around-ad (origfun &rest args) (interactive (find-file-read-args "Open file: " (confirm-nonexistent-file-or-buffer))) (apply origfun args)) The only problem is when I use TAB completion to replace abbreviations, it appends the TAB to the end instead of *replacing it*....find-file does it right and I was hoping using find-file-read-args would work right too but it didn't. Do you know why TAB remains unlike with find-file? On Friday, January 30, 2015 at 2:42:46 AM UTC-6, Michael Heerdegen wrote: > Christian Seberino writes: > > > 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? > > Actually it is not hard, at least for this specific case and in Emacs >= > 24 (didn't check older Emacsen): > > --8<---------------cut here---------------start------------->8--- > (defun my-find-file-around-ad (origfun &rest args) > (interactive > (find-file-read-args "Open file: " > (confirm-nonexistent-file-or-buffer))) > (apply origfun args)) > > (advice-add 'find-file :around #'my-find-file-around-ad) > --8<---------------cut here---------------end--------------->8--- > > But I think in the long term it's better to get used to the Emacs > nomenclature. > > > Michael.