From unknown Sat Sep 20 10:51:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28998: 27.0.50; Man--sections is in reverse order Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Oct 2017 16:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28998@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150895042220694 (code B ref -1); Wed, 25 Oct 2017 16:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Oct 2017 16:53:42 +0000 Received: from localhost ([127.0.0.1]:33598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Ow2-0005Nh-70 for submit@debbugs.gnu.org; Wed, 25 Oct 2017 12:53:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Oes-0004uJ-TC for submit@debbugs.gnu.org; Wed, 25 Oct 2017 12:35:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Oel-0007gq-LS for submit@debbugs.gnu.org; Wed, 25 Oct 2017 12:35:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e7Oel-0007gK-HR for submit@debbugs.gnu.org; Wed, 25 Oct 2017 12:35:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Oej-0001h4-5J for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 12:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Oed-0007Zr-V8 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 12:35:49 -0400 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:55079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7Oed-0007Yn-G8 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 12:35:43 -0400 Received: by mail-wr0-x236.google.com with SMTP id o44so584687wrf.11 for ; Wed, 25 Oct 2017 09:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=onwpNDS1boQ3OFyv02uTxyWIqvxJilgX6YWC8d5sOzM=; b=lXhogiDempAoFEtchfHK2f3d2aTa2CCWdblJ7o0o5wPEx0/35PHzoiu4JpQz1NbcBf 3v+8++lkwqq0oegyhwlhAcuEjrae1YjCYE2u9hqdBogt22aw1Rtx4nsuxTgl+CIiHA1l +wQULUxi+DcGUdvzxDCkDw010r1zhpaBzZMdcGEbLQIa67KTIWIHgTFwqMvz7Ev4T7te ihdvagdN4iHgvxZ+yooTe2jokRDs9KK86PX+IpL2YsQQo+CxIejN+lP+A+wghog0VE0p ZS/Wy9iIh4GjmXpIZJ4F+fodzOmJn3WnsT0KeefINa2NyUCU9MRbfazFBpp9So+XopiV Ahqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=onwpNDS1boQ3OFyv02uTxyWIqvxJilgX6YWC8d5sOzM=; b=K9oHmOWUhTYISOKF1q4glDzKSnfO/ocyrl1szNdqlfiMzlgBXG3oqXeEZvkD474mHZ cgnjbrt9kpvYMFKfOvihd/JltaCTU7hpBGsffym4x5EnJsA6weY+iZ7RbjPprpMpud9X fDFT0gHRuJE1XwWWMryZcvQ88jeJnuMKCt73Kds2+C6bV7eozT7KqdtfWnUElFMfVcaZ wqRrRtsvoD6UO0t1UD5K+/3QRW7z6A6/GulMsggxrRW95OAPEUvUk7m1D1iVR86mUDGa fFeJqENwo5C0+DEtNcfYl9cikN1rWGPZMCH/8sIjJsRoZLeJMG6LRO1p/zfYXsoy3Ypd Kj1Q== X-Gm-Message-State: AMCzsaXi+Sm35qVwdEk/pYWyBKPwrOBejW/y4Hmt0q6ZWwf5ASVagAJ0 ccnjy1I/H7Xani/JwJJFCWFfXPwu X-Google-Smtp-Source: ABhQp+QZ38G8qNLUkxek+zK1AjneD2tCegHOLXuhC3QNfCv5tUp+CYHmfCYkaa97XjH4vjpPtd3R6w== X-Received: by 10.223.191.8 with SMTP id p8mr3019179wrh.69.1508949341581; Wed, 25 Oct 2017 09:35:41 -0700 (PDT) Received: from localhost ([134.226.214.245]) by smtp.gmail.com with ESMTPSA id v8sm3128243wrg.80.2017.10.25.09.35.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 09:35:40 -0700 (PDT) From: "Basil L. Contovounesios" Date: Wed, 25 Oct 2017 17:35:35 +0100 Message-ID: <87zi8f18yw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Wed, 25 Oct 2017 12:53:40 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-man.el-Man-build-section-alist-Reverse-sections.patch >From 824ff332efebc69b436e4893626a68125af20cd5 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 25 Oct 2017 16:57:43 +0100 Subject: [PATCH 1/2] * lisp/man.el (Man-build-section-alist): Reverse sections --- lisp/man.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/man.el b/lisp/man.el index 7a892c6e88..f7b1609c92 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1522,7 +1522,8 @@ Man-build-section-alist (let ((section (match-string 1))) (unless (member section Man--sections) (push section Man--sections))) - (forward-line 1)))) + (forward-line 1))) + (setq Man--sections (nreverse Man--sections))) (defsubst Man-build-references-alist () "Build the list of references (in the SEE ALSO section)." -- 2.14.2 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Rename-Man-build-section-alist.patch >From ecbe8f2d076cbfb61d447ab0faca8e581864d459 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 25 Oct 2017 17:03:12 +0100 Subject: [PATCH 2/2] Rename Man-build-section-alist Man--sections is a list of strings, so rename inline function to Man-build-section-list. * lisp/man.el (Man-build-section-alist): Do it and reduce syntax. (Man-goto-page): * lisp/woman.el (woman-find-file): Use it. --- lisp/man.el | 12 ++++++------ lisp/woman.el | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/man.el b/lisp/man.el index f7b1609c92..2ff25344fe 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1513,16 +1513,16 @@ Man-mode (set (make-local-variable 'bookmark-make-record-function) 'Man-bookmark-make-record)) -(defsubst Man-build-section-alist () +(defsubst Man-build-section-list () "Build the list of manpage sections." - (setq Man--sections nil) + (setq Man--sections ()) (goto-char (point-min)) - (let ((case-fold-search nil)) - (while (re-search-forward Man-heading-regexp (point-max) t) + (let (case-fold-search) + (while (re-search-forward Man-heading-regexp nil t) (let ((section (match-string 1))) (unless (member section Man--sections) (push section Man--sections))) - (forward-line 1))) + (forward-line))) (setq Man--sections (nreverse Man--sections))) (defsubst Man-build-references-alist () @@ -1803,7 +1803,7 @@ Man-goto-page (widen) (goto-char page-start) (narrow-to-region page-start page-end) - (Man-build-section-alist) + (Man-build-section-list) (Man-build-references-alist) (goto-char (point-min))))) diff --git a/lisp/woman.el b/lisp/woman.el index 111086e362..1edf6e34c3 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1619,7 +1619,7 @@ woman-find-file (setq woman-buffer-alist (cons (cons file-name bufname) woman-buffer-alist) woman-buffer-number 0))))) - (Man-build-section-alist) + (Man-build-section-list) (Man-build-references-alist) (goto-char (point-min))) -- 2.14.2 --=-=-= Content-Type: text/plain # Current behaviour The inline function Man-build-section-alist in lisp/man.el populates the buffer-local list Man--sections with the section names of the current manpage in reverse natural order (i.e. the common section headers NAME and SEE ALSO end up somewhere near the end and beginning of Man--sections, respectively). # Discussion In the function Man-goto-section, Man--sections is passed as a collection to completing-read. The order of candidates is irrelevant in a default Emacs configuration, as the minibuffer help buffer sorts candidates lexicographically by default. There is, however, at least one completion frontend (in my case, ivy.el[1] from ELPA) which displays candidates in the received order. AFAICT there is no purpose or benefit to keeping Man--sections reversed, other than avoiding a call to nreverse, which AFAIK is quite an efficient operation. Conversely, keeping the sections in their natural order (i.e. from (point-min) to (point-max)) both seems more natural and is more convenient for users of completion frontends like ivy.el. Footnotes: [1] https://github.com/abo-abo/swiper # Patch I attach two patches. The first patch implements my suggested reversing of the reversed Man--sections at the end of Man-build-section-alist. The second patch is purely aesthetic in removing some redundant syntax from Man-build-section-alist and renaming it to the more apt Man-build-section-list, seeing as Man--sections is never a list of cons cells. # Environment In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2017-10-25 built on thunk Repository revision: 090f4f157eea6f0d0d13963520f5e05706de142f Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 System Description: Debian GNU/Linux testing (buster) Configured using: 'configure --prefix=/home/blc/.local --enable-locallisppath= --with-mailutils --with-sound=yes --with-x-toolkit=lucid --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-libsystemd --with-xml2 --with-imagemagick --with-xft --with-libotf --with-m17n-flt --with-toolkit-scroll-bars --with-xaw3d --with-xim --with-gpm --with-dbus --with-gsettings --with-selinux --with-gnutls --with-zlib --with-modules --with-threads --with-file-notification=yes --with-x --without-gconf --with-lcms2 'CFLAGS=-flto -fomit-frame-pointer -march=native -maes -mavx -mcrc32 -mf16c -mfpmath=sse -mfsgsbase -mfxsr -minline-all-stringops -mmmx -mpclmul -mpopcnt -msahf -msse4.2 -mxsave -mxsaveopt -mvzeroupper -O3 -pipe' LDFLAGS=-flto' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 MODULES LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_IE.UTF-8 locale-coding-system: utf-8-unix Major mode: IBuffer Minor modes in effect: projectile-mode: t ibuffer-auto-mode: t hl-line-mode: t magit-wip-before-change-mode: t magit-wip-after-apply-mode: t magit-wip-after-save-mode: t magit-auto-revert-mode: t async-bytecomp-package-mode: t diff-auto-refine-mode: t recentf-mode: t ace-window-display-mode: t shell-dirtrack-mode: t counsel-mode: t global-paren-face-mode: t xterm-mouse-mode: t winner-mode: t global-whitespace-mode: t display-time-mode: t global-subword-mode: t subword-mode: t save-place-mode: t global-hi-lock-mode: t hi-lock-mode: t engine-mode: t delete-selection-mode: t display-battery-mode: t override-global-mode: t blc-dropbox-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t window-divider-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-save-visited-mode: t Features: (dabbrev counsel-projectile projectile grep compile ibuf-ext ibuffer ibuffer-loaddefs view hl-line git-rebase magit-bookmark magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-branch magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode magit-git magit-section magit-popup git-commit magit-utils log-edit pcvs-util add-log with-editor async-bytecomp async dash unfill executable tramp tramp-compat tramp-loaddefs trampver ucs-normalize vc-git diff-mode recentf tree-widget bookmark pp shadow sort footnote face-remap mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus nnheader emacsbug eudcb-bbdb bbdb-com crm bbdb bbdb-site timezone eudc eudc-options-file cus-edit eudc-vars wid-edit message rmc puny git-annex dired-x dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs xdg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils ace-window avy cl-print debug shell pcomplete comint ansi-color cus-start cus-load colir color counsel jka-compr esh-util etags xref project swiper ivy flx ivy-overlay ffap thingatpt server bug-reference fic-mode fill-column-indicator paren-face elec-pair xt-mouse winner ring disp-table whitespace time cap-words superword subword saveplace paren ibuf-macs highlight-escape-sequences hi-lock time-date engine-mode delsel battery edmacro kmacro cl-extra help-mode delight advice zenburn-theme browse-url use-package diminish bind-key finder-inf tex-site info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars blc-macs blc-lib easy-mmode rx pcase thunk subr-x map seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib realpath mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 545111 235884) (symbols 48 46611 7) (miscs 40 3990 14356) (strings 32 124523 28431) (string-bytes 1 3875163) (vectors 16 75843) (vector-slots 8 2064942 434084) (floats 8 566 2272) (intervals 56 2459 2469) (buffers 992 55)) Thanks, -- Basil --=-=-=-- From unknown Sat Sep 20 10:51:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28998: 27.0.50; Man--sections is in reverse order Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Nov 2017 00:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 28998@debbugs.gnu.org Received: via spool by 28998-submit@debbugs.gnu.org id=B28998.151001583214658 (code B ref 28998); Tue, 07 Nov 2017 00:51:02 +0000 Received: (at 28998) by debbugs.gnu.org; 7 Nov 2017 00:50:32 +0000 Received: from localhost ([127.0.0.1]:54930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBs63-0003oL-Mr for submit@debbugs.gnu.org; Mon, 06 Nov 2017 19:50:31 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:56586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBs62-0003o4-Av for 28998@debbugs.gnu.org; Mon, 06 Nov 2017 19:50:30 -0500 Received: by mail-it0-f41.google.com with SMTP id r127so376128itb.5 for <28998@debbugs.gnu.org>; Mon, 06 Nov 2017 16:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=JjmTtjmK8ShWHy5ITMZp2k3MlP8BxDcCS4xzKnqxRNo=; b=JVbwajGcU7Bb1V2hwERPRYn0z2utzx2xz2Nhod5na798QPL0RyvgMgca/F7dw9/2OA wcmLVt27WavQklOVXg6hbD4IkQeF1kFutHyZQOmVlnPK/+hbxZqDZSs2929AdQXp1JzA 1hwyjFKbSaKD53wYNiEw7LffKtO3WfT1quhhsof6PwoCibRjGrEMi1gc5NFZuYYHJcVg +P7qw+U/ND+XTrY1i5n31+ztkCSG2hwZXk+dGzAgoZvVsBpTEx6wJ+nVGZXHl1TC1i5A 6hA6uCdqYZJzz3IakWE8hHNdQXcffEkJNKgXireRhW2u3nMKzqLeCmE3po4OXRsUjGEf lQTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=JjmTtjmK8ShWHy5ITMZp2k3MlP8BxDcCS4xzKnqxRNo=; b=YB+2CCyYvPUKIAFytooWtT+T4yhehrSeh0vGt61E3pqVlhbeoSFprwGQVVpDyT3FIs GRjfK6O2ExjEisvhZTSV2o+Dzcz1ioy0g8DTisQ7rcxWiwvKvWMQnP/O/jmoQTsTCI6O Ms0LIgIgc9rHpAygQRipQ4hZqVgDQoomGOGnuFdo0q27mEKvN2TggE9yDQSWY/1NZ6yc O4LgDyCbqzDRX3GPEgw7A5Yrg/dt2XzTlXgL7LXHSs+6r4tRwtkw/b2ngyz24Ev1Qp0J 81WkdRDp4Or8f5TDsLajONjtMQiHVrT5jVTeJil9p1xlNBHWeUWbCh95y+SQAHPqefeW hgww== X-Gm-Message-State: AJaThX7WwSOFqc0uNLgSsuII2LpQeDzagwhksKnRR1nB4K7K3g2UXdII 0oFK2YALZDV1V3SpRYvg5JVVLA== X-Google-Smtp-Source: ABhQp+QDR97N3SjsjCvF9xqAd1/P4Xfq5fSZ43VkMDL26QRJqFh0gdqZ2d1GXP4nHjq8DVIhjBRUIQ== X-Received: by 10.36.79.22 with SMTP id c22mr67731itb.102.1510015824498; Mon, 06 Nov 2017 16:50:24 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o207sm140702itc.27.2017.11.06.16.50.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 16:50:23 -0800 (PST) From: Noam Postavsky References: <87zi8f18yw.fsf@gmail.com> Date: Mon, 06 Nov 2017 19:50:22 -0500 In-Reply-To: <87zi8f18yw.fsf@gmail.com> (Basil L. Contovounesios's message of "Wed, 25 Oct 2017 17:35:35 +0100") Message-ID: <87tvy66hf5.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) "Basil L. Contovounesios" writes: > -(defsubst Man-build-section-alist () > +(defsubst Man-build-section-list () Perhaps we should switch to defun while we're at it? > - (let ((case-fold-search nil)) > + (let (case-fold-search) Personally, I like the more explicit version here. > AFAICT there is no purpose or benefit to keeping > Man--sections reversed, other than avoiding a call to > nreverse, which AFAIK is quite an efficient operation. > > Conversely, keeping the sections in their natural order > (i.e. from (point-min) to (point-max)) both seems more > natural and is more convenient for users of completion > frontends like ivy.el. Makes sense to me. From unknown Sat Sep 20 10:51:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28998: 27.0.50; Man--sections is in reverse order Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Nov 2017 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 28998@debbugs.gnu.org Received: via spool by 28998-submit@debbugs.gnu.org id=B28998.151006724015049 (code B ref 28998); Tue, 07 Nov 2017 15:08:02 +0000 Received: (at 28998) by debbugs.gnu.org; 7 Nov 2017 15:07:20 +0000 Received: from localhost ([127.0.0.1]:56715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC5TD-0003uf-PV for submit@debbugs.gnu.org; Tue, 07 Nov 2017 10:07:20 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:48510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC5TB-0003uS-QM for 28998@debbugs.gnu.org; Tue, 07 Nov 2017 10:07:18 -0500 Received: by mail-wm0-f44.google.com with SMTP id p75so4409604wmg.3 for <28998@debbugs.gnu.org>; Tue, 07 Nov 2017 07:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=x5QjyfYpkEOCWxLDZai3AZG3ZdHDRaCHptRkUaI/uX0=; b=ZIx+bh65NiZ9Plfjjntm/UHSPgwfnwVGF3H2feJfC+douiF0/sRAarhkbqSlXRH1XR NkZdOOuFNEAI7SHI61MWPPhYXbKmIqnuhNpcJouO4pxuB0/WShOuUiz0pqNXbYJrmNhd 0yKKxc+o1i1bVIADhEDCQ0HwIDHnjt8HXw/Ws2wlt1P+FWE6/3q4hn6y3dRajDiti6PC nrXi49lepBsyp1IhAx+DjY+9NWd9zm1ExBJKhaV/XxwyJwEWi3HkV+Uvc6B9q7KoIq+j nO26QPRFHmaNzVxpfwwd/O72t2lV3BCqr6cE0CeorF9GXn7uMSdSwlAIQceVRbTkrq3E VBTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=x5QjyfYpkEOCWxLDZai3AZG3ZdHDRaCHptRkUaI/uX0=; b=fEGuNOIZOMdOvYdvJTkZ+8b96BmqQVxvB7MUfEQghJaCFJ+oDum69aKtqjvpasyHUd UN62qx73uC4JQC7/0/Gm6sIYEfgfE3TG5QoWnH0AtuZi27z6rSwL0cElQUy+P4KVQ15N 8QIdo4uwk3H18JU4yONxfJHEo9ISqbc+1hPWDO7fgqtKINMekVquH+RflgLj+/6pIJ79 xrFshyPbYc9LwRPNfWl4lsJ8tOlP1yaGrnR7OuckXGqw3eIg560EdGGyKQ3W/0YK7CfM fYCQ+noDHB1hJ3XqN7Iih2TTTypWzjpqSVD03FUGspmnpdUFJUf87tAW46IJFd3IFeiC l7lw== X-Gm-Message-State: AMCzsaXJrpfTD8Pz+nEolOzWcGuoR/RKsdKj3UGivmXF99K7G3xwgEwT OUWgQNwKL8O+fcpnr/FTWFvaDA== X-Google-Smtp-Source: ABhQp+TltdePbccnWZWrjallhV+Ko8whQrRRWQ4SR1oMvLazIuzN0ZHmzjxJlEPqqLBIBV3C+8yRbQ== X-Received: by 10.80.151.21 with SMTP id c21mr24369474edb.47.1510067232211; Tue, 07 Nov 2017 07:07:12 -0800 (PST) Received: from localhost ([89.101.18.86]) by smtp.gmail.com with ESMTPSA id 34sm1690550eds.17.2017.11.07.07.07.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 07:07:11 -0800 (PST) From: "Basil L. Contovounesios" References: <87zi8f18yw.fsf@gmail.com> <87tvy66hf5.fsf@users.sourceforge.net> Date: Tue, 07 Nov 2017 15:07:09 +0000 In-Reply-To: <87tvy66hf5.fsf@users.sourceforge.net> (Noam Postavsky's message of "Mon, 06 Nov 2017 19:50:22 -0500") Message-ID: <87inemm8ki.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Keep-Man-sections-in-natural-order-bug-28998.patch >From 6bc6f316f4bd3dc80b96d2d894bce66487cb9127 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 25 Oct 2017 16:57:43 +0100 Subject: [PATCH 1/2] Keep Man sections in natural order (bug#28998) * lisp/man.el (Man-build-section-alist): Reverse sections. --- lisp/man.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/man.el b/lisp/man.el index 7a892c6e88..f7b1609c92 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1522,7 +1522,8 @@ Man-build-section-alist (let ((section (match-string 1))) (unless (member section Man--sections) (push section Man--sections))) - (forward-line 1)))) + (forward-line 1))) + (setq Man--sections (nreverse Man--sections))) (defsubst Man-build-references-alist () "Build the list of references (in the SEE ALSO section)." -- 2.14.2 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Rename-Man-build-section-alist-bug-28998.patch >From f96f95b830825681fb618f1727fcc3e0f488102f Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 7 Nov 2017 14:51:37 +0000 Subject: [PATCH 2/2] Rename Man-build-section-alist (bug#28998) The defsubst Man-build-section-alist builds and returns a list of strings, so rename it to Man-build-section-list and make it a defun. * lisp/man.el (Man-build-section-alist): Do it and reduce syntax. (Man-goto-page): * lisp/woman.el (woman-find-file): Use it. --- lisp/man.el | 10 +++++----- lisp/woman.el | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/man.el b/lisp/man.el index f7b1609c92..798e78bbe7 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1513,16 +1513,16 @@ Man-mode (set (make-local-variable 'bookmark-make-record-function) 'Man-bookmark-make-record)) -(defsubst Man-build-section-alist () +(defun Man-build-section-list () "Build the list of manpage sections." - (setq Man--sections nil) + (setq Man--sections ()) (goto-char (point-min)) (let ((case-fold-search nil)) - (while (re-search-forward Man-heading-regexp (point-max) t) + (while (re-search-forward Man-heading-regexp nil t) (let ((section (match-string 1))) (unless (member section Man--sections) (push section Man--sections))) - (forward-line 1))) + (forward-line))) (setq Man--sections (nreverse Man--sections))) (defsubst Man-build-references-alist () @@ -1803,7 +1803,7 @@ Man-goto-page (widen) (goto-char page-start) (narrow-to-region page-start page-end) - (Man-build-section-alist) + (Man-build-section-list) (Man-build-references-alist) (goto-char (point-min))))) diff --git a/lisp/woman.el b/lisp/woman.el index 111086e362..1edf6e34c3 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1619,7 +1619,7 @@ woman-find-file (setq woman-buffer-alist (cons (cons file-name bufname) woman-buffer-alist) woman-buffer-number 0))))) - (Man-build-section-alist) + (Man-build-section-list) (Man-build-references-alist) (goto-char (point-min))) -- 2.14.2 --=-=-= Content-Type: text/plain Noam Postavsky writes: >> -(defsubst Man-build-section-alist () >> +(defsubst Man-build-section-list () > > Perhaps we should switch to defun while we're at it? > >> - (let ((case-fold-search nil)) >> + (let (case-fold-search) > > Personally, I like the more explicit version here. I attach slightly reworded patches updated with your two suggestions. Thanks, -- Basil --=-=-=-- From unknown Sat Sep 20 10:51:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28998: 27.0.50; Man--sections is in reverse order Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Nov 2017 17:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 28998@debbugs.gnu.org Received: via spool by 28998-submit@debbugs.gnu.org id=B28998.151007661930548 (code B ref 28998); Tue, 07 Nov 2017 17:44:01 +0000 Received: (at 28998) by debbugs.gnu.org; 7 Nov 2017 17:43:39 +0000 Received: from localhost ([127.0.0.1]:56943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC7uV-0007wc-8w for submit@debbugs.gnu.org; Tue, 07 Nov 2017 12:43:39 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:50838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC7uS-0007wL-Lt for 28998@debbugs.gnu.org; Tue, 07 Nov 2017 12:43:37 -0500 Received: by mail-wm0-f44.google.com with SMTP id s66so5386578wmf.5 for <28998@debbugs.gnu.org>; Tue, 07 Nov 2017 09:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Kz82vg1hYgXpSOVjOgqhhgwFUps7GJDTnmi+jWtwlhI=; b=Sz2t4ufaYHRmrhgG7o4C9GAcR7M1FQ4wvIUx0EMtvU7nfIeiwgr+KMY/fiv9gdrMDW buSeSQc30/S0dYVn2o3/zzRh1g80VQtKWhpRmPiHBTKUa/OQoOItpcl1vr94fIhIsM2E oxOsKGW+dlxf2V2eiEVTGSjr68CGz7PVLmKEwPlO9KCqDCQf885Qys653gW0WsJ2ux6b fCX6P9L9ldfganbATqMYrv/U6gfpY3+8ZgRXcYsDxOckTssUK1wpe4nPQvbmAYRmNVPH x9lfvigXM9j35GW1qpiQjxzfRfkAuNGDOdOK0I290xaomIN5kGIbL4MM0g6vstrlTSmI TQFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Kz82vg1hYgXpSOVjOgqhhgwFUps7GJDTnmi+jWtwlhI=; b=gAAVN9x9Z7iQdjh1w4EKO27/EPYOSrfrKOPyFR7yZFuTOv1mJ4EOFys5P7xufSXIqm bnG0jMBxtMukqSYFzN66GTbL63LVPGrg/kx4XUXE6dkvo6ONKjlZYuVCI9iwVMT3v+n1 bVEEAod/cDvaNmfGK/spooVv8BxMdjCmZzq1+Mb79f1uxFccuR+0DhofW1WVN2BPApQi m0Aszv5zy5XdQ+5lVOgFctVP9s/iDyRvSG8J/f15fBsJyFNUEneFkC5DG0TUa0Ejzg4D NjkgMorhhWWh/1dN4/1Ra0f7z2/4a+dtXwCYB1SN9x5YyOEQDA/lhgxDHZ/L9EIeuNf7 IlKg== X-Gm-Message-State: AJaThX6aj/yuvdVrfdgnvdBzqaW0kRpdNRazENSr8ntxa0w+SMQ2PqBZ 2vL2aZ3hjhtJrpAcPx3nBK780kiL2KSIMd37A40= X-Google-Smtp-Source: ABhQp+SQzQY/so4Pr6luHh9dgx4YndUhidjy0fyVFSYDTX10V3kAeU8BgwIxQFMp/AOD/Ufpus6ITK96U+s7bB4TI2g= X-Received: by 10.28.131.200 with SMTP id f191mr2192060wmd.39.1510076611004; Tue, 07 Nov 2017 09:43:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.146.227 with HTTP; Tue, 7 Nov 2017 09:43:30 -0800 (PST) In-Reply-To: <87inemm8ki.fsf@gmail.com> References: <87zi8f18yw.fsf@gmail.com> <87tvy66hf5.fsf@users.sourceforge.net> <87inemm8ki.fsf@gmail.com> From: Noam Postavsky Date: Tue, 7 Nov 2017 12:43:30 -0500 X-Google-Sender-Auth: A1j47aWevJJRL0ezmqjcDCo4uGk Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) 2017-11-07 10:07 GMT-05:00 Basil L. Contovounesios : > I attach slightly reworded patches updated with your two > suggestions. Thanks, I plan to push patch#1 to emacs-26 and patch#2 to master in a few days if there are no objections. From unknown Sat Sep 20 10:51:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28998: 27.0.50; Man--sections is in reverse order Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Nov 2017 16:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 28998@debbugs.gnu.org Received: via spool by 28998-submit@debbugs.gnu.org id=B28998.15104171459396 (code B ref 28998); Sat, 11 Nov 2017 16:20:01 +0000 Received: (at 28998) by debbugs.gnu.org; 11 Nov 2017 16:19:05 +0000 Received: from localhost ([127.0.0.1]:35521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDYUq-0002RQ-Ng for submit@debbugs.gnu.org; Sat, 11 Nov 2017 11:19:04 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:46951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDYUo-0002Qp-KQ; Sat, 11 Nov 2017 11:19:03 -0500 Received: by mail-io0-f182.google.com with SMTP id n79so5658038ion.3; Sat, 11 Nov 2017 08:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=oSS+YfGxKEWd2nnuIMKw7cuy0yH5se8qqv7FrpvSLbs=; b=Pu1zFcWKOvCBNGAUKvX2REXKaEN/5M9FVkSCemqAPZh+MCw3FlZC8V3t3lT7R3WWMq 0wBPhs5gZ4b9Rgu20jInAX5j47vT4yTkVTbWh6pN1HO1bJuFRSdJiVaLiVOncAvZtqFP 77XYQ729FV8hCBJqJYBm5amZyqh62f5Py1/TCcTRNC42mXf7zSJJqQUbiXL/9Pj0B0sC TsW0smpPDPDkqXwAc9L2uhZrhIJF0FK9PX22Ds41aRvTya2k34S+tY9nw0/SSgN2Aj0p a1dyWOKtb44irvGeIKZUZCBw3Rx9uODo4jipHT7FttjTY66rYfU8qK+oemZXA7RFfIXY KO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=oSS+YfGxKEWd2nnuIMKw7cuy0yH5se8qqv7FrpvSLbs=; b=FZj+hOHD8643NUtPaEWcxpv0xs4916CQD5NkzqgN+ZKARqvzrIZ50mv7FfhRn8FZ7r NWRBAeN/Ly1ebGHDA4ImrUbuBUNXktD4P6LfyeEwarKFIxVqFZQizAwlTmTTUL5cH8gg WLt/ngpKCul24KncNgvGXb+BV2xVn8AvD0fYXNsaz0bwbgsZbWocX+4o4OzylPIGF1S9 FVZ6OdA4YkkR1W3so/n+CRnwak7usdd3LMZic1fHL58NiYF1TeiAgPk7sbNk8tpoS7k9 jRcNj5lGqanR8TybTgJZ6cqe7ax8pTPHv60Yw4pY2VLS15NuscCF9jxvSwuaGhMpItM/ Wj/Q== X-Gm-Message-State: AJaThX7YmTMZebhvvv5y4Ef2MZPMSMVFfTN/qhaPsxznNfsoe8lsV+JE GsCM4+0qESBW7RXGol0MdW0jvw== X-Google-Smtp-Source: AGs4zMbq4hiSkuaQeL/x3oV73vztZ/ci1o3htTe+86Ea7NJ8WgHrMvjX+JfTo5PppBkOPcSBdRrESA== X-Received: by 10.107.150.67 with SMTP id y64mr4595600iod.74.1510417136725; Sat, 11 Nov 2017 08:18:56 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id b66sm2196040itb.28.2017.11.11.08.18.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Nov 2017 08:18:55 -0800 (PST) From: Noam Postavsky References: <87zi8f18yw.fsf@gmail.com> <87tvy66hf5.fsf@users.sourceforge.net> <87inemm8ki.fsf@gmail.com> Date: Sat, 11 Nov 2017 11:18:53 -0500 In-Reply-To: (Noam Postavsky's message of "Tue, 7 Nov 2017 12:43:30 -0500") Message-ID: <87fu9k3i1e.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) tags 28998 fixed close 28998 26.1 quit Noam Postavsky writes: > Thanks, I plan to push patch#1 to emacs-26 and patch#2 to master in a > few days if there are no objections. Done. [1: 9533d76b0b]: 2017-11-11 10:46:43 -0500 Keep Man sections in natural order (bug#28998) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9533d76b0b5bfe2df1cccc55a92c2545b1de4e2b [2: 000e729071]: 2017-11-11 11:12:28 -0500 Rename Man-build-section-alist (bug#28998) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=000e729071d6fb75eabe2bde8a5912440f1f3c44