From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#22332: 25.0.50; woman moves point in a wrong buffer Date: Thu, 04 Feb 2016 05:41:27 +0000 Message-ID: References: <87y4c0ylnl.fsf@gmail.com> <5690D1EE.4000306@gmx.at> <56913B50.6020808@gmx.at> <87bn8uoe54.fsf@gmail.com> <5691469B.7000304@gmx.at> <56923823.1030109@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013a04a83058a4052aeb30ad X-Trace: ger.gmane.org 1454564554 3538 80.91.229.3 (4 Feb 2016 05:42:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Feb 2016 05:42:34 +0000 (UTC) Cc: Ari Roponen , 22332@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 04 06:42:25 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aRCgR-000836-K5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Feb 2016 06:42:24 +0100 Original-Received: from localhost ([::1]:39706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRCgQ-0005Jc-Tu for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Feb 2016 00:42:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRCgA-000515-Ce for bug-gnu-emacs@gnu.org; Thu, 04 Feb 2016 00:42:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRCg6-0001IW-Nr for bug-gnu-emacs@gnu.org; Thu, 04 Feb 2016 00:42:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRCg6-0001Hv-HQ for bug-gnu-emacs@gnu.org; Thu, 04 Feb 2016 00:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aRCg6-0003KT-7Z for bug-gnu-emacs@gnu.org; Thu, 04 Feb 2016 00:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Feb 2016 05:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22332 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22332-submit@debbugs.gnu.org id=B22332.145456450612775 (code B ref 22332); Thu, 04 Feb 2016 05:42:02 +0000 Original-Received: (at 22332) by debbugs.gnu.org; 4 Feb 2016 05:41:46 +0000 Original-Received: from localhost ([127.0.0.1]:58744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRCfp-0003Jy-Dj for submit@debbugs.gnu.org; Thu, 04 Feb 2016 00:41:46 -0500 Original-Received: from mail-ob0-f174.google.com ([209.85.214.174]:33723) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRCfn-0003Jj-BD for 22332@debbugs.gnu.org; Thu, 04 Feb 2016 00:41:44 -0500 Original-Received: by mail-ob0-f174.google.com with SMTP id is5so54976784obc.0 for <22332@debbugs.gnu.org>; Wed, 03 Feb 2016 21:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=UiAcMObMJIy/OZngrR0vgpoii49OQ6zwI8WxVNSWjT4=; b=klpmUmpzeUfC9FlABh8ZcrP4hARHEGk9OvZcj/pHbBoXTjlrXRfm28hnXv1dIoGfZF k+/+zaAUWTe7hs4/B4WvB3dTBTgPVgi4fWj/8m3R+HE4d7zS8nSIYWXpNioRcLvD7OkF b5IE21n3648EislRq6MHZGMYV9RB6ldKgmgPXQXtVY9gbX8putHPTwIXVvYUYtIqns2W X+cJZukwAZKVGytoYfL+iDAcsKbA8WXmw3xTet5qY63O7KhNyg4RdES5RMAQnzOT4Mak h43Y1P9obg9HYYZgd10uQnOshBAm3K6Krtu0X0M05kTQhQgV3ghMurWPoAv5dAQo0moo orWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=UiAcMObMJIy/OZngrR0vgpoii49OQ6zwI8WxVNSWjT4=; b=e1SLy0Y5g8Z6/z2UJiIMdDww2EpxgeVSBf7noeFLllcDUkyvNpOruHPmNAuTREcQ9a dxDmgGgPuxMPMOfe6ih3SPvBpSW26M9SYNCECyz5H4WsuvDBlkFOwBKlb6QK/BLhAZti KWjzEY4+Zhd+EyPmXBRl943AGaGmvVhOixV85dbChQEZNoXAkG7IDznczp2ELRhLQ5xo 0TFhfnrllddDJn9mOEgHyKD6jEh01GTBPPeztlQyeK2gFWU2Kz81sWX/KbZXBdgaXEG5 oJJO4+ZZlkqMM99W/7Vo/HJ6JNN6GbVfOY5TIf79EuDVrB85cJ/BJWj8/liYJl3UbYQS 34qA== X-Gm-Message-State: AG10YOTNXvphdhbryhUEQTsuootR/QQnM4pZ+8UnefbcQbJZiZTGd1TyZk9ZmtY+cu6cDdP+Q4rDSvbLLIKGkw== X-Received: by 10.60.60.3 with SMTP id d3mr5742047oer.24.1454564497706; Wed, 03 Feb 2016 21:41:37 -0800 (PST) In-Reply-To: <56923823.1030109@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112381 Archived-At: --089e013a04a83058a4052aeb30ad Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, >> Martin Rudalics > This might fix the call from =E2=80=98woman-find-file=E2=80=99. But =E2= =80=98WoMan-find-buffer=E2=80=99 > is also called from =E2=80=98WoMan-previous-manpage=E2=80=99 and =E2=80= =98WoMan-next-manpage=E2=80=99. > How can we be sure that =E2=80=98display-buffer=E2=80=99 does not display= the previous > or next WoMan buffer in another window? And if it does so, we have the > problem that that other window does not get selected. > Can you please try this updated patch? This time, I hope to have it tested all the woman buffer switching activities. PS: The patch also resulted in many indentation changes. Looks like the default lisp-indent-function is changed since the last major edits to woman.el (because I did C-x h C-M-\ at the end committing my edits). Please advise how to remove just the indentation changes. >From 657205fa5156a853e6d300b98f26fba75210e646 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Thu, 4 Feb 2016 00:22:31 -0500 Subject: [PATCH] Fix-22332: woman.el display/switch-to-buffer behav - This is a continuation of the fix in commit 244a00860b6fe1d6acf92948c5c0d1ef0f8426fa - This also fixes debbugs 22332; now executing `woman` does not manipulate the point in a non-*WoMan* buffer. - WoMan-find-buffer definition is changed; now it returns the WoMan buffer but does not switch to it by default. We directly switch to the WoMan buffer only if `WoMan-find-buffer` is given a non-nil argument. - WoMan-previous-manpage and WoMan-next-manpage now do not result in new window pops. We now switch to prev/next manpage in the same window. --- lisp/woman.el | 189 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 103 insertions(+), 86 deletions(-) mode change 100644 =3D> 100755 lisp/woman.el diff --git a/lisp/woman.el b/lisp/woman.el index 28a4798..f171ac2 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1601,32 +1601,38 @@ woman-find-file (interactive "fBrowse UN*X manual file: \nP") (setq woman-last-file-name (setq file-name (expand-file-name file-name))) ; to canonicalize - (let ((alist-tail woman-buffer-alist) exists) + (let ((alist-tail woman-buffer-alist) + woman-buffer + exists) (setq woman-buffer-number 0) (while (and alist-tail (not (string=3D file-name (car (car alist-tail))))) (setq alist-tail (cdr alist-tail) woman-buffer-number (1+ woman-buffer-number))) - (or (and (setq exists - (and alist-tail (WoMan-find-buffer))) ; buffer exists - (not reformat)) - ;; Format new buffer or reformat current buffer: - (let* ((bufname (file-name-nondirectory file-name)) - (case-fold-search t) - (compressed - (and (string-match-p woman-file-compression-regexp bufname) t))) - (if compressed - (setq bufname (file-name-sans-extension bufname))) - (setq bufname (if exists - (buffer-name) - (woman-make-bufname bufname))) - (woman-really-find-file file-name compressed bufname) - (or exists - (setq woman-buffer-alist - (cons (cons file-name bufname) woman-buffer-alist) - woman-buffer-number 0))))) - (Man-build-section-alist) - (Man-build-references-alist) - (goto-char (point-min))) + (when alist-tail + (setq woman-buffer (WoMan-find-buffer))) + (setq exists (and alist-tail woman-buffer)) + (or (and exists ; buffer exists + (not reformat)) + ;; Format new buffer or reformat current buffer: + (let* ((bufname (file-name-nondirectory file-name)) + (case-fold-search t) + (compressed + (and (string-match-p woman-file-compression-regexp bufname) t))) + (if compressed + (setq bufname (file-name-sans-extension bufname))) + (setq bufname (if exists + (buffer-name) + (woman-make-bufname bufname))) + (woman-really-find-file file-name compressed bufname) + (or exists + (setq woman-buffer-alist + (cons (cons file-name bufname) woman-buffer-alist) + woman-buffer-number 0)))) + (when woman-buffer + (with-current-buffer (get-buffer woman-buffer) + (Man-build-section-alist) + (Man-build-references-alist) + (goto-char (point-min)))))) (defun woman-make-bufname (bufname) "Create an unambiguous buffer name from BUFNAME." @@ -2032,13 +2038,13 @@ WoMan-previous-manpage "Find the previous WoMan buffer." ;; Assumes currently in a WoMan buffer! (interactive) - (WoMan-find-buffer) ; find current existing buffer + (WoMan-find-buffer :switch) ; find current existing buffer (if (null (cdr woman-buffer-alist)) (error "No previous WoMan buffer")) (if (>=3D (setq woman-buffer-number (1+ woman-buffer-number)) - (length woman-buffer-alist)) + (length woman-buffer-alist)) (setq woman-buffer-number 0)) - (if (WoMan-find-buffer) + (if (WoMan-find-buffer :switch) () (if (< (setq woman-buffer-number (1- woman-buffer-number)) 0) (setq woman-buffer-number (1- (length woman-buffer-alist)))) @@ -2048,30 +2054,41 @@ WoMan-next-manpage "Find the next WoMan buffer." ;; Assumes currently in a WoMan buffer! (interactive) - (WoMan-find-buffer) ; find current existing buffer + (WoMan-find-buffer :switch) ; find current existing buffer (if (null (cdr woman-buffer-alist)) (error "No next WoMan buffer")) (if (< (setq woman-buffer-number (1- woman-buffer-number)) 0) (setq woman-buffer-number (1- (length woman-buffer-alist)))) - (if (WoMan-find-buffer) + (if (WoMan-find-buffer :switch) () (WoMan-next-manpage))) -(defun WoMan-find-buffer () - "Switch to buffer corresponding to `woman-buffer-number' and return it. +(defun WoMan-find-buffer (&optional switch) + "Display the buffer corresponding to `woman-buffer-number'. +If SWITCH is non-nil, directly switch to the WoMan buffer using +`switch-to-buffer' instead of `display-buffer'. If such a buffer does not exist then remove its association from the -alist in `woman-buffer-alist' and return nil." +alist in `woman-buffer-alist' and return nil. +Return the buffer otherwise." (if (zerop woman-buffer-number) (let ((buffer (get-buffer (cdr (car woman-buffer-alist))))) (if buffer - (display-buffer buffer) + (if switch + (switch-to-buffer buffer) + (progn + (display-buffer buffer) + buffer)) ;; Delete alist element: (setq woman-buffer-alist (cdr woman-buffer-alist)) nil)) (let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist)) (buffer (get-buffer (cdr (car (cdr prev-ptr)))))) (if buffer - (display-buffer buffer) + (if switch + (switch-to-buffer buffer) + (progn + (display-buffer buffer) + buffer)) ;; Delete alist element: (setcdr prev-ptr (cdr (cdr prev-ptr))) (if (>=3D woman-buffer-number (length woman-buffer-alist)) @@ -2137,12 +2154,12 @@ woman-decode-buffer (let ((start-time (current-time)) time) (message "WoMan formatting buffer...") -; (goto-char (point-min)) -; (cond -; ((re-search-forward "^\\.[ \t]*TH" nil t) ; wrong format if not found? -; (beginning-of-line) -; (delete-region (point-min) (point))) ; potentially dangerous! -; (t (message "WARNING: .TH request not found -- not man-page format?"))= ) + ;; (goto-char (point-min)) ; ; ; + ;; (cond ; ; ; + ;; ((re-search-forward "^\\.[ \t]*TH" nil t) ; wrong format if not found? ; ; ; + ;; (beginning-of-line) ; ; ; + ;; (delete-region (point-min) (point))) ; potentially dangerous! ; ; ; + ;; (t (message "WARNING: .TH request not found -- not man-page format?"))) ; ; ; (woman-decode-region (point-min) (point-max)) (setq time (float-time (time-since start-time))) (message "WoMan formatting buffer...done in %g seconds" time) @@ -2259,7 +2276,7 @@ woman-decode-region (setq-local adaptive-fill-mode nil) ; No special "%" "#" etc filling. - ;; Set syntax and display tables: + ;; Set syntax and display tables: (set-syntax-table woman-syntax-table) (woman-set-buffer-display-table) @@ -2335,8 +2352,8 @@ woman-decode-region (woman-strings) ;; Special chars moved after translation in ;; `woman2-process-escapes' (for pic.1): -; (goto-char from) -; (woman-special-characters) + ;; (goto-char from) ; ; + ;; (woman-special-characters) ; ; ;; Process standard font-change requests and escapes: (goto-char from) @@ -2875,7 +2892,7 @@ woman-strings (let ((beg (match-beginning 0))) (woman-match-name) (let* ((stringname (match-string 0)) - (string (assoc stringname woman-string-alist))) + (string (assoc stringname woman-string-alist))) (cond (string (delete-region beg (point)) ;; Temporary hack in case string starts with a @@ -2884,7 +2901,7 @@ woman-strings (insert-before-markers (cdr string))) (t (WoMan-warn "Undefined string %s not interpolated!" - stringname) + stringname) (cond (woman-ignore ;; Output above message once only per call (delete-region beg (point)) @@ -3050,10 +3067,10 @@ woman1-roff-buffer ;; (woman1-unquote is used by called function): (setq woman1-unquote (not (eolp))) (if (eolp) (delete-char 1)) -; ;; Hide leading control character in unquoted argument: -; (cond ((memq (following-char) '(?. ?')) -; (insert "\\&") -; (beginning-of-line))) + ;; ;; Hide leading control character in unquoted argument: + ;; (cond ((memq (following-char) '(?. ?')) + ;; (insert "\\&") + ;; (beginning-of-line))) ;; Call the appropriate function: (funcall fn) ;; Hide leading control character in quoted argument (only): @@ -3107,15 +3124,15 @@ woman1-IB (woman1-alt-fonts (list "\\fI" "\\fB"))) (defun woman1-IR () - ".IR -- Join words of current line alternating italic and Roman fonts." - (woman1-alt-fonts (list "\\fI" "\\fR"))) + ".IR -- Join words of current line alternating italic and Roman fonts." + (woman1-alt-fonts (list "\\fI" "\\fR"))) (defun woman1-RB () - ".RB -- Join words of current line alternating Roman and bold fonts." + ".RB -- Join words of current line alternating Roman and bold fonts." (woman1-alt-fonts (list "\\fR" "\\fB"))) (defun woman1-RI () - ".RI -- Join words of current line alternating Roman and italic fonts." + ".RI -- Join words of current line alternating Roman and italic fonts." (woman1-alt-fonts (list "\\fR" "\\fI"))) (defun woman1-alt-fonts (fonts) @@ -3202,7 +3219,7 @@ woman1-hc ".hc c -- Set hyphenation character to c, i.e. delete it!" (let ((c (char-to-string (following-char)))) ;; (WoMan-log - ;; "Hyphenation character %s deleted -- hyphenation not supported!" c= ) + ;; "Hyphenation character %s deleted -- hyphenation not supported!" c) (woman-delete-whole-line) (setq c (concat "\\(" c "\\)\\|^[.'][ \t]*hc")) (save-excursion @@ -3220,27 +3237,27 @@ woman1-hw (put 'woman1-ps 'notfont t) (defalias 'woman1-ps 'woman-delete-whole-line) - ;; .ps -- Point size -- IGNORE! +;; .ps -- Point size -- IGNORE! (put 'woman1-ss 'notfont t) (defalias 'woman1-ss 'woman-delete-whole-line) - ;; .ss -- Space-character size -- IGNORE! +;; .ss -- Space-character size -- IGNORE! (put 'woman1-cs 'notfont t) (defalias 'woman1-cs 'woman-delete-whole-line) - ;; .cs -- Constant character space (width) mode -- IGNORE! +;; .cs -- Constant character space (width) mode -- IGNORE! (put 'woman1-ne 'notfont t) (defalias 'woman1-ne 'woman-delete-whole-line) - ;; .ne -- Need vertical space -- IGNORE! +;; .ne -- Need vertical space -- IGNORE! (put 'woman1-vs 'notfont t) (defalias 'woman1-vs 'woman-delete-whole-line) - ;; .vs -- Vertical base line spacing -- IGNORE! +;; .vs -- Vertical base line spacing -- IGNORE! (put 'woman1-bd 'notfont t) (defalias 'woman1-bd 'woman-delete-whole-line) - ;; .bd -- Embolden font -- IGNORE! +;; .bd -- Embolden font -- IGNORE! ;;; Non-breaking SunOS-specific macros: @@ -3251,7 +3268,7 @@ woman1-TX (put 'woman1-IX 'notfont t) (defalias 'woman1-IX 'woman-delete-whole-line) - ;; .IX -- Index macro, for Sun internal use -- IGNORE! +;; .IX -- Index macro, for Sun internal use -- IGNORE! ;;; Direct font selection: @@ -3552,14 +3569,14 @@ woman-parse-numeric-arg (if (> (woman-parse-numeric-value) 0) 1 0)) ))) )) -; (if (looking-at "[ \t\nRC)\"]") ; R, C are tab types -; () -; (WoMan-warn "Unimplemented numerical operator `%c' in %s" -; (following-char) -; (buffer-substring -; (line-beginning-position) -; (line-end-position))) -; (skip-syntax-forward "^ ")) + ;; (if (looking-at "[ \t\nRC)\"]") ; R, C are tab types + ;; () + ;; (WoMan-warn "Unimplemented numerical operator `%c' in %s" + ;; (following-char) + ;; (buffer-substring + ;; (line-beginning-position) + ;; (line-end-position))) + ;; (skip-syntax-forward "^ ")) value )) @@ -3700,16 +3717,16 @@ woman2-roff-buffer (beginning-of-line) (woman-delete-line 1)) (t (end-of-line) (insert ?\n)) ) - (if (not (or fn - (and (not (memq (following-char) '(?. ?'))) - (setq fn 'woman2-format-paragraphs)))) - () - ;; Find next control line: - (if (equal woman-request "TS") - (set-marker to (woman-find-next-control-line "TE")) - (set-marker to (woman-find-next-control-line))) - ;; Call the appropriate function: - (funcall fn to))) + (if (not (or fn + (and (not (memq (following-char) '(?. ?'))) + (setq fn 'woman2-format-paragraphs)))) + () + ;; Find next control line: + (if (equal woman-request "TS") + (set-marker to (woman-find-next-control-line "TE")) + (set-marker to (woman-find-next-control-line))) + ;; Call the appropriate function: + (funcall fn to))) (if (not (eobp)) ; This should not happen, but ... (woman2-format-paragraphs (copy-marker (point-max) t) woman-left-margin)) @@ -4312,13 +4329,13 @@ woman-set-arg (if previous (set previous (eval arg))) (woman2-process-escapes-to-eol 'numeric) (let ((pm (if (looking-at "[+-]") - (prog1 (following-char) - (forward-char 1)))) - (i (woman-parse-numeric-arg))) - (cond ((null pm) (set arg i)) - ((=3D pm ?+) (set arg (+ (eval arg) i))) - ((=3D pm ?-) (set arg (- (eval arg) i))) - )) + (prog1 (following-char) + (forward-char 1)))) + (i (woman-parse-numeric-arg))) + (cond ((null pm) (set arg i)) + ((=3D pm ?+) (set arg (+ (eval arg) i))) + ((=3D pm ?-) (set arg (- (eval arg) i))) + )) (beginning-of-line)) (woman-delete-line 1)) ; ignore any remaining arguments @@ -4515,8 +4532,8 @@ woman2-TS (woman2-format-paragraphs to)) (defalias 'woman2-TE 'woman2-fi) - ;; ".TE -- End of table code for the tbl processor." - ;; Turn filling and adjusting back on. +;; ".TE -- End of table code for the tbl processor." +;; Turn filling and adjusting back on. (defun woman-break-table (start-column to start) (while (< (point) to) --=20 2.6.0.rc0.24.gec371ff I used this little snippet (saved to test.el) and then running "emacs -Q --load=3Dtest.el" to test the above. "C-c 0" would load the patched woman.e= l and then it is self explanatory how I would have used the test.el. =3D=3D=3D=3D=3D (global-set-key (kbd "C-c 0") (lambda () (interactive) (load-file "/path/to/the/patched/woman.el"))) (global-set-key (kbd "C-c 1") (lambda () (interactive) (woman "timelocal"))= ) (global-set-key (kbd "C-c 2") (lambda () (interactive) (woman "timezone"))) (global-set-key (kbd "C-c 3") (lambda () (interactive) (woman "acos"))) (global-set-key (kbd "C-c p") #'WoMan-previous-manpage) (global-set-key (kbd "C-c n") #'WoMan-next-manpage) =3D=3D=3D=3D=3D --089e013a04a83058a4052aeb30ad Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

