From unknown Sun Jun 22 22:42:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13837 <13837@debbugs.gnu.org> To: bug#13837 <13837@debbugs.gnu.org> Subject: Status: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Reply-To: bug#13837 <13837@debbugs.gnu.org> Date: Mon, 23 Jun 2025 05:42:53 +0000 retitle 13837 24.2; Make it possible to turn whitespace-mode only when ther= e are no existing problems reassign 13837 emacs submitter 13837 Reuben Thomas severity 13837 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 27 16:44:45 2013 Received: (at submit) by debbugs.gnu.org; 27 Feb 2013 21:44:45 +0000 Received: from localhost ([127.0.0.1]:54096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAons-0007qz-3x for submit@debbugs.gnu.org; Wed, 27 Feb 2013 16:44:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59336) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAonn-0007qq-UU for submit@debbugs.gnu.org; Wed, 27 Feb 2013 16:44:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAolo-0002aO-9d for submit@debbugs.gnu.org; Wed, 27 Feb 2013 16:42:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-104.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAolo-0002ZR-6L for submit@debbugs.gnu.org; Wed, 27 Feb 2013 16:42:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAolX-00010Y-6c for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 16:42:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAolH-0002NO-EB for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 16:42:11 -0500 Received: from exprod7og106.obsmtp.com ([64.18.2.165]:38265) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1UAolG-0002G6-UZ for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 16:42:03 -0500 Received: from mail-lb0-f197.google.com ([209.85.217.197]) (using TLSv1) by exprod7ob106.postini.com ([64.18.6.12]) with SMTP ID DSNKUS59mWEXobptxGFDM8IRV+TF6qWekgcY@postini.com; Wed, 27 Feb 2013 13:42:02 PST Received: by mail-lb0-f197.google.com with SMTP id gg6so1310832lbb.8 for ; Wed, 27 Feb 2013 13:41:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:from:to:subject:date:message-id:mime-version :content-type:x-gm-message-state; bh=huc69VK243YUcyfqm2UfAU+MCiNglmNHXTFEFjusYGw=; b=WVE3r4vGNtbrXSXrUlkWuaYpurtckDesCYF5GbliqeZEjbdgSHCXYQLMCdqAyqmA9c Abvhf6XIIAmmLbMdMpFwZ8wmvxSiU7/sfYwmyUW6CkPV+r3K1szUEk/b4kiFoVA6VTMW PyT1QrDcowCK0uKQCM/A1ztfubHhop7rueWFYTAGXA89UPglSJ81M6RiNr1snScL0Dz0 LQufYwf8DgmYyVUrIPVqEYqufwebU7BpHpfixTWCkT30FOER5gWLgZ5LKinvEDGJpSRP OQK2wdBsxXt+S27Gaexy0LmRSb/ybse2oSG+TKhX+LeD7EJEWuuXZKW2UIKienUqGkHp 3iyQ== X-Received: by 10.181.13.175 with SMTP id ez15mr28886187wid.8.1362001303124; Wed, 27 Feb 2013 13:41:43 -0800 (PST) X-Received: by 10.181.13.175 with SMTP id ez15mr28886180wid.8.1362001303010; Wed, 27 Feb 2013 13:41:43 -0800 (PST) Received: from skwd ([149.241.115.91]) by mx.google.com with ESMTPS id j4sm29914512wiz.10.2013.02.27.13.41.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Feb 2013 13:41:42 -0800 (PST) From: Reuben Thomas To: bug-gnu-emacs@gnu.org Subject: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Date: Wed, 27 Feb 2013 21:41:41 +0000 Message-ID: <878v69fn8q.fsf@sc3d.org> MIME-Version: 1.0 Content-Type: text/plain X-Gm-Message-State: ALoCoQncziAOq/zNHJ628dNhbaQ/lhj0Ctxld1xIg3xifv6vZBMQYPpCudqJHQ+fI7rR2F4LsTSpxWzEohC+w0ABAnbvmYQk2ZId6BuuqqBh8RI3Y/RXO5PvargxqOdGidSnW/ouFiaevip1mT1+XUKPGf7gxAbzWbTTRJuDMYEJ2jDnhulyO5w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) I like global-whitespace-mode, but it has a downside: it keeps activating in files that have whitespace problems, but which don't belong to me, so I don't want to fix them. Typically I want to make a small edit to someone else's code, and they, entirely reasonably, don't want a big diff. The following code implements a solution to that, which is to check if the buffer is whitespace-clean before activating whitespace-mode. Unfortunately, my current solution is non-optional: it requires modifying whitespace-turn-on-if-enabled. This could be fixed, for example by adding a preference. The other part of the solution is easier to integrate: I've factored out part of whitespace-report-region into whitespace-test-region, in a way which is easy to use to implement whitespace-report-region. If maintainers are interested in adding this feature, I'd be happy to take guidance on how to modify my code into a patch (currently it just sits in my .emacs). ;; Make whitespace-turn-on-if-enabled to turn on only if no ;; whitespace problems in current buffer. (require 'whitespace) (defun whitespace-test-region (start end) "Find whether there are whitespace problems in a region. Return nil if there is no whitespace problem; otherwise, return non-nil. A whitespace problem is one of the following: * If `indent-tabs-mode' is non-nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. 8 or more SPACEs at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. * If `indent-tabs-mode' is nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. TABS at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for cleaning up these problems." (save-excursion (save-match-data ;FIXME: Why? (let* ((has-bogus nil) (rstart (min start end)) (rend (max start end)) (bogus-list (mapcar #'(lambda (option) (when force (add-to-list 'whitespace-style (car option))) (goto-char rstart) (let ((regexp (cond ((eq (car option) 'indentation) (whitespace-indentation-regexp)) ((eq (car option) 'indentation::tab) (whitespace-indentation-regexp 'tab)) ((eq (car option) 'indentation::space) (whitespace-indentation-regexp 'space)) ((eq (car option) 'space-after-tab) (whitespace-space-after-tab-regexp)) ((eq (car option) 'space-after-tab::tab) (whitespace-space-after-tab-regexp 'tab)) ((eq (car option) 'space-after-tab::space) (whitespace-space-after-tab-regexp 'space)) (t (cdr option))))) (and (re-search-forward regexp rend t) (setq has-bogus t)))) whitespace-report-list))) has-bogus)))) (defun whitespace-turn-on-if-enabled () (when (cond ((eq whitespace-global-modes t)) ((listp whitespace-global-modes) (if (eq (car-safe whitespace-global-modes) 'not) (not (memq major-mode (cdr whitespace-global-modes))) (memq major-mode whitespace-global-modes))) (t nil)) (let (inhibit-quit) ;; Don't turn on whitespace mode if... (or ;; ...we don't have a display (we're running a batch job) noninteractive ;; ...or if the buffer is invisible (name starts with a space) (eq (aref (buffer-name) 0) ?\ ) ;; ...or if the buffer is temporary (name starts with *) (and (eq (aref (buffer-name) 0) ?*) ;; except the scratch buffer. (not (string= (buffer-name) "*scratch*"))) ;; Otherwise, turn on whitespace mode. (whitespace-find-problems-region (point-min) (point-max)) (whitespace-turn-on))))) In GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.13) of 2012-12-13 on komainu, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11300000 Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: recentf-mode: t show-paren-mode: t server-mode: t savehist-mode: t minibuffer-electric-default-mode: t iswitchb-mode: t icomplete-mode: t global-whitespace-mode: t global-auto-revert-mode: t dtrt-indent-mode: t desktop-save-mode: t TeX-PDF-mode: t TeX-source-correlate-mode: t tooltip-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 column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: SPC SPC C-x C-s C-x k C-x k C-x b C-x b C-s C-a C-] C-] C-] C-x b f u n s C-a C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-g C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n M a k e C-x C-s C-a C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p M-w M-x r e p o r t - b e m a c s - b u g Recent messages: Saving file /home/rrt/Software/hacked/cw/bar.c... Wrote /home/rrt/Software/hacked/cw/bar.c Quit call-interactively: No recursive edit is in progress [2 times] Mark set Quit Saving file /home/rrt/.emacs.d/funs.el... Wrote /home/rrt/.emacs.d/funs.el Mark activated Saved text from ";; Make whitespace-turn-on-if-enabled to" Load-path shadows: /home/rrt/local/share/emacs/site-lisp/browse-kill-ring hides /usr/share/emacs24/site-lisp/emacs-goodies-el/browse-kill-ring /home/rrt/local/share/emacs/site-lisp/dict hides /usr/share/emacs24/site-lisp/emacs-goodies-el/dict /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary-init hides /usr/share/emacs24/site-lisp/dictionary-el/dictionary-init /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary hides /usr/share/emacs24/site-lisp/dictionary-el/dictionary /home/rrt/.emacs.d/elpa/dictionary-1.8.7/link hides /usr/share/emacs24/site-lisp/dictionary-el/link /home/rrt/.emacs.d/elpa/dictionary-1.8.7/connection hides /usr/share/emacs24/site-lisp/dictionary-el/connection /usr/share/emacs24/site-lisp/auctex/tex-style hides /usr/share/emacs/site-lisp/auctex/tex-style /usr/share/emacs24/site-lisp/auctex/tex-mik hides /usr/share/emacs/site-lisp/auctex/tex-mik /usr/share/emacs24/site-lisp/auctex/multi-prompt hides /usr/share/emacs/site-lisp/auctex/multi-prompt /usr/share/emacs24/site-lisp/auctex/tex-jp hides /usr/share/emacs/site-lisp/auctex/tex-jp /usr/share/emacs24/site-lisp/auctex/tex-info hides /usr/share/emacs/site-lisp/auctex/tex-info /usr/share/emacs24/site-lisp/auctex/plain-tex hides /usr/share/emacs/site-lisp/auctex/plain-tex /usr/share/emacs24/site-lisp/auctex/latex hides /usr/share/emacs/site-lisp/auctex/latex /usr/share/emacs24/site-lisp/auctex/preview hides /usr/share/emacs/site-lisp/auctex/preview /usr/share/emacs24/site-lisp/auctex/tex hides /usr/share/emacs/site-lisp/auctex/tex /usr/share/emacs24/site-lisp/auctex/texmathp hides /usr/share/emacs/site-lisp/auctex/texmathp /usr/share/emacs24/site-lisp/auctex/context-nl hides /usr/share/emacs/site-lisp/auctex/context-nl /usr/share/emacs24/site-lisp/auctex/tex-font hides /usr/share/emacs/site-lisp/auctex/tex-font /usr/share/emacs24/site-lisp/auctex/toolbar-x hides /usr/share/emacs/site-lisp/auctex/toolbar-x /usr/share/emacs24/site-lisp/auctex/tex-buf hides /usr/share/emacs/site-lisp/auctex/tex-buf /usr/share/emacs24/site-lisp/auctex/bib-cite hides /usr/share/emacs/site-lisp/auctex/bib-cite /usr/share/emacs24/site-lisp/auctex/context-en hides /usr/share/emacs/site-lisp/auctex/context-en /usr/share/emacs24/site-lisp/auctex/tex-fold hides /usr/share/emacs/site-lisp/auctex/tex-fold /usr/share/emacs24/site-lisp/auctex/tex-bar hides /usr/share/emacs/site-lisp/auctex/tex-bar /usr/share/emacs24/site-lisp/auctex/context hides /usr/share/emacs/site-lisp/auctex/context /usr/share/emacs24/site-lisp/auctex/prv-emacs hides /usr/share/emacs/site-lisp/auctex/prv-emacs /usr/share/emacs24/site-lisp/auctex/font-latex hides /usr/share/emacs/site-lisp/auctex/font-latex /usr/share/emacs/site-lisp/golang-mode/go-mode-load hides /usr/share/emacs/24.2/site-lisp/golang-mode/go-mode-load /usr/share/emacs/site-lisp/golang-mode/go-mode hides /usr/share/emacs/24.2/site-lisp/golang-mode/go-mode /usr/share/emacs/24.2/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode /usr/share/emacs/24.2/site-lisp/cdargs hides /usr/share/emacs/site-lisp/cdargs /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.2/lisp/textmodes/rst /usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.2/lisp/textmodes/ispell /usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.2/lisp/textmodes/flyspell /home/rrt/local/share/emacs/site-lisp/flymake hides /usr/share/emacs/24.2/lisp/progmodes/flymake Features: (shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils find-func help-mode view cperl-mode sh-script executable nroff-mode conf-mode newcomment misearch multi-isearch jka-compr rect todoo noutline outline lua-mode autoconf autoconf-mode make-mode vc-git cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs flymake compile comint ansi-color ring face-remap flyspell ispell smart-quotes auto-dictionary-autoloads c-eldoc-autoloads dictionary-autoloads diff-git-autoloads dired-isearch-autoloads full-ack-autoloads guess-style-autoloads kill-ring-search-autoloads magit-autoloads mv-shell-autoloads tumble-autoloads http-post-simple-autoloads package tabulated-list completing-help recentf tree-widget wid-edit uniquify paren server savehist minibuf-eldef iswitchb icomplete whitespace autorevert dtrt-indent desktop cus-start cus-load ropemacs pymacs warnings url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cconv macroexp gnus-util password-cache url-vars mm-util mail-prsvr tex dbus xml regexp-opt remember user-site-loaddefs advice advice-preload yasnippet help-fns derived edmacro kmacro easymenu assoc cl muse-autoloads go-mode-load emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode preview-latex tex-site auto-loads time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- http://rrt.sc3d.org/ From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 27 21:02:46 2013 Received: (at 13837) by debbugs.gnu.org; 28 Feb 2013 02:02:46 +0000 Received: from localhost ([127.0.0.1]:54571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAspY-0005dp-KD for submit@debbugs.gnu.org; Wed, 27 Feb 2013 21:02:46 -0500 Received: from exprod7og104.obsmtp.com ([64.18.2.161]:47441) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UAspS-0005dc-5Q for 13837@debbugs.gnu.org; Wed, 27 Feb 2013 21:02:43 -0500 Received: from mail-bk0-f70.google.com ([209.85.214.70]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKUS66S1ezpB7JUkTJOPFjq5RBIIDmmQ93@postini.com; Wed, 27 Feb 2013 18:00:44 PST Received: by mail-bk0-f70.google.com with SMTP id jk7so1411051bkc.5 for <13837@debbugs.gnu.org>; Wed, 27 Feb 2013 18:00:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=JahKEHzfv0aOn2C+QZGsrvHL2YyRpW6Iq80q49euRs0=; b=VeGcgEt6sHGkPSc/eaMGC80GnRfCGscUY6ZTZ4HQ3umRFczXpVq0G2QQmuBSzTdvg3 kuFk2pXPY9lHnReUs5YDDohfiqGSshoPt77/j4NDUDY3Hg7bd8OCQMVv+INKf7GYTG5J 4wrWks608kPyrLxpvO73RHPAsznTWmAzrbplbresftK6GDY5PhNwICv/usRv8ElliKlJ CDHcLvyOuOVRojsM4iqpJdUo0h1Xhs53XoFSLuXKGC70AHPkqwIJoaWvDwWUCFfNVQhr OqMU4zyD3eovLIMM94PkI4D9FcEKEsl6b5l5dbir5NiCHaUlgH3t0rgCgYkc5FAjaCrY FPlg== X-Received: by 10.112.88.5 with SMTP id bc5mr2911644lbb.50.1362016841827; Wed, 27 Feb 2013 18:00:41 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.88.5 with SMTP id bc5mr2911641lbb.50.1362016841646; Wed, 27 Feb 2013 18:00:41 -0800 (PST) Received: by 10.152.5.40 with HTTP; Wed, 27 Feb 2013 18:00:41 -0800 (PST) Date: Thu, 28 Feb 2013 02:00:41 +0000 Message-ID: Subject: Update to code From: Reuben Thomas To: 13837@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnNfOva+lppER6OPbvDMaSVchzHeUmhxkQPYh3vBb8GfnX7p3VRfRUgZpk4Zgedd9IGhcyV1ABSIH0Fq968zn/sKr0KVRG/fMahX0l2xrMb7XtztqinaQ/lEqIRf3avzARAYIOkXHu3DvHexT3JxacnefWg9IiMeVMaq/3oe5ASn1x3+Wg= X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13837 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Apologies, the original code posted contained two lines which shouldn't've been there, mentioning a non-existent "force" parameter to whitespace-test-region. The function should read: (defun whitespace-test-region (start end) "Find whether there are whitespace problems in a region. Return nil if there is no whitespace problem; otherwise, return non-nil. A whitespace problem is one of the following: * If `indent-tabs-mode' is non-nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. 8 or more SPACEs at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. * If `indent-tabs-mode' is nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. TABS at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for cleaning up these problems." (save-excursion (save-match-data ;FIXME: Why? (let* ((has-bogus nil) (rstart (min start end)) (rend (max start end)) (bogus-list (mapcar #'(lambda (option) (goto-char rstart) (let ((regexp (cond ((eq (car option) 'indentation) (whitespace-indentation-regexp)) ((eq (car option) 'indentation::tab) (whitespace-indentation-regexp 'tab)) ((eq (car option) 'indentation::space) (whitespace-indentation-regexp 'space)) ((eq (car option) 'space-after-tab) (whitespace-space-after-tab-regexp)) ((eq (car option) 'space-after-tab::tab) (whitespace-space-after-tab-regexp 'tab)) ((eq (car option) 'space-after-tab::space) (whitespace-space-after-tab-regexp 'space)) (t (cdr option))))) (and (re-search-forward regexp rend t) (setq has-bogus t)))) whitespace-report-list))) has-bogus)))) -- http://rrt.sc3d.org From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 11:25:35 2013 Received: (at 13837) by debbugs.gnu.org; 28 Feb 2013 16:25:36 +0000 Received: from localhost ([127.0.0.1]:56387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB6IY-0002PT-Sb for submit@debbugs.gnu.org; Thu, 28 Feb 2013 11:25:35 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:23261) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB6IW-0002PL-2K for 13837@debbugs.gnu.org; Thu, 28 Feb 2013 11:25:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpaTU/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJC6HcAbBLZEKA4hhnBmBXoMVgUgk X-IPAS-Result: Av8EABK/CFFFpaTU/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJC6HcAbBLZEKA4hhnBmBXoMVgUgk X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2694313" Received: from 69-165-164-212.dsl.teksavvy.com (HELO pastel.home) ([69.165.164.212]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 28 Feb 2013 11:23:32 -0500 Received: by pastel.home (Postfix, from userid 20848) id BC98E6BDCD; Thu, 28 Feb 2013 11:23:33 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> Date: Thu, 28 Feb 2013 11:23:33 -0500 In-Reply-To: <878v69fn8q.fsf@sc3d.org> (Reuben Thomas's message of "Wed, 27 Feb 2013 21:41:41 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Unfortunately, my current solution is non-optional: it requires > modifying whitespace-turn-on-if-enabled. This could be fixed, for > example by adding a preference. Indeed. I suggest to add a whitespace-enable-predicate hook. Then you can do (defun whitespace-check-cleanliness () (not (whitespace-test-region (point-min) (point-max)))) (add-function :after-while whitespace-enable-predicate #'whitespace-check-cleanliness) > If maintainers are interested in adding this feature, I'd be happy to > take guidance on how to modify my code into a patch (currently it just > sits in my .emacs). You can start with the patch below, and refactor the whitespace-report-region so as to provide whitespace-test-region. Your .emacs can then be reduced to the above 4 lines, and if you add the whitespace-check-cleanliness function to whitespace.el that gets reduced to just 2 lines. Stefan === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2013-01-11 23:08:55 +0000 +++ lisp/whitespace.el 2013-02-28 16:19:01 +0000 @@ -1145,29 +1145,31 @@ (unless whitespace-mode (whitespace-turn-off))))))) - -(defun whitespace-turn-on-if-enabled () - (when (cond +(defvar whitespace-enable-predicate + (lambda () + (and (cond ((eq whitespace-global-modes t)) ((listp whitespace-global-modes) (if (eq (car-safe whitespace-global-modes) 'not) (not (memq major-mode (cdr whitespace-global-modes))) (memq major-mode whitespace-global-modes))) (t nil)) - (let (inhibit-quit) - ;; Don't turn on whitespace mode if... - (or - ;; ...we don't have a display (we're running a batch job) - noninteractive - ;; ...or if the buffer is invisible (name starts with a space) - (eq (aref (buffer-name) 0) ?\ ) - ;; ...or if the buffer is temporary (name starts with *) - (and (eq (aref (buffer-name) 0) ?*) + ;; ...we have a display (we're running a batch job) + (not noninteractive) + ;; ...the buffer is not internal (name starts with a space) + (not (eq (aref (buffer-name) 0) ?\ )) + ;; ...the buffer is not special (name starts with *) + (or (not (eq (aref (buffer-name) 0) ?*)) ;; except the scratch buffer. - (not (string= (buffer-name) "*scratch*"))) - ;; Otherwise, turn on whitespace mode. - (whitespace-turn-on))))) + (string= (buffer-name) "*scratch*")))) + "Predicate to decide which buffers obey `global-whitespace-mode'. +This function is called with no argument and should return non-nil +if the current buffer should obey `global-whitespace-mode'. +This variable is normally modified via `add-function'.") +(defun whitespace-turn-on-if-enabled () + (when (funcall whitespace-enable-predicate) + (whitespace-turn-on))) ;;;###autoload (define-minor-mode global-whitespace-newline-mode From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 11:34:21 2013 Received: (at 13837) by debbugs.gnu.org; 28 Feb 2013 16:34:21 +0000 Received: from localhost ([127.0.0.1]:56400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB6R2-0002cz-Hg for submit@debbugs.gnu.org; Thu, 28 Feb 2013 11:34:21 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:63603) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB6R1-0002cs-5I for 13837@debbugs.gnu.org; Thu, 28 Feb 2013 11:34:19 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpaTU/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSSIJMEtkQoDiGGcGYFegxU X-IPAS-Result: Av4EABK/CFFFpaTU/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSSIJMEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2695105" Received: from 69-165-164-212.dsl.teksavvy.com (HELO pastel.home) ([69.165.164.212]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 28 Feb 2013 11:32:20 -0500 Received: by pastel.home (Postfix, from userid 20848) id 595746BDCD; Thu, 28 Feb 2013 11:32:21 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> Date: Thu, 28 Feb 2013 11:32:21 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 28 Feb 2013 11:23:33 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > (add-function :after-while whitespace-enable-predicate > #'whitespace-check-cleanliness) Sorry, this should be (add-function :after-while (default-value 'whitespace-enable-predicate) #'whitespace-check-cleanliness) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 17:04:10 2013 Received: (at 13837) by debbugs.gnu.org; 1 Mar 2013 22:04:10 +0000 Received: from localhost ([127.0.0.1]:58687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBY3m-0005s1-84 for submit@debbugs.gnu.org; Fri, 01 Mar 2013 17:04:10 -0500 Received: from exprod7og103.obsmtp.com ([64.18.2.159]:56288) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UBY3j-0005rs-1c for 13837@debbugs.gnu.org; Fri, 01 Mar 2013 17:04:08 -0500 Received: from mail-ee0-f70.google.com ([74.125.83.70]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKUTElWSeSCgu5NslKsjs13JIAi3JWFk9r@postini.com; Fri, 01 Mar 2013 14:02:03 PST Received: by mail-ee0-f70.google.com with SMTP id l10so4263766eei.5 for <13837@debbugs.gnu.org>; Fri, 01 Mar 2013 14:02:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=p+glFYVn9+uefjV3jLe3kQ+98yHsMDGgUlAsK68UjQs=; b=agmdWTKFii2PI8jWnGWm6PplAdn1Beg8PAPqTQ69MO97TLDGyQfMRW09Z0zcq7ka8+ urMIn5O7+TihY6cF2xpXnXARcm+Xt2YtV66J5SqIqycAxTdiyYbwTtAQ4A97rHXovE8h PW7vrTz+kYap5qnmLlR0UOMWauVieVvW82S83liMoiTvSjXfeIukNoEvflKi4cwYmNZp Rc6yiKcjBSbyjlYCcCDtJjvcVuW1/qx2WX/SaE8+7SHDtDKr4DKQR/s+D6Pp1+YPISTz Jaei3boQooHykSK26AIPvkFqF+svTPXMzyhRj4FJpU6QSHNWnqtoCxJJkUek3dOWISRr KsSA== X-Received: by 10.112.13.162 with SMTP id i2mr1300646lbc.105.1362175320470; Fri, 01 Mar 2013 14:02:00 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.13.162 with SMTP id i2mr1300644lbc.105.1362175320325; Fri, 01 Mar 2013 14:02:00 -0800 (PST) Received: by 10.152.5.40 with HTTP; Fri, 1 Mar 2013 14:02:00 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Fri, 1 Mar 2013 22:02:00 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmkmpSmmpRYGRHTOGO1QT98FdE95YUu1mRKSU8AWZp5SA4qmM0EMnE2vtjjWsxbR+o/ujfLfj1bGs7ILA1c8Jd4IJayZaPdPUdyhI+rp4kSu3QLHXZT9mm3NEJ3HT0uIfXua2+8qmmr2FpLoASl5WDQBD0jk0u5rH4b0Aer5zXCge5qqIk= X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 28 February 2013 16:32, Stefan Monnier wrote: >> (add-function :after-while whitespace-enable-predicate >> #'whitespace-check-cleanliness) > > Sorry, this should be > > (add-function :after-while (default-value 'whitespace-enable-predicate) > #'whitespace-check-cleanliness) Emacs 24 doesn't seem to have add-function; copying nadvice.el into my site-lisp directory seems to take me down the gv-ref rabbit hole (in the sense that I tried installing it into Emacs 24 before and found I was just copying more and more stuff from master). Do you have an old-fashioned alternative? (Sorry, I only tried advice for the first time, while trying to do the above hack more neatly.) -- http://rrt.sc3d.org From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 17:23:51 2013 Received: (at 13837) by debbugs.gnu.org; 1 Mar 2013 22:23:51 +0000 Received: from localhost ([127.0.0.1]:58706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBYMo-0006MB-Vv for submit@debbugs.gnu.org; Fri, 01 Mar 2013 17:23:51 -0500 Received: from exprod7og104.obsmtp.com ([64.18.2.161]:60799) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UBYMm-0006M2-8j for 13837@debbugs.gnu.org; Fri, 01 Mar 2013 17:23:49 -0500 Received: from mail-fa0-f71.google.com ([209.85.161.71]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKUTEp95DM7AB82mqSwvPYmnmHNYh8etGX@postini.com; Fri, 01 Mar 2013 14:21:43 PST Received: by mail-fa0-f71.google.com with SMTP id t1so4232365fae.10 for <13837@debbugs.gnu.org>; Fri, 01 Mar 2013 14:21:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=/bbT8rzj9XKdnIlAZj9/7OEo6+GSaFCTL9dsgSdNxBE=; b=e/0Gk5JfBS/6zQpYhN49QDCU2Pgwzd0xvW/X5xATXUoz5MhuppZDyiwJ8DQ8Pe7njo 4dTpVe/iuZbScuIrKuFUTNNvdaiL+EVNBu4ZouSUsar/dgrwqugPJugIBGR1abTcOjvR IOolvw/1PBAHFnS1HJJ2+ZxSzapPK/oOP9IM8YB5WKR8u5l9k0qsSTPS4LTYBNv5g5cG WTsHW/Fa/MfjI3z6HXuCAk6b9p3KmsRfnwIUm/bSg8BwHAusmApvQBqN/MCSMFr8DEjW iAurmj26Uw/dXRlRSWocRiqlpNSC5UoVCcRrYlia7dX0fevVHgVvuIfbMKzlP82kk/jQ D4GQ== X-Received: by 10.152.109.112 with SMTP id hr16mr10560163lab.38.1362176501610; Fri, 01 Mar 2013 14:21:41 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.109.112 with SMTP id hr16mr10560158lab.38.1362176501464; Fri, 01 Mar 2013 14:21:41 -0800 (PST) Received: by 10.152.5.40 with HTTP; Fri, 1 Mar 2013 14:21:41 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Fri, 1 Mar 2013 22:21:41 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlBKf6gLalDsXlpnS1lfzExEABlTgEibpuTV9gM4DdOj5UK5IOHQqhmEaj8F6KHXDASndG8G/gck7RuK+pVUCeFVbb6KCD5a/bun3VIuFOT8Yjok9onlvyDL6oUy0jCtR6QfERJXW8enL5XXABlc44yYvT2CuDG9xowtiEMTqTHZDeUlmM= X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 28 February 2013 16:23, Stefan Monnier wrote: > > You can =85 refactor the > whitespace-report-region so as to provide whitespace-test-region. Here's an attempt at that: (defun whitespace-test-region (start end) "Find whether there are whitespace problems in a region. Return a list of whitespace problems (hence, nil if there is no whitespace problem). A whitespace problem is one of the following: * If `indent-tabs-mode' is non-nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. 8 or more SPACEs at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. * If `indent-tabs-mode' is nil: empty 1. empty lines at beginning of buffer. empty 2. empty lines at end of buffer. trailing 3. SPACEs or TABs at end of line. indentation 4. TABS at beginning of line. space-before-tab 5. SPACEs before TAB. space-after-tab 6. 8 or more SPACEs after TAB. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for cleaning up these problems." (save-excursion (save-match-data ;FIXME: Why? (let* ((has-bogus nil) (rstart (min start end)) (rend (max start end)) (bogus-list (mapcar #'(lambda (option) (goto-char rstart) (let ((regexp (cond ((eq (car option) 'indentation) (whitespace-indentation-regexp)) ((eq (car option) 'indentation::tab) (whitespace-indentation-regexp 'tab)) ((eq (car option) 'indentation::space) (whitespace-indentation-regexp 'space)) ((eq (car option) 'space-after-tab) (whitespace-space-after-tab-regexp)) ((eq (car option) 'space-after-tab::tab) (whitespace-space-after-tab-regexp 'tab)) ((eq (car option) 'space-after-tab::space) (whitespace-space-after-tab-regexp 'space)) (t (cdr option))))) (and (re-search-forward regexp rend t) t))) whitespace-report-list))) bogus-list)))) (defun whitespace-report-region (start end &optional force report-if-bogus) "Report some whitespace problems in a region. Return nil if there is no whitespace problem; otherwise, return non-nil. If FORCE is non-nil or \\[universal-argument] was pressed just before calling `whitespace-report-region' interactively, it forces `whitespace-style' to have: empty indentation space-before-tab trailing space-after-tab If REPORT-IF-BOGUS is non-nil, it reports only when there are any whitespace problems in buffer. For a description of whitespace problems, see `whitespace-test-region'." (interactive "r") (setq force (or current-prefix-arg force)) (save-excursion (let ((bogus-list (whitespace-test-region start end))) (when (if report-if-bogus bogus-list t) (whitespace-kill-buffer whitespace-report-buffer-name) ;; `whitespace-indent-tabs-mode' is local to current buffer ;; `whitespace-tab-width' is local to current buffer (let ((ws-indent-tabs-mode whitespace-indent-tabs-mode) (ws-tab-width whitespace-tab-width)) (with-current-buffer (get-buffer-create whitespace-report-buffer-name) (erase-buffer) (insert (if ws-indent-tabs-mode (car whitespace-report-text) (cdr whitespace-report-text))) (goto-char (point-min)) (forward-line 3) (dolist (option whitespace-report-list) (forward-line 1) (whitespace-mark-x 27 (memq (car option) whitespace-style)) (whitespace-mark-x 7 (car bogus-list)) (setq bogus-list (cdr bogus-list))) (forward-line 1) (whitespace-insert-value ws-indent-tabs-mode) (whitespace-insert-value ws-tab-width) (when bogus-list (goto-char (point-max)) (insert " Type `M-x whitespace-cleanup'" " to cleanup the buffer.\n\n" " Type `M-x whitespace-cleanup-region'" " to cleanup a region.\n\n")) (whitespace-display-window (current-buffer))))) (null bogus-list)))) From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 22:01:17 2013 Received: (at 13837) by debbugs.gnu.org; 2 Mar 2013 03:01:17 +0000 Received: from localhost ([127.0.0.1]:54284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBchI-0005x2-G4 for submit@debbugs.gnu.org; Fri, 01 Mar 2013 22:01:16 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:2974) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBchG-0005we-95 for 13837@debbugs.gnu.org; Fri, 01 Mar 2013 22:01:14 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlQJABK/CFFFpaTU/2dsb2JhbABEhke3RAQEexdzgh4BAQQBIzMjEAsODAIYBwcCAhQYDSSIHgauX5JOgSOOVIETA4hhnBmBXoMV X-IPAS-Result: AlQJABK/CFFFpaTU/2dsb2JhbABEhke3RAQEexdzgh4BAQQBIzMjEAsODAIYBwcCAhQYDSSIHgauX5JOgSOOVIETA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2841782" Received: from 69-165-164-212.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.164.212]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 01 Mar 2013 22:01:05 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 2CD30AE1AA; Fri, 1 Mar 2013 22:01:07 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> Date: Fri, 01 Mar 2013 22:01:07 -0500 In-Reply-To: (Reuben Thomas's message of "Fri, 1 Mar 2013 22:21:41 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) >> You can =E2=80=A6 refactor the >> whitespace-report-region so as to provide whitespace-test-region. > Here's an attempt at that: Can you please (re)send it as a patch? Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 01 22:02:37 2013 Received: (at 13837) by debbugs.gnu.org; 2 Mar 2013 03:02:37 +0000 Received: from localhost ([127.0.0.1]:54288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBcib-0005ys-6Z for submit@debbugs.gnu.org; Fri, 01 Mar 2013 22:02:37 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:43610) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBciZ-0005yf-5d for 13837@debbugs.gnu.org; Fri, 01 Mar 2013 22:02:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpaTU/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSQuh3bBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFFpaTU/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSQuh3bBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2841825" Received: from 69-165-164-212.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.164.212]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 01 Mar 2013 22:02:27 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id A1A7AAE1AA; Fri, 1 Mar 2013 22:02:28 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> Date: Fri, 01 Mar 2013 22:02:28 -0500 In-Reply-To: (Reuben Thomas's message of "Fri, 1 Mar 2013 22:02:00 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> (add-function :after-while (default-value 'whitespace-enable-predicate) >> #'whitespace-check-cleanliness) > Emacs 24 doesn't seem to have add-function; We're talking about changing whitespace.el, so I take it for granted that this can be a "trunk-only" solution. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 02:46:43 2013 Received: (at 13837) by debbugs.gnu.org; 2 Mar 2013 07:46:43 +0000 Received: from localhost ([127.0.0.1]:54555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBh9W-0004D2-5q for submit@debbugs.gnu.org; Sat, 02 Mar 2013 02:46:42 -0500 Received: from exprod7og120.obsmtp.com ([64.18.2.18]:50680) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UBh9R-0004Cq-2t for 13837@debbugs.gnu.org; Sat, 02 Mar 2013 02:46:38 -0500 Received: from mail-wi0-f199.google.com ([209.85.212.199]) (using TLSv1) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKUTGuWZjtZc7izd/lp+/+RldLrLdDe1tA@postini.com; Fri, 01 Mar 2013 23:46:34 PST Received: by mail-wi0-f199.google.com with SMTP id hq4so363216wib.10 for <13837@debbugs.gnu.org>; Fri, 01 Mar 2013 23:46:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=ds/WmGXl0iIwFv0Weu2ZyJcxxsztMDO92mrN5dDV5cM=; b=Iyt22gj5qeLq/ZXhsGXXqtybtLAVX7UCuBlH5gftpI3Zapz9PJG7N4hsj8P4FcCXa/ kxGpnFq0JyH/daKuZxZs/y7lZ2Ot3qOtslV3YYgC4ZuPJyejlRyamSJDZZ5sZ0v3nk/Y 1d49PwRQaJ5KNj86bhsSUloy1J9OQHCOsWJG3cZAplvPJiejo51dA509bmMU5Q/+cX5F 3oYHPn9gLUj9Yw8LG6K5itIQQ3iCHo14n6M71eTz3yv+QFrrBvArniuZiFeBcb9ZRUkD GuhY+wtvJkytGk/lplKZiS6ViRJ1guQ83/wij7xYmZFG3rb8Djp3MNJnEx2kAY8Pc3SJ JokQ== X-Received: by 10.152.130.131 with SMTP id oe3mr11416833lab.1.1362210392214; Fri, 01 Mar 2013 23:46:32 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.130.131 with SMTP id oe3mr11416826lab.1.1362210392089; Fri, 01 Mar 2013 23:46:32 -0800 (PST) Received: by 10.152.5.40 with HTTP; Fri, 1 Mar 2013 23:46:31 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Sat, 2 Mar 2013 07:46:31 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkL+cvYxBw1dygw2maywuc/RQh2IJuh0Ullg6XflXUHbqfrSac6Rfme2pI9EnCNfVmF8TX7fk/uVSS9NOmFN23Zi0QGi9XznuWcfa7YVmpoe0LpZNpt0UrQCFskERxUuEFP+w8BMPcVEQ+VG30OqBgyMROqK8TccgfE6JmQuvQYJcZpdRA= X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 2 March 2013 03:02, Stefan Monnier wrote: >>> (add-function :after-while (default-value 'whitespace-enable-predicate) >>> #'whitespace-check-cleanliness) >> Emacs 24 doesn't seem to have add-function; > > We're talking about changing whitespace.el, so I take it for granted > that this can be a "trunk-only" solution. This was a bit of code you suggested putting in my .emacs, not patching whitespace.el. If possible, I'd like something I can use today with Emacs 24. -- http://rrt.sc3d.org From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 02:49:44 2013 Received: (at 13837) by debbugs.gnu.org; 2 Mar 2013 07:49:44 +0000 Received: from localhost ([127.0.0.1]:54559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBhCR-0004HH-JA for submit@debbugs.gnu.org; Sat, 02 Mar 2013 02:49:44 -0500 Received: from exprod7og107.obsmtp.com ([64.18.2.167]:60288) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UBhCN-0004H8-8F for 13837@debbugs.gnu.org; Sat, 02 Mar 2013 02:49:41 -0500 Received: from mail-wi0-f198.google.com ([209.85.212.198]) (using TLSv1) by exprod7ob107.postini.com ([64.18.6.12]) with SMTP ID DSNKUTGvDzY863+BDSdzJb5cN0CHVWD6uIEE@postini.com; Fri, 01 Mar 2013 23:49:36 PST Received: by mail-wi0-f198.google.com with SMTP id hm6so365752wib.5 for <13837@debbugs.gnu.org>; Fri, 01 Mar 2013 23:49:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=eYNrVxK5/LKEvtldLEAKL4JHSwDF7fTiOvPgcyFx6rQ=; b=D/aIkKYXyeKc6wrDEo1w9takCup0nSnvV8BiNzooLjJ+GDi+PVkRSPgIJ+ZME9D4cd UGW9kcFR7uQRtMkaHYobS9fV04nkFPmMUvRS9kq6EDrOl0gk114tlkW0fGcHGfZ/hlw0 l8PNeh6G1CUaGt0t+NV4vXJSWbO0QaFqKz+Hri1nM6zPoDoF2HEvwDrGAsqNMcmT+6L9 tVbH8VgcnPP7HT5DyPFcVVBReDyo9zv/U7KKA7NRMuM5FUZpvFy2Ssff9E04Um8jFRVk eshTeSDOvNeATN2aoIsuaBxSEMBDpLEx3SQupSJgwkbRxRKckXMVEWG1BvVVr1xM3n7U Dwww== X-Received: by 10.152.146.199 with SMTP id te7mr11393673lab.23.1362210575583; Fri, 01 Mar 2013 23:49:35 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.146.199 with SMTP id te7mr11393666lab.23.1362210575469; Fri, 01 Mar 2013 23:49:35 -0800 (PST) Received: by 10.152.5.40 with HTTP; Fri, 1 Mar 2013 23:49:35 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Sat, 2 Mar 2013 07:49:35 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQm4eP2B0Zz/i7LifTAAdzdWNLqxxqo2uDBJ740oYfC4L5mipiaiAWPU+KuCExLPw0wqnJ3XnYLZ+TPXuXn1YhctN1xKte/JoRrUMjzufWmfSj5gAy6x9m9dxC71osUf+7iYj+uoumy//1lNP3la37ucUjMdmRhw7RT9jheLflckDHbLaSk= X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 2 March 2013 03:01, Stefan Monnier wrote: >>> You can =85 refactor the >>> whitespace-report-region so as to provide whitespace-test-region. >> Here's an attempt at that: > > Can you please (re)send it as a patch? Sure: =3D=3D=3D modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2013-01-11 23:08:55 +0000 +++ lisp/whitespace.el 2013-03-02 07:47:43 +0000 @@ -1821,6 +1821,64 @@ ;;;###autoload +(defun whitespace-test-region (start end) + "Find whether there are whitespace problems in a region. + +Return a list of whitespace problems (hence, nil if there is no +whitespace problem). + +A whitespace problem is one of the following: + +* If `indent-tabs-mode' is non-nil: + empty 1. empty lines at beginning of buffer. + empty 2. empty lines at end of buffer. + trailing 3. SPACEs or TABs at end of line. + indentation 4. 8 or more SPACEs at beginning of line. + space-before-tab 5. SPACEs before TAB. + space-after-tab 6. 8 or more SPACEs after TAB. + +* If `indent-tabs-mode' is nil: + empty 1. empty lines at beginning of buffer. + empty 2. empty lines at end of buffer. + trailing 3. SPACEs or TABs at end of line. + indentation 4. TABS at beginning of line. + space-before-tab 5. SPACEs before TAB. + space-after-tab 6. 8 or more SPACEs after TAB. + +See `whitespace-style' for documentation. +See also `whitespace-cleanup' and `whitespace-cleanup-region' for +cleaning up these problems." + (save-excursion + (save-match-data ;FIXME: Why? + (let* ((has-bogus nil) + (rstart (min start end)) + (rend (max start end)) + (bogus-list + (mapcar + #'(lambda (option) + (goto-char rstart) + (let ((regexp + (cond + ((eq (car option) 'indentation) + (whitespace-indentation-regexp)) + ((eq (car option) 'indentation::tab) + (whitespace-indentation-regexp 'tab)) + ((eq (car option) 'indentation::space) + (whitespace-indentation-regexp 'space)) + ((eq (car option) 'space-after-tab) + (whitespace-space-after-tab-regexp)) + ((eq (car option) 'space-after-tab::tab) + (whitespace-space-after-tab-regexp 'tab)) + ((eq (car option) 'space-after-tab::space) + (whitespace-space-after-tab-regexp 'space)) + (t + (cdr option))))) + (and (re-search-forward regexp rend t) + t))) + whitespace-report-list))) + bogus-list)))) + +;;;###autoload (defun whitespace-report-region (start end &optional force report-if-bogus= ) "Report some whitespace problems in a region. @@ -1840,90 +1898,43 @@ If REPORT-IF-BOGUS is non-nil, it reports only when there are any whitespace problems in buffer. -Report if some of the following whitespace problems exist: - -* If `indent-tabs-mode' is non-nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. 8 or more SPACEs at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. - -* If `indent-tabs-mode' is nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. TABS at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. - -See `whitespace-style' for documentation. -See also `whitespace-cleanup' and `whitespace-cleanup-region' for -cleaning up these problems." +For a description of whitespace problems, see +`whitespace-test-region'." (interactive "r") (setq force (or current-prefix-arg force)) (save-excursion - (save-match-data ;FIXME: Why? - (let* ((has-bogus nil) - (rstart (min start end)) - (rend (max start end)) - (bogus-list - (mapcar - #'(lambda (option) - (when force - (add-to-list 'whitespace-style (car option))) - (goto-char rstart) - (let ((regexp - (cond - ((eq (car option) 'indentation) - (whitespace-indentation-regexp)) - ((eq (car option) 'indentation::tab) - (whitespace-indentation-regexp 'tab)) - ((eq (car option) 'indentation::space) - (whitespace-indentation-regexp 'space)) - ((eq (car option) 'space-after-tab) - (whitespace-space-after-tab-regexp)) - ((eq (car option) 'space-after-tab::tab) - (whitespace-space-after-tab-regexp 'tab)) - ((eq (car option) 'space-after-tab::space) - (whitespace-space-after-tab-regexp 'space)) - (t - (cdr option))))) - (and (re-search-forward regexp rend t) - (setq has-bogus t)))) - whitespace-report-list))) - (when (if report-if-bogus has-bogus t) - (whitespace-kill-buffer whitespace-report-buffer-name) - ;; `whitespace-indent-tabs-mode' is local to current buffer - ;; `whitespace-tab-width' is local to current buffer - (let ((ws-indent-tabs-mode whitespace-indent-tabs-mode) - (ws-tab-width whitespace-tab-width)) - (with-current-buffer (get-buffer-create - whitespace-report-buffer-name) - (erase-buffer) - (insert (if ws-indent-tabs-mode - (car whitespace-report-text) - (cdr whitespace-report-text))) - (goto-char (point-min)) - (forward-line 3) - (dolist (option whitespace-report-list) - (forward-line 1) - (whitespace-mark-x - 27 (memq (car option) whitespace-style)) - (whitespace-mark-x 7 (car bogus-list)) - (setq bogus-list (cdr bogus-list))) - (forward-line 1) - (whitespace-insert-value ws-indent-tabs-mode) - (whitespace-insert-value ws-tab-width) - (when has-bogus - (goto-char (point-max)) - (insert " Type `M-x whitespace-cleanup'" - " to cleanup the buffer.\n\n" - " Type `M-x whitespace-cleanup-region'" - " to cleanup a region.\n\n")) - (whitespace-display-window (current-buffer))))) - has-bogus)))) + (let ((bogus-list (whitespace-test-region start end))) + (when (if report-if-bogus bogus-list t) + (whitespace-kill-buffer whitespace-report-buffer-name) + ;; `whitespace-indent-tabs-mode' is local to current buffer + ;; `whitespace-tab-width' is local to current buffer + (let ((ws-indent-tabs-mode whitespace-indent-tabs-mode) + (ws-tab-width whitespace-tab-width)) + (with-current-buffer (get-buffer-create + whitespace-report-buffer-name) + (erase-buffer) + (insert (if ws-indent-tabs-mode + (car whitespace-report-text) + (cdr whitespace-report-text))) + (goto-char (point-min)) + (forward-line 3) + (dolist (option whitespace-report-list) + (forward-line 1) + (whitespace-mark-x + 27 (memq (car option) whitespace-style)) + (whitespace-mark-x 7 (car bogus-list)) + (setq bogus-list (cdr bogus-list))) + (forward-line 1) + (whitespace-insert-value ws-indent-tabs-mode) + (whitespace-insert-value ws-tab-width) + (when bogus-list + (goto-char (point-max)) + (insert " Type `M-x whitespace-cleanup'" + " to cleanup the buffer.\n\n" + " Type `M-x whitespace-cleanup-region'" + " to cleanup a region.\n\n")) + (whitespace-display-window (current-buffer))))) + (null bogus-list)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- http://rrt.sc3d.org From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 03 18:36:25 2013 Received: (at 13837) by debbugs.gnu.org; 3 Mar 2013 23:36:25 +0000 Received: from localhost ([127.0.0.1]:57717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCIS9-0007ud-HC for submit@debbugs.gnu.org; Sun, 03 Mar 2013 18:36:25 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:62510) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCIS7-0007uR-NB for 13837@debbugs.gnu.org; Sun, 03 Mar 2013 18:36:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLvL/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFFxLvL/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2938886" Received: from 69-196-187-203.dsl.teksavvy.com (HELO pastel.home) ([69.196.187.203]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Mar 2013 18:36:05 -0500 Received: by pastel.home (Postfix, from userid 20848) id C72126A69D; Sun, 3 Mar 2013 18:36:03 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> Date: Sun, 03 Mar 2013 18:36:03 -0500 In-Reply-To: (Reuben Thomas's message of "Sat, 2 Mar 2013 07:46:31 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > This was a bit of code you suggested putting in my .emacs, not > patching whitespace.el. If possible, I'd like something I can use > today with Emacs 24. You already have "something I can use today with Emacs 24" and by definition whatever we change in trunk won't really help you if you need it to work in older Emacsen. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 20:53:57 2013 Received: (at 13837) by debbugs.gnu.org; 10 Apr 2013 00:53:57 +0000 Received: from localhost ([127.0.0.1]:42680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UPjIT-0005NC-Bf for submit@debbugs.gnu.org; Tue, 09 Apr 2013 20:53:57 -0400 Received: from exprod7og103.obsmtp.com ([64.18.2.159]:46618) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1UPjIR-0005N3-2p for 13837@debbugs.gnu.org; Tue, 09 Apr 2013 20:53:56 -0400 Received: from mail-lb0-f200.google.com ([209.85.217.200]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKUWS3RVxzzVvMZc95Kp+bx+HsnTD3hIah@postini.com; Tue, 09 Apr 2013 17:50:14 PDT Received: by mail-lb0-f200.google.com with SMTP id t12so10794lbi.11 for <13837@debbugs.gnu.org>; Tue, 09 Apr 2013 17:50:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=zQbabl4IDnCIqms6chuXJ2ZVCBI81isEMtMH0qCNW38=; b=CJxpHsYHRK7h+wddoxiYVekprK05LDjdaHKXF7S1MKPf62G0MpuiunvR6n6C+gI9U/ RP4S2roVD2430RNjLaLdJT17NbjEkxJtpRB/1AmY3LcRJ4q2qYdNEXmNRQdEyv7jKvv6 NV4SVnQhnJOGppdsy9WlYdUEyTC06uG6+VFsc66bLuukJ1ORHBc0vs+RxSKYnksp81/8 fW2+kgeaUQLqugXK9fFcq0qaptOC1kg9jhYdlHERhKihjPV4Q1EcxV8xCb4hZK+XSIql 4HmgG3Ytn/4h6Vu3kdx2CqQkRvQK2c0Kan9lvqFmgmxDiAXELu1k2H40rZA/btrIs4Fw a2sQ== X-Received: by 10.112.73.70 with SMTP id j6mr154693lbv.39.1365555010913; Tue, 09 Apr 2013 17:50:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.73.70 with SMTP id j6mr154688lbv.39.1365555010671; Tue, 09 Apr 2013 17:50:10 -0700 (PDT) Received: by 10.152.5.40 with HTTP; Tue, 9 Apr 2013 17:50:10 -0700 (PDT) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Wed, 10 Apr 2013 01:50:10 +0100 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c23b1c55323a04d9f70d3a X-Gm-Message-State: ALoCoQlRts/EJsAJ0oPpGJjPwMk8LiOcLDDck+Nx5GwQlejC0dirg7e/ST4+KAPiOBwQnBHvstL0Pu4jbhFctYUJUGxP+V7AyaaeA6HLB45XJmqzwHy1pwv7Lba8RKGt+8x6y3mbVhbXoDnHz8jKSZPCfxd/0iDWqUqK9nBBKMuK8H6CUNMkv+Q= X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) --001a11c23b1c55323a04d9f70d3a Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2 March 2013 07:49, Reuben Thomas wrote: > On 2 March 2013 03:01, Stefan Monnier wrote: > >>> You can =85 refactor the > >>> whitespace-report-region so as to provide whitespace-test-region. > >> Here's an attempt at that: > > > > Can you please (re)send it as a patch? > > Sure: > > =3D=3D=3D modified file 'lisp/whitespace.el' > [patch snipped] Ping? --=20 http://rrt.sc3d.org --001a11c23b1c55323a04d9f70d3a Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On 2 March 2013 07:49, Reuben Thomas <= ;rrt@sc3d.org> wrote:
On 2 March 2013 03:01, Stefan Monni= er <monnier@iro.umontreal.ca= > wrote:
>>> You can =85 refactor the
>>> whitespace-report-region so as to provide whitespace-test-regi= on.
>> Here's an attempt at that:
>
> Can you please (re)send it as a patch?

