aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Lang2014-06-05 15:40:54 +0200
committerMario Lang2014-06-05 15:40:54 +0200
commita1d799c25e4ad96dd2303ef2daa6cb51b5a0fe01 (patch)
tree6d99bcc852f3c86fc06911135ff61645327dfe47
parent4545be9dcbf7f10bce68db3cfba22f9cb1862dfc (diff)
downloademacs-a1d799c25e4ad96dd2303ef2daa6cb51b5a0fe01.tar.gz
emacs-a1d799c25e4ad96dd2303ef2daa6cb51b5a0fe01.zip
* woman.el (woman-mapcan): Remove.
(woman-parse-colon-path): Use cl-mapcan instead.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/woman.el16
2 files changed, 10 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 90cfedceb85..f5273a66659 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-06-05 Mario Lang <mlang@delysid.org>
2
3 * woman.el (woman-mapcan): Remove.
4 (woman-parse-colon-path): Use cl-mapcan instead.
5
12014-06-03 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> 62014-06-03 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
2 7
3 * register.el: Add link to Emacs manual in Commentary. 8 * register.el: Add link to Emacs manual in Commentary.
diff --git a/lisp/woman.el b/lisp/woman.el
index 88510517b25..2dda211200d 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -414,18 +414,12 @@
414 (substring arg 0 (match-end 1)) 414 (substring arg 0 (match-end 1))
415 arg)))) 415 arg))))
416 416
417(require 'cl-lib)
418
417(eval-when-compile ; to avoid compiler warnings 419(eval-when-compile ; to avoid compiler warnings
418 (require 'dired) 420 (require 'dired)
419 (require 'cl-lib)
420 (require 'apropos)) 421 (require 'apropos))
421 422
422(defun woman-mapcan (fn x)
423 "Return concatenated list of FN applied to successive `car' elements of X.
424FN must return a list, cons or nil. Useful for splicing into a list."
425 ;; Based on the Standard Lisp function MAPCAN but with args swapped!
426 ;; More concise implementation than the recursive one. -- dak
427 (apply #'nconc (mapcar fn x)))
428
429(defun woman-parse-colon-path (paths) 423(defun woman-parse-colon-path (paths)
430 "Explode search path string PATHS into a list of directory names. 424 "Explode search path string PATHS into a list of directory names.
431Allow Cygwin colon-separated search paths on Microsoft platforms. 425Allow Cygwin colon-separated search paths on Microsoft platforms.
@@ -440,7 +434,7 @@ As a special case, if PATHS is nil then replace it by calling
440 (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))) 434 (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))
441 ((string-match-p ";" paths) 435 ((string-match-p ";" paths)
442 ;; Assume DOS-style path-list... 436 ;; Assume DOS-style path-list...
443 (woman-mapcan ; splice list into list 437 (cl-mapcan ; splice list into list
444 (lambda (x) 438 (lambda (x)
445 (if x 439 (if x
446 (list x) 440 (list x)
@@ -451,14 +445,14 @@ As a special case, if PATHS is nil then replace it by calling
451 (list paths)) 445 (list paths))
452 (t 446 (t
453 ;; Assume UNIX/Cygwin-style path-list... 447 ;; Assume UNIX/Cygwin-style path-list...
454 (woman-mapcan ; splice list into list 448 (cl-mapcan ; splice list into list
455 (lambda (x) 449 (lambda (x)
456 (mapcar 'woman-Cyg-to-Win 450 (mapcar 'woman-Cyg-to-Win
457 (if x (list x) (woman-parse-man.conf)))) 451 (if x (list x) (woman-parse-man.conf))))
458 (let ((path-separator ":")) 452 (let ((path-separator ":"))
459 (parse-colon-path paths))))) 453 (parse-colon-path paths)))))
460 ;; Assume host-default-style path-list... 454 ;; Assume host-default-style path-list...
461 (woman-mapcan ; splice list into list 455 (cl-mapcan ; splice list into list
462 (lambda (x) (if x (list x) (woman-parse-man.conf))) 456 (lambda (x) (if x (list x) (woman-parse-man.conf)))
463 (parse-colon-path (or paths ""))))) 457 (parse-colon-path (or paths "")))))
464 458