>> Martin Rudalics
This might fix the call = from =E2=80=98woman-find-file=E2=80=99.=C2=A0 But =E2=80=98WoMan-find-buffe= r=E2=80=99
is also called from =E2=80=98WoMan-previous-manpage=E2=80=99 and =E2=80=98W= oMan-next-manpage=E2=80=99.
How can we be sure that =E2=80=98display-buffer=E2=80=99 does not display t= he previous
or next WoMan buffer in another window?=C2=A0 And if it does so, we have th= e
problem that that other window does not get selected.
=
Can you please try this updated patch? This time, I hope to = have it tested all the woman buffer switching activities.

PS: The patch also resulted in many indentation changes. Looks like= the default lisp-indent-function is changed since the last major edits to = woman.el (because I did C-x h C-M-\ at the end committing my edits). Please= advise how to remove just the indentation changes.=C2=A0

From 657205fa5156a853e6d300b98f26fba75210e646 Mon Sep 17 00:00= :00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Thu, 4 Feb 2016 00:= 22:31 -0500
Subject: [PATCH] Fix-22332: woman.el display/switch-t= o-buffer behav

- This is a continuation of the fix= in commit
=C2=A0 244a00860b6fe1d6acf92948c5c0d1ef0f8426fa
<= div>- This also fixes debbugs 22332; now executing `woman` does not
=C2=A0 manipulate the point in a non-*WoMan* buffer.
- WoMan-f= ind-buffer definition is changed; now it returns the WoMan
=C2=A0= buffer but does not switch to it by default. We directly switch to the
=C2=A0 WoMan buffer only if `WoMan-find-buffer` is given a non-nil a= rgument.
- WoMan-previous-manpage and WoMan-next-manpage now do n= ot result in new
=C2=A0 window pops. We now switch to prev/next m= anpage in the same window.
---
=C2=A0lisp/woman.el | 18= 9 ++++++++++++++++++++++++++++++++--------------------------
=C2= =A01 file changed, 103 insertions(+), 86 deletions(-)
=C2=A0mode = change 100644 =3D> 100755 lisp/woman.el

diff --= git a/lisp/woman.el b/lisp/woman.el
index 28a4798..f171ac2
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -160= 1,32 +1601,38 @@ woman-find-file
=C2=A0 =C2=A0(interactive "= fBrowse UN*X manual file: \nP")
=C2=A0 =C2=A0(setq woman-las= t-file-name
=C2=A0 (setq file-name (expand-file-name file-name))) ; to canonicalize
- =C2=A0(let ((alist-tail woman-buffer-alist) exists)
+ = =C2=A0(let ((alist-tail woman-buffer-alist)
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0woman-buffer
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0exists)
=
=C2=A0 =C2=A0 =C2=A0(setq woman-buffer-number 0)
=C2=A0 =C2= =A0 =C2=A0(while (and alist-tail (not (string=3D file-name (car (car alist-= tail)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq alist-tail (cdr alist-= tail)
=C2=A0 =C2=A0 =C2=A0woman-buffer-number (1+ woman-buffer-number)))
- =C2=A0 =C2=A0(or (and (setq exists
- =C2=A0 (and alist-tail (WoM= an-find-buffer))) ; buffer exists
- =C2=A0 =C2=A0 (not reformat))
- ;; Forma= t new buffer or reformat current buffer:
- (let* ((bufname (file-name-nondir= ectory file-name))
- =C2=A0 =C2=A0 =C2=A0 (case-fold-search t)
-<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> =C2=A0 =C2= =A0 =C2=A0 (compressed
- (and (string-match-p woman-file-compression-regexp= bufname) t)))
- =C2=A0(if compressed
- =C2=A0 =C2=A0 =C2=A0(setq bufname (= file-name-sans-extension bufname)))
- =C2=A0(setq bufname (if exists
<= div>- = =C2=A0 =C2=A0(buffer-name)
- =C2=A0(woman-make-bufname bufname)))
<= div>- =C2= =A0(woman-really-find-file file-name compressed bufname)
- =C2=A0(or exists=
- =C2=A0 =C2=A0 =C2=A0(setq woman-buffer-alist
- =C2=A0 =C2=A0(cons (cons= file-name bufname) woman-buffer-alist)
- =C2=A0 =C2=A0woman-buffer-number= 0)))))
- =C2=A0(Man-build-section-alist)
- =C2=A0(Man-= build-references-alist)
- =C2=A0(goto-char (point-min)))
+ =C2=A0 =C2=A0(when alist-tail
+ =C2=A0 =C2=A0 =C2=A0(setq wom= an-buffer (WoMan-find-buffer)))
+ =C2=A0 =C2=A0(setq exists (and = alist-tail woman-buffer))
+ =C2=A0 =C2=A0(or (and exists ; buffer= exists
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (not reformat= ))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Format new buffer or reformat = current buffer:
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((bufname (fil= e-name-nondirectory file-name))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (case-fold-search t)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (compressed
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and (string-match-p woman-file-compression-= regexp bufname) t)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if comp= ressed
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq bu= fname (file-name-sans-extension bufname)))
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0(setq bufname (if exists
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(b= uffer-name)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(woman-make-bufname bufname)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(woman-really-find-file file-nam= e compressed bufname)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or exi= sts
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq woman= -buffer-alist
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(cons (cons file-name bufname) woman-buffer-alist)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0woman-buffer-number 0))))
+ =C2=A0 =C2=A0(when woman-buffer
+ =C2=A0 =C2=A0 =C2=A0(with-current-buffer (get-buffer woman-buffer= )
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(Man-build-section-alist)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(Man-build-references-alist)
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0(goto-char (point-min))))))
=C2=A0
<= div>=C2=A0(defun woman-make-bufname (bufname)
=C2=A0 =C2=A0"= Create an unambiguous buffer name from BUFNAME."
@@ -2032,13= +2038,13 @@ WoMan-previous-manpage
=C2=A0 =C2=A0"Find the p= revious WoMan buffer."
=C2=A0 =C2=A0;; Assumes currently in = a WoMan buffer!
=C2=A0 =C2=A0(interactive)
- =C2=A0(WoM= an-find-buffer) = ; find current existing buffer
+ =C2=A0(WoMan-find-buffer = :switch) = ; find current existing buffer
=C2=A0 =C2=A0(if (null (cdr woman-= buffer-alist))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(error "No previou= s WoMan buffer"))
=C2=A0 =C2=A0(if (>=3D (setq woman-buff= er-number (1+ woman-buffer-number))
- (length woman-buffer-alist))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(length woman-buffer-alist))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq woman-buffer-number 0))
- =C2= =A0(if (WoMan-find-buffer)
+ =C2=A0(if (WoMan-find-buffer :switch= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0()
=C2=A0 =C2=A0 =C2=A0(if= (< (setq woman-buffer-number (1- woman-buffer-number)) 0)
=C2= =A0 (setq w= oman-buffer-number (1- (length woman-buffer-alist))))
@@ -2048,30= +2054,41 @@ WoMan-next-manpage
=C2=A0 =C2=A0"Find the next = WoMan buffer."
=C2=A0 =C2=A0;; Assumes currently in a WoMan = buffer!
=C2=A0 =C2=A0(interactive)
- =C2=A0(WoMan-find-= buffer) ;= find current existing buffer
+ =C2=A0(WoMan-find-buffer :switch)= ; find c= urrent existing buffer
=C2=A0 =C2=A0(if (null (cdr woman-buffer-a= list))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(error "No next WoMan buff= er"))
=C2=A0 =C2=A0(if (< (setq woman-buffer-number (1- w= oman-buffer-number)) 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq woman-bu= ffer-number (1- (length woman-buffer-alist))))
- =C2=A0(if (WoMan= -find-buffer)
+ =C2=A0(if (WoMan-find-buffer :switch)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0()
=C2=A0 =C2=A0 =C2=A0(WoMan-next-man= page)))
=C2=A0
-(defun WoMan-find-buffer ()
-= =C2=A0"Switch to buffer corresponding to `woman-buffer-number' an= d return it.
+(defun WoMan-find-buffer (&optional switch)
+ =C2=A0"Display the buffer corresponding to `woman-buffer-numb= er'.
+If SWITCH is non-nil, directly switch to the WoMan buff= er using
+`switch-to-buffer' instead of `display-buffer'.=
=C2=A0If such a buffer does not exist then remove its associatio= n from the
-alist in `woman-buffer-alist' and return nil.&quo= t;
+alist in `woman-buffer-alist' and return nil.
+= Return the buffer otherwise."
=C2=A0 =C2=A0(if (zerop woman-= buffer-number)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((buffer (get-buff= er (cdr (car woman-buffer-alist)))))
=C2=A0 (if buffer
- =C2=A0 =C2=A0(displ= ay-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if = switch
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= switch-to-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(progn
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(display-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0buffer))
=C2=A0 =C2=A0;; Delete alist element:
=C2=A0 =C2=A0(setq woman-buffer-alist (cdr woman-buffer-alist))
= =C2=A0 =C2= =A0nil))
=C2=A0 =C2=A0 =C2=A0(let* ((prev-ptr (nthcdr (1- woman-b= uffer-number) woman-buffer-alist))
=C2=A0 =C2=A0 (buffer (get-buffer (cdr (= car (cdr prev-ptr))))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(if buffer
- = =C2=A0(display-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(if switch
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= switch-to-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(progn
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(disp= lay-buffer buffer)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0buffer))
=C2=A0 ;; Delete alist element:
=C2=A0 (setcdr prev-ptr (cdr= (cdr prev-ptr)))
=C2=A0 (if (>=3D woman-buffer-number (length woman-buff= er-alist))
@@ -2137,12 +2154,12 @@ woman-decode-buffer
= =C2=A0 =C2=A0(let ((start-time (current-time))
=C2=A0 time)
=C2= =A0 =C2=A0 =C2=A0(message "WoMan formatting buffer...")
-; =C2=A0(goto-char (point-min))
-; =C2=A0(cond
-; =C2= =A0 ((re-search-forward "^\\.[ \t]*TH" nil t) ; wrong format if n= ot found?
-; =C2=A0 =C2=A0(beginning-of-line)
-; =C2=A0= =C2=A0(delete-region (point-min) (point))) ; potentially dangerous!
<= div>-; =C2=A0 (t (message "WARNING: .TH request not found -- not man-p= age format?")))
+ =C2=A0 =C2=A0;; =C2=A0(goto-char (point-mi= n)) ; ; ;
+ =C2=A0 =C2=A0;; =C2=A0(cond ; ; ;
+ =C2=A0 = =C2=A0;; =C2=A0 ((re-search-forward "^\\.[ \t]*TH" nil t) ; wrong= format if not found? ; ; ;
+ =C2=A0 =C2=A0;; =C2=A0 =C2=A0(begin= ning-of-line) ; ; ;
+ =C2=A0 =C2=A0;; =C2=A0 =C2=A0(delete-region= (point-min) (point))) ; potentially dangerous! ; ; ;
+ =C2=A0 = =C2=A0;; =C2=A0 (t (message "WARNING: .TH request not found -- not man= -page format?"))) ; ; ;
=C2=A0 =C2=A0 =C2=A0(woman-decode-re= gion (point-min) (point-max))
=C2=A0 =C2=A0 =C2=A0(setq time (flo= at-time (time-since start-time)))
=C2=A0 =C2=A0 =C2=A0(message &q= uot;WoMan formatting buffer...done in %g seconds" time)
@@ -= 2259,7 +2276,7 @@ woman-decode-region
=C2=A0
=C2=A0 =C2= =A0 =C2=A0(setq-local adaptive-fill-mode nil) ; No special "%" &q= uot;#" etc filling.
=C2=A0
- =C2=A0 =C2=A0 =C2=A0 = =C2=A0;; Set syntax and display tables:
+ =C2=A0 =C2=A0;; Set syn= tax and display tables:
=C2=A0 =C2=A0 =C2=A0(set-syntax-table wom= an-syntax-table)
=C2=A0 =C2=A0 =C2=A0(woman-set-buffer-display-ta= ble)
=C2=A0
@@ -2335,8 +2352,8 @@ woman-decode-region
=C2=A0 =C2=A0 =C2=A0(woman-strings)
=C2=A0 =C2=A0 =C2=A0= ;; Special chars moved after translation in
=C2=A0 =C2=A0 =C2=A0;= ; `woman2-process-escapes' (for pic.1):
-; =C2=A0 =C2=A0(goto= -char from)
-; =C2=A0 =C2=A0(woman-special-characters)
= + =C2=A0 =C2=A0;; =C2=A0 =C2=A0(goto-char from) ; ;
+ =C2=A0 =C2= =A0;; =C2=A0 =C2=A0(woman-special-characters) ; ;
=C2=A0
=C2=A0 =C2=A0 =C2=A0;; Process standard font-change requests and escapes:=
=C2=A0 =C2=A0 =C2=A0(goto-char from)
@@ -2875,7 +2892,= 7 @@ woman-strings
=C2=A0 =C2=A0 (let ((beg (match-beginning 0)))
=C2=A0 = =C2=A0 =C2=A0 (woman-match-name)
=C2=A0 =C2=A0 =C2=A0 (let* ((stringname (m= atch-string 0))
- =C2=A0 (string (assoc stringname woman-string-alist)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(string (assoc stringname woman-string-alist)))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 (cond (string
=C2=A0 =C2=A0 =C2=A0 =C2=A0(delete-region beg (poin= t))
=C2=A0 =C2=A0 =C2=A0 =C2=A0;; Temporary hack in case string starts wit= h a
@@ -2884,7 +2901,7 @@ woman-strings
=C2=A0 =C2=A0 =C2=A0 =C2= =A0(insert-before-markers (cdr string)))
=C2=A0 =C2=A0 =C2=A0 (t
=C2=A0 = =C2=A0 =C2=A0 =C2=A0(WoMan-warn "Undefined string %s not interpolated!= "
-= =C2=A0 =C2=A0 =C2=A0 stringname)
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0stringname)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(cond (w= oman-ignore
=C2=A0 =C2=A0 =C2=A0 ;; Output above message once only per ca= ll
=C2=A0 =C2=A0 =C2=A0 (delete-region beg (point))
@@ -3050,10= +3067,10 @@ woman1-roff-buffer
=C2=A0 =C2=A0;; (woman1-unquote is used by = called function):
=C2=A0 =C2=A0(setq woman1-unquote (not (eolp)))
=C2=A0 = =C2=A0(if (eolp) (delete-char 1))
-; =C2=A0 =C2=A0;; Hide leading control c= haracter in unquoted argument:
-; =C2=A0 =C2=A0(cond ((memq (following-char= ) '(?. ?'))
-; =C2=A0 (insert "\\&")
-; =C2=A0 (beg= inning-of-line)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0;; Hi= de leading control character in unquoted argument:
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0(cond ((memq (following-char) '(?. ?'= ))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 (insert "\\&&quo= t;)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 (beginning-of-line)))
=C2=A0 =C2=A0;; Call the appropriate function:
=C2=A0 =C2=A0(funcall fn)
=C2=A0 =C2=A0;; Hide leading control character in quoted argument (only):
=
@@ -3107,15 +3124,15 @@ woman1-IB
=C2=A0 =C2=A0(woman1-alt-f= onts (list "\\fI" "\\fB")))
=C2=A0
= =C2=A0(defun woman1-IR ()
- =C2=A0 ".IR -- Join words of cur= rent line alternating italic and Roman fonts."
- (woman1-alt= -fonts (list "\\fI" "\\fR")))
+ =C2=A0".= IR -- Join words of current line alternating italic and Roman fonts."<= /div>
+ =C2=A0(woman1-alt-fonts (list "\\fI" "\\fR"= )))
=C2=A0
=C2=A0(defun woman1-RB ()
- =C2=A0= ".RB -- Join words of current line alternating Roman and bold fonts.&= quot;
+ =C2=A0".RB -- Join words of current line alternating= Roman and bold fonts."
=C2=A0 =C2=A0(woman1-alt-fonts (list= "\\fR" "\\fB")))
=C2=A0
=C2=A0(def= un woman1-RI ()
- =C2=A0 ".RI -- Join words of current line = alternating Roman and italic fonts."
+ =C2=A0".RI -- Jo= in words of current line alternating Roman and italic fonts."
=C2=A0 =C2=A0(woman1-alt-fonts (list "\\fR" "\\fI")))=
=C2=A0
=C2=A0(defun woman1-alt-fonts (fonts)
@@ -3202,7 +3219,7 @@ woman1-hc
=C2=A0 =C2=A0".hc c -- Set = hyphenation character to c, i.e. delete it!"
=C2=A0 =C2=A0(l= et ((c (char-to-string (following-char))))
=C2=A0 =C2=A0 =C2=A0;;= (WoMan-log
- =C2=A0 =C2=A0 ;; "Hyphenation character %s del= eted -- hyphenation not supported!" c)
+ =C2=A0 =C2=A0;; &qu= ot;Hyphenation character %s deleted -- hyphenation not supported!" c)<= /div>
=C2=A0 =C2=A0 =C2=A0(woman-delete-whole-line)
=C2=A0 = =C2=A0 =C2=A0(setq c (concat "\\(" c "\\)\\|^[.'][ \t]*h= c"))
=C2=A0 =C2=A0 =C2=A0(save-excursion
@@ -3220,= 27 +3237,27 @@ woman1-hw
=C2=A0
=C2=A0(put 'woman1-= ps 'notfont t)
=C2=A0(defalias 'woman1-ps 'woman-dele= te-whole-line)
- =C2=A0;; .ps -- Point size -- IGNORE!
= +;; .ps -- Point size -- IGNORE!
=C2=A0
=C2=A0(put '= ;woman1-ss 'notfont t)
=C2=A0(defalias 'woman1-ss 'wo= man-delete-whole-line)
- =C2=A0;; .ss -- Space-character size -- = IGNORE!
+;; .ss -- Space-character size -- IGNORE!
=C2= =A0
=C2=A0(put 'woman1-cs 'notfont t)
=C2=A0(de= falias 'woman1-cs 'woman-delete-whole-line)
- =C2=A0;; .c= s -- Constant character space (width) mode -- IGNORE!
+;; .cs -- = Constant character space (width) mode -- IGNORE!
=C2=A0
=C2=A0(put 'woman1-ne 'notfont t)
=C2=A0(defalias 'w= oman1-ne 'woman-delete-whole-line)
- =C2=A0;; .ne -- Need ver= tical space -- IGNORE!
+;; .ne -- Need vertical space -- IGNORE!<= /div>
=C2=A0
=C2=A0(put 'woman1-vs 'notfont t)
<= div>=C2=A0(defalias 'woman1-vs 'woman-delete-whole-line)
= - =C2=A0;; .vs -- Vertical base line spacing -- IGNORE!
+;; .vs -= - Vertical base line spacing -- IGNORE!
=C2=A0
=C2=A0(p= ut 'woman1-bd 'notfont t)
=C2=A0(defalias 'woman1-bd = 'woman-delete-whole-line)
- =C2=A0;; .bd -- Embolden font -- = IGNORE!
+;; .bd -- Embolden font -- IGNORE!
=C2=A0
=C2=A0;;; Non-breaking SunOS-specific macros:
=C2=A0
<= div>@@ -3251,7 +3268,7 @@ woman1-TX
=C2=A0
=C2=A0(put &= #39;woman1-IX 'notfont t)
=C2=A0(defalias 'woman1-IX '= ;woman-delete-whole-line)
- =C2=A0;; .IX -- Index macro, for Sun = internal use -- IGNORE!
+;; .IX -- Index macro, for Sun internal = use -- IGNORE!
=C2=A0
=C2=A0=0C
=C2=A0;;; Dir= ect font selection:
@@ -3552,14 +3569,14 @@ woman-parse-numeric-a= rg
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (> (woman-parse-numeric-value) 0) 1 = 0))
=C2=A0 =C2=A0 =C2=A0 )))
=C2=A0 =C2=A0 =C2=A0))
-; =C2=A0 = =C2=A0(if (looking-at "[ \t\nRC)\"]") ; R, C are tab types
-;= ()
-; =C2=A0 =C2=A0 =C2=A0(WoMan-warn "Unimplemented numerical operato= r `%c' in %s"
-; =C2=A0(following-char)
-; =C2=A0(buffer-subst= ring
-; = =C2=A0 (line-beginning-position)
-; =C2=A0 (line-end-position)))<= /div>
-; =C2=A0 =C2=A0 =C2=A0(skip-syntax-forward "^ "))
+ =C2=A0 =C2=A0;; =C2=A0 =C2=A0(if (looking-at "[ \t\nRC)\"= ]") ; = R, C are tab types
+ =C2=A0 =C2=A0;; ()
+ =C2=A0 =C2=A0;; =C2=A0 = =C2=A0 =C2=A0(WoMan-warn "Unimplemented numerical operator `%c' in= %s"
+ =C2=A0 =C2=A0;; =C2=A0(following-char)
+ =C2=A0 = =C2=A0;; = =C2=A0(buffer-substring
+ =C2=A0 =C2=A0;; =C2=A0 (line-beginning-position)=
+ =C2=A0 =C2=A0;; =C2=A0 (line-end-position)))
+ =C2=A0 =C2=A0;= ; =C2=A0 =C2=A0 =C2=A0(skip-syntax-forward "^ "))
=C2= =A0 =C2=A0 =C2=A0value
=C2=A0 =C2=A0 =C2=A0))
=C2=A0
@@ -3700,16 +3717,16 @@ woman2-roff-buffer
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(beginning-of-line) (woman-delete-line 1)= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (t (end-of-line) (ins= ert ?\n))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
-= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (not (or fn
- =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(a= nd (not (memq (following-char) '(?. ?')))
- =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (setq fn 'woman2-format-paragraphs))))
- =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ()
- =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ;; Find next control line:
- =C2=A0 =C2=A0 (if (e= qual woman-request "TS")
- (set-marker to (woman-find-next-contr= ol-line "TE"))
- =C2=A0 =C2=A0 =C2=A0 (set-marker to (woman-find-= next-control-line)))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = ;; Call the appropriate function:
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (funcall fn to)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(if (not (or fn
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (not (memq (following-char) '(?= . ?')))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq fn 'woman2-format= -paragraphs))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0()
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Find next con= trol line:
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (equal = woman-request "TS")
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(set-marker to (woman-find-next-control-line "= TE"))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set= -marker to (woman-find-next-control-line)))
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0;; Call the appropriate function:
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(funcall fn to)))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0(if (not (eobp)) ; This should not happen, but ...
=C2= =A0 =C2=A0= (woman2-format-paragraphs (copy-marker (point-max) t)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0woman-left-margin))
@@ -4312,13 +4329,13 @@ woman-set-arg
=C2=A0 =C2=A0 =C2=A0(if = previous (set previous (eval arg)))
=C2=A0 =C2=A0 =C2=A0(woman2-p= rocess-escapes-to-eol 'numeric)
=C2=A0 =C2=A0 =C2=A0(let ((pm= (if (looking-at "[+-]")
- (prog1 (following-char)
- =C2=A0(forw= ard-char 1))))
- (i (woman-parse-numeric-arg)))
- =C2=A0 =C2=A0(co= nd ((null pm) (set arg i))
- =C2=A0((=3D pm ?+) (set arg (+ (eval arg) i))= )
- =C2=A0((=3D pm ?-) (set arg (- (eval arg) i)))
- =C2=A0))
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(prog1 (foll= owing-char)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(forward-char 1))))
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(i (woman-parse-numeric-arg)))
+ =C2=A0 =C2=A0 =C2= =A0(cond ((null pm) (set arg i))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0((=3D pm ?+) (set arg (+ (eval arg) i)))
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((=3D pm ?-) (set arg (- (eval arg) i)))<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0))
=C2=A0 = =C2=A0 =C2=A0(beginning-of-line))
=C2=A0 =C2=A0(woman-delete-line= 1)) ; ign= ore any remaining arguments
=C2=A0
@@ -4515,8 +4532,8 @= @ woman2-TS
=C2=A0 =C2=A0(woman2-format-paragraphs to))
=C2=A0
=C2=A0(defalias 'woman2-TE 'woman2-fi)
= - =C2=A0;; ".TE -- End of table code for the tbl processor."
- =C2=A0;; Turn filling and adjusting back on.
+;; ".T= E -- End of table code for the tbl processor."
+;; Turn fill= ing and adjusting back on.
=C2=A0
=C2=A0(defun woman-br= eak-table (start-column to start)
=C2=A0 =C2=A0(while (< (poin= t) to)
--=C2=A0
2.6.0.rc0.24.gec371ff


I used this little snippet (saved to test.el) = and then running "emacs -Q --load=3Dtest.el" to test the above. &= quot;C-c 0" would load the patched woman.el and then it is self explan= atory how I would have used the test.el.

=3D=3D=3D= =3D=3D

(global-set-key (kbd "C-c 0"= ) (lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (interactive)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (load-file "/path/to/the= /patched/woman.el")))
(global-set-key (kbd "C-c 1"= ) (lambda () (interactive) (woman "timelocal")))
(globa= l-set-key (kbd "C-c 2") (lambda () (interactive) (woman "tim= ezone")))
(global-set-key (kbd "C-c 3") (lambda ()= (interactive) (woman "acos")))
(global-set-key (kbd &q= uot;C-c p") #'WoMan-previous-manpage)
(global-set-key (k= bd "C-c n") #'WoMan-next-manpage)

<= div>=3D=3D=3D=3D=3D
=C2=A0
--089e013a04a83058a4052aeb30ad--