From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Newsgroups: gmane.emacs.bugs Subject: bug#28390: 26.0.50; overlays-at actually sorts by increating priority Date: Thu, 07 Sep 2017 23:21:15 +0100 Message-ID: <871snijgkk.fsf@lolita> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1504822967 17713 195.159.176.226 (7 Sep 2017 22:22:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2017 22:22:47 +0000 (UTC) To: 28390@debbugs.gnu.org, monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 00:22:32 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq5Bf-0003H4-HW for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 00:22:15 +0200 Original-Received: from localhost ([::1]:42468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5Bm-0007j2-Jx for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Sep 2017 18:22:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5BY-0007Zs-2b for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:22:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5BS-0001pH-N1 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:22:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq5BS-0001ot-It for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dq5BS-0000hi-Bc for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Sep 2017 22:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28390 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.15048229052680 (code B ref -1); Thu, 07 Sep 2017 22:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2017 22:21:45 +0000 Original-Received: from localhost ([127.0.0.1]:54837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq5BA-0000hA-CS for submit@debbugs.gnu.org; Thu, 07 Sep 2017 18:21:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq5B8-0000gu-7N for submit@debbugs.gnu.org; Thu, 07 Sep 2017 18:21:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5Ax-0001QO-B6 for submit@debbugs.gnu.org; Thu, 07 Sep 2017 18:21:36 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dq5Ax-0001QH-6T for submit@debbugs.gnu.org; Thu, 07 Sep 2017 18:21:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5Ar-0007OS-Ha for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:21:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5Am-0001GX-7X for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:21:25 -0400 Original-Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:36378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq5Al-0001F3-Tb for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 18:21:20 -0400 Original-Received: by mail-wm0-x235.google.com with SMTP id i189so4121562wmf.1 for ; Thu, 07 Sep 2017 15:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=9uM/qBDbmiXFGUzHkUVu3OCJxaPlY11LcmZYolNFXT8=; b=dR3wR+/ukjRhLV5XNxXr+m+jGxtSRUOUIKNDc66Sp+bJghizYL5cE7CDxsr+MXqaO+ FozVk+KHBx8PWxf9LCPT6R65dJzZF6N12TYKj8lOsx0I5eqtl9MdSToiebRRLfsHqu6C Ht5mlikZl/5KOf3P+p9R2cQvYyu3SUFpUaXrQ6QoyYPljx8APxdsJZs4dC0+ZpmljMMf Fd5jgAWpmB2r5asuM+gJ6l2xGaSPVL9/BONA6vOFciRk0QugfXZiGYKvhMuTMLewcZKx qHHCUKCinOgKsjJHGR23RwqtlCWwWXK+ocwxhu81EZ/wDSJVmSvIKne1ph7fY6zeyPEq FPMA== 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 :content-transfer-encoding; bh=9uM/qBDbmiXFGUzHkUVu3OCJxaPlY11LcmZYolNFXT8=; b=BSiugFKkD66pvTfsiTzR9h0d/fr5Ivc7pXzbUHJpQflpNiRmTjsPNctrvBCVK/2NUW 083QoGtxtDTvZQwXY2bDRa8O3Gic8hD6e66fMqSlaIAt4MqKK/fI5hie68TcCnJLS/cv KPpVHBkmSrLHVVRM1emxu+lfJv7TA7yUmyZlmLmr+URWKwoGlKVU2ohlt/e7hXtA1VMb 15cGdXMM65hzT3J7EZ7j7tkpOBjs8GR6flCpZcvQl2yFlL5q1dtLB+kKUx14Pq2orJ+0 0Al6hPi8qa31qdHO9yaBstno8mNEEJ1PM7bpV8kUwNjOlyG0pBvZR/hU+GymoRsCZAkI LJXQ== X-Gm-Message-State: AHPjjUi3pbyRI88ZmEFB8p/PArq9S6CgBw38RXZ2k5Tbmu4XRYNMmNtB +1kpe6drcs3oAA== X-Google-Smtp-Source: AOwi7QA2FJdGe/u6AlAfVRuiD5FvgOi7SjjjOC0+HlZSJZS77ya7UY7kRDMkq4s5gLIg8Z7sdsZatQ== X-Received: by 10.28.87.147 with SMTP id l141mr249996wmb.144.1504822877534; Thu, 07 Sep 2017 15:21:17 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id k52sm470786wrf.62.2017.09.07.15.21.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 15:21:16 -0700 (PDT) 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-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" Xref: news.gmane.org gmane.emacs.bugs:136670 Archived-At: Hi Stefan, maintainters I believe I found a rather easy glitch in the doc of overlays-at. It says if SORTED in non-nil it sorts overlays by "decreasing" priority, but actually the reverse is true. Line 3234 of buffer.c seems to confirm this: /* Sort the overlays into the proper order: increasing priority. */ and compare_overlays passed to qsort() as well: return s1->priority < s2->priority ? -1 : 1; I also did this test: (progn (mapc #'delete-overlay (overlays-in (point-min) (point-max))) (dotimes (i 4) (overlay-put (make-overlay 20 30) 'priority i)) (mapcar (lambda (ov) (overlay-get ov 'priority)) (overlays-at 20 t))) this returns (0 1 2 3) This is a 3-year-old docbug, so I'm suspicious I might be missing something. Anyway here's a docpatch. Jo=C3=A3o diff --git a/src/buffer.c b/src/buffer.c index 2d508f35cf..14722f7c17 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4151,7 +4151,7 @@ OVERLAY. */) DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 2, 0, doc: /* Return a list of the overlays that contain the character at= POS. -If SORTED is non-nil, then sort them by decreasing priority. */) +If SORTED is non-nil, then sort them by increasing priority. */) (Lisp_Object pos, Lisp_Object sorted) { ptrdiff_t len, noverlays; diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 2ed848adf3..181b003501 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1806,7 +1806,7 @@ Finding Overlays @defun overlays-at pos &optional sorted This function returns a list of all the overlays that cover the character = at position @var{pos} in the current buffer. If @var{sorted} is non-@code{ni= l}, -the list is in decreasing order of priority, otherwise it is in no particu= lar +the list is in increasing order of priority, otherwise it is in no particu= lar order. An overlay contains position @var{pos} if it begins at or before @var{pos}, and ends after @var{pos}. In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll b= ars) of 2017-08-24 built on lolita Repository revision: 5c048f5b327bbcd93d69c332a6c51ab139cd8071 Windowing system distributor 'The X.Org Foundation', version 11.0.11903000 System Description: Ubuntu 17.04 Recent messages: Undo! Saving file /home/capitaomorte/Source/Emacs/emacs/src/buffer.c... Wrote /home/capitaomorte/Source/Emacs/emacs/src/buffer.c Undo! Saving file /home/capitaomorte/Source/Emacs/emacs/src/buffer.c... Wrote /home/capitaomorte/Source/Emacs/emacs/src/buffer.c Finding changes in /home/capitaomorte/Source/Emacs/emacs/src/buffer.c...done You can run the command =E2=80=98vc-diff=E2=80=99 with C-x v =3D Finding changes in /home/capitaomorte/Source/Emacs/emacs/src/buffer.c...done Mark set [2 times] Quit Configured using: 'configure --with-modules --with-x-toolkit=3Dlucid' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 MODULES Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LC_MONETARY: pt_PT.UTF-8 value of $LC_NUMERIC: pt_PT.UTF-8 value of $LC_TIME: pt_PT.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Diff Minor modes in effect: global-aggressive-indent-mode: t shell-dirtrack-mode: t sly-autodoc-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t diff-auto-refine-mode: t whitespace-mode: t electric-pair-mode: t ido-everywhere: t delete-selection-mode: t global-auto-revert-mode: t show-paren-mode: t yas-global-mode: t yas-minor-mode: t cl-old-struct-compat-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-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 Load-path shadows: ~/Source/Emacs/darkroom/darkroom hides /home/capitaomorte/.emacs.d/elpa/dar= kroom-0.1/darkroom Features: (shadow sort emacsbug sendmail descr-text crm aggressive-indent tabify hanja-util vc-annotate vc-filewise smerge-mode vc-dir trace ibuf-ext ibuffer ibuffer-loaddefs sly-named-readtables sly-fancy sly-tramp tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell parse-time sly-indentation sly-cl-indent cl-indent sly-stickers color hi-lock sly-trace-dialog sly-fontifying-fu sly-package-fu sly-scratch sly-fancy-trace sly-fancy-inspector sly-autodoc sly-parse sly-mrepl network-stream nsm starttls tls gnutls sly info gud sly-completion sly-buttons sly-messages sly-common apropos arc-mode archive-mode noutline outline hyperspec browse-url display-line-numbers mail-extr ffap etags log-view semantic/symref/grep semantic/symref semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat cua-rect rect cua-base eieio-opt speedbar sb-image ezimage dframe edebug disass perl-mode flymake-tests pulse warnings imenu base16-hopscotch-theme base16-irblack-theme base16-isotope-theme base16-london-tube-theme base16-default-light-theme base16-eighties-theme base16-chalk-theme base16-solarflare-theme base16-tomorrow-theme base16-theme cus-theme hippie-exp bug-reference cl-print ert-x ert find-func ewoc debug help-fns radix-tree misearch multi-isearch vc-git diff-mode linum hideshow whitespace cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs cc-vars cc-defs cc-bytecomp git-rebase-mode thingatpt darkroom face-remap sly-named-readtables-autoloads sly-autoloads flymake-easy flymake flymake-proc flymake-ui rust-mode json map pp cus-edit cus-start cus-load wid-edit epa-file windmove ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff elec-pair ido delsel autorevert filenotify paren server log-edit message puny dired-x dired desktop frameset pcase dired-loaddefs subr-x format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log grep compile comint ansi-color vc vc-dispatcher advice xref project ring cl-extra yasnippet help-mode easy-mmode edmacro kmacro holy cl finder-inf rx package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date 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 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 930795 207805) (symbols 48 50058 1) (miscs 40 3425 957) (strings 32 147889 13156) (string-bytes 1 5467904) (vectors 16 73522) (vector-slots 8 1956561 77022) (floats 8 329 1718) (intervals 56 33152 527) (buffers 992 148))