From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.emacs.devel Subject: Eshell manual overhaul and Eshell patches Date: Fri, 08 Feb 2013 16:44:53 +1300 Message-ID: <87obfvsc3u.fsf@dimension8.tehua.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1360295118 6033 80.91.229.3 (8 Feb 2013 03:45:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Feb 2013 03:45:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 08 04:45:39 2013 Return-path: Envelope-to: ged-emacs-devel@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 1U3euB-0005q2-AZ for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2013 04:45:39 +0100 Original-Received: from localhost ([::1]:43217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3etr-00073w-PH for ged-emacs-devel@m.gmane.org; Thu, 07 Feb 2013 22:45:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3eto-00073k-0I for emacs-devel@gnu.org; Thu, 07 Feb 2013 22:45:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3etm-0008Us-GS for emacs-devel@gnu.org; Thu, 07 Feb 2013 22:45:15 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3etm-0008UB-5X for emacs-devel@gnu.org; Thu, 07 Feb 2013 22:45:14 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U3eu1-0005kA-KE for emacs-devel@gnu.org; Fri, 08 Feb 2013 04:45:29 +0100 Original-Received: from 114-134-8-58.rurallink.co.nz ([114.134.8.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Feb 2013 04:45:29 +0100 Original-Received: from aidalgol by 114-134-8-58.rurallink.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Feb 2013 04:45:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 155 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114-134-8-58.rurallink.co.nz User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:C5xWeL6eGHj6Md3lVjkMWeod/cQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156877 Archived-At: --=-=-= Content-Type: text/plain Hello, With the help of the Eshell maintainer, John Wiegley, I have filled in most of the missing sections in the Eshell manual, and made some fixes to Eshell itself along the way. There is still much more to do, but I would like to submit my changes so far, because I have done the easier parts of this task (i.e. trivial documentation and source patches). John has seen my changes, and said I should send them to the Emacs devel mailing list instead of him directly. I have attached patches for the Eshell source, but as my changes to the manual affect most of the file, I will instead refer to the complete texinfo file on the Web: . I started from the texinfo file in Emacs 23 (the version of Emacs I was using when I started this project): Best regards, Aidan Gauland --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=kill.patch Content-Description: eshell/kill patch --- a/esh-proc.el 2012-10-25 16:15:47.469236248 +1300 +++ b/esh-proc.el 2012-10-25 16:15:37.184135738 +1300 @@ -165,43 +165,39 @@ (list-processes))) (defun eshell/kill (&rest args) - "Kill processes, buffers, symbol or files." - (let ((ptr args) - (signum 'SIGINT)) - (while ptr - (if (or (eshell-processp (car ptr)) - (and (stringp (car ptr)) - (string-match "^[A-Za-z/][A-Za-z0-9<>/]+$" - (car ptr)))) - ;; What about when $lisp-variable is possible here? - ;; It could very well name a process. - (setcar ptr (get-process (car ptr)))) - (setq ptr (cdr ptr))) - (while args - (let ((id (if (eshell-processp (car args)) - (process-id (car args)) - (car args)))) - (when id - (cond - ((null id) - (error "kill: bad signal spec")) - ((and (numberp id) (= id 0)) - (error "kill: bad signal spec `%d'" id)) - ((and (stringp id) - (string-match "^-?[0-9]+$" id)) - (setq signum (abs (string-to-number id)))) - ((stringp id) - (let (case-fold-search) - (if (string-match "^-\\([A-Z]+[12]?\\)$" id) - (setq signum - (intern (concat "SIG" (match-string 1 id)))) - (error "kill: bad signal spec `%s'" id)))) - ((< id 0) - (setq signum (abs id))) - (t - (signal-process id signum))))) - (setq args (cdr args))) - nil)) + "Kill processes. +Usage: kill [-] | ... +Accepts PIDs and process objects." + ;; If the first argument starts with a dash, treat it as the signal + ;; specifier. +(let ((signum 'SIGINT)) + (let ((arg (car args)) + (case-fold-search nil)) + (when (stringp arg) + (cond + ((string-match "^-[[:digit:]]+$" arg) + (setq signum (abs (string-to-number arg))) + ((or (string-match "^-[[:upper:]]+$" arg) + (string-match "^-[[:lower:]]+$" arg)) + (setq signum (abs (string-to-number arg)))))) + (setq args (cdr args)))) + (while args + (let ((arg (if (eshell-processp (car args)) + (process-id (car args)) + (car args)))) + (when arg + (cond + ((null arg) + (error "kill: null pid. Process may actually be a network connection.")) + ((not (numberp arg)) + (error "kill: invalid argument type: %s" (type-of arg))) + ((and (numberp arg) + (<= arg 0)) + (error "kill: bad pid: %d" arg)) + (t + (signal-process arg signum))))) + (setq args (cdr args)))) + nil) (defun eshell-read-process-name (prompt) "Read the name of a process from the minibuffer, using completion. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=ls_-A.patch Content-Description: ls -A patch --- a/em-ls.el 2012-10-27 16:58:13.256903342 +1300 +++ b/em-ls.el 2012-10-27 16:16:16.207204792 +1300 @@ -327,6 +327,7 @@ (defvar numeric-uid-gid) (defvar reverse-list) (defvar show-all) +(defvar show-almost-all) (defvar show-recursive) (defvar show-size) (defvar sort-method) @@ -342,7 +343,9 @@ (list eshell-ls-initial-args args) args) `((?a "all" nil show-all - "show all files in directory") + "do not ignore entries starting with .") + (?A "almost-all" nil show-almost-all + "do not list implied . and ..") (?c nil by-ctime sort-method "sort by last status change time") (?d "directory" nil dir-literal @@ -557,7 +560,17 @@ ;; later when we are going to ;; display user and group names. (if numeric-uid-gid 'integer 'string)))) - (when (and (not show-all) eshell-ls-exclude-regexp) + (when (and show-almost-all + (not show-all)) + (setq entries + (remove-if + (lambda (entry) + (let ((filename (caar entry))) + (or (string= filename ".") + (string= filename "..")))) + entries))) + (when (and (not show-all) + eshell-ls-exclude-regexp) (while (and entries (string-match eshell-ls-exclude-regexp (caar entries))) (setq entries (cdr entries))) --=-=-=--