[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/man.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/man.el |
Date: |
Sun, 13 Jul 2003 13:16:31 -0400 |
Index: emacs/lisp/man.el
diff -c emacs/lisp/man.el:1.124 emacs/lisp/man.el:1.125
*** emacs/lisp/man.el:1.124 Mon Jul 7 17:01:55 2003
--- emacs/lisp/man.el Sun Jul 13 13:16:31 2003
***************
*** 504,520 ****
(error "Malformed Man-filter-list"))
phrase)
pargs " ")))
! (setq flist (cdr flist))))
command))
(defun Man-translate-references (ref)
"Translates REF from \"chmod(2V)\" to \"2v chmod\" style.
Leave it as is if already in that style. Possibly downcase and
translate the section (see the Man-downcase-section-letters-flag
and the Man-section-translations-alist variables)."
(let ((name "")
! (section "")
! (slist Man-section-translations-alist))
(cond
;; "chmod(2V)" case ?
((string-match (concat "^" Man-reference-regexp "$") ref)
--- 504,533 ----
(error "Malformed Man-filter-list"))
phrase)
pargs " ")))
! (setq flist (cdr flist))))
command))
+
+ (defun Man-translate-cleanup (string)
+ "Strip leading, trailing and middle spaces."
+ (when (stringp string)
+ ;; Strip leading and trailing
+ (if (string-match "^[ \t\f\r\n]*\\(.+[^ \t\f\r\n]\\)" string)
+ (setq string (match-string 1 string)))
+ ;; middle spaces
+ (setq string (replace-regexp-in-string "[\t\r\n]" " " string))
+ (setq string (replace-regexp-in-string " +" " " string))
+ string))
+
(defun Man-translate-references (ref)
"Translates REF from \"chmod(2V)\" to \"2v chmod\" style.
Leave it as is if already in that style. Possibly downcase and
translate the section (see the Man-downcase-section-letters-flag
and the Man-section-translations-alist variables)."
(let ((name "")
! (section "")
! (slist Man-section-translations-alist))
! (setq ref (Man-translate-cleanup ref))
(cond
;; "chmod(2V)" case ?
((string-match (concat "^" Man-reference-regexp "$") ref)
***************
*** 577,582 ****
--- 590,596 ----
;; For compatibility with older versions.
;;;###autoload
(defalias 'manual-entry 'man)
+
;;;###autoload
(defun man (man-args)