From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 26 11:57:26 2019 Received: (at submit) by debbugs.gnu.org; 26 Feb 2019 16:57:26 +0000 Received: from localhost ([127.0.0.1]:53262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyg2o-0000JX-FK for submit@debbugs.gnu.org; Tue, 26 Feb 2019 11:57:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyg2m-0000JL-GF for submit@debbugs.gnu.org; Tue, 26 Feb 2019 11:57:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:34781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyg2h-00087j-6x for submit@debbugs.gnu.org; Tue, 26 Feb 2019 11:57:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyg2g-0004qD-5l for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2019 11:57:18 -0500 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,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyg2f-00085z-Cm for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2019 11:57:18 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:42654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gyg2e-00084x-Tt for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2019 11:57:17 -0500 Received: by mail-ed1-x535.google.com with SMTP id j89so11307986edb.9 for ; Tue, 26 Feb 2019 08:57:16 -0800 (PST) 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:user-agent:mime-version; bh=nqIiDnRPI2MXQjrOSa8FL0qAiLhMp21osjER7o4hZeg=; b=D46Inf5Ffj4AFnpGLgBVsorjbcO6n6rD1wRmWhTcyspLtinFv2HZf1He5L30Qv8uh3 bZHxxDHsgt9VE2OWi1LFUpL8h4qnpkjWqIRiHq8GYkzKpBkMB4PErZmj+hFKv9RMp6VU mu1mF+PCttyUcHDhtE2Gc6AqX4mXOierIiOAo1j2aaLUfMpYZbuOovUXlP2uLsPQzZlW eUVONzeFEjd8LDsJ2PoqC4RuhXyf78AaSCa3dZ7z9xBCNXcgX/1RDyJu1BqKUifYXp3Y Jet4XJ+yyumq9pFbNveQ59XWm7nF8+1ckrUxwlXkIPeDlb3GMJJ4TawcRrN4URJ5jpnn aoNA== 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:user-agent :mime-version; bh=nqIiDnRPI2MXQjrOSa8FL0qAiLhMp21osjER7o4hZeg=; b=ttkvuwoMD620KXEo8LQGlAVx4T+Gk+r7eh81EWUe0xUppsrNTvhcm/qmc337qxsbPZ AF3zJUdN3AUxMWo1o+O90+hcnhXknSY0TuEzSIK+K9qBRcGncctxaQEfBcYHym3KfhSX 55onrw3OFhJaW6gkc2E3TUUHsjPv0svVss0f0m0x8qio5VyECB3iuDHBoNp6zg6nZsQQ OPlrILqqYbQ1b71VJhdwJP21/CT1XTlbUOBeAdUbAxQXxxrzS5bpHyrhWC1ROwTGf0e6 I2nXh0kz7/ds8NFXfDcx7yCAADD+lqACI5efSCIyhf8IF1g03yPYkZSA8Eiet2Y1wp47 366g== X-Gm-Message-State: AHQUAuZKqEo0w779zDeOOk3t+NQa+qoWvdq31CkTd3ZaeqJEBGjPN3c5 WS4e17tPzWUXCKWM/AqkcQPM8uwDViw= X-Google-Smtp-Source: AHgI3IaPWySnnvLMP+rrTAtSVM3EvjdFP1fbIURkdwnv8FnnZ96bYxFCkEtkwf83m2JOn8+3jgI0rg== X-Received: by 2002:a50:c344:: with SMTP id q4mr20109343edb.250.1551200235254; Tue, 26 Feb 2019 08:57:15 -0800 (PST) Received: from localhost ([134.226.214.248]) by smtp.gmail.com with ESMTPSA id o6sm2324554ejb.14.2019.02.26.08.57.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 26 Feb 2019 08:57:14 -0800 (PST) From: "Basil L. Contovounesios" To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Outdated code listings in (elisp) Example Major Modes Date: Tue, 26 Feb 2019 16:57:12 +0000 Message-ID: <87bm2yqyhj.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::535 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit 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: -1.0 (-) Some of the examples in '(elisp) Example Major Modes' do not reflect the current code in lisp/textmodes/text-mode.el and lisp/emacs-lisp/lisp-mode.el. Furthermore, the indentation of the lisp-mode-map listing in the manual is off due to a tab character in its Texinfo source. Patch(es) to follow. -- Basil In GNU Emacs 27.0.50 (build 9, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2019-02-25 built on thunk Repository revision: 0d49078ad80f54b810180a071e2b6b4bcc024851 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 System Description: Debian GNU/Linux buster/sid From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 26 12:07:09 2019 Received: (at 34671) by debbugs.gnu.org; 26 Feb 2019 17:07:09 +0000 Received: from localhost ([127.0.0.1]:53271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gygCC-0000Zb-TA for submit@debbugs.gnu.org; Tue, 26 Feb 2019 12:07:09 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:46648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gygCB-0000ZJ-Fa for 34671@debbugs.gnu.org; Tue, 26 Feb 2019 12:07:08 -0500 Received: by mail-ed1-f44.google.com with SMTP id f2so11330528edy.13 for <34671@debbugs.gnu.org>; Tue, 26 Feb 2019 09:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=/4AcUfHjtYPZS6sphL/i3//LgFM0AS5KElJlKbCiYsc=; b=lme70Hk5QJYurxsJTtMsl7ghWd7/I4X7XUzj1DCJUt7J9YumZSafBKsQXL+6TLovG8 IYZMPUWMonmGHovY3C9I+DpjTWT8tqBU/cyoGbHr/huYMf4jAjEP+i77CBUyFW30f3Gi qRkxrmGQO5gQGbW0pvCle3nl9YSw28WG+P5xEe5OQLv8IqR2I4mlZULCLrKxVRLFoEy3 RAhuMkPZIM9DW9EofMP5Hv3YDNYRjuoKqutkrUe4O4FhzsBQdWzzH+siAd7ZX4BCzinv jLd3Z4qABu5MPe78Oc0A71ukbqljLw0EyJ38rsMja3FQGlbyYjAuIf/967bLXieA/NHG ethA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/4AcUfHjtYPZS6sphL/i3//LgFM0AS5KElJlKbCiYsc=; b=K4gsu5kJxg68a4lPFCEgJlk0EjpdwjnxX6//GCBEqng6coE7vltkqcJRl06dng+RS0 USGuxreNp21r/I7QhKK9UBsPAuFjoRSs19EeacmqpQf/sQXz8nAmowMvxEyUgXSGZ5lX NqTmS94eQMs0MCLv3XuLvcXuNKFf6Lztv1+3VIVTrJlf6Sb/jWgnM2AP5NY8xNY1kg/G Lff0DB1vT6UnKDAnqbujRY48uyEeQwB6LklEe0m6KsPiErOH+KQy5l2ahCC9NMlrnZE5 EYCoQ0cngkySSvCr7G8cfpWi3s8bz//AM69h39oGQiTqlI+gAC/87MTCuEJ14pdXCHa5 7UUg== X-Gm-Message-State: AHQUAubyYhDbSibXOXIq/ZW3zvkMqGekPWXBTM7ijr2XHtdN42NJ+VdZ lRjMjI+easPMaN3fykgqcpWn4r1puIrAbA== X-Google-Smtp-Source: AHgI3IYm64gaN16G6sVfuN2Jfz49zFAXtnontWgwDV0Wucu1MX1U1+tAWYZb6Kj9z58fkEULv88iQw== X-Received: by 2002:a17:906:24ca:: with SMTP id f10mr17826501ejb.240.1551200821348; Tue, 26 Feb 2019 09:07:01 -0800 (PST) Received: from localhost ([134.226.214.248]) by smtp.gmail.com with ESMTPSA id f7sm2335779ejk.28.2019.02.26.09.06.59 for <34671@debbugs.gnu.org> (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 26 Feb 2019 09:07:00 -0800 (PST) From: "Basil L. Contovounesios" To: 34671@debbugs.gnu.org Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes References: <87bm2yqyhj.fsf@tcd.ie> Date: Tue, 26 Feb 2019 17:06:58 +0000 In-Reply-To: <87bm2yqyhj.fsf@tcd.ie> (Basil L. Contovounesios's message of "Tue, 26 Feb 2019 16:57:12 +0000") Message-ID: <877edmqy19.fsf@tcd.ie> 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-Debbugs-Envelope-To: 34671 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: -1.0 (-) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Update-example-major-mode-code-in-Elisp-manual.patch >From b232d11d6753a98563badc823668214ff32e6d81 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 26 Feb 2019 11:57:53 +0000 Subject: [PATCH 1/3] Update example major mode code in Elisp manual * doc/lispref/modes.texi (Example Major Modes): Update code examples to reflect current state of lisp/textmodes/text-mode.el and lisp/emacs-lisp/lisp-mode.el. (bug#34671) --- doc/lispref/modes.texi | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 6349dec98b..f4d7f41a62 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1237,6 +1237,7 @@ Example Major Modes (modify-syntax-entry ?\\ ". " st) ;; Add 'p' so M-c on 'hello' leads to 'Hello', not 'hello'. (modify-syntax-entry ?' "w p" st) + @dots{} st) "Syntax table used while in `text-mode'.") @end group @@ -1246,6 +1247,7 @@ Example Major Modes (defvar text-mode-map (let ((map (make-sparse-keymap))) (define-key map "\e\t" 'ispell-complete-word) + @dots{} map) "Keymap for `text-mode'. Many other modes, such as `mail-mode', `outline-mode' and @@ -1289,11 +1291,11 @@ Example Major Modes @smallexample @group ;; @r{Create mode-specific table variables.} -(defvar lisp-mode-abbrev-table nil) -(define-abbrev-table 'lisp-mode-abbrev-table ()) +(define-abbrev-table 'lisp-mode-abbrev-table () + "Abbrev table for Lisp mode.") (defvar lisp-mode-syntax-table - (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) + (let ((table (make-syntax-table lisp--mode-syntax-table))) (modify-syntax-entry ?\[ "_ " table) (modify-syntax-entry ?\] "_ " table) (modify-syntax-entry ?# "' 14" table) @@ -1308,10 +1310,9 @@ Example Major Modes @smallexample @group -(defun lisp-mode-variables (&optional syntax keywords-case-insensitive) +(defun lisp-mode-variables (&optional syntax keywords-case-insensitive elisp) (when syntax (set-syntax-table lisp-mode-syntax-table)) - (setq local-abbrev-table lisp-mode-abbrev-table) @dots{} @end group @end smallexample @@ -1322,8 +1323,7 @@ Example Major Modes @smallexample @group - (make-local-variable 'comment-start) - (setq comment-start ";") + (setq-local comment-start ";") @dots{} @end group @end smallexample @@ -1337,6 +1337,7 @@ Example Major Modes @group (defvar lisp-mode-shared-map (let ((map (make-sparse-keymap))) + (set-keymap-parent map prog-mode-map) (define-key map "\e\C-q" 'indent-sexp) (define-key map "\177" 'backward-delete-char-untabify) map) @@ -1351,7 +1352,7 @@ Example Major Modes @group (defvar lisp-mode-map (let ((map (make-sparse-keymap)) - (menu-map (make-sparse-keymap "Lisp"))) + (menu-map (make-sparse-keymap "Lisp"))) (set-keymap-parent map lisp-mode-shared-map) (define-key map "\e\C-x" 'lisp-eval-defun) (define-key map "\C-c\C-z" 'run-lisp) @@ -1375,17 +1376,13 @@ Example Major Modes \\@{lisp-mode-map@} Note that `run-lisp' may be used either to start an inferior Lisp job -or to switch back to an existing one. +or to switch back to an existing one." @end group - @group -Entry to this mode calls the value of `lisp-mode-hook' -if that value is non-nil." (lisp-mode-variables nil t) - (set (make-local-variable 'find-tag-default-function) - 'lisp-find-tag-default) - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") + (setq-local find-tag-default-function 'lisp-find-tag-default) + (setq-local comment-start-skip + "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") (setq imenu-case-fold-search t)) @end group @end smallexample -- 2.20.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Use-lexical-binding-in-text-mode.el.patch >From ac2a834bcd6d0474107c439800a9ec66adff16eb Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 26 Feb 2019 14:22:32 +0000 Subject: [PATCH 2/3] Use lexical-binding in text-mode.el * lisp/textmodes/text-mode.el: Use lexical-binding. (text-mode-syntax-table): Align comments to comment-column. (text-mode-map, text-mode): Refill docstring. (text-mode, paragraph-indent-minor-mode, text-mode-hook-identify): Use setq-local. (toggle-text-mode-auto-fill): Hoist save-current-buffer out of loop. (center-region, center-line): Tiny simplification. * doc/lispref/modes.texi (Example Major Modes): Adapt code examples to these text-mode.el changes. --- doc/lispref/modes.texi | 16 +++++----- lisp/textmodes/text-mode.el | 60 ++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index f4d7f41a62..44efff416e 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1261,17 +1261,17 @@ Example Major Modes @group (define-derived-mode text-mode nil "Text" "Major mode for editing text written for humans to read. -In this mode, paragraphs are delimited only by blank or white lines. -You can thus get the full benefit of adaptive filling - (see the variable `adaptive-fill-mode'). -\\@{text-mode-map@} +In this mode, paragraphs are delimited only by blank or white +lines. You can thus get the full benefit of adaptive +filling (see the variable `adaptive-fill-mode'). + +\\{text-mode-map} Turning on Text mode runs the normal hook `text-mode-hook'." @end group @group - (set (make-local-variable 'text-mode-variant) t) - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) - (set (make-local-variable 'indent-line-function) 'indent-relative)) + (setq-local text-mode-variant t) + (setq-local require-final-newline mode-require-final-newline) + (setq-local indent-line-function #'indent-relative)) @end group @end smallexample diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 931faadb5b..8dcc4e3696 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -1,4 +1,4 @@ -;;; text-mode.el --- text mode, and its idiosyncratic commands +;;; text-mode.el --- text mode, and its idiosyncratic commands -*- lexical-binding: t -*- ;; Copyright (C) 1985, 1992, 1994, 2001-2019 Free Software Foundation, ;; Inc. @@ -49,7 +49,7 @@ text-mode-syntax-table (modify-syntax-entry ?' "w p" st) ;; UAX #29 says HEBREW PUNCTUATION GERESH behaves like a letter ;; for the purposes of finding word boundaries. - (modify-syntax-entry #x5f3 "w ") ; GERESH + (modify-syntax-entry #x5f3 "w ") ; GERESH ;; UAX #29 says HEBREW PUNCTUATION GERSHAYIM should not be a word ;; boundary when surrounded by letters. Our infrastructure for ;; finding a word boundary doesn't support 3-character @@ -57,13 +57,13 @@ text-mode-syntax-table ;; character. This leaves a problem of having GERSHAYIM at the ;; beginning or end of a word, where it should be a boundary; ;; FIXME. - (modify-syntax-entry #x5f4 "w ") ; GERSHAYIM + (modify-syntax-entry #x5f4 "w ") ; GERSHAYIM ;; These all should not be a word boundary when between letters, ;; according to UAX #29, so they again are prone to the same ;; problem as GERSHAYIM; FIXME. - (modify-syntax-entry #xb7 "w ") ; MIDDLE DOT - (modify-syntax-entry #x2027 "w ") ; HYPHENATION POINT - (modify-syntax-entry #xff1a "w ") ; FULLWIDTH COLON + (modify-syntax-entry #xb7 "w ") ; MIDDLE DOT + (modify-syntax-entry #x2027 "w ") ; HYPHENATION POINT + (modify-syntax-entry #xff1a "w ") ; FULLWIDTH COLON st) "Syntax table used while in `text-mode'.") @@ -93,21 +93,21 @@ text-mode-map :help "Center the current line")) map) "Keymap for `text-mode'. -Many other modes, such as `mail-mode', `outline-mode' and `indented-text-mode', -inherit all the commands defined in this map.") +Many other modes, such as `mail-mode', `outline-mode', and +`indented-text-mode', inherit all the commands defined in this map.") (define-derived-mode text-mode nil "Text" "Major mode for editing text written for humans to read. -In this mode, paragraphs are delimited only by blank or white lines. -You can thus get the full benefit of adaptive filling - (see the variable `adaptive-fill-mode'). +In this mode, paragraphs are delimited only by blank or white +lines. You can thus get the full benefit of adaptive +filling (see the variable `adaptive-fill-mode'). + \\{text-mode-map} Turning on Text mode runs the normal hook `text-mode-hook'." - (set (make-local-variable 'text-mode-variant) t) - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) - (set (make-local-variable 'indent-line-function) 'indent-relative)) + (setq-local text-mode-variant t) + (setq-local require-final-newline mode-require-final-newline) + (setq-local indent-line-function #'indent-relative)) (define-derived-mode paragraph-indent-text-mode text-mode "Parindent" "Major mode for editing text, with leading spaces starting a paragraph. @@ -134,11 +134,10 @@ paragraph-indent-minor-mode (if (eq t (compare-strings ps-re nil nil paragraph-start nil (length ps-re))) (if (not paragraph-indent-minor-mode) - (set (make-local-variable 'paragraph-start) - (substring paragraph-start (length ps-re)))) + (setq-local paragraph-start + (substring paragraph-start (length ps-re)))) (if paragraph-indent-minor-mode - (set (make-local-variable 'paragraph-start) - (concat ps-re paragraph-start))))) + (setq-local paragraph-start (concat ps-re paragraph-start))))) ;; Change the indentation function. (if paragraph-indent-minor-mode (add-function :override (local 'indent-line-function) @@ -154,7 +153,7 @@ 'indented-text-mode (defun text-mode-hook-identify () "Mark that this mode has run `text-mode-hook'. This is how `toggle-text-mode-auto-fill' knows which buffers to operate on." - (set (make-local-variable 'text-mode-variant) t)) + (setq-local text-mode-variant t)) (defun toggle-text-mode-auto-fill () "Toggle whether to use Auto Fill in Text mode and related modes. @@ -163,10 +162,11 @@ toggle-text-mode-auto-fill (interactive) (let ((enable-mode (not (memq 'turn-on-auto-fill text-mode-hook)))) (if enable-mode - (add-hook 'text-mode-hook 'turn-on-auto-fill) - (remove-hook 'text-mode-hook 'turn-on-auto-fill)) - (dolist (buffer (buffer-list)) - (with-current-buffer buffer + (add-hook 'text-mode-hook #'turn-on-auto-fill) + (remove-hook 'text-mode-hook #'turn-on-auto-fill)) + (save-current-buffer + (dolist (buffer (buffer-list)) + (set-buffer buffer) (if (or (derived-mode-p 'text-mode) text-mode-variant) (auto-fill-mode (if enable-mode 1 0))))) (message "Auto Fill %s in Text modes" @@ -191,8 +191,7 @@ center-region See `center-line' for more info." (interactive "r") (if (> from to) - (let ((tem to)) - (setq to from from tem))) + (setq to (prog1 from (setq from to)))) (save-excursion (save-restriction (narrow-to-region from to) @@ -214,15 +213,14 @@ center-line (while (not (eq nlines 0)) (save-excursion (let ((lm (current-left-margin)) - line-length) + space) (beginning-of-line) (delete-horizontal-space) (end-of-line) (delete-horizontal-space) - (setq line-length (current-column)) - (if (> (- fill-column lm line-length) 0) - (indent-line-to - (+ lm (/ (- fill-column lm line-length) 2)))))) + (setq space (- fill-column lm (current-column))) + (if (> space 0) + (indent-line-to (+ lm (/ space 2)))))) (cond ((null nlines) (setq nlines 0)) ((> nlines 0) -- 2.20.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0003-Do-not-set-indent-line-function-in-text-mode.patch >From 7c655b0f0363134f750bae25f45198b713f851b7 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 26 Feb 2019 16:13:23 +0000 Subject: [PATCH 3/3] Do not set indent-line-function in text-mode * lisp/textmodes/text-mode.el (text-mode): Remove redundant setting of indent-line-function to indent-relative, which is its default value. * doc/lispref/modes.texi (Example Major Modes): Adapt docs accordingly. --- doc/lispref/modes.texi | 7 +------ lisp/textmodes/text-mode.el | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 44efff416e..08d96e6a65 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1270,15 +1270,10 @@ Example Major Modes @end group @group (setq-local text-mode-variant t) - (setq-local require-final-newline mode-require-final-newline) - (setq-local indent-line-function #'indent-relative)) + (setq-local require-final-newline mode-require-final-newline)) @end group @end smallexample -@noindent -(The last line is redundant nowadays, since @code{indent-relative} is -the default value, and we'll delete it in a future version.) - @cindex @file{lisp-mode.el} The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp Interaction mode) have more features than Text mode and the code is correspondingly diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 8dcc4e3696..9f3cdf46e0 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -106,8 +106,7 @@ text-mode \\{text-mode-map} Turning on Text mode runs the normal hook `text-mode-hook'." (setq-local text-mode-variant t) - (setq-local require-final-newline mode-require-final-newline) - (setq-local indent-line-function #'indent-relative)) + (setq-local require-final-newline mode-require-final-newline)) (define-derived-mode paragraph-indent-text-mode text-mode "Parindent" "Major mode for editing text, with leading spaces starting a paragraph. -- 2.20.1 --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > Some of the examples in '(elisp) Example Major Modes' do not reflect the > current code in lisp/textmodes/text-mode.el and > lisp/emacs-lisp/lisp-mode.el. Furthermore, the indentation of the > lisp-mode-map listing in the manual is off due to a tab character in its > Texinfo source. > > Patch(es) to follow. I attach said patches; WDYT? The first patch reconciles the code listings in the manual with the current state of the corresponding libraries. The second patch enables lexical-binding in text-mode.el along with some minor aesthetic changes. The last patch fulfils an old promise in the manual to eventually forgo setting indent-line-function in text-mode, which is considered redundant. Thanks, -- Basil --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 05:16:11 2019 Received: (at 34671) by debbugs.gnu.org; 1 Mar 2019 10:16:11 +0000 Received: from localhost ([127.0.0.1]:55813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzfD8-0004j0-AL for submit@debbugs.gnu.org; Fri, 01 Mar 2019 05:16:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzfD6-0004in-8G for 34671@debbugs.gnu.org; Fri, 01 Mar 2019 05:16:08 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzfD0-0000aj-Vf; Fri, 01 Mar 2019 05:16:03 -0500 Received: from [176.228.60.248] (port=1661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gzfD0-0004V0-JR; Fri, 01 Mar 2019 05:16:02 -0500 Date: Fri, 01 Mar 2019 12:15:48 +0200 Message-Id: <83imx2j3xn.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-reply-to: <877edmqy19.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes References: <87bm2yqyhj.fsf@tcd.ie> <877edmqy19.fsf@tcd.ie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34671 Cc: 34671@debbugs.gnu.org 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: -1.0 (-) > From: "Basil L. Contovounesios" > Date: Tue, 26 Feb 2019 17:06:58 +0000 > > "Basil L. Contovounesios" writes: > > > Some of the examples in '(elisp) Example Major Modes' do not reflect the > > current code in lisp/textmodes/text-mode.el and > > lisp/emacs-lisp/lisp-mode.el. Furthermore, the indentation of the > > lisp-mode-map listing in the manual is off due to a tab character in its > > Texinfo source. > > > > Patch(es) to follow. > > I attach said patches; WDYT? Thanks. > The first patch reconciles the code listings in the manual with the > current state of the corresponding libraries. This part is definitely OK, please push to the emacs-26 branch. > The second patch enables lexical-binding in text-mode.el along with some > minor aesthetic changes. I don't see the need for parts of this patch. Enabling lexical-binding is OK, but it should be a separate change unrelated to this bug report. And I'm not sure I see the reason for the other changes, nor even agree with them. In particular, please modify whitespace only where you actually make other non-trivial changes. > The last patch fulfils an old promise in the manual to eventually forgo > setting indent-line-function in text-mode, which is considered > redundant. What if the user customizes the default values, shouldn't text-mode reset that in the buffer where it is turned on? From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 14:46:46 2019 Received: (at 34671) by debbugs.gnu.org; 1 Mar 2019 19:46:47 +0000 Received: from localhost ([127.0.0.1]:56806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzo7K-0003q5-In for submit@debbugs.gnu.org; Fri, 01 Mar 2019 14:46:46 -0500 Received: from mail-ed1-f47.google.com ([209.85.208.47]:39782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzo7I-0003pq-I2 for 34671@debbugs.gnu.org; Fri, 01 Mar 2019 14:46:45 -0500 Received: by mail-ed1-f47.google.com with SMTP id p27so20988108edc.6 for <34671@debbugs.gnu.org>; Fri, 01 Mar 2019 11:46:44 -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=robUdxRMU0RKeVYbiXBS7zuXjv6EagHER+gHSW9ffzg=; b=1CUioQcLo/z+yaru+bvchxLUrFcenbVm7wwKtRiMcfjvSqiqDdiQfhdg/Gjx4/A/qf kiQMsqfL8UNPbvumkQQFsb4FKrQ+F6W6kIM+lesbzfSmk8AVh4S41SsVwTMXinS/HaAb 6QxI+blaoRJMwwZf2z8nUhuLbWzZZZqjDiNUg0lne1NCNrPzdgIKnBggJmuJzr10ioxO COlVPUVW/WPif4QzDIugUf52FgtjLoegtTnMIMig47DOMMTgRmsgOz2Tm7S0oCPkd/G3 vZR444NPvtUe7fuVfnK2BMcYFlzdXPA/jCzY1G0TEdyqAP6E4aQCTpgbleBnLW9MxhrV 41fg== 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=robUdxRMU0RKeVYbiXBS7zuXjv6EagHER+gHSW9ffzg=; b=J9uaK5xZR5L0GfZ2DgIydDBEO0S0LjcgKWMzHCys8c5y3EWHukXhCxakeT7HoZu9wB y1kbJG6S0X9CjcYOt3pAAjUocSzZiO5Dm7ERBSp15pJC0DYicj+7gAlz7voDkz0pYfl6 WNiJuL0/iT0diz9EGqnjVrbRr8oYNocPTWStEn4E4x0HoZnyOj+zkMYLctyQhs6LWR1h 6t5GTHhWUYq6xyihYiCs8C15aVzS4r3/C//ONSCYVqYEQGrBCiXVcctSAmbTWvu2xgh/ ISFileYC0wXTUs2AHO6n8gkGAZzDASHOsnxPyiCO0NvnB55CKmdW0TOu/ytEuOPfZVgb 6TXQ== X-Gm-Message-State: APjAAAXYcXfk4Z0ofldQkC2lYulLL16CARZcVV4NXiDFhU7uWZ/uX+0B fPfShZX/oR+61rHDU9mFKU+p1g== X-Google-Smtp-Source: APXvYqwHTWu9zEUyb3lsuePfv8UZJG7ixKDmxh3Ggf24bptriN/8l7VBzupgJs+mdoqYDgXa07D/pw== X-Received: by 2002:a50:9012:: with SMTP id b18mr5618179eda.30.1551469598559; Fri, 01 Mar 2019 11:46:38 -0800 (PST) Received: from localhost ([134.226.214.253]) by smtp.gmail.com with ESMTPSA id q11sm3854771ejb.39.2019.03.01.11.46.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 01 Mar 2019 11:46:37 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes References: <87bm2yqyhj.fsf@tcd.ie> <877edmqy19.fsf@tcd.ie> <83imx2j3xn.fsf@gnu.org> Date: Fri, 01 Mar 2019 19:46:31 +0000 In-Reply-To: <83imx2j3xn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 1 Mar 2019 12:15:48 +0200") Message-ID: <87d0naml7s.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34671 Cc: 34671@debbugs.gnu.org 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: -1.0 (-) Eli Zaretskii writes: >> The first patch reconciles the code listings in the manual with the >> current state of the corresponding libraries. > > This part is definitely OK, please push to the emacs-26 branch. Sorry, I don't have write access, so someone else will have to do that. BTW, is one expected to be a package author before it is acceptable to request write access, or is it a matter of amassing enough flight hours? >> The second patch enables lexical-binding in text-mode.el along with some >> minor aesthetic changes. > > I don't see the need for parts of this patch. Enabling > lexical-binding is OK, but it should be a separate change unrelated to > this bug report. Should I submit a new bug report for that, or message emacs-devel? > And I'm not sure I see the reason for the other changes, nor even > agree with them. In particular, please modify whitespace only where > you actually make other non-trivial changes. (Oops, looking back I accidentally mangled some Texinfo escape characters by copy-pasting.) I agree with this principle, but simply thought that a file-wide change like enabling lexical-binding was sufficient excuse for minor "cleanups" along the way. I'm sorry the proposed changes weren't clean enough. I assume the parts of the patch you're least keen on are: * lisp/textmodes/text-mode.el (text-mode-syntax-table): Align comments to comment-column. (toggle-text-mode-auto-fill): Hoist save-current-buffer out of loop. (center-region): Tiny simplification. but that you're okay with the following: * lisp/textmodes/text-mode.el: Use lexical-binding. (text-mode-map, text-mode): Refill docstring. (text-mode, paragraph-indent-minor-mode, text-mode-hook-identify): Use setq-local. (center-line): Tiny simplification. Let me know and I will send updated patch(es) to a new ticket/thread. >> The last patch fulfils an old promise in the manual to eventually forgo >> setting indent-line-function in text-mode, which is considered >> redundant. > > What if the user customizes the default values, shouldn't text-mode > reset that in the buffer where it is turned on? I can think of two reasons for keeping the reset in text-mode: 0. If text-mode breaks when indent-line-function is set to anything other than indent-relative. I'm not sure, but I don't think this is the case, as I set the variable in text-mode-hook for a while without any noticeable fallout. 1. To avoid a user-visible change of behaviour with user configurations (like mine) which change the default global value of indent-line-function. The only reason (I can think of) to remove the reset is in order to fulfil the relevant promise in the manual. Keeping the reset is clearly less risky. I don't mind either way, so long as the side-note in the manual accurately reflects future intentions. Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 02:39:55 2019 Received: (at 34671) by debbugs.gnu.org; 2 Mar 2019 07:39:55 +0000 Received: from localhost ([127.0.0.1]:56958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzzFT-0001Jx-Es for submit@debbugs.gnu.org; Sat, 02 Mar 2019 02:39:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzzFR-0001Jl-O8 for 34671@debbugs.gnu.org; Sat, 02 Mar 2019 02:39:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzzFF-0007EY-Nw; Sat, 02 Mar 2019 02:39:43 -0500 Received: from [176.228.60.248] (port=1883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gzzFD-00013t-S6; Sat, 02 Mar 2019 02:39:41 -0500 Date: Sat, 02 Mar 2019 09:39:27 +0200 Message-Id: <83mumdhgi8.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-reply-to: <87d0naml7s.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes References: <87bm2yqyhj.fsf@tcd.ie> <877edmqy19.fsf@tcd.ie> <83imx2j3xn.fsf@gnu.org> <87d0naml7s.fsf@tcd.ie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34671 Cc: 34671@debbugs.gnu.org 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: -1.0 (-) > From: "Basil L. Contovounesios" > Cc: <34671@debbugs.gnu.org> > Date: Fri, 01 Mar 2019 19:46:31 +0000 > > Eli Zaretskii writes: > > >> The first patch reconciles the code listings in the manual with the > >> current state of the corresponding libraries. > > > > This part is definitely OK, please push to the emacs-26 branch. > > Sorry, I don't have write access, so someone else will have to do that. Done. > BTW, is one expected to be a package author before it is acceptable to > request write access, or is it a matter of amassing enough flight hours? The latter. I think you are there already, so feel free to create a user on Savannah and then request write access. > >> The second patch enables lexical-binding in text-mode.el along with some > >> minor aesthetic changes. > > > > I don't see the need for parts of this patch. Enabling > > lexical-binding is OK, but it should be a separate change unrelated to > > this bug report. > > Should I submit a new bug report for that, or message emacs-devel? The latter, I think, since the main issue here is how well was the package tested after turning on lexical-binding. > > And I'm not sure I see the reason for the other changes, nor even > > agree with them. In particular, please modify whitespace only where > > you actually make other non-trivial changes. > > (Oops, looking back I accidentally mangled some Texinfo escape > characters by copy-pasting.) > > I agree with this principle, but simply thought that a file-wide change > like enabling lexical-binding was sufficient excuse for minor "cleanups" > along the way. Not in such a sweeping manner. In general, only in the same function/code fragment where you are making changes. > I assume the parts of the patch you're least keen on are: > > * lisp/textmodes/text-mode.el (text-mode-syntax-table): Align comments > to comment-column. > (toggle-text-mode-auto-fill): Hoist save-current-buffer out of loop. > (center-region): Tiny simplification. > > but that you're okay with the following: > > * lisp/textmodes/text-mode.el: Use lexical-binding. > (text-mode-map, text-mode): Refill docstring. > (text-mode, paragraph-indent-minor-mode, text-mode-hook-identify): > Use setq-local. > (center-line): Tiny simplification. Refilling doc strings also caused me to raise a brow. IMO, that is only justified if the original doc string is badly formatted, like has overly-long lines, close to or longer than 80 columns. Otherwise, we don't generally refill doc strings we don't change, we only make sure they look well and read clearly on the screen. > >> The last patch fulfils an old promise in the manual to eventually forgo > >> setting indent-line-function in text-mode, which is considered > >> redundant. > > > > What if the user customizes the default values, shouldn't text-mode > > reset that in the buffer where it is turned on? > > I can think of two reasons for keeping the reset in text-mode: > > 0. If text-mode breaks when indent-line-function is set to anything > other than indent-relative. > > I'm not sure, but I don't think this is the case, as I set the > variable in text-mode-hook for a while without any noticeable > fallout. > > 1. To avoid a user-visible change of behaviour with user configurations > (like mine) which change the default global value of > indent-line-function. > > The only reason (I can think of) to remove the reset is in order to > fulfil the relevant promise in the manual. > > Keeping the reset is clearly less risky. I don't mind either way, so > long as the side-note in the manual accurately reflects future > intentions. Maybe we should make the change you propose, but it isn't clear-cut and requires discussion in a separate bug report, or perhaps even on emacs-devel. It certainly isn't cleanup. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 06:37:04 2019 Received: (at control) by debbugs.gnu.org; 2 Mar 2019 11:37:04 +0000 Received: from localhost ([127.0.0.1]:57020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h02wx-0007RA-Ps for submit@debbugs.gnu.org; Sat, 02 Mar 2019 06:37:04 -0500 Received: from mail-ed1-f49.google.com ([209.85.208.49]:36125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h02wt-0007QZ-Eu for control@debbugs.gnu.org; Sat, 02 Mar 2019 06:37:02 -0500 Received: by mail-ed1-f49.google.com with SMTP id g9so506864eds.3 for ; Sat, 02 Mar 2019 03:36:59 -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:message-id:references:date:in-reply-to :user-agent:mime-version; bh=ubwck8R8+YwtSa1S2ppRcEETAwtcrURBQdmiHcSuEoY=; b=qOoXrAHvICjGjP5J6u/QiX79PTJVcay1B1dmdlpfsivOHwNX/FoW1bEB+pWbUg4k/h Mw9tNJiAjSXNMHDF9wRrsesnSyR8Y71Ak8jhzEpOeMrKpyhx4hOQuxd3r9kEXMp8YEqd RUwNUD8qhj7m7aVL7rsJYYgsJBHaOLk8oAkNtmJijwe64oBjjaOPhBv93v/WiJzUnE1l DRqVkGeFb45yesnHyteT5M+SgAy07wo3oVsHMHpYlWSVBH0nkHpkzW38LtacA0Vaxreu DFEZRQMNuU/RmqDfUNJQOa6ziwpAHeP7piuy8WxuMlxLLgXTPoLirFQQnUK0fcTrRWy7 FL+Q== 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:message-id:references:date :in-reply-to:user-agent:mime-version; bh=ubwck8R8+YwtSa1S2ppRcEETAwtcrURBQdmiHcSuEoY=; b=lBvDodKcAzoWjdvapZHeWRLLOBkJANBD69hSFwioTHuWZ24jXfiUq0tKL/Kvx9Ogg7 o9tjjxH+E1b/tLyt+7+v6hEiPa880iXgN0DqcmWUy3akl+8PQ59htk9NuoJmri5AnnFI F8K+yjIWs60nEqLed935wDduxbHShwknhklOYo+LXbb1xW42ouQa2yOopucB+DyREm3b uM0iY1f0r8ZKAOhxd4Xc2gkU+cZp9YmYdrrM63hi6VTV/nU25RJp4tBldANyNs4EBLp5 iz0tqDHllBZfj1bMbMUIGJLdj8MZzupkBgOtSqvkHyRdSteOIkvjWESp6moyoy+r0igb v+wQ== X-Gm-Message-State: APjAAAWtvUPiyK3qYNBuHVMeOUYFyyFYL+MYgiIMAKeIoclVHaqHvZVs C+Ftk+YHEtc2UbrA3mM2oXmgzJTGT++Tug== X-Google-Smtp-Source: APXvYqylnzsA4v1ZXG7NHhNZ7DnxpCTdLT4/jDQdZjkX1AMFzTm9S8IsGCNFhL5HR3Su/AFcwAkhqQ== X-Received: by 2002:a17:906:190f:: with SMTP id a15mr6218822eje.231.1551526613379; Sat, 02 Mar 2019 03:36:53 -0800 (PST) Received: from localhost ([136.206.5.71]) by smtp.gmail.com with ESMTPSA id h44sm275644edh.34.2019.03.02.03.36.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 02 Mar 2019 03:36:52 -0800 (PST) From: "Basil L. Contovounesios" To: Eli Zaretskii Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes Message-ID: <87sgw54jzx.fsf@tcd.ie> References: <87bm2yqyhj.fsf@tcd.ie> <877edmqy19.fsf@tcd.ie> <83imx2j3xn.fsf@gnu.org> <87d0naml7s.fsf@tcd.ie> <83mumdhgi8.fsf@gnu.org> Date: Sat, 02 Mar 2019 11:36:51 +0000 In-Reply-To: <83mumdhgi8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 2 Mar 2019 09:39:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 34671-done@debbugs.gnu.org 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: -1.0 (-) tags 34671 fixed close 34671 26.2 quit Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: <34671@debbugs.gnu.org> >> Date: Fri, 01 Mar 2019 19:46:31 +0000 >> >> Sorry, I don't have write access, so someone else will have to do that. > > Done. Thanks. >> BTW, is one expected to be a package author before it is acceptable to >> request write access, or is it a matter of amassing enough flight hours? > > The latter. I think you are there already, so feel free to create a > user on Savannah and then request write access. > >> >> The second patch enables lexical-binding in text-mode.el along with some >> >> minor aesthetic changes. >> > >> > I don't see the need for parts of this patch. Enabling >> > lexical-binding is OK, but it should be a separate change unrelated to >> > this bug report. >> >> Should I submit a new bug report for that, or message emacs-devel? > > The latter, I think, since the main issue here is how well was the > package tested after turning on lexical-binding. Thanks, will do (on both counts). >> > And I'm not sure I see the reason for the other changes, nor even >> > agree with them. In particular, please modify whitespace only where >> > you actually make other non-trivial changes. >> >> (Oops, looking back I accidentally mangled some Texinfo escape >> characters by copy-pasting.) >> >> I agree with this principle, but simply thought that a file-wide change >> like enabling lexical-binding was sufficient excuse for minor "cleanups" >> along the way. > > Not in such a sweeping manner. In general, only in the same > function/code fragment where you are making changes. > >> I assume the parts of the patch you're least keen on are: >> >> * lisp/textmodes/text-mode.el (text-mode-syntax-table): Align comments >> to comment-column. >> (toggle-text-mode-auto-fill): Hoist save-current-buffer out of loop. >> (center-region): Tiny simplification. >> >> but that you're okay with the following: >> >> * lisp/textmodes/text-mode.el: Use lexical-binding. >> (text-mode-map, text-mode): Refill docstring. >> (text-mode, paragraph-indent-minor-mode, text-mode-hook-identify): >> Use setq-local. >> (center-line): Tiny simplification. > > Refilling doc strings also caused me to raise a brow. IMO, that is > only justified if the original doc string is badly formatted, like has > overly-long lines, close to or longer than 80 columns. Otherwise, we > don't generally refill doc strings we don't change, we only make sure > they look well and read clearly on the screen. Fair enough, will be more careful in future. In my defence, I only refilled these two docstrings after adding an Oxford comma to text-mode-map and in order to avoid a leading space in text-mode. >> >> The last patch fulfils an old promise in the manual to eventually forgo >> >> setting indent-line-function in text-mode, which is considered >> >> redundant. >> > >> > What if the user customizes the default values, shouldn't text-mode >> > reset that in the buffer where it is turned on? >> >> I can think of two reasons for keeping the reset in text-mode: >> >> 0. If text-mode breaks when indent-line-function is set to anything >> other than indent-relative. >> >> I'm not sure, but I don't think this is the case, as I set the >> variable in text-mode-hook for a while without any noticeable >> fallout. >> >> 1. To avoid a user-visible change of behaviour with user configurations >> (like mine) which change the default global value of >> indent-line-function. >> >> The only reason (I can think of) to remove the reset is in order to >> fulfil the relevant promise in the manual. >> >> Keeping the reset is clearly less risky. I don't mind either way, so >> long as the side-note in the manual accurately reflects future >> intentions. > > Maybe we should make the change you propose, but it isn't clear-cut > and requires discussion in a separate bug report, or perhaps even on > emacs-devel. It certainly isn't cleanup. Agreed, will ask elsewhere, so I'm closing this ticket. Sorry for the hassle. Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 07:23:59 2019 Received: (at 34671) by debbugs.gnu.org; 2 Mar 2019 12:23:59 +0000 Received: from localhost ([127.0.0.1]:57037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h03gN-00029v-0a for submit@debbugs.gnu.org; Sat, 02 Mar 2019 07:23:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h03gL-00029i-8R for 34671@debbugs.gnu.org; Sat, 02 Mar 2019 07:23:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h03gE-0006XQ-L7; Sat, 02 Mar 2019 07:23:51 -0500 Received: from [176.228.60.248] (port=4132 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h03gE-0003bl-8F; Sat, 02 Mar 2019 07:23:50 -0500 Date: Sat, 02 Mar 2019 14:23:39 +0200 Message-Id: <83d0n9h3ck.fsf@gnu.org> From: Eli Zaretskii To: "Basil L. Contovounesios" In-reply-to: <87sgw54jzx.fsf@tcd.ie> (contovob@tcd.ie) Subject: Re: bug#34671: 27.0.50; Outdated code listings in (elisp) Example Major Modes References: <87bm2yqyhj.fsf@tcd.ie> <877edmqy19.fsf@tcd.ie> <83imx2j3xn.fsf@gnu.org> <87d0naml7s.fsf@tcd.ie> <83mumdhgi8.fsf@gnu.org> <87sgw54jzx.fsf@tcd.ie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34671 Cc: 34671@debbugs.gnu.org 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: -1.0 (-) > From: "Basil L. Contovounesios" > Cc: <34671-done@debbugs.gnu.org> > Date: Sat, 02 Mar 2019 11:36:51 +0000 > > Sorry for the hassle. No need to apologize, you did nothing that requires an apology. From unknown Sat Sep 13 02:39:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Mar 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator