From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Do we still need `woman-mapcan'? Date: Tue, 03 Jun 2014 19:27:28 +0200 Message-ID: <87wqcxx5rz.fsf@fx.delysid.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1401816516 25600 80.91.229.3 (3 Jun 2014 17:28:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2014 17:28:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 03 19:28:28 2014 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 1WrsVd-00074l-VQ for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2014 19:28:26 +0200 Original-Received: from localhost ([::1]:54945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrsVd-00054r-IA for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2014 13:28:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrsUw-0003zk-Ef for emacs-devel@gnu.org; Tue, 03 Jun 2014 13:27:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrsUm-0001Iw-5p for emacs-devel@gnu.org; Tue, 03 Jun 2014 13:27:42 -0400 Original-Received: from fep12.mx.upcmail.net ([62.179.121.32]:43527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrsUl-0001IA-SJ for emacs-devel@gnu.org; Tue, 03 Jun 2014 13:27:32 -0400 Original-Received: from edge03.upcmail.net ([192.168.13.238]) by viefep12-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140603172729.OFON62019.viefep12-int.chello.at@edge03.upcmail.net> for ; Tue, 3 Jun 2014 19:27:29 +0200 Original-Received: from fx.delysid.org ([80.109.200.215]) by edge03.upcmail.net with edge id 9tTV1o0074fLMH403tTVcE; Tue, 03 Jun 2014 19:27:29 +0200 X-SourceIP: 80.109.200.215 Original-Received: from mlang by fx.delysid.org with local (Exim 4.82) (envelope-from ) id 1WrsUi-00021R-VM for emacs-devel@gnu.org; Tue, 03 Jun 2014 19:27:28 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 62.179.121.32 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:172304 Archived-At: Hi. Or do we want to kill it in favour of `cl-mapcan'? Besides, the comment is= lying, there are no swapped args anywhere. --- a/lisp/woman.el +++ b/lisp/woman.el @@ -414,18 +414,12 @@ (substring arg 0 (match-end 1)) arg)))) =20 +(require 'cl-lib) + (eval-when-compile ; to avoid compiler warnings (require 'dired) - (require 'cl-lib) (require 'apropos)) =20 -(defun woman-mapcan (fn x) - "Return concatenated list of FN applied to successive `car' elements of = X. -FN must return a list, cons or nil. Useful for splicing into a list." - ;; Based on the Standard Lisp function MAPCAN but with args swapped! - ;; More concise implementation than the recursive one. -- dak - (apply #'nconc (mapcar fn x))) - (defun woman-parse-colon-path (paths) "Explode search path string PATHS into a list of directory names. Allow Cygwin colon-separated search paths on Microsoft platforms. @@ -440,7 +434,7 @@ As a special case, if PATHS is nil then replace it by c= alling (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))) ((string-match-p ";" paths) ;; Assume DOS-style path-list... - (woman-mapcan ; splice list into list + (cl-mapcan ; splice list into list (lambda (x) (if x (list x) @@ -451,14 +445,14 @@ As a special case, if PATHS is nil then replace it by= calling (list paths)) (t ;; Assume UNIX/Cygwin-style path-list... - (woman-mapcan ; splice list into list + (cl-mapcan ; splice list into list (lambda (x) (mapcar 'woman-Cyg-to-Win (if x (list x) (woman-parse-man.conf)))) (let ((path-separator ":")) (parse-colon-path paths))))) ;; Assume host-default-style path-list... - (woman-mapcan ; splice list into list + (cl-mapcan ; splice list into list (lambda (x) (if x (list x) (woman-parse-man.conf))) (parse-colon-path (or paths ""))))) =20 --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95