Sure:

=3D=3D=3D modified file 'lisp/whitespace.el'
=

[patch snipped]

Ping?

--
= http://rrt.sc3d.org
--001a11c23b1c55323a04d9f70d3a-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 17 19:10:09 2013 Received: (at 13837) by debbugs.gnu.org; 17 Oct 2013 23:10:09 +0000 Received: from localhost ([127.0.0.1]:56116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWwhj-0004FN-UX for submit@debbugs.gnu.org; Thu, 17 Oct 2013 19:10:08 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:52749) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWwhg-0004Ee-27 for 13837@debbugs.gnu.org; Thu, 17 Oct 2013 19:10:05 -0400 Received: by mail-lb0-f178.google.com with SMTP id z5so2438561lbh.23 for <13837@debbugs.gnu.org>; Thu, 17 Oct 2013 16:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0Ui7psamUiBLtZs1uqmGGryiFO2TljP1LCgOyEBu7e4=; b=mcTaGQecCB86tsNggvJKNKe0/ykpX+cXz8JKsg42S3Arx1tGZ08yJ2fUwJ7iZqFFQh s00vVp6iMlBEwhyS1kxyLusCHYV3rZCaE0UpgrSttWCz7/lIG22fbNie+0j2kESGISkU yC6jDWKd6QmlGHcWaVOEM8HWAiYlIEE+DQVqA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=0Ui7psamUiBLtZs1uqmGGryiFO2TljP1LCgOyEBu7e4=; b=VbSTYrtcAk6PVdV7XWM5Cslco9/FZKVRkjYxXjIutoXNUDZQnhrXI7W9oOnCOC+7FQ fNiYS2DJYiHJXXlGwoMTLkvvbbG0jZXCEMiegm/Ejk0O5lqAzpVijwVfV13JMVqZGugt cnP9hfAjs4u+OCJCMTXxVrWn9bDyYIVEUyuDJ7ngJDRLtRIN4beBgWJ2achwqOGhNkHU eiC4OjBLZ/Lza0K8VnU62HutNY6G+CSrmgoB4X529sGYIyv2fAys9F4MVKGHAvw+AWZa 97fzMJ+dw7Jh43Glc95KY+sd8op92R0jkkiqdiktBFVwma03u++FqfHpjnnwEvbsb/tP WCzg== X-Gm-Message-State: ALoCoQnOLnO7qtIi8iwKmhUNrSBlsIb/ka8PxcGpcgwryd3ZfJsBLUSl+5QMFSSlx6vD3IkG0jZf MIME-Version: 1.0 X-Received: by 10.152.19.168 with SMTP id g8mr50512lae.75.1382051398053; Thu, 17 Oct 2013 16:09:58 -0700 (PDT) Received: by 10.152.228.135 with HTTP; Thu, 17 Oct 2013 16:09:57 -0700 (PDT) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Fri, 18 Oct 2013 00:09:57 +0100 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=089e01493a0ea4850804e8f7ea39 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --089e01493a0ea4850804e8f7ea39 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10 April 2013 01:50, Reuben Thomas wrote: > On 2 March 2013 07:49, Reuben Thomas wrote: > >> On 2 March 2013 03:01, Stefan Monnier wrote: >> >>> You can =85 refactor the >> >>> whitespace-report-region so as to provide whitespace-test-region. >> >> Here's an attempt at that: >> > >> > Can you please (re)send it as a patch? >> >> Sure: >> >> =3D=3D=3D modified file 'lisp/whitespace.el' >> > > [patch snipped] > > Ping? > Ping again? My patch still applies cleanly to trunk. --=20 http://rrt.sc3d.org --089e01493a0ea4850804e8f7ea39 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On 10 April 2013 01:50, Reuben Thomas &l= t;rrt@sc3d.org> wrote:
On 2 March 2013 07:49, Reuben Thomas <rrt@sc= 3d.org> wrote:
On 2 March 2013 03:01, Stefan Monnier <monnier@iro.umontreal.ca> wro= te:
>>> You can =85 refactor the
>>> whitespace-report-region so as to provide whitespace-test-regi= on.
>> Here's an attempt at that:
>
> Can you please (re)send it as a patch?

Sure:

=3D=3D=3D modified file 'lisp/whitespace.el'
=

[patch snipped]

Ping?

Ping again? My patc= h still applies cleanly to trunk.
--089e01493a0ea4850804e8f7ea39-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 18:12:13 2014 Received: (at 13837) by debbugs.gnu.org; 26 Jan 2014 23:12:13 +0000 Received: from localhost ([127.0.0.1]:37010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7Ys8-00074O-Us for submit@debbugs.gnu.org; Sun, 26 Jan 2014 18:12:13 -0500 Received: from mail-qa0-f54.google.com ([209.85.216.54]:51102) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7Ys7-00074H-7x for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 18:12:11 -0500 Received: by mail-qa0-f54.google.com with SMTP id i13so6456145qae.13 for <13837@debbugs.gnu.org>; Sun, 26 Jan 2014 15:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gVepey50ESTo82OnmNpLm/leaWcYlEL8cTMZWn2FcG0=; b=n1HmjQI2PryOCJvo8kRNeYNwtSRngvzWT6ag5WHrRhMNIpxZNSOXELzrKG4PaPGRi3 y1cB3dYgf9QB62HbgkIHXm7JTkw/wTdv7sktq+rZu1U7HHEYwbjVWgdUGUtN/vQ7fdfl DktIcbknUXVqnFnKm/mDWMZwfvOmyuqX5ef3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gVepey50ESTo82OnmNpLm/leaWcYlEL8cTMZWn2FcG0=; b=S3jQmSXfv4sfgBXWqtCkispu8NNAHCvSCaxWfjAnyPz+QKvfJ960vK+s44GgKGlE0I l91DdFH0oPcjG2abpx6w1SPZB3emQm9yos2R38f1zxFgXXsb6jn7t6RhvNBe+fGkfsgb kH3n8kCwRy/7m3l0L9Fi0I/+2ubZIWLD01OoF/byOVWvL6WzfN+V4nX6rRjG8cd/HDaJ vJonJuCp+UWSAW3bfDp1JA1mjTZS/OZGYv8myl1r+mrNm6RNejPSFJuxXFNpNX3amPmd 6k6dGTJyV1t1XfGRBzjt+c0vTOQaOzN55NJDdyg3yRDzRpaEvXRn2TDQTps5CPOm92Cr q/eQ== X-Gm-Message-State: ALoCoQknZWxMrORAaOzdAZ2tdVHKnhaCmIG6Md56u4x+5v/Z/sC+LrQ1Yu+Aahnf09pIoBu8zO62 MIME-Version: 1.0 X-Received: by 10.224.15.76 with SMTP id j12mr38736996qaa.74.1390777930539; Sun, 26 Jan 2014 15:12:10 -0800 (PST) Received: by 10.229.71.66 with HTTP; Sun, 26 Jan 2014 15:12:10 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> Date: Sun, 26 Jan 2014 23:12:10 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=047d7bea2e5483047004f0e7b83a X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --047d7bea2e5483047004f0e7b83a Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 18 October 2013 00:09, Reuben Thomas wrote: > On 10 April 2013 01:50, Reuben Thomas wrote: > >> On 2 March 2013 07:49, Reuben Thomas wrote: >> >>> On 2 March 2013 03:01, Stefan Monnier wrote: >>> >>> You can =85 refactor the >>> >>> whitespace-report-region so as to provide whitespace-test-region. >>> >> Here's an attempt at that: >>> > >>> > Can you please (re)send it as a patch? >>> >>> Sure: >>> >>> =3D=3D=3D modified file 'lisp/whitespace.el' >>> >> >> [patch snipped] >> >> Ping? >> > > Ping again? My patch still applies cleanly to trunk. > Ping again! My patch still applies cleanly to trunk. Just to repeat why this patch is worthwhile, it splits out a function whitespace-test-region which can usefully be used to advise whitespace-enable-predicate. (For use with 24.3, I simply redefine whitespace-enable-predicate instead.) --=20 http://rrt.sc3d.org --047d7bea2e5483047004f0e7b83a Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On 1= 8 October 2013 00:09, Reuben Thomas <rrt@sc3d.org> wrote:
On 10 April 2013 01:50, Reuben Thom= as <= rrt@sc3d.org> wrote:
On 2 March 2013 07:49, Reuben Thomas <rrt@sc3d.org>= ; wrote:
On 2 March 2013 03:01, Stefan Monnier <monnier@iro.umontreal.ca> wro= te:
>>> You can =85 refactor the
>>> whitespace-report-region so as to provide whitespace-test-regi= on.
>> Here's an attempt at that:
>
> Can you please (re)send it as a patch?

Sure:

=3D=3D=3D modified file 'lisp/whitespace.el'
=

[patch snipped]

Ping?

Ping ag= ain? My patch still applies cleanly to trunk.
<= div>
Ping again! My patch still applies cleanly to trunk. Just to= repeat why this patch is worthwhile, it splits out a function whitespace-t= est-region which can usefully be used to advise whitespace-enable-predicate= . (For use with 24.3, I simply redefine whitespace-enable-predicate instead= .)

--
http://rrt.sc3d.org<= /a>
--047d7bea2e5483047004f0e7b83a-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 18:29:33 2014 Received: (at 13837) by debbugs.gnu.org; 26 Jan 2014 23:29:33 +0000 Received: from localhost ([127.0.0.1]:37016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7Z8u-0007Uc-LE for submit@debbugs.gnu.org; Sun, 26 Jan 2014 18:29:32 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:54879) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7Z8s-0007US-Ep for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 18:29:30 -0500 Received: by mail-ee0-f41.google.com with SMTP id e49so1960852eek.28 for <13837@debbugs.gnu.org>; Sun, 26 Jan 2014 15:29:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=EDD8G0eLaCuT7THxJ41Z0LEUOb7fgCmR553qs4CnZNs=; b=e8mC2/88iNrfFpqfSbf6u/EJpbAm5Gcti3mclX4BCP27t6Zb5+kbKT1qTD2Yof/Nbg veTN7dPbbu05K+9vpNadduMuDlk8RU+7HzYSB98U74rGGLSHxhHDlwn0CAQtxufrm4XG rpDEAfM5T7hDHMSOK+x9ZafKjbaPibUZQDwEnuA8alqffkDBG2/75K0sZAz10mVB87+s PrCni3VRG716rMEVYXAylvnQCR3MaP66mbrIeM0LzJWYE+nbVD5a79nAHo+9WLTHofKR 4H2tyGYUHt9HxRVdhPgWx5cPMsEIlFiiH+ntbBlyTNVu6/eGQwzc57sG0We7f8SzcFva ggqQ== X-Received: by 10.14.114.70 with SMTP id b46mr1755808eeh.84.1390778969726; Sun, 26 Jan 2014 15:29:29 -0800 (PST) Received: from axl (213-173-121.netrunf.cytanet.com.cy. [213.7.173.121]) by mx.google.com with ESMTPSA id z46sm34956824een.1.2014.01.26.15.29.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 26 Jan 2014 15:29:28 -0800 (PST) From: Dmitry Gutov To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems References: <878v69fn8q.fsf@sc3d.org> Date: Mon, 27 Jan 2014 01:29:21 +0200 In-Reply-To: (Reuben Thomas's message of "Sun, 26 Jan 2014 23:12:10 +0000") Message-ID: <87mwiiz5im.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) Reuben Thomas writes: > Ping again! My patch still applies cleanly to trunk. That's great, but we're in feature freeze now, so the patch will probably have to wait until the trunk is unfrozen for changes (and thus will only be incorporated in whatever version comes after Emacs 24.4). From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 18:31:56 2014 Received: (at 13837) by debbugs.gnu.org; 26 Jan 2014 23:31:56 +0000 Received: from localhost ([127.0.0.1]:37020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7ZBD-0007ZY-Ea for submit@debbugs.gnu.org; Sun, 26 Jan 2014 18:31:55 -0500 Received: from mail-qa0-f47.google.com ([209.85.216.47]:46427) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7ZBA-0007ZO-Vg for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 18:31:53 -0500 Received: by mail-qa0-f47.google.com with SMTP id j5so6353516qaq.20 for <13837@debbugs.gnu.org>; Sun, 26 Jan 2014 15:31:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ink6RcUjyCR/3/Xnm8UNiV03o0QrJrsdYl/5LvHnkgI=; b=win6nPz3j/H1DrV2JWakG0NzUVcGccTYRtbCN5zaQIpfg80RyHqQeRb7Vvr9DNYfT+ Eu0YepdRn+czcpg0azFeq7tVbcdbmdXCN7adrXb8ZWm9ngvPJ2ddLXTZQH4w5n5B/Qrq rk2QSCAfb6sKOboWP1OubMu8aoaRJVBvs7uQ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Ink6RcUjyCR/3/Xnm8UNiV03o0QrJrsdYl/5LvHnkgI=; b=DvBgk+Z4fN/HCTRhbJGNUTwgJLq2xU0WMHWpqbLbuh20zXzlutykKVivdYYBpjAjwh 3xGMi0Hvm7B6Jtx0rhUizSsMhF0ibIT42tfwEwMNKfoFM40a4Fnfg2fWE4a/p2O3RQh+ WHEHcXeCA6t5Zl1S6qNB2QP4eJkdTILWE0tfL4eOlR/nsHwk94r2cTmO6DRnWp+S7Aji SPLMLI1dGFhx/4kpYJ2FsH2/pmcUGlZcblQE/j62yPDKEAhOiljJR9FCuCsCR2k7gnsI fCbPxsdrw/nwChYtTNJYAw+8bQU8Xt+FbtsDvt7baK1rXxTqTAPN3b9NP33su0Ubsh+a oSzg== X-Gm-Message-State: ALoCoQmH7F5OXzBCR6+hD6Bett3KdgxMeT+DDeF0RnP+DeBJhQwEc5tf6pc/TYqYz6N13OXzoSHl MIME-Version: 1.0 X-Received: by 10.140.100.181 with SMTP id s50mr95320qge.113.1390779112575; Sun, 26 Jan 2014 15:31:52 -0800 (PST) Received: by 10.229.71.66 with HTTP; Sun, 26 Jan 2014 15:31:52 -0800 (PST) In-Reply-To: <87mwiiz5im.fsf@yandex.ru> References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> Date: Sun, 26 Jan 2014 23:31:52 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Dmitry Gutov Content-Type: multipart/alternative; boundary=001a1134f2b8f781a504f0e7fee7 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a1134f2b8f781a504f0e7fee7 Content-Type: text/plain; charset=ISO-8859-1 On 26 January 2014 23:29, Dmitry Gutov wrote: > Reuben Thomas writes: > > > Ping again! My patch still applies cleanly to trunk. > > That's great, but we're in feature freeze now, so the patch will > probably have to wait until the trunk is unfrozen for changes (and thus > will only be incorporated in whatever version comes after Emacs 24.4). > That's a pity: this patch has been available in its current form for nearly a year, and I last pinged a couple of weeks before feature freeze. But I await 24.4 with impatience too! -- http://rrt.sc3d.org --001a1134f2b8f781a504f0e7fee7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 6 January 2014 23:29, Dmitry Gutov <dgutov@yandex.ru> wrote:<= br>
Reuben Thomas <rrt@sc3= d.org> writes:

> Ping again! My patch still applies cleanly to trunk.

That's great, but we're in feature freeze now, so the patch w= ill
probably have to wait until the trunk is unfrozen for changes (and thus
will only be incorporated in whatever version comes after Emacs 24.4).

That's a pity: = this patch has been available in its current form for nearly a year, and I = last pinged a couple of weeks before feature freeze. But I await 24.4 with = impatience too!
--001a1134f2b8f781a504f0e7fee7-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 19:28:00 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 00:28:00 +0000 Received: from localhost ([127.0.0.1]:37033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7a3T-0000Yh-Op for submit@debbugs.gnu.org; Sun, 26 Jan 2014 19:28:00 -0500 Received: from mail-ee0-f48.google.com ([74.125.83.48]:45411) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7a3R-0000YX-0q for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 19:27:57 -0500 Received: by mail-ee0-f48.google.com with SMTP id t10so1942348eei.7 for <13837@debbugs.gnu.org>; Sun, 26 Jan 2014 16:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=POixc7AYhWAyTNmQ90jEKgNFtv/HFl9GYg0qyGwWMok=; b=MUdHwdlP36csQ1Bl+qOev7zrLstKCQLHR90psrVt/dybD42j4VfMGwg3CXLuLjrkH0 Vj4M+W/TurO3GYgQYchy7u32h7jvBd9uA1/DtCQXLqM9gIuXKqejn9JQypW3SpYCYn8V NLHJFdlNJfWA+aw8zuC+HRaaUJ9BUw0sfoUWjqzUlrEuXI38dusELdbrGuRiXrgcTkDR +aNg7MirNXYv+P/5BVi35Mat5RFHHfpnszzHjCuD6Cpy1SbVwaNXrH3T+zZXoIwd2uLH L/U570ev4zmzvhQIcAmWpWcU15RSmHRDW0eNOC2xR6RB9z2aRR0nVL674C3p6AR7noIG 8xpg== X-Received: by 10.15.81.196 with SMTP id x44mr22038438eey.31.1390782476325; Sun, 26 Jan 2014 16:27:56 -0800 (PST) Received: from [192.168.10.2] (213-173-121.netrunf.cytanet.com.cy. [213.7.173.121]) by mx.google.com with ESMTPSA id j46sm35319729eew.18.2014.01.26.16.27.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 16:27:55 -0800 (PST) Message-ID: <52E5A807.1040804@yandex.ru> Date: Mon, 27 Jan 2014 02:27:51 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) On 27.01.2014 01:31, Reuben Thomas wrote: > That's a pity: this patch has been available in its current form for > nearly a year, and I last pinged a couple of weeks before feature > freeze. But I await 24.4 with impatience too! Alas, this bug wasn't tagged as having a patch, so it eluded the pre-feature freeze call-to-arms. But it's up to Stefan. Maybe this change can pass as "already discussed". From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 19:41:22 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 00:41:23 +0000 Received: from localhost ([127.0.0.1]:37042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7aGQ-0000uu-Fp for submit@debbugs.gnu.org; Sun, 26 Jan 2014 19:41:22 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:64385) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7aGO-0000uk-AG for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 19:41:20 -0500 Received: by mail-qc0-f174.google.com with SMTP id x13so7164635qcv.33 for <13837@debbugs.gnu.org>; Sun, 26 Jan 2014 16:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pLZR3Lz1ErYvVOC3Q3ZDi5aX32jeIMKPCfvLvK0AOH0=; b=bpjLEy9eeCJKTyOC6k447Yu2hMBNJLd76NMUgVIfjZd3Kloe+W7VfXKXmgmsXHc26D tZFBTZeW8oNv91TzdT3zXJtkLDkfXBgLeDdubKlzEju5cPkcqM65+eVyuo5cIZX+cdeQ rCNDH01a5S99AtLN+dfUJW8YCnPkaDYD869Rk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pLZR3Lz1ErYvVOC3Q3ZDi5aX32jeIMKPCfvLvK0AOH0=; b=L5jdmwgsV8gGdxe/pt0Vy/LU4MA869ZJh9nwfjqYwR4bcY5HcGJBXlRbob8tSDhJ1Y QfUAl1tUAMyPu66+YEdcaTeXyqDtcjzf0JUxtcLJTlkMHcDl0DrSHe7BLDgRHAkXcw99 gRnVzcsjSx+7fZPK1a3LjVNNu5Jn2faCMxKSbO6OTNwlmxr9o2DeewIfDtljSkO8lSCH 8XUl6WkMNZ69NQYHWips+1UrqHiCsomaScnsDgqJTiTljjEnb51M6hEPNu42Oil1TNIM 3sZNPvkz6b3cfKnXgzueyH4UF7o8naWbS3u56VgA1FEyg0VZixK/HuybxQlymsWrhu+D YRVg== X-Gm-Message-State: ALoCoQmBldNr4T7upLUp6i/fkIS+tqSTLCjzYtRPr1f5qpEqKIIzz57MRsonxxSzO1znzSxtzcZN MIME-Version: 1.0 X-Received: by 10.224.51.74 with SMTP id c10mr4424854qag.33.1390783279696; Sun, 26 Jan 2014 16:41:19 -0800 (PST) Received: by 10.229.71.66 with HTTP; Sun, 26 Jan 2014 16:41:19 -0800 (PST) In-Reply-To: <52E5A807.1040804@yandex.ru> References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> <52E5A807.1040804@yandex.ru> Date: Mon, 27 Jan 2014 00:41:19 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Dmitry Gutov Content-Type: multipart/alternative; boundary=089e0158cb54589e9404f0e8f785 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --089e0158cb54589e9404f0e8f785 Content-Type: text/plain; charset=ISO-8859-1 On 27 January 2014 00:27, Dmitry Gutov wrote: > On 27.01.2014 01:31, Reuben Thomas wrote: > >> That's a pity: this patch has been available in its current form for >> nearly a year, and I last pinged a couple of weeks before feature >> freeze. But I await 24.4 with impatience too! >> > > Alas, this bug wasn't tagged as having a patch, so it eluded the > pre-feature freeze call-to-arms. > Thanks for that information, I can try to remember to tag bugs in future when I provide a patch. -- http://rrt.sc3d.org --089e0158cb54589e9404f0e8f785 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 7 January 2014 00:27, Dmitry Gutov <dgutov@yandex.ru> wrote:<= br>
On 27.01.2014 01:31, Reuben Thomas wrote:
That's a pity: this patch has been available in its current form for nearly a year, and I last pinged a couple of weeks before feature
freeze. But I await 24.4 with impatience too!

Alas, this bug wasn't tagged as having a patch, so it eluded the pre-fe= ature freeze call-to-arms.

Thanks for t= hat information, I can try to remember to tag bugs in future when I provide= a patch.

--
http://rrt.sc3d.org<= /a>
--089e0158cb54589e9404f0e8f785-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 20:52:55 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 01:52:55 +0000 Received: from localhost ([127.0.0.1]:37068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7bNe-0004yf-Kg for submit@debbugs.gnu.org; Sun, 26 Jan 2014 20:52:55 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27997) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7bNb-0004yW-P7 for 13837@debbugs.gnu.org; Sun, 26 Jan 2014 20:52:52 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFsoXJr/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtkQoDiGGJeZIggV6DFQ X-IPAS-Result: Av8EABK/CFFsoXJr/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtkQoDiGGJeZIggV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="46125162" Received: from 108-161-114-107.dsl.teksavvy.com (HELO pastel.home) ([108.161.114.107]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 Jan 2014 20:52:50 -0500 Received: by pastel.home (Postfix, from userid 20848) id 4DD4160286; Sun, 26 Jan 2014 20:52:50 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> <52E5A807.1040804@yandex.ru> Date: Sun, 26 Jan 2014 20:52:50 -0500 In-Reply-To: (Reuben Thomas's message of "Mon, 27 Jan 2014 00:41:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) > Thanks for that information, I can try to remember to tag bugs in future > when I provide a patch. I could be convinced to install it if it's "obviously safe". The patch as sent is a large chunk of "new" code plus a large chunk of "removed" code, so it's not very appealing. Diffing while ignoring whitespace indicates it's more of a "refactoring", and by introducing an "artificial" new function while helps keep the text lines in the original order (and hence helps reduce the size of the diff), I get the patch below. But it's not obviously safe to me. Two non-obvious parts are: - the removal of "(add-to-list 'whitespace-style (car option))". - the change from has-bogus to bogus-list, where bogus-list will (initially) only be nil if whitespace-report-list is nil. Another problem is that the docstring of whitespace-test-region does not accurately describe its return value. So it's probably best to keep it for after 24.4, but let's try to deal with it as soon as the trunk reopens (real soon now). Stefan === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-01-06 06:25:30 +0000 +++ lisp/whitespace.el 2014-01-27 01:35:49 +0000 @@ -1779,7 +1779,20 @@ If REPORT-IF-BOGUS is non-nil, it reports only when there are any whitespace problems in buffer. -Report if some of the following whitespace problems exist: +For a description of whitespace problems, see +`whitespace-test-region'." + (interactive "r") + (setq force (or current-prefix-arg force)) + (whitespace--report-region start end force report-if-bogus)) + +;;;###autoload +(defun whitespace-test-region (start end) + "Find whether there are whitespace problems in a region. + +Return a list of whitespace problems (hence, nil if there is no +whitespace problem). + +A whitespace problem is one of the following: * If `indent-tabs-mode' is non-nil: empty 1. empty lines at beginning of buffer. @@ -1800,18 +1813,13 @@ See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for cleaning up these problems." - (interactive "r") - (setq force (or current-prefix-arg force)) (save-excursion (save-match-data ;FIXME: Why? - (let* ((has-bogus nil) - (rstart (min start end)) + (let* ((rstart (min start end)) (rend (max start end)) (bogus-list (mapcar #'(lambda (option) - (when force - (add-to-list 'whitespace-style (car option))) (goto-char rstart) (let ((regexp (cond @@ -1830,9 +1838,14 @@ (t (cdr option))))) (and (re-search-forward regexp rend t) - (setq has-bogus t)))) + t))) whitespace-report-list))) - (when (if report-if-bogus has-bogus t) + bogus-list)))) + +(defun whitespace--report-region (start end &optional force report-if-bogus) + (save-excursion + (let ((bogus-list (whitespace-test-region start end))) + (when (if report-if-bogus bogus-list t) (whitespace-kill-buffer whitespace-report-buffer-name) ;; `whitespace-indent-tabs-mode' is local to current buffer ;; `whitespace-tab-width' is local to current buffer @@ -1855,14 +1868,14 @@ (forward-line 1) (whitespace-insert-value ws-indent-tabs-mode) (whitespace-insert-value ws-tab-width) - (when has-bogus + (when bogus-list (goto-char (point-max)) (insert " Type `M-x whitespace-cleanup'" " to cleanup the buffer.\n\n" " Type `M-x whitespace-cleanup-region'" " to cleanup a region.\n\n")) (whitespace-display-window (current-buffer))))) - has-bogus)))) + (null bogus-list)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 08:25:07 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 13:25:07 +0000 Received: from localhost ([127.0.0.1]:37505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7mBV-00083Z-Rw for submit@debbugs.gnu.org; Mon, 27 Jan 2014 08:25:06 -0500 Received: from mail-qc0-f170.google.com ([209.85.216.170]:44039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7mBS-00083D-99 for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 08:25:03 -0500 Received: by mail-qc0-f170.google.com with SMTP id e9so8124052qcy.29 for <13837@debbugs.gnu.org>; Mon, 27 Jan 2014 05:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FrwKs/iZKTpa9asxSA9keYUXQK7le105wE/UGQwbZIY=; b=VdTppF9IVpeuGqRT7WXIQpYrsBl/oBA/qNKWvRlQRayb05w0Zu9w0GgvfcFw8S0NeY 21VVRCRq2Rb/vqIeqdeZSNlWeSJC3EqXjPdn6H/nX+oCGoXM5bC9UcLIXpXIL1R2QF8c uCKhvC1gQcfpjVNyBwpua6X38asJSQTB7YDVs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FrwKs/iZKTpa9asxSA9keYUXQK7le105wE/UGQwbZIY=; b=h0y8mLodWDXO/53SuVErUEqkY5ngxIgWD0pyBP17SLcovkXsaWqIMMYVRVfhnyby14 INkVKkGMWZw+1HDPfduuctbSXvSG34ahbsbUbWEmUlKXz1MRrU+7MjEyu+z3pqHtIVQm /ZF+lGgpWXKKWbc2MLUpScZdvKo5w4HEVwnHM7tBbEdqZUDw6ECHgSzDlaFdbBnQutQe nQESUm8rwvp0quEU216UmBJqKkQx9YN4ojfxYpIfPBUrCYNt3olfI1i3fLDZdozViNsQ RBG2DO/HPc3eUQ7CGFSStM0YkHUaRGCI1b3MAUCoJeAj6LJd4xULMUCocAXi1NhcTX77 ArzQ== X-Gm-Message-State: ALoCoQlKs0ehV5RxdgPtv/5lT+td5ZdcieER2sUGZ3BluodHKvNFHW6mWPmP84U3psGymzRuyikN MIME-Version: 1.0 X-Received: by 10.140.86.202 with SMTP id p68mr40108498qgd.81.1390829101553; Mon, 27 Jan 2014 05:25:01 -0800 (PST) Received: by 10.229.71.66 with HTTP; Mon, 27 Jan 2014 05:25:01 -0800 (PST) In-Reply-To: References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> <52E5A807.1040804@yandex.ru> Date: Mon, 27 Jan 2014 13:25:01 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c131b88aaa7204f0f3a284 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a11c131b88aaa7204f0f3a284 Content-Type: text/plain; charset=ISO-8859-1 On 27 January 2014 01:52, Stefan Monnier wrote: > > I could be convinced to install it if it's "obviously safe". > The patch as sent is a large chunk of "new" code plus a large chunk of > "removed" code, so it's not very appealing. Diffing while ignoring > whitespace indicates it's more of a "refactoring", and by introducing an > "artificial" new function while helps keep the text lines in the > original order (and hence helps reduce the size of the diff), I get the > patch below. > Thanks very much for trying. > But it's not obviously safe to me. Two non-obvious parts are: > - the removal of "(add-to-list 'whitespace-style (car option))". > The removal looks wrong to me too: without that code, the force argument has no effect. On the other hand, the way it's implemented also seems wrong, as it permanently changes whitespace-style. > - the change from has-bogus to bogus-list, where bogus-list will > (initially) only be nil if whitespace-report-list is nil. > As far as I can see, has-bogus was set whenever an element was added to bogus-list. Hence, bogus-list is nil when has-bogus was nil. bogus-list is a list of whichever elements of whitespace-report-list problems are found, so if no problem is found, it will be nil. > Another problem is that the docstring of whitespace-test-region does not > accurately describe its return value. > So the return value is currently a list of flags corresponding to elements of whitespace-report-list. Two more things: 1. I would like to refactor the description of whitespace problems in whitespace-report-region to move those which are the same regardless of the value of indent-tabs-mode into a separate list. 2. Since we're no longer going for getting this into 24.4, can we fold your "artificial" whitespace--report-report-region back into whitespace-report-region, which both simplifies the end result slightly, and avoids the question of whether the new function should be moved down into "internal functions"? --001a11c131b88aaa7204f0f3a284 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 7 January 2014 01:52, Stefan Monnier <monnier@iro.umontreal.ca&= gt; wrote:

I could be convinced to install it if it's "obviously safe&q= uot;.
The patch as sent is a large chunk of "new" code plus a large chu= nk of
"removed" code, so it's not very appealing. =A0Diffing while = ignoring
whitespace indicates it's more of a "refactoring", and by int= roducing an
"artificial" new function while helps keep the text lines in the<= br> original order (and hence helps reduce the size of the diff), I get the
patch below.

Thanks very much for tryin= g.
=A0
But it's not obviously safe to me. =A0Two non-obvious parts are:
- the removal of "(add-to-list 'whitespace-style (car option))&quo= t;.

The removal looks wrong to me too: = without that code, the force argument has no effect. On the other hand, the= way it's implemented also seems wrong, as it permanently changes white= space-style.
=A0
- the change from has-bogus to bogus-list, where bogus-list will
=A0 (initially) only be nil if whitespace-report-list is nil.

As far as I can see, has-bogus was set whenever an e= lement was added to bogus-list. Hence, bogus-list is nil when has-bogus was= nil. bogus-list is a list of whichever elements of whitespace-report-list = problems are found, so if no problem is found, it will be nil.
=A0
Another problem is that the docstring of whitespace-test-region does not accurately describe its return value.

So the return value is currently a list of flags correspon= ding to elements of whitespace-report-list.

Two more things:

1. I would like to refactor the description of whit= espace problems in whitespace-report-region to move those which are the sam= e regardless of the value of indent-tabs-mode into a separate list.

2. Since we're no longer going for getting this into 24.4, can we f= old your "artificial" whitespace--report-report-region back into = whitespace-report-region, which both simplifies the end result slightly, an= d avoids the question of whether the new function should be moved down into= "internal functions"?
--001a11c131b88aaa7204f0f3a284-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 10:00:35 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 15:00:35 +0000 Received: from localhost ([127.0.0.1]:38242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7nfu-0002AB-V7 for submit@debbugs.gnu.org; Mon, 27 Jan 2014 10:00:35 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:49680) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7nfr-0002A1-Es for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 10:00:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+IO1/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFHO+IO1/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="46156759" Received: from 206-248-131-181.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.181]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jan 2014 10:00:30 -0500 Received: by pastel.home (Postfix, from userid 20848) id 766FB60621; Mon, 27 Jan 2014 10:00:30 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <878v69fn8q.fsf@sc3d.org> <87mwiiz5im.fsf@yandex.ru> <52E5A807.1040804@yandex.ru> Date: Mon, 27 Jan 2014 10:00:30 -0500 In-Reply-To: (Reuben Thomas's message of "Mon, 27 Jan 2014 13:25:01 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) >> But it's not obviously safe to me. Two non-obvious parts are: >> - the removal of "(add-to-list 'whitespace-style (car option))". > The removal looks wrong to me too: without that code, the force argument > has no effect. On the other hand, the way it's implemented also seems > wrong, as it permanently changes whitespace-style. Agreed on both aspects. >> - the change from has-bogus to bogus-list, where bogus-list will >> (initially) only be nil if whitespace-report-list is nil. > As far as I can see, has-bogus was set whenever an element was added to > bogus-list. The way I read the code bogus-list is a list of booleans (either nil or t), returned by `mapcar', so it has as many elements as whitespace-report-list. IOW an element was/is added to bogus-list regardless if a test succeeds/fails. > 1. I would like to refactor the description of whitespace problems in > whitespace-report-region to move those which are the same regardless of the > value of indent-tabs-mode into a separate list. Fine. > 2. Since we're no longer going for getting this into 24.4, can we fold your > "artificial" whitespace--report-report-region back into > whitespace-report-region, which both simplifies the end result slightly, > and avoids the question of whether the new function should be moved down > into "internal functions"? Of course, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 16:19:33 2014 Received: (at 13837) by debbugs.gnu.org; 27 Jan 2014 21:19:33 +0000 Received: from localhost ([127.0.0.1]:38445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7tae-0005oJ-TW for submit@debbugs.gnu.org; Mon, 27 Jan 2014 16:19:33 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:37450) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7tab-0005o7-Lm for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 16:19:30 -0500 Received: by mail-wg0-f51.google.com with SMTP id z12so6160129wgg.6 for <13837@debbugs.gnu.org>; Mon, 27 Jan 2014 13:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=from:to:cc:subject:mime-version:content-type :content-transfer-encoding:date:message-id; bh=N+0tSlTDDNU4lipVcYqSJhhiHPpahE+3nKD1xVAbqH0=; b=rgjQi6c7Ns6j2bXL54h5VZ7XUw4Bf2LAy+bVTAs22gGLFid0lSb1lS0UXp7rjGmNp8 JnsjLUTIl1HJ7DORNYu86nLtUOJR0aHunk6gkU4w17eSioh1zfeOz15Nd7eTrpJAL4il fh5pnQd4V48GjTNAriD8X+Eim3XKVkO4FCUhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:mime-version:content-type :content-transfer-encoding:date:message-id; bh=N+0tSlTDDNU4lipVcYqSJhhiHPpahE+3nKD1xVAbqH0=; b=J7KoDJJSmOFPUEbwFgUYazGn6sFP+tHFAQ2wNcEzqum8rSMVaaFxgYqJmYoUccu1tF sPOLCa5AnMmKcdKATSYyHcocUJcWnSLCmkACr4HqPbSZ5yKW2zm4Y+N7W65Oo0UNQY99 2KuwD0AkUlVrCDRHQZaNAQjRLXE6OV7OFPGeQm8lOSDdcPeCvmqHqGcgOApRw0IyW9NX 5Ahcnz/VtH36MZhOFAhCybSAR+c5p05sDVSlpZQZTDy9CS1E0ED0NkKLFvcLSyxERLSn zQuQo8oHlQ9z2/gEOydxxVslaUYsFhecRM4ZOX7gvmB79Y5cQhehHYebQEJbQDB4Gqjo Tgow== X-Gm-Message-State: ALoCoQkLHBX5hI/pvj0LhIHqgxHc6AoNSwdLpU1N4HE+DZcSFUY0LztulQBwTBOIhIie4XpH3+uS X-Received: by 10.180.96.228 with SMTP id dv4mr447054wib.24.1390857568873; Mon, 27 Jan 2014 13:19:28 -0800 (PST) Received: from skwd ([90.212.124.146]) by mx.google.com with ESMTPSA id jw4sm28120468wjc.20.2014.01.27.13.19.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 13:19:27 -0800 (PST) From: Reuben Thomas To: Stefan Monnier Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: Mon, 27 Jan 2014 21:19:27 -0000 Message-Id: <1390857567.273549.1665@skwd> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) I’ve thought about the approach taken by my original patch and concluded that it’s wrong: better not to split whitespace-report-region, but instead allow it not to report. If the report parameter (renamed from report-if-bogus) is 'never, then it does not report any problem. I’ve updated the docstring describing whitespace problems to common up the indent-tabs-mode true/false lists as promised. The unconditional updating of whitespace-style remains. Patch follows. === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-01-27 12:30:17 +0000 +++ lisp/whitespace.el 2014-01-27 21:03:00 +0000 @@ -1714,7 +1714,7 @@ ;;;###autoload -(defun whitespace-report (&optional force report-if-bogus) +(defun whitespace-report (&optional force report) "Report some whitespace problems in buffer. Return nil if there is no whitespace problem; otherwise, return @@ -1730,8 +1730,8 @@ space-before-tab space-after-tab -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. +If REPORT is t, it reports only when there are any whitespace +problems in buffer; if it is 'never, it does not report problems. Report if some of the following whitespace problems exist: @@ -1756,11 +1756,11 @@ cleaning up these problems." (interactive (list current-prefix-arg)) (whitespace-report-region (point-min) (point-max) - force report-if-bogus)) + force report)) ;;;###autoload -(defun whitespace-report-region (start end &optional force report-if-bogus) +(defun whitespace-report-region (start end &optional force report) "Report some whitespace problems in a region. Return nil if there is no whitespace problem; otherwise, return @@ -1776,26 +1776,22 @@ trailing space-after-tab -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. +If REPORT is t, it reports only when there are any whitespace +problems in buffer; if it is 'never, it does not report problems. Report if some of the following whitespace problems exist: + empty 1. empty lines at beginning of buffer. + empty 2. empty lines at end of buffer. + trailing 3. SPACEs or TABs at end of line. + space-before-tab 4. SPACEs before TAB. + space-after-tab 5. 8 or more SPACEs after TAB. + * If `indent-tabs-mode' is non-nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. 8 or more SPACEs at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. + indentation 6. 8 or more SPACEs at beginning of line. * If `indent-tabs-mode' is nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. TABS at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. + indentation 6. TABS at beginning of line. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for @@ -1832,7 +1828,7 @@ (and (re-search-forward regexp rend t) (setq has-bogus t)))) whitespace-report-list))) - (when (if report-if-bogus has-bogus t) + (when (if (equal report t) has-bogus (null report)) (whitespace-kill-buffer whitespace-report-buffer-name) ;; `whitespace-indent-tabs-mode' is local to current buffer ;; `whitespace-tab-width' is local to current buffer -- http://rrt.sc3d.org/ From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 19:32:44 2014 Received: (at 13837) by debbugs.gnu.org; 28 Jan 2014 00:32:44 +0000 Received: from localhost ([127.0.0.1]:38469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wbc-0002CO-0t for submit@debbugs.gnu.org; Mon, 27 Jan 2014 19:32:44 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:48595) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wba-0002CF-Ef for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 19:32:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+IO1/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSSIJMEtkQoDiGGcGYFegxU X-IPAS-Result: Av4EABK/CFHO+IO1/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYHCxQYDSSIJMEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="46210377" Received: from 206-248-131-181.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.181]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jan 2014 19:32:41 -0500 Received: by pastel.home (Postfix, from userid 20848) id A193F60EE1; Mon, 27 Jan 2014 19:32:41 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <1390857567.273549.1665@skwd> Date: Mon, 27 Jan 2014 19:32:41 -0500 In-Reply-To: <1390857567.273549.1665@skwd> (Reuben Thomas's message of "Mon, 27 Jan 2014 21:19:27 -0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) > -(defun whitespace-report (&optional force report-if-bogus) > +(defun whitespace-report (&optional force report) I'd leave the name unchanged. Will make for a cleaner diff and the name "report" is not convincingly better. > +If REPORT is t, it reports only when there are any whitespace > +problems in buffer; if it is 'never, it does not report problems. ^^^^^^ should be `never' > +problems in buffer; if it is 'never, it does not report problems. ^^^^^^ should be `never' > * If `indent-tabs-mode' is non-nil: > + indentation 6. 8 or more SPACEs at beginning of line. > * If `indent-tabs-mode' is nil: > + indentation 6. TABS at beginning of line. Why not indentation 6. if `indent-tabs-mode': 8 or more SPACEs at beginning of line else: TABS at beginning of line. > - (when (if report-if-bogus has-bogus t) > + (when (if (equal report t) has-bogus (null report)) For better backward compatibility, this should check for `never' and treat any other non-nil value as t. IOW (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 19:48:25 2014 Received: (at 13837) by debbugs.gnu.org; 28 Jan 2014 00:48:25 +0000 Received: from localhost ([127.0.0.1]:38474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wqm-0002ZF-U2 for submit@debbugs.gnu.org; Mon, 27 Jan 2014 19:48:25 -0500 Received: from mail-qa0-f43.google.com ([209.85.216.43]:58035) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7wqk-0002Z6-C9 for 13837@debbugs.gnu.org; Mon, 27 Jan 2014 19:48:23 -0500 Received: by mail-qa0-f43.google.com with SMTP id o15so8291732qap.16 for <13837@debbugs.gnu.org>; Mon, 27 Jan 2014 16:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1i4VidyeGK5qv2xkByavXSRmwo/AzXUs6/jb8AKZfwQ=; b=loRGsmUSRVqbNGzaMnLjpV/fXeceuU3PKEMGYN9S1ICykdCvz/c0b+sVhyxiPF6b9z us6lpYanyLCA6UKYk8XXL1FQhQvxK3/Qc27i3W31ACLNItzqgbHwDCVagBUpLzp40lWF V3889FO7eLMsUa9uNboTXJpQrJ2mL14++GGlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1i4VidyeGK5qv2xkByavXSRmwo/AzXUs6/jb8AKZfwQ=; b=Zk4E97KGlcrP67jDCbKPpKCauLh0bY50AqO5bpXg7yZ0Dyt5Ql/55b1MvgNoL8AF4w TWyNSY5LRdZpVteFr3gaAQ643FpAKasFPhKSyh3Jh4URzoTFSnQfDOU033gbHGi05xv4 B3U7JnROrtbhGbp6AWpzm/bm0LUDryFTcVdfEe+JwLrcW/kLqvbEW+Uyt9UVi8WDh361 IijIQ/CcVGURETUxPxscwqjf9bm+nBc2s6oe4r3YEbk/3einoxems91q9F+HuJ0TR/YY emm1wXA4teVJINBW+37O5HYcQSEOT/ZnHX/BzGhuqBs5rPWDw4UdqN0f9bxCYe9mPUg6 noPg== X-Gm-Message-State: ALoCoQlJpgEKBt510uV1jDCRNzf25iv6TMbWkszE+x9J3vvS9X5fagUPjl+KwMNe4u2UV8vj0X9J MIME-Version: 1.0 X-Received: by 10.140.46.119 with SMTP id j110mr45397026qga.32.1390870101340; Mon, 27 Jan 2014 16:48:21 -0800 (PST) Received: by 10.229.172.137 with HTTP; Mon, 27 Jan 2014 16:48:21 -0800 (PST) In-Reply-To: References: <1390857567.273549.1665@skwd> Date: Tue, 28 Jan 2014 00:48:21 +0000 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11395aaa51d95604f0fd2eb2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a11395aaa51d95604f0fd2eb2 Content-Type: text/plain; charset=ISO-8859-1 On 28 January 2014 00:32, Stefan Monnier wrote: > > -(defun whitespace-report (&optional force report-if-bogus) > > +(defun whitespace-report (&optional force report) > > I'd leave the name unchanged. Will make for a cleaner diff and the > name "report" is not convincingly better. > Sure, OK. > > +If REPORT is t, it reports only when there are any whitespace > > +problems in buffer; if it is 'never, it does not report problems. > ^^^^^^ > should be `never' > > > +problems in buffer; if it is 'never, it does not report problems. > ^^^^^^ > should be `never' > > > * If `indent-tabs-mode' is non-nil: > > + indentation 6. 8 or more SPACEs at beginning of line. > > * If `indent-tabs-mode' is nil: > > + indentation 6. TABS at beginning of line. > > Why not > > indentation 6. if `indent-tabs-mode': > 8 or more SPACEs at beginning of line > else: TABS at beginning of line. > OK. > > - (when (if report-if-bogus has-bogus t) > > + (when (if (equal report t) has-bogus (null report)) > > For better backward compatibility, this should check for `never' and > treat any other non-nil value as t. IOW > > (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) > Fine, revised patch to follow. -- http://rrt.sc3d.org --001a11395aaa51d95604f0fd2eb2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 2= 8 January 2014 00:32, Stefan Monnier <monnier@iro.umontreal.ca&= gt; wrote:
> -(defun whitespace-re= port (&optional force report-if-bogus)
> +(defun whitespace-report (&optional force report)

I'd leave the name unchanged. =A0Will make for a cleaner diff and= the
name "report" is not convincingly better.
Sure, OK.
=A0
> +If REPORT is t, it reports only when there are any whitespace
> +problems in buffer; if it is 'never, it does not report problems.=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^= ^
should be =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 `never'

> +problems in buffer; if it is 'never, it does not report problems.=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^= ^
should be =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 `never'

> =A0* If `indent-tabs-mode' is non-nil:
> + =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 = 6. 8 or more SPACEs at beginning of line.
> =A0* If `indent-tabs-mode' is nil:
> + =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 = 6. TABS at beginning of line.

Why not

=A0 =A0 =A0 indentation =A0 =A0 =A0 =A0 =A0 =A0 =A0 6. if `indent-tabs-mode= ':
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A08 or more SPACEs at beginning of line
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0else: TABS at beginning of line.

OK.
= =A0
> - =A0 =A0 (when (if report-if-bogus has-bogus t)
> + =A0 =A0 (when (if (equal report t) has-bogus (null report))

For better backward compatibility, this should check for `never' = and
treat any other non-nil value as t. =A0 IOW

=A0 =A0 =A0 =A0 (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-b= ogus))

Fine, revised patch to follow. <= br>

--
http://rrt.sc3d.o= rg
--001a11395aaa51d95604f0fd2eb2-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 13:26:24 2014 Received: (at 13837) by debbugs.gnu.org; 29 May 2014 17:26:24 +0000 Received: from localhost ([127.0.0.1]:36359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq45w-0003Fs-BL for submit@debbugs.gnu.org; Thu, 29 May 2014 13:26:24 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51229) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq45s-0003FW-Hm for 13837@debbugs.gnu.org; Thu, 29 May 2014 13:26:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQNWIxALDgocBwsUGA0kiAzSGReOegeEOASpGYFqgXGBWyE X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQNWIxALDgocBwsUGA0kiAzSGReOegeEOASpGYFqgXGBWyE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="64984373" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 May 2014 13:26:14 -0400 Received: by pastel.home (Postfix, from userid 20848) id 5CE43601BC; Thu, 29 May 2014 13:26:14 -0400 (EDT) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <1390857567.273549.1665@skwd> Date: Thu, 29 May 2014 13:26:14 -0400 In-Reply-To: (Reuben Thomas's message of "Tue, 28 Jan 2014 00:48:21 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) In January you wrote: > Fine, revised patch to follow. Hmm... Did I miss it, or are you waiting for something? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 15:01:41 2014 Received: (at 13837) by debbugs.gnu.org; 29 May 2014 19:01:41 +0000 Received: from localhost ([127.0.0.1]:36417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq5a8-0006Qr-4S for submit@debbugs.gnu.org; Thu, 29 May 2014 15:01:40 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:36332) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq5a6-0006QX-42 for 13837@debbugs.gnu.org; Thu, 29 May 2014 15:01:39 -0400 Received: by mail-lb0-f180.google.com with SMTP id p9so437109lbv.39 for <13837@debbugs.gnu.org>; Thu, 29 May 2014 12:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mORlLpb1HNcCcpIjKSE4gsyQyQYeQA4odiEtIjrqgLk=; b=EKxM13KxLj0aU7U1WXokZaIpT+MjMEu9OtzYmxIaGIidX8N0Ilc5rJCdBM8luJD8o2 bqZ/rxXo+i1PXqdeAeR+1SuJ9kHFYB2WQiEff4g5YpD2OQBQyQYOPZAFj4agXhW/qzH3 t8Jx25yKytJKNIbg/cEz4b+liXdQOMvYO5BFM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mORlLpb1HNcCcpIjKSE4gsyQyQYeQA4odiEtIjrqgLk=; b=BcKH+BwE6wcJfrChs12pK9XsKGYC5jKt58GmobZnbipaYOhS+OXf0vsztd8cEr+z9w 1QI2Lnh1hOgMpaxxOBuLOaiBgZaF1QljLpQKcWSs+IyZOYBZxj/z+2P/uu9CqWBFYUsV E1DmuGgzeJG52GuTm1Dd5b7VgAqP9C1qDRE7ivNIcN9iLOUw79oLbHIusCfcNwsOHec3 /k5zA6tIPsuct/BJo5x6MDYEVNDhI86ycls2oI8v8YjTi/c7LJLAmxXAGMwFTkGYx4fF llLgq8K2dT5xBM6xApW5biLZrHolSgFEbSE51aP9u2t0ws4vn/VxZzVpGXAwVro3NNvo BDyQ== X-Gm-Message-State: ALoCoQklIn3/v0EV+EkeAii5s1zkHD3xvk2oSU+TWBvSkdL2CIzS6gokl8TktozCxjcjZ700/KbR MIME-Version: 1.0 X-Received: by 10.152.246.11 with SMTP id xs11mr4165621lac.73.1401390091586; Thu, 29 May 2014 12:01:31 -0700 (PDT) Received: by 10.152.166.103 with HTTP; Thu, 29 May 2014 12:01:31 -0700 (PDT) In-Reply-To: References: <1390857567.273549.1665@skwd> Date: Thu, 29 May 2014 20:01:31 +0100 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11341e1699e11704fa8e8e75 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a11341e1699e11704fa8e8e75 Content-Type: text/plain; charset=UTF-8 On 29 May 2014 18:26, Stefan Monnier wrote: > In January you wrote: > > Fine, revised patch to follow. > > Hmm... Did I miss it, or are you waiting for something? I sent the patch and you replied "Looks good, thank you," Unfortunately, I sent the patch only to you, as I managed to somehow get what should have been the contents of the Cc: header into the Subject instead. I will now resend it, sorry. -- http://rrt.sc3d.org --001a11341e1699e11704fa8e8e75 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 9 May 2014 18:26, Stefan Monnier <monnier@iro.umontreal.ca><= /span> wrote:
In January you wrote:
> Fine, revised patch to follow.

Hmm... Did I miss it, or are you waiting for something?
<= div>
=C2=A0I sent the patch and you replied "Looks good,= thank you,"

Unfortunately, I sent the patch only to= you, as I managed to somehow get what should have been the contents of the= Cc: header into the Subject instead. I will now resend it, sorry.

--
http://rrt.sc3d.org<= /a>
--001a11341e1699e11704fa8e8e75-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 15:02:58 2014 Received: (at 13837) by debbugs.gnu.org; 29 May 2014 19:02:59 +0000 Received: from localhost ([127.0.0.1]:36421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq5bO-0006Tc-6E for submit@debbugs.gnu.org; Thu, 29 May 2014 15:02:58 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:45780) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq5bL-0006TI-Bq for 13837@debbugs.gnu.org; Thu, 29 May 2014 15:02:56 -0400 Received: by mail-lb0-f179.google.com with SMTP id c11so433721lbj.38 for <13837@debbugs.gnu.org>; Thu, 29 May 2014 12:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=UXXUGCPSNjGlSf7Z99SDf/WfPT24brP18jcX1/0aoVI=; b=vQQpsPFH6B1DI2jVa7ZrMVlB6N1VAx1D0oPVjstI8GUMn22RmnnxVZOJB6O0eFO+eu s2d9JmTvWlYc1VrNzDC0QOtK+w3RRqPBeZQHki4Gsw42zQwUsjne7tMq6B7wRb/5U8Bu O3C/OMlM+14r3lkppl+A8KIRBghVeFhpV6f8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=UXXUGCPSNjGlSf7Z99SDf/WfPT24brP18jcX1/0aoVI=; b=Sz0lEvJiC+vQg75j1B+BiDtufPsDNFq/sOnOHbCccOvn7TxKZ6NpkBQDYUu+ER87zN mgdDJ6fW1JBsaDEJ+2SaY6QEDTlT0U1SuI7H83R9/c3QSMGvISut+m3uliQjziNVrwln Lft8SSQIlA/1s4+s2rykKmX4kL0eL5T6ppyySCn4vJAd5VpNNM7fDe6tROQPj4AbSyrD VCkHhMeHWiwCVIbRl1JvIeTNyrD28jJeoW3R4nVUDB9DV3Zxfl5z9tyoU2QLwz+Urbjm q70F17Emod/3/SoqjLNpIBVy/2guP3xoZZ65gAKeCER+nyoA5bJy3+IBkjTWHPdF8fLj gSDA== X-Gm-Message-State: ALoCoQm2f0Z0iBPrDuwxsGS0A0DUik+1GUd4bLX8Zps8PSVkc0ZwKobUIe26EmrsnZoyDbgTszu/ MIME-Version: 1.0 X-Received: by 10.112.89.66 with SMTP id bm2mr3731470lbb.91.1401390169112; Thu, 29 May 2014 12:02:49 -0700 (PDT) Received: by 10.152.166.103 with HTTP; Thu, 29 May 2014 12:02:49 -0700 (PDT) Date: Thu, 29 May 2014 20:02:49 +0100 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c377b838d8e104fa8e93d4 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a11c377b838d8e104fa8e93d4 Content-Type: text/plain; charset=UTF-8 Revised patch as promised. [Resent owing to addressing error the first time around.] === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2014-01-27 12:30:17 +0000 +++ lisp/whitespace.el 2014-01-28 00:41:32 +0000 @@ -1730,8 +1730,9 @@ space-before-tab space-after-tab -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. +If REPORT-IF-BOGUS is t, it reports only when there are any +whitespace problems in buffer; if it is `never', it does not +report problems. Report if some of the following whitespace problems exist: @@ -1776,26 +1777,20 @@ trailing space-after-tab -If REPORT-IF-BOGUS is non-nil, it reports only when there are any -whitespace problems in buffer. +If REPORT-IF-BOGUS is t, it reports only when there are any +whitespace problems in buffer; if it is `never', it does not +report problems. Report if some of the following whitespace problems exist: -* If `indent-tabs-mode' is non-nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. 8 or more SPACEs at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. - -* If `indent-tabs-mode' is nil: - empty 1. empty lines at beginning of buffer. - empty 2. empty lines at end of buffer. - trailing 3. SPACEs or TABs at end of line. - indentation 4. TABS at beginning of line. - space-before-tab 5. SPACEs before TAB. - space-after-tab 6. 8 or more SPACEs after TAB. + empty 1. empty lines at beginning of buffer. + empty 2. empty lines at end of buffer. + trailing 3. SPACEs or TABs at end of line. + space-before-tab 4. SPACEs before TAB. + space-after-tab 5. 8 or more SPACEs after TAB. + indentation 6. If `indent-tabs-mode': + 8 or more SPACEs at beginning of line + else: TABS at beginning of line. See `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for @@ -1832,7 +1827,7 @@ (and (re-search-forward regexp rend t) (setq has-bogus t)))) whitespace-report-list))) - (when (if report-if-bogus has-bogus t) + (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) (whitespace-kill-buffer whitespace-report-buffer-name) ;; `whitespace-indent-tabs-mode' is local to current buffer ;; `whitespace-tab-width' is local to current buffer -- http://rrt.sc3d.org/ -- http://rrt.sc3d.org --001a11c377b838d8e104fa8e93d4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Revised patch as promised. [Res= ent owing to addressing error the first time around.]

=3D=3D=3D modified file 'lisp/whitespace.el'
--- lisp/whitespace.el =C2=A02014-01-27 12:30:17 +0000
+++ lisp/whitespace.el =C2=A02014-01-28 00:41:32 +0000
@@ -1730,8 +1730,9 @@
=C2=A0 =C2=A0 space-before-tab
=C2=A0 =C2=A0 space-after-tab

-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.

=C2=A0Report if some of the following whitespace problems exist:

@@ -1776,26 +1777,20 @@
=C2=A0 =C2=A0 trailing
=C2=A0 =C2=A0 space-after-tab

-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.

=C2=A0Report if some of the following whitespace problems exist:

-* If `indent-tabs-mode' is non-nil:
- =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1. empty li= nes at beginning of buffer.
- =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2. empty li= nes at end of buffer.
- =C2=A0 trailing =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03. SPACEs or TAB= s at end of line.
- =C2=A0 indentation =C2=A0 =C2=A0 =C2=A0 =C2=A0 4. 8 or more SPACEs at beg= inning of line.
- =C2=A0 space-before-tab =C2=A0 =C2=A05. SPACEs before TAB.
- =C2=A0 space-after-tab =C2=A0 =C2=A0 6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
- =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1. empty li= nes at beginning of buffer.
- =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2. empty li= nes at end of buffer.
- =C2=A0 trailing =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03. SPACEs or TAB= s at end of line.
- =C2=A0 indentation =C2=A0 =C2=A0 =C2=A0 =C2=A0 4. TABS at beginning of li= ne.
- =C2=A0 space-before-tab =C2=A0 =C2=A05. SPACEs before TAB.
- =C2=A0 space-after-tab =C2=A0 =C2=A0 6. 8 or more SPACEs after TAB.
+ =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1. empty li= nes at beginning of buffer.
+ =C2=A0 empty =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2. empty li= nes at end of buffer.
+ =C2=A0 trailing =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03. SPACEs or TAB= s at end of line.
+ =C2=A0 space-before-tab =C2=A0 =C2=A04. SPACEs before TAB.
+ =C2=A0 space-after-tab =C2=A0 =C2=A0 5. 8 or more SPACEs after TAB.
+ =C2=A0 indentation =C2=A0 =C2=A0 =C2=A0 =C2=A0 6. If `indent-tabs-mode= 9;:
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 8 or more SPACEs at beginning of line
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 else: TABS at beginning of line.

=C2=A0See `whitespace-style' for documentation.
=C2=A0See also `whitespace-cleanup' and `whitespace-cleanup-region'= for
@@ -1832,7 +1827,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(and (re-search-forward regexp rend t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (setq has-bogus t))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0whitespace-report-li= st)))
- =C2=A0 =C2=A0 =C2=A0 (when (if report-if-bogus has-bogus t)
+ =C2=A0 =C2=A0 =C2=A0 (when (pcase report-if-bogus (`nil t) (`never nil) (= _ has-bogus))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (whitespace-kill-buffer whitespace-repor= t-buffer-name)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `whitespace-indent-tabs-mode' is = local to current buffer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `whitespace-tab-width' is local t= o current buffer

--
http://rrt.sc3d.org/=



--
http://rrt.sc3d.org
--001a11c377b838d8e104fa8e93d4-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 16:28:20 2014 Received: (at 13837) by debbugs.gnu.org; 29 May 2014 20:28:20 +0000 Received: from localhost ([127.0.0.1]:36472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq6vz-0000lj-AZ for submit@debbugs.gnu.org; Thu, 29 May 2014 16:28:19 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:44980) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq6vw-0000lS-DG for 13837@debbugs.gnu.org; Thu, 29 May 2014 16:28:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJgcLFBgNJIgECNIZF456B4Q4BKkZgWqBcYFbIQ X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJgcLFBgNJIgECNIZF456B4Q4BKkZgWqBcYFbIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65000740" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 May 2014 16:28:10 -0400 Received: by pastel.home (Postfix, from userid 20848) id 73E42601BC; Thu, 29 May 2014 16:28:10 -0400 (EDT) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems Message-ID: References: <1390857567.273549.1665@skwd> Date: Thu, 29 May 2014 16:28:10 -0400 In-Reply-To: (Reuben Thomas's message of "Thu, 29 May 2014 20:01:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) > I sent the patch and you replied "Looks good, thank you," Then, go ahead and install it, Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 18:53:19 2014 Received: (at 13837) by debbugs.gnu.org; 29 May 2014 22:53:19 +0000 Received: from localhost ([127.0.0.1]:36585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq9CI-0005WT-Ly for submit@debbugs.gnu.org; Thu, 29 May 2014 18:53:19 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:53497) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wq9CF-0005W6-PT for 13837@debbugs.gnu.org; Thu, 29 May 2014 18:53:16 -0400 Received: by mail-la0-f46.google.com with SMTP id ec20so569870lab.5 for <13837@debbugs.gnu.org>; Thu, 29 May 2014 15:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dVSslbmmylG4vqkko4G1Dg2ouLtT/NJyUi1rTwCD7qw=; b=pm43sR3iscv1GsHo0SGd0tx66B5X7RKe1I4w5NfIr+LdXNw73kNlnuMvi4HLX/MN/4 8UWAp04JrbvD909k1nsX3rR/2enBf4B9axp8S1ojHi2Oz7EyeAEgomN0pBftZfKY/qUr cqwFwwHTa7CV+/AWSCQo3dp0FsOJ6GMp8yNXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=dVSslbmmylG4vqkko4G1Dg2ouLtT/NJyUi1rTwCD7qw=; b=Ai0cU+nEycxU6pEtnkdN1H7fyg6DKgj3U8Vlx4lmvZpIyxdDzabdNH8BeZ8KB79ntl Vbj5Kc8fsHSR8twQqfKmnYPIklPjVw6tJMWcUcZC3niEUekUwRXjra4XPnnrGIjtqNJn /ks/5/z3mIyIdao5KKqwyVe7RJInTG7q7kvyTkjl599D10GzkuKO/v0C2zDeUce9agdV o1MJd8BvFoAdaWmJo353SW9KyAP2O0yqnjUN/1LRAPsfoi9JKRNiXdj6/NqO6a7DKEjL J12jTLymUmk+NVDxItNSD7PP24bxwjEiCytbXeswt8Vlg6zPO7hvXsVsGApxRU/rij93 IipA== X-Gm-Message-State: ALoCoQkIrIaBUIsZGoc+i3bIPL3RkOqD6kww2TViE1FObY4XRKbFPeBWM7imKOS6sdAviOGT4tFM MIME-Version: 1.0 X-Received: by 10.112.85.167 with SMTP id i7mr8287903lbz.32.1401403989578; Thu, 29 May 2014 15:53:09 -0700 (PDT) Received: by 10.152.166.103 with HTTP; Thu, 29 May 2014 15:53:09 -0700 (PDT) In-Reply-To: References: <1390857567.273549.1665@skwd> Date: Thu, 29 May 2014 23:53:09 +0100 Message-ID: Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11346ddefc6a0204fa91ca22 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --001a11346ddefc6a0204fa91ca22 Content-Type: text/plain; charset=UTF-8 On 29 May 2014 21:28, Stefan Monnier wrote: > > I sent the patch and you replied "Looks good, thank you," > > Then, go ahead and install it, > Done. Apologies for the hiccups in the commit log. This bug can now be closed. -- http://rrt.sc3d.org --001a11346ddefc6a0204fa91ca22 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 9 May 2014 21:28, Stefan Monnier <monnier@iro.umontreal.ca><= /span> wrote:
> =C2=A0I sent the patch = and you replied "Looks good, thank you,"

Then, go ahead and install it,

Done. Apologies for the hiccups in the commit log. Thi= s bug can now be closed.
--001a11346ddefc6a0204fa91ca22-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 29 22:01:59 2014 Received: (at 13837) by debbugs.gnu.org; 30 May 2014 02:01:59 +0000 Received: from localhost ([127.0.0.1]:36659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqC8t-0004FX-Ew for submit@debbugs.gnu.org; Thu, 29 May 2014 22:01:59 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46747 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqC8r-0004FP-R6 for 13837@debbugs.gnu.org; Thu, 29 May 2014 22:01:58 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WqC8q-0006w1-Vr; Thu, 29 May 2014 22:01:57 -0400 From: Glenn Morris To: Reuben Thomas Subject: Re: bug#13837: 24.2; Make it possible to turn whitespace-mode only when there are no existing problems References: <1390857567.273549.1665@skwd> X-Spook: CIA Israel Ft. Bragg EuroFed military Jyllandsposten X-Ran: nfbk:%*1log0SXA(^Qsv;t&~3R{od\}7R~&TreOlU\!#tlDQk>H3<5^M@fV'I@wdCVt'a| X-Hue: white X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 29 May 2014 22:01:56 -0400 In-Reply-To: (Reuben Thomas's message of "Thu, 29 May 2014 23:53:09 +0100") Message-ID: <9nd2ewc9d7.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 13837 Cc: 13837@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (-----) Reuben Thomas wrote: > This bug can now be closed. You (or anyone) can do that by mailing 13837-done@debbugs rather than 13837@debbugs. (I like to put "Version: 24.5" at the start of the message body, so that the system knows what version of Emacs the fix should appear in.) From debbugs-submit-bounces@debbugs.gnu.org Fri May 30 11:41:13 2014 Received: (at control) by debbugs.gnu.org; 30 May 2014 15:41:13 +0000 Received: from localhost ([127.0.0.1]:37905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqOvc-000798-EF for submit@debbugs.gnu.org; Fri, 30 May 2014 11:41:13 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:43057 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqOvV-00078T-5X for control@debbugs.gnu.org; Fri, 30 May 2014 11:41:06 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WqOvU-0004L4-B6 for control@debbugs.gnu.org; Fri, 30 May 2014 11:41:00 -0400 Date: Fri, 30 May 2014 11:41:00 -0400 Message-Id: Subject: control message for bug 13837 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (-----) close 13837 24.5 From unknown Sun Jun 22 22:42:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 28 Jun 2014 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 04 12:35:32 2014 Received: (at control) by debbugs.gnu.org; 4 Oct 2014 16:35:32 +0000 Received: from localhost ([127.0.0.1]:33183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIt-0002m9-8U for submit@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:31 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:60039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIr-0002lz-Gi for control@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:29 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XaSIq-0005r2-MO; Sat, 04 Oct 2014 12:35:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21552.8656.554316.921175@gnu.org> Date: Sat, 4 Oct 2014 12:35:28 -0400 From: Glenn Morris To: GNU bug tracker automated control server Subject: Update Emacs archived fixed bugs for 24.5 version number change X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (-----) unarchive 18304 fixed 18304 25.1 notfixed 18304 24.5 unarchive 12008 fixed 12008 25.1 notfixed 12008 24.5 unarchive 17110 fixed 17110 25.1 notfixed 17110 24.5 unarchive 17218 fixed 17218 25.1 notfixed 17218 24.5 unarchive 18222 fixed 18222 25.1 notfixed 18222 24.5 unarchive 18023 fixed 18023 25.1 notfixed 18023 24.5 unarchive 17225 fixed 17225 25.1 notfixed 17225 24.5 unarchive 16626 fixed 16626 25.1 notfixed 16626 24.5 unarchive 18326 fixed 18326 25.1 notfixed 18326 24.5 unarchive 18227 fixed 18227 25.1 notfixed 18227 24.5 unarchive 16328 fixed 16328 25.1 notfixed 16328 24.5 unarchive 17333 fixed 17333 25.1 notfixed 17333 24.5 unarchive 13837 fixed 13837 25.1 notfixed 13837 24.5 unarchive 17641 fixed 17641 25.1 notfixed 17641 24.5 unarchive 18341 fixed 18341 25.1 notfixed 18341 24.5 unarchive 18349 fixed 18349 25.1 notfixed 18349 24.5 unarchive 2151 fixed 2151 25.1 notfixed 2151 24.5 unarchive 5853 fixed 5853 25.1 notfixed 5853 24.5 unarchive 17857 fixed 17857 25.1 notfixed 17857 24.5 unarchive 17858 fixed 17858 25.1 notfixed 17858 24.5 unarchive 17859 fixed 17859 25.1 notfixed 17859 24.5 unarchive 17160 fixed 17160 25.1 notfixed 17160 24.5 unarchive 2263 fixed 2263 25.1 notfixed 2263 24.5 unarchive 18368 fixed 18368 25.1 notfixed 18368 24.5 unarchive 17772 fixed 17772 25.1 notfixed 17772 24.5 unarchive 17276 fixed 17276 25.1 notfixed 17276 24.5 unarchive 15991 fixed 15991 25.1 notfixed 15991 24.5 unarchive 17699 fixed 17699 25.1 notfixed 17699 24.5 From unknown Sun Jun 22 22:42:53 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, 02 Nov 2014 12:24:06 +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