From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: help create function alias Date: Tue, 21 Sep 2010 19:07:06 -0700 (PDT) Organization: http://groups.google.com Message-ID: <962ba4f8-c462-455c-bf06-4c3149f7680d@h37g2000pro.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291876302 3604 80.91.229.12 (9 Dec 2010 06:31:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 06:31:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 07:31:32 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQa2N-000177-PO for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 07:31:32 +0100 Original-Received: from localhost ([127.0.0.1]:52520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQa2M-0001Gt-AI for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 01:31:30 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!h37g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 95 Original-NNTP-Posting-Host: 67.180.85.8 Original-X-Trace: posting.google.com 1285121226 24860 127.0.0.1 (22 Sep 2010 02:07:06 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 22 Sep 2010 02:07:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h37g2000pro.googlegroups.com; posting-host=67.180.85.8; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.59 Safari/534.3, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:181411 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76793 Archived-At: On Sep 20, 8:35=C2=A0am, Stefan Monnier wrote: > > I use (insert-date) often, but rather than a hotkey I'd > > prefer M-x id =C2=A0or =C2=A0ALT-x id =C2=A0 > > How 'bout: > > =C2=A0 =C2=A0(define-key minibuffer-local-completion-map > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[(meta tab)] 'mini= buffer-force-complete) > > and then > > =C2=A0 =C2=A0M-x i-d M-TAB RET > > or even > > =C2=A0 =C2=A0(define-key minibuffer-local-completion-map > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[(meta return)] > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda () > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(interactiv= e) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(minibuffer= -force-complete) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(minibuffer= -complete-and-exit))) > > and then > > =C2=A0 =C2=A0M-x i-d M-RET > > -- Stefan would it be nice to have a general mechanism to execute commands with just their inits? maybe a command named =E2=80=9Cexecute-extended-command-by-init=E2=80=9D wi= th a keybinding. e.g. i have lots aliases: ; shortening of often used commands (defalias 'rn 'wdired-change-to-wdired-mode) ; rename file in dired (defalias 'dj 'dired-jump) (defalias 'g 'grep) (defalias 'gf 'grep-find) (defalias 'fd 'find-dired) (defalias 'ntr 'narrow-to-region) (defalias 'lml 'list-matching-lines2) (defalias 'dml 'delete-matching-lines) (defalias 'dnml 'delete-non-matching-lines) (defalias 'sl 'sort-lines) (defalias 'dtw 'delete-trailing-whitespace) (defalias 'lcd 'list-colors-display) (defalias 'rb 'revert-buffer) (defalias 'sh 'shell) (defalias 'ps 'powershell) (defalias 'fb 'flyspell-buffer) (defalias 'rof 'recentf-open-files) ; elisp (defalias 'eb 'eval-buffer) (defalias 'er 'eval-region) (defalias 'ed 'eval-defun) (defalias 'eis 'elisp-index-search) ; modes (defalias 'hm 'html-mode) (defalias 'tm 'text-mode) (defalias 'elm 'emacs-lisp-mode) (defalias 'vbm 'visual-basic-mode) (defalias 'vlm 'visual-line-mode) (defalias 'wsm 'whitespace-mode) (defalias 'om 'org-mode) (defalias 'ssm 'shell-script-mode) (defalias 'cc 'calc) (defalias 'rs 'replace-string) plus about 40 more on personal commands... =C2=ABmaybe a command named =E2=80=9Cexecute-extended-command-by-init=E2=80= =9D with a keybinding.=C2=BB humm.. actually does that exist somewhere? seems not hard to write... i guess i could write a command that take input and insert =E2=80=9C*=E2=80= =9D between letters than feed it to execute-extended-command? Xah =E2=88=91 xahlee.org =E2=98=84