From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ikumi Keita Newsgroups: gmane.emacs.bugs Subject: bug#52175: 27.2; stale marker left by `fill-region-as-paragraph' Date: Mon, 29 Nov 2021 19:49:53 +0900 Message-ID: <26598.1638182993@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4259"; mail-complaints-to="usenet@ciao.gmane.io" To: 52175@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 29 11:51:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mreFj-0000tZ-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Nov 2021 11:51:19 +0100 Original-Received: from localhost ([::1]:49790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mreFi-00083M-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Nov 2021 05:51:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mreFT-00082d-4J for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 05:51:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mreFS-0006fR-Rk for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 05:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mreFS-0004YU-B9 for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 05:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Nov 2021 10:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52175 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163818301017422 (code B ref -1); Mon, 29 Nov 2021 10:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2021 10:50:10 +0000 Original-Received: from localhost ([127.0.0.1]:37224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mreEb-0004Wv-Eo for submit@debbugs.gnu.org; Mon, 29 Nov 2021 05:50:10 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:51322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mreEV-0004Wd-WE for submit@debbugs.gnu.org; Mon, 29 Nov 2021 05:50:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mreEV-0007v0-Oj for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 05:50:03 -0500 Original-Received: from smtp1a.inetd.co.jp ([210.129.88.11]:48082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mreES-0006U5-0p for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 05:50:03 -0500 Original-Received: from localhost (110-133-201-220.rev.home.ne.jp [110.133.201.220]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 0289461 for ; Mon, 29 Nov 2021 19:49:55 +0900 (JST) X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.2 Received-SPF: pass client-ip=210.129.88.11; envelope-from=ikumi@ikumi.que.jp; helo=smtp1a.inetd.co.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220987 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-2022-jp The function `fill-region-as-paragraph' leaves a temporal marker which isn't cleared in the buffer. Here is the structure of `fill-region-as-paragraph': ---------------------------------------------------------------------- (defun fill-region-as-paragraph (from to &optional justify nosqueeze squeeze-after) [...] (setq to (copy-marker (point) t)) [...] (if (not (> to (point))) nil ;; There is no paragraph, only whitespace: exit now. [...] (goto-char to) (unless (eobp) (forward-char 1)) ;; Return the fill-prefix we used fill-prefix))) ---------------------------------------------------------------------- With this code, temporal marker bound to local variable `to' is left in the buffer. According to elisp reference `(elisp) Overview of Markers', it is recommended to clear such stale marker with suitable `(set-marker MARKER nil)': ,---- | Insertion and deletion in a buffer must check all the markers and | relocate them if necessary. This slows processing in a buffer with a | large number of markers. For this reason, it is a good idea to make a | marker point nowhere if you are sure you don’t need it any more. `---- I'd propose to apply the attached patch to accomplish that. Regards, Ikumi Keita --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=patch Content-Description: clear temporal marker diff -r b5040f7ef2cb -r a9285b04999c lisp/textmodes/fill.el --- a/lisp/textmodes/fill.el Sat Mar 27 02:27:15 2021 +0900 +++ b/lisp/textmodes/fill.el Fri Nov 19 14:00:38 2021 +0900 @@ -708,7 +709,10 @@ (goto-char from-plus-indent)) (if (not (> to (point))) - nil ;; There is no paragraph, only whitespace: exit now. + ;; There is no paragraph, only whitespace: exit now. + (progn + (set-marker to nil) + nil) (or justify (setq justify (current-justification))) @@ -784,6 +788,7 @@ ;; Leave point after final newline. (goto-char to) (unless (eobp) (forward-char 1)) + (set-marker to nil) ;; Return the fill-prefix we used fill-prefix))) --=-=-= Content-Type: text/plain In GNU Emacs 27.2 (build 1, x86_64-unknown-freebsd13.0, GTK+ Version 3.24.27, cairo version 1.16.0) of 2021-04-15 built on freebsd.vmware Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: 13.0-RELEASE-p5 Recent messages: No current message Scanning +outbox...done No more undeleted messages Processing deletes and refiles for +outbox...done Making completion list... C-x v ~ runs the command vc-revision-other-window Type C-x 1 to delete the help window, C-M-v to scroll help. Mark saved where search started Mark set Making completion list... Configured using: 'configure --with-canna --with-canna-includes=/usr/local/canna/include --with-canna-libraries=/usr/local/canna/lib --without-xim --disable-largefile --without-modules --with-sound=yes --with-file-notification=yes --with-cairo=yes CFLAGS=-O3' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS JSON PDUMPER LCMS2 GMP Important settings: value of $EMACSLOADPATH: /home/keita/elisp: value of $LANG: ja_JP.eucJP locale-coding-system: japanese-iso-8bit-unix Major mode: Info Minor modes in effect: global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-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 blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: ~/elisp/reftex-parse hides /usr/local/share/emacs/27.2/lisp/textmodes/reftex-parse /home/keita/.emacs.d/elpa/soap-client-3.2.0/soap-client hides /usr/local/share/emacs/27.2/lisp/net/soap-client /home/keita/.emacs.d/elpa/soap-client-3.2.0/soap-inspect hides /usr/local/share/emacs/27.2/lisp/net/soap-inspect Features: (shadow emacsbug mule-util jka-compr misearch multi-isearch log-view vc vc-dispatcher vc-hg bug-reference magit-gitignore face-remap magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff git-commit rx log-edit pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ring server ansi-color magit-mode transient magit-git magit-section magit-utils dash mh-thread boxquote rect supercite regi mh-identity mh-letter mh-comp sendmail vc-git diff-mode easy-mmode conf-mode flow-fill cl-extra help-mode shr-color color mh-search mh-alias multi-prompt crm smiley qp mm-archive mail-extr mh-mime mh-gnus mh-show goto-addr thingatpt gnus-cite gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum url url-proxy url-privacy url-expand url-methods url-history mailcap shr url-cookie url-domsuf url-util svg xml dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader gnus-win gnus-range gnus nnheader wid-edit mh-seq mh-inc hl-line mh-tool-bar mh-xface mh-utils mh-folder which-func imenu gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils text-property-search time-date mh-scan mh-e mh-compat mailabbrev mh-buffers mh-loaddefs edmacro kmacro preview-latex auto-loads tex-site canna-im info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib japan-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 tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer 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 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 threads dbusbind kqueue lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 244096 28812) (symbols 48 22813 1) (strings 32 77097 10106) (string-bytes 1 2539003) (vectors 16 43698) (vector-slots 8 1236535 74930) (floats 8 398 186) (intervals 56 4375 0) (buffers 1000 31)) --=-=-=--