From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: Colin Walters Newsgroups: gmane.emacs.devel Subject: Re: using pcomplete for comint.el/shell.el Date: 16 Feb 2002 19:43:26 -0500 Message-ID: <1013906606.32274.59.camel@space-ghost> References: <1013730609.754.60.camel@space-ghost> <200202162155.g1GLtP209864@aztec.santafe.edu> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-2SwZ2UvFf+ghZe/SBt/U" X-Trace: quimby2.netfonds.no 1013907839 31942 195.204.10.66 (17 Feb 2002 01:03:59 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 17 Feb 2002 01:03:59 GMT Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16cFkE-0008J6-00 for ; Sun, 17 Feb 2002 02:03:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16cFXt-0002A5-00; Sat, 16 Feb 2002 19:51:13 -0500 Original-Received: from monk.debian.net ([216.185.54.61] helo=monk.verbum.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16cFXY-000295-00 for ; Sat, 16 Feb 2002 19:50:53 -0500 Original-Received: from space-ghost.verbum.private (freedom.cis.ohio-state.edu [164.107.60.183]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "space-ghost.verbum.org", Issuer "monk.verbum.org" (verified OK)) by monk.verbum.org (Postfix (Debian/GNU)) with ESMTP id BF5FF74004C4 for ; Sat, 16 Feb 2002 19:50:41 -0500 (EST) Original-Received: by space-ghost.verbum.private (Postfix (Debian/GNU), from userid 1000) id E9AD1806BB9; Sat, 16 Feb 2002 19:43:26 -0500 (EST) Original-To: emacs-devel@gnu.org In-Reply-To: <200202162155.g1GLtP209864@aztec.santafe.edu> X-Mailer: Evolution/1.0 (Preview Release) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1238 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1238 --=-2SwZ2UvFf+ghZe/SBt/U Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2002-02-16 at 16:55, Richard Stallman wrote: > It should not redefine itself, that is confusing. It should just call > pcomplete every time. Hm. I don't find it particularly confusing, but I guess it maybe does try to be a bit too efficient at the expense of comprehensibility. How about this version? --=-2SwZ2UvFf+ghZe/SBt/U Content-Disposition: attachment; filename=shell.patch Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1 --- shell.el.~1.105.~ Mon Dec 3 12:24:41 2001 +++ shell.el Sat Feb 16 19:31:54 2002 @@ -310,7 +310,8 @@ (setq shell-mode-map (nconc (make-sparse-keymap) comint-mode-map)) (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) - (define-key shell-mode-map "\t" 'comint-dynamic-complete) + (define-key shell-mode-map "\t" 'shell-pcomplete) + (define-key shell-mode-map "\M-\t" 'shell-pcomplete-reverse) (define-key shell-mode-map "\M-?" 'comint-dynamic-list-filename-completions) (define-key shell-mode-map [menu-bar completion] @@ -396,7 +397,6 @@ (setq comint-delimiter-argument-list shell-delimiter-argument-list) (setq comint-file-name-chars shell-file-name-chars) (setq comint-file-name-quote-list shell-file-name-quote-list) - (setq comint-dynamic-complete-functions shell-dynamic-complete-functions= ) (make-local-variable 'paragraph-start) (setq paragraph-start comint-prompt-regexp) (make-local-variable 'font-lock-defaults) @@ -857,6 +857,22 @@ (progn (goto-char (match-beginning 1)) (skip-chars-forward ";&|"))))) =20 +(defvar shell-pcomplete-setup-p nil) +(defun shell-pcomplete () + "Invoke `pcomplete', after ensuring this buffer is set up for it." + (interactive) + (unless (prog1 shell-pcomplete-setup-p + (setq shell-pcomplete-setup-p t)) + (pcomplete-comint-setup 'shell-dynamic-complete-functions)) + (call-interactively #'pcomplete)) + +(defun shell-pcomplete-reverse () + "Invoke `pcomplete-reverse', after ensuring this buffer is set up for it= ." + (interactive) + (unless (prog1 shell-pcomplete-setup-p + (setq shell-pcomplete-setup-p t)) + (pcomplete-comint-setup 'shell-dynamic-complete-functions)) + (call-interactively #'pcomplete-reverse)) =20 (defun shell-dynamic-complete-command () "Dynamically complete the command at point. --=-2SwZ2UvFf+ghZe/SBt/U-- _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel