From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 07:45:30 2013 Received: (at submit) by debbugs.gnu.org; 7 Feb 2013 12:45:30 +0000 Received: from localhost ([127.0.0.1]:40926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Qr0-0004kM-3T for submit@debbugs.gnu.org; Thu, 07 Feb 2013 07:45:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34341) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Qqu-0004k8-3P for submit@debbugs.gnu.org; Thu, 07 Feb 2013 07:45:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3QpV-00085P-AB for submit@debbugs.gnu.org; Thu, 07 Feb 2013 07:43:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QpV-00085L-6V for submit@debbugs.gnu.org; Thu, 07 Feb 2013 07:43:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QpO-0004IF-Q8 for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 07:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3QpI-00082p-53 for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 07:43:46 -0500 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:46484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QpH-00081E-3w for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 07:43:40 -0500 Received: from Scofield.local.free.fr (unknown [IPv6:2a01:e35:8b50:e80:5ab0:35ff:fe7b:9220]) by smtp1-g21.free.fr (Postfix) with ESMTP id 0EE8E9400DE; Thu, 7 Feb 2013 13:43:27 +0100 (CET) From: Didier Verna To: bug-gnu-emacs@gnu.org Subject: Whitespace support for file/mode-specific styles and actions User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVfISi7uXMbIRbQ0c2x aVhqe1lYchlOh6WjAAACeklEQVQ4jVWUQdPiIAyGI9N6lgU8d5mv3BncPbcjehY1nLfdIf//J2xo q35LZ+rIw0uSN1GwvPq7XT6M8kFuC+rOzx8L2PF3L2VY1gqqonsiYlL/KXb3zrYaEUA0Sm0KaerB zqKM8XITXXop+JRF7G2qx7wWfVCfGAVdu14Q9EuygmT+biAcdvW9gWmWr/3g4bvi+HjtS3VI/g3w l3rtS3VqvynwLeDab+c3mKZ3BC3lkN4gvUJ4WcHuE+MF9Cgr+BT4+IRgsEQH0WbC8yYYoD3LoV8V k5lRBe9VON1Y3chhcQWgJDJKXkQTzI0tZWAfng0QvcxHpfwFgo4bWBSMSz4HCV0wnAnAyFd5z6CX mB+n9jaGg+iGCuxXVThbiD2sM2CGUTPQsFtsd7lkroM7OIDi/jJoRsOgHIk35VLGKEcdY8MtSUCI tHl4gtHrOEYYtMngiMoGdGx8bGIc4mgIiLDUCeGa+BK+iEHTmAJImZbR4TJqrhXENh0hZzZxAVwD sCgO1+cej0DSbOAk2BAWXOOY0QBNmWhthu5YcuUQpmCGkikXtY3UIskFUWbOav7T1/J8rEGaa7wk SjgzoLkQd+mp2CiAa3yOSJbqVQvgDvoqoWtCcgwoO5ftg4ffx2u9q0ThyM4wu0Ib0EuQ9uI4zzt7 VZ+nVHUMFwmnacsMuZq1gsDt7uDrlmdH+wookX5WoEWdHyAGAshazmo6MPF1LLsIaN295+D1wPS7 Q6zzZqGBVvQMsput5R4Kuy5o7H7GmSDb3Lo8hcO630G0gOXOWXXYt5iCXyXsr+1KuXPlhf8aHP8k zAaaoaNCM7DHPMs8WH6wVtQCtXAT2X/K7NQKPk4fSgAAAABJRU5ErkJggg== X-Face: compface: (warning) : excess data ignored X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Thu, 07 Feb 2013 13:43:26 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit Cc: viniciusjl@ig.com.br 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.9 (------) --=-=-= Content-Type: text/plain Hello, the following patch extends whitespace.el with the ability to specify styles and actions on a file or mode specific basis. The rationale is that the current unique style and action settings are not sufficient. You may not want to see the exact same whitespace problems in all files or major modes, and you also may not want the same actions to be undertaken everywhere. To make this work, some new user options are introduced (which see): whitespace-file-style, whitespace-mode-style and their action counterpart. When computing the style to use for a specific file, whitespace now looks for a match on the file name, then on the major mode, and then falls back to the global setting. Same thing for actions. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=ChangeLog 2013-02-07 Didier Verna Support for file/mode-specific styles and actions in whitespace.el. * whitespace.el: Update comments throughout the file for this new feature. (whitespace-style-custom-type): New constant. (whitespace-style): Use it. Update and improve docstring format. (whitespace-file-style) (whitespace-mode-style): New user options. (whitespace-style): New function. Handles file and mode-specific style settings introduced by the above new user options. Used throughout the file instead of the just the eponym variable. (whitespace-action-custom-type): New constant. (whitespace-action): Use it. Update and improve docstring format. (whitespace-file-action) (whitespace-mode-action): New user options. (whitespace-action): New function. Handles file and mode-specific style settings introduced by the above new user options. Used throughout the file instead of the just the eponym variable. (whitespace-cleanup) (whitespace-cleanup-region) (whitespace-report-region): Update docstring. Use the `whitespace-style' function instead of the eponym variable. (whitespace-interactive-char) (whitespace-toggle-list) (whitespace-turn-on): Handle file/mode-specific styles. (whitespace-action-when-on) (whitespace-write-file-hook) (whitespace-warn-when-read-only): Handle file-mode-specific actions by using the function `whitespace-action' instead of the eponym variable. (whitespace-space) (whitespace-hspace) (whitespace-tab) (whitespace-newline) (whitespace-trailing) (whitespace-line) (whitespace-space-before-tab) (whitespace-indentation) (whitespace-empty) (whitespace-space-after-tab) (whitespace-hspace-regexp) (whitespace-tab-regexp) (whitespace-trailing-regexp) (whitespace-space-before-tab-regexp) (whitespace-indentation-regexp) (whitespace-empty-at-bob-regexp) (whitespace-empty-at-eob-regexp) (whitespace-space-after-tab-regexp) (whitespace-line-column) (whitespace-display-mappings) (whitespace-style-value-list) (whitespace-active-style) (whitespace-toggle-options) (global-whitespace-toggle-options) (whitespace-report): Update docstrings. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=whitespace.patch *** whitespace.el.orig Thu Feb 7 12:57:24 2013 --- whitespace.el Sat Jan 19 19:00:26 2013 *************** *** 43,49 **** ;; it provides a visual mark for characters, for example, at the end ;; of line (?\xB6), at SPACEs (?\xB7) and at TABs (?\xBB). ;; ! ;; The `whitespace-style' variable selects which way blanks are ;; visualized. ;; ;; Note that when whitespace is turned on, whitespace saves the --- 43,50 ---- ;; it provides a visual mark for characters, for example, at the end ;; of line (?\xB6), at SPACEs (?\xB7) and at TABs (?\xBB). ;; ! ;; The `whitespace-file-style', `whitespace-mode-style' and ! ;; `whitespace-style' variables select which way blanks are ;; visualized. ;; ;; Note that when whitespace is turned on, whitespace saves the *************** *** 186,224 **** ;; ;; 1. empty lines at beginning of buffer. ;; 2. empty lines at end of buffer. ! ;; If `whitespace-style' includes the value `empty', remove all ;; empty lines at beginning and/or end of buffer. ;; ;; 3. 8 or more SPACEs at beginning of line. ! ;; If `whitespace-style' includes the value `indentation': ;; replace 8 or more SPACEs at beginning of line by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs by ;; SPACEs. ! ;; If `whitespace-style' includes the value `indentation::tab', ;; replace 8 or more SPACEs at beginning of line by TABs. ! ;; If `whitespace-style' includes the value `indentation::space', ;; replace TABs by SPACEs. ;; ;; 4. SPACEs before TAB. ! ;; If `whitespace-style' includes the value `space-before-tab': ;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; ;; otherwise, replace TABs by SPACEs. ! ;; If `whitespace-style' includes the value ;; `space-before-tab::tab', replace SPACEs by TABs. ! ;; If `whitespace-style' includes the value ;; `space-before-tab::space', replace TABs by SPACEs. ;; ;; 5. SPACEs or TABs at end of line. ! ;; If `whitespace-style' includes the value `trailing', remove all ;; SPACEs or TABs at end of line. ;; ;; 6. 8 or more SPACEs after TAB. ! ;; If `whitespace-style' includes the value `space-after-tab': ;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; ;; otherwise, replace TABs by SPACEs. ! ;; If `whitespace-style' includes the value `space-after-tab::tab', ;; replace SPACEs by TABs. ! ;; If `whitespace-style' includes the value ;; `space-after-tab::space', replace TABs by SPACEs. ;; ;; --- 187,225 ---- ;; ;; 1. empty lines at beginning of buffer. ;; 2. empty lines at end of buffer. ! ;; If whitespace style includes the value `empty', remove all ;; empty lines at beginning and/or end of buffer. ;; ;; 3. 8 or more SPACEs at beginning of line. ! ;; If whitespace style includes the value `indentation': ;; replace 8 or more SPACEs at beginning of line by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs by ;; SPACEs. ! ;; If whitespace style includes the value `indentation::tab', ;; replace 8 or more SPACEs at beginning of line by TABs. ! ;; If whitespace style includes the value `indentation::space', ;; replace TABs by SPACEs. ;; ;; 4. SPACEs before TAB. ! ;; If whitespace style includes the value `space-before-tab': ;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; ;; otherwise, replace TABs by SPACEs. ! ;; If whitespace style includes the value ;; `space-before-tab::tab', replace SPACEs by TABs. ! ;; If whitespace style includes the value ;; `space-before-tab::space', replace TABs by SPACEs. ;; ;; 5. SPACEs or TABs at end of line. ! ;; If whitespace style includes the value `trailing', remove all ;; SPACEs or TABs at end of line. ;; ;; 6. 8 or more SPACEs after TAB. ! ;; If whitespace style includes the value `space-after-tab': ;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; ;; otherwise, replace TABs by SPACEs. ! ;; If whitespace style includes the value `space-after-tab::tab', ;; replace SPACEs by TABs. ! ;; If whitespace style includes the value ;; `space-after-tab::space', replace TABs by SPACEs. ;; ;; *************** *** 243,248 **** --- 244,251 ---- ;; Below it's shown a brief description of whitespace options, please, ;; see the options declaration in the code for a long documentation. ;; + ;; `whitespace-file-style' + ;; `whitespace-mode-style' ;; `whitespace-style' Specify which kind of blank is ;; visualized. ;; *************** *** 305,310 **** --- 308,315 ---- ;; `whitespace-mode' is automagically ;; turned on. ;; + ;; `whitespace-file-action' + ;; `whitespace-mode-action' ;; `whitespace-action' Specify which action is taken when a ;; buffer is visited or written. ;; *************** *** 383,388 **** --- 388,448 ---- :group 'convenience) + (defconst whitespace-style-custom-type + '(repeat :tag "Kind of Blank" + (choice :tag "Kind of Blank Face" + (const :tag "(Face) Face visualization" face) + (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs" + trailing) + (const :tag "(Face) SPACEs and HARD SPACEs" spaces) + (const :tag "(Face) TABs" tabs) + (const :tag "(Face) Lines" lines) + (const :tag "(Face) SPACEs before TAB" space-before-tab) + (const :tag "(Face) NEWLINEs" newline) + (const :tag "(Face) Indentation SPACEs" indentation) + (const :tag "(Face) Empty Lines At BOB And/Or EOB" empty) + (const :tag "(Face) SPACEs after TAB" space-after-tab) + (const :tag "(Mark) SPACEs and HARD SPACEs" space-mark) + (const :tag "(Mark) TABs" tab-mark) + (const :tag "(Mark) NEWLINEs" newline-mark))) + ;; Custom type specification for Whitespace styles. Used in + ;; WHITESPACE-FILE-STYLE, WHITESPACE-MODE-STYLE and + ;; WHITESPACE-STYLE. + ) + + (defcustom whitespace-file-style nil + "Specify which kind of blank is visualized for specific files. + + This is a list of elements of the form (REGEXP STYLE...) where + REGEXP is matched against file names. For a list of possible + STYLEs, see `whitespace-style'. + + Whitespace determines which style to use on a specific buffer by + trying a match from this variable, then from + `whitespace-mode-style' and then by falling back to + `whitespace-style'." + :type `(repeat (cons :value ("") + (regexp :tag "File Name Matching") + ,whitespace-style-custom-type)) + :version "24.3" + :group 'whitespace) + + (defcustom whitespace-mode-style nil + "Specify which kind of blank is visualized for specific major modes. + + This is a list of elements of the form (MODE STYLE...) where MODE + is a major mode name. For a list of possible STYLEs, see + `whitespace-style'. + + Whitespace determines which style to use on a specific buffer by + trying a match from `whitespace-file-style', then from this + variable and then by falling back to `whitespace-style'." + :type `(repeat (cons :value (fundamental-mode) + (symbol :tag "Major Mode") + ,whitespace-style-custom-type)) + :version "24.3" + :group 'whitespace) + (defcustom whitespace-style '(face tabs spaces trailing lines space-before-tab newline *************** *** 392,411 **** It's a list containing some or all of the following values: ! face enable all visualization via faces (see below). trailing trailing blanks are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. ! tabs TABs are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. spaces SPACEs and HARD SPACEs are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. lines lines which have columns beyond `whitespace-line-column' are highlighted via --- 452,471 ---- It's a list containing some or all of the following values: ! face enable all visualization via faces (see below). trailing trailing blanks are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. ! tabs TABs are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. spaces SPACEs and HARD SPACEs are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. lines lines which have columns beyond `whitespace-line-column' are highlighted via *************** It's a list containing some or all of th *** 414,420 **** It has precedence over `lines-tail' (see below). It has effect only if `face' (see above) ! is present in `whitespace-style'. lines-tail lines which have columns beyond `whitespace-line-column' are highlighted via --- 474,480 ---- It has precedence over `lines-tail' (see below). It has effect only if `face' (see above) ! is present in whitespace style. lines-tail lines which have columns beyond `whitespace-line-column' are highlighted via *************** It's a list containing some or all of th *** 422,497 **** But only the part of line which goes beyond `whitespace-line-column' column. It has effect only if `lines' (see above) ! is not present in `whitespace-style' and if `face' (see above) is present in ! `whitespace-style'. newline NEWLINEs are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. empty empty lines at beginning and/or end of buffer are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. indentation::tab 8 or more SPACEs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. indentation::space TABs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. indentation 8 or more SPACEs at beginning of line are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, TABs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. ! space-after-tab::tab 8 or more SPACEs after a TAB are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-after-tab::space TABs are visualized when 8 or more SPACEs occur after a TAB, via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-after-tab 8 or more SPACEs after a TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-before-tab::tab SPACEs before TAB are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-before-tab::space TABs are visualized when SPACEs occur before TAB, via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-before-tab SPACEs before TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. It has effect only if `face' (see above) ! is present in `whitespace-style'. space-mark SPACEs and HARD SPACEs are visualized via display table. tab-mark TABs are visualized via display table. ! newline-mark NEWLINEs are visualized via display table. Any other value is ignored. --- 482,557 ---- But only the part of line which goes beyond `whitespace-line-column' column. It has effect only if `lines' (see above) ! is not present in whitespace style and if `face' (see above) is present in ! whitespace style. newline NEWLINEs are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. empty empty lines at beginning and/or end of buffer are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. indentation::tab 8 or more SPACEs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. indentation::space TABs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. indentation 8 or more SPACEs at beginning of line are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, TABs at beginning of line are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. ! space-after-tab::tab 8 or more SPACEs after a TAB are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-after-tab::space TABs are visualized when 8 or more SPACEs occur after a TAB, via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-after-tab 8 or more SPACEs after a TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-before-tab::tab SPACEs before TAB are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-before-tab::space TABs are visualized when SPACEs occur before TAB, via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-before-tab SPACEs before TAB are visualized, if `indent-tabs-mode' (which see) is non-nil; otherwise, the TABs are visualized via faces. It has effect only if `face' (see above) ! is present in whitespace style. space-mark SPACEs and HARD SPACEs are visualized via display table. tab-mark TABs are visualized via display table. ! newline-mark NEWLINEs are visualized via display table. Any other value is ignored. *************** If nil, don't visualize TABs, (HARD) SPA *** 499,508 **** via display table. There is an evaluation order for some values, if they are ! included in `whitespace-style' list. For example, if ! indentation, indentation::tab and/or indentation::space are ! included in `whitespace-style' list. The evaluation order for ! these values is: * For indentation: 1. indentation --- 559,567 ---- via display table. There is an evaluation order for some values, if they are ! present, for example if indentation, indentation::tab and/or ! indentation::space are included. The evaluation order for these ! values is: * For indentation: 1. indentation *************** these values is: *** 520,564 **** 3. space-before-tab::space So, for example, if indentation and indentation::space are ! included in `whitespace-style' list, the indentation value is ! evaluated instead of indentation::space value. One reason for not visualize spaces via faces (if `face' is not ! included in `whitespace-style') is to use exclusively for cleaning up a buffer. See `whitespace-cleanup' and `whitespace-cleanup-region' for documentation. See also `whitespace-display-mappings' for documentation." ! :type '(repeat :tag "Kind of Blank" ! (choice :tag "Kind of Blank Face" ! (const :tag "(Face) Face visualization" ! face) ! (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs" ! trailing) ! (const :tag "(Face) SPACEs and HARD SPACEs" ! spaces) ! (const :tag "(Face) TABs" tabs) ! (const :tag "(Face) Lines" lines) ! (const :tag "(Face) SPACEs before TAB" ! space-before-tab) ! (const :tag "(Face) NEWLINEs" newline) ! (const :tag "(Face) Indentation SPACEs" ! indentation) ! (const :tag "(Face) Empty Lines At BOB And/Or EOB" ! empty) ! (const :tag "(Face) SPACEs after TAB" ! space-after-tab) ! (const :tag "(Mark) SPACEs and HARD SPACEs" ! space-mark) ! (const :tag "(Mark) TABs" tab-mark) ! (const :tag "(Mark) NEWLINEs" newline-mark))) :group 'whitespace) (defcustom whitespace-space 'whitespace-space "Symbol face used to visualize SPACE. ! Used when `whitespace-style' includes the value `spaces'." :type 'face :group 'whitespace) --- 579,621 ---- 3. space-before-tab::space So, for example, if indentation and indentation::space are ! included, the indentation value is evaluated instead of ! indentation::space value. One reason for not visualize spaces via faces (if `face' is not ! included in whitespace style) is to use exclusively for cleaning up a buffer. See `whitespace-cleanup' and `whitespace-cleanup-region' for documentation. + Whitespace determines which style to use on a specific buffer by + trying a match from `whitespace-file-style', then from + `whitespace-mode-style' and then by falling back to this + variable. + See also `whitespace-display-mappings' for documentation." ! :type whitespace-style-custom-type :group 'whitespace) + (defun whitespace-style () + "Determine which style to use on current buffer." + (let (match) + (when buffer-file-name + (let ((styles whitespace-file-style) + style) + (while (and (not match) (setq style (pop styles))) + (when (string-match (car style) buffer-file-name) + (setq match style))))) + (unless match + (setq match (assoc major-mode whitespace-mode-style))) + (if match + (cdr match) + whitespace-style))) + (defcustom whitespace-space 'whitespace-space "Symbol face used to visualize SPACE. ! Used when whitespace style includes the value `spaces'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 576,582 **** (defcustom whitespace-hspace 'whitespace-hspace "Symbol face used to visualize HARD SPACE. ! Used when `whitespace-style' includes the value `spaces'." :type 'face :group 'whitespace) --- 633,639 ---- (defcustom whitespace-hspace 'whitespace-hspace "Symbol face used to visualize HARD SPACE. ! Used when whitespace style includes the value `spaces'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 594,600 **** (defcustom whitespace-tab 'whitespace-tab "Symbol face used to visualize TAB. ! Used when `whitespace-style' includes the value `tabs'." :type 'face :group 'whitespace) --- 651,657 ---- (defcustom whitespace-tab 'whitespace-tab "Symbol face used to visualize TAB. ! Used when whitespace style includes the value `tabs'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 614,620 **** See `whitespace-display-mappings'. ! Used when `whitespace-style' includes the values `newline-mark' and `newline'." :type 'face :group 'whitespace) --- 671,677 ---- See `whitespace-display-mappings'. ! Used when whitespace style includes the values `newline-mark' and `newline'." :type 'face :group 'whitespace) *************** See `whitespace-display-mappings'." *** 637,643 **** (defcustom whitespace-trailing 'whitespace-trailing "Symbol face used to visualize trailing blanks. ! Used when `whitespace-style' includes the value `trailing'." :type 'face :group 'whitespace) --- 694,700 ---- (defcustom whitespace-trailing 'whitespace-trailing "Symbol face used to visualize trailing blanks. ! Used when whitespace style includes the value `trailing'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 655,661 **** See `whitespace-line-column'. ! Used when `whitespace-style' includes the value `line'." :type 'face :group 'whitespace) --- 712,718 ---- See `whitespace-line-column'. ! Used when whitespace style includes the value `line'." :type 'face :group 'whitespace) *************** See `whitespace-line-column'." *** 672,678 **** (defcustom whitespace-space-before-tab 'whitespace-space-before-tab "Symbol face used to visualize SPACEs before TAB. ! Used when `whitespace-style' includes the value `space-before-tab'." :type 'face :group 'whitespace) --- 729,735 ---- (defcustom whitespace-space-before-tab 'whitespace-space-before-tab "Symbol face used to visualize SPACEs before TAB. ! Used when whitespace style includes the value `space-before-tab'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 687,693 **** (defcustom whitespace-indentation 'whitespace-indentation "Symbol face used to visualize 8 or more SPACEs at beginning of line. ! Used when `whitespace-style' includes the value `indentation'." :type 'face :group 'whitespace) --- 744,750 ---- (defcustom whitespace-indentation 'whitespace-indentation "Symbol face used to visualize 8 or more SPACEs at beginning of line. ! Used when whitespace style includes the value `indentation'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 702,708 **** (defcustom whitespace-empty 'whitespace-empty "Symbol face used to visualize empty lines at beginning and/or end of buffer. ! Used when `whitespace-style' includes the value `empty'." :type 'face :group 'whitespace) --- 759,765 ---- (defcustom whitespace-empty 'whitespace-empty "Symbol face used to visualize empty lines at beginning and/or end of buffer. ! Used when whitespace style includes the value `empty'." :type 'face :group 'whitespace) *************** Used when `whitespace-style' includes th *** 717,723 **** (defcustom whitespace-space-after-tab 'whitespace-space-after-tab "Symbol face used to visualize 8 or more SPACEs after TAB. ! Used when `whitespace-style' includes the value `space-after-tab'." :type 'face :group 'whitespace) --- 774,780 ---- (defcustom whitespace-space-after-tab 'whitespace-space-after-tab "Symbol face used to visualize 8 or more SPACEs after TAB. ! Used when whitespace style includes the value `space-after-tab'." :type 'face :group 'whitespace) *************** visualize only HARD SPACEs between TABs. *** 753,759 **** NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when `whitespace-style' includes `spaces'." :type '(regexp :tag "HARD SPACE Chars") :group 'whitespace) --- 810,816 ---- NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when whitespace style includes `spaces'." :type '(regexp :tag "HARD SPACE Chars") :group 'whitespace) *************** visualize leading and/or trailing SPACEs *** 775,781 **** NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when `whitespace-style' includes `spaces'." :type '(regexp :tag "SPACE Chars") :group 'whitespace) --- 832,838 ---- NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when whitespace style includes `spaces'." :type '(regexp :tag "SPACE Chars") :group 'whitespace) *************** visualize leading and/or trailing TABs. *** 797,803 **** NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when `whitespace-style' includes `tabs'." :type '(regexp :tag "TAB Chars") :group 'whitespace) --- 854,860 ---- NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. Use exactly one pair of enclosing \\\\( and \\\\). ! Used when whitespace style includes `tabs'." :type '(regexp :tag "TAB Chars") :group 'whitespace) *************** that should be considered blank. *** 815,821 **** NOTE: Enclose always by \"\\\\(\" and \"\\\\)$\" the elements to highlight. Use exactly one pair of enclosing elements above. ! Used when `whitespace-style' includes `trailing'." :type '(regexp :tag "Trailing Chars") :group 'whitespace) --- 872,878 ---- NOTE: Enclose always by \"\\\\(\" and \"\\\\)$\" the elements to highlight. Use exactly one pair of enclosing elements above. ! Used when whitespace style includes `trailing'." :type '(regexp :tag "Trailing Chars") :group 'whitespace) *************** If you're using `mule' package, there ma *** 830,836 **** that should be considered blank. ! Used when `whitespace-style' includes `space-before-tab', `space-before-tab::tab' or `space-before-tab::space'." :type '(regexp :tag "SPACEs Before TAB") :group 'whitespace) --- 887,893 ---- that should be considered blank. ! Used when whitespace style includes `space-before-tab', `space-before-tab::tab' or `space-before-tab::space'." :type '(regexp :tag "SPACEs Before TAB") :group 'whitespace) *************** If you're using `mule' package, there ma *** 851,857 **** that should be considered blank. ! Used when `whitespace-style' includes `indentation', `indentation::tab' or `indentation::space'." :type '(cons (regexp :tag "Indentation SPACEs") (regexp :tag "Indentation TABs")) --- 908,914 ---- that should be considered blank. ! Used when whitespace style includes `indentation', `indentation::tab' or `indentation::space'." :type '(cons (regexp :tag "Indentation SPACEs") (regexp :tag "Indentation TABs")) *************** If you're using `mule' package, there ma *** 868,874 **** that should be considered blank. ! Used when `whitespace-style' includes `empty'." :type '(regexp :tag "Empty Lines At Beginning Of Buffer") :group 'whitespace) --- 925,931 ---- that should be considered blank. ! Used when whitespace style includes `empty'." :type '(regexp :tag "Empty Lines At Beginning Of Buffer") :group 'whitespace) *************** If you're using `mule' package, there ma *** 883,889 **** that should be considered blank. ! Used when `whitespace-style' includes `empty'." :type '(regexp :tag "Empty Lines At End Of Buffer") :group 'whitespace) --- 940,946 ---- that should be considered blank. ! Used when whitespace style includes `empty'." :type '(regexp :tag "Empty Lines At End Of Buffer") :group 'whitespace) *************** If you're using `mule' package, there ma *** 903,909 **** that should be considered blank. ! Used when `whitespace-style' includes `space-after-tab', `space-after-tab::tab' or `space-after-tab::space'." :type '(regexp :tag "SPACEs After TAB") :group 'whitespace) --- 960,966 ---- that should be considered blank. ! Used when whitespace style includes `space-after-tab', `space-after-tab::tab' or `space-after-tab::space'." :type '(regexp :tag "SPACEs After TAB") :group 'whitespace) *************** Used when `whitespace-style' includes `s *** 915,921 **** It must be an integer or nil. If nil, the `fill-column' variable value is used. ! Used when `whitespace-style' includes `lines' or `lines-tail'." :type '(choice :tag "Line Length Limit" (integer :tag "Line Length") (const :tag "Use fill-column" nil)) --- 972,978 ---- It must be an integer or nil. If nil, the `fill-column' variable value is used. ! Used when whitespace style includes `lines' or `lines-tail'." :type '(choice :tag "Line Length Limit" (integer :tag "Line Length") (const :tag "Use fill-column" nil)) *************** VECTOR is a vector of characters to be d *** 969,975 **** The NEWLINE character is displayed using the face given by `whitespace-newline' variable. ! Used when `whitespace-style' includes `tab-mark', `space-mark' or `newline-mark'." :type '(repeat (list :tag "Character Mapping" --- 1026,1032 ---- The NEWLINE character is displayed using the face given by `whitespace-newline' variable. ! Used when whitespace style includes `tab-mark', `space-mark' or `newline-mark'." :type '(repeat (list :tag "Character Mapping" *************** C++ modes only." *** 1016,1026 **** (symbol :tag "Mode")))) :group 'whitespace) (defcustom whitespace-action nil ! "Specify which action is taken when a buffer is visited or written. ! It's a list containing some or all of the following values: nil no action is taken. --- 1073,1137 ---- (symbol :tag "Mode")))) :group 'whitespace) + (defconst whitespace-action-custom-type + '(choice :tag "Actions" + (const :tag "None" nil) + (repeat :tag "Action List" + (choice :tag "Action" + (const :tag "Cleanup When On" cleanup) + (const :tag "Report On Bogus" report-on-bogus) + (const :tag "Auto Cleanup" auto-cleanup) + (const :tag "Abort On Bogus" abort-on-bogus) + (const :tag "Warn If Read-Only" + warn-if-read-only)))) + ;; Custom type specification for Whitespace actions. Used in + ;; WHITESPACE-FILE-ACTION, WHITESPACE-MODE-ACTION and + ;; WHITESPACE-ACTION. + ) + + (defcustom whitespace-file-action nil + "File-specific actions to take when a buffer is visited or written. + + This is a list of elements of the form (REGEXP ACTION...) where + REGEXP is matched against file names. For a list of possible + ACTIONs, see `whitespace-action'. + + Whitespace determines which actions need to be taken on a + specific buffer by trying a match from this variable, then from + `whitespace-mode-action' and then by falling back to + `whitespace-action'." + :type `(repeat (cons :value ("") + (regexp :tag "File Name Matching") + ,whitespace-action-custom-type)) + :version "24.3" + :group 'whitespace) + + (defcustom whitespace-mode-action nil + "Mode-specific actions to take when a buffer is visited or written. + + This is a list of elements of the form (MODE ACTION...) where + MODE is a major mode name. For a list of possible ACTIONs, see + `whitespace-action'. + + Whitespace determines which actions need to be taken on a + specific buffer by trying a match from `whitespace-file-action', + then from this variable and then by falling back to + `whitespace-action'." + :type `(repeat (cons :value (fundamental-mode) + (symbol :tag "Major Mode") + ,whitespace-action-custom-type)) + :version "24.3" + :group 'whitespace) (defcustom whitespace-action nil ! "Default actions to take when a buffer is visited or written. ! Whitespace determines which actions need to be taken on a ! specific buffer by trying a match from `whitespace-file-action', ! then from `whitespace-mode-action' and then by falling back to ! this variable. ! ! Its value is a list containing some or all of the following symbols: nil no action is taken. *************** It's a list containing some or all of th *** 1032,1038 **** report-on-bogus report if there is any bogus whitespace always when local whitespace is turned on. ! auto-cleanup cleanup any bogus whitespace when buffer is written. See `whitespace-cleanup' and `whitespace-cleanup-region'. --- 1143,1149 ---- report-on-bogus report if there is any bogus whitespace always when local whitespace is turned on. ! auto-cleanup cleanup any bogus whitespace when buffer is written. See `whitespace-cleanup' and `whitespace-cleanup-region'. *************** It's a list containing some or all of th *** 1041,1061 **** buffer is written. warn-if-read-only give a warning if `cleanup' or `auto-cleanup' ! is included in `whitespace-action' and the ! buffer is read-only. Any other value is treated as nil." ! :type '(choice :tag "Actions" ! (const :tag "None" nil) ! (repeat :tag "Action List" ! (choice :tag "Action" ! (const :tag "Cleanup When On" cleanup) ! (const :tag "Report On Bogus" report-on-bogus) ! (const :tag "Auto Cleanup" auto-cleanup) ! (const :tag "Abort On Bogus" abort-on-bogus) ! (const :tag "Warn If Read-Only" warn-if-read-only)))) :group 'whitespace) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; User commands - Local mode --- 1152,1179 ---- buffer is written. warn-if-read-only give a warning if `cleanup' or `auto-cleanup' ! is present and the buffer is read-only. Any other value is treated as nil." ! :type whitespace-action-custom-type :group 'whitespace) + (defun whitespace-action () + "Determine which actions to take on current buffer." + (let (match) + (when buffer-file-name + (let ((actions whitespace-file-action) + action) + (while (and (not match) (setq action (pop actions))) + (when (string-match (car action) buffer-file-name) + (setq match action))))) + (unless match + (setq match (assoc major-mode whitespace-mode-action))) + (if match + (cdr match) + whitespace-action))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; User commands - Local mode *************** See also `whitespace-newline' and `white *** 1188,1194 **** :group 'whitespace (let ((whitespace-style '(newline-mark newline))) (global-whitespace-mode (if global-whitespace-newline-mode ! 1 -1)) ;; sync states (running a batch job) (setq global-whitespace-newline-mode global-whitespace-mode))) --- 1306,1312 ---- :group 'whitespace (let ((whitespace-style '(newline-mark newline))) (global-whitespace-mode (if global-whitespace-newline-mode ! 1 -1)) ;; sync states (running a batch job) (setq global-whitespace-newline-mode global-whitespace-mode))) *************** See also `whitespace-newline' and `white *** 1220,1226 **** space-mark newline-mark ) ! "List of valid `whitespace-style' values.") (defconst whitespace-toggle-option-alist --- 1338,1344 ---- space-mark newline-mark ) ! "List of valid whitespace style values.") (defconst whitespace-toggle-option-alist *************** SYMBOL is a valid symbol associated with *** 1261,1267 **** (defvar whitespace-active-style nil ! "Used to save locally `whitespace-style' value.") (defvar whitespace-indent-tabs-mode indent-tabs-mode "Used to save locally `indent-tabs-mode' value.") --- 1379,1385 ---- (defvar whitespace-active-style nil ! "Used to save locally whitespace style value.") (defvar whitespace-indent-tabs-mode indent-tabs-mode "Used to save locally `indent-tabs-mode' value.") *************** Interactively, it reads one of the follo *** 1328,1334 **** S toggle SPACEs before TAB visualization N toggle NEWLINE visualization ! x restore `whitespace-style' value ? display brief help Non-interactively, ARG should be a symbol or a list of symbols. --- 1446,1452 ---- S toggle SPACEs before TAB visualization N toggle NEWLINE visualization ! x restore original whitespace style ? display brief help Non-interactively, ARG should be a symbol or a list of symbols. *************** The valid symbols are: *** 1346,1352 **** indentation::tab toggle indentation SPACEs visualization indentation::space toggle indentation TABs visualization space-after-tab toggle SPACEs after TAB visualization ! space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization space-after-tab::space toggle SPACEs after TAB: TABs visualization space-before-tab toggle SPACEs before TAB visualization space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization --- 1464,1470 ---- indentation::tab toggle indentation SPACEs visualization indentation::space toggle indentation TABs visualization space-after-tab toggle SPACEs after TAB visualization ! space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization space-after-tab::space toggle SPACEs after TAB: TABs visualization space-before-tab toggle SPACEs before TAB visualization space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization *************** The valid symbols are: *** 1356,1362 **** space-mark toggle SPACEs before TAB visualization newline-mark toggle NEWLINE visualization ! whitespace-style restore `whitespace-style' value See `whitespace-style' and `indent-tabs-mode' for documentation." (interactive (whitespace-interactive-char t)) --- 1474,1480 ---- space-mark toggle SPACEs before TAB visualization newline-mark toggle NEWLINE visualization ! whitespace-style restore original whitespace style See `whitespace-style' and `indent-tabs-mode' for documentation." (interactive (whitespace-interactive-char t)) *************** Interactively, it accepts one of the fol *** 1407,1413 **** S toggle SPACEs before TAB visualization N toggle NEWLINE visualization ! x restore `whitespace-style' value ? display brief help Non-interactively, ARG should be a symbol or a list of symbols. --- 1525,1531 ---- S toggle SPACEs before TAB visualization N toggle NEWLINE visualization ! x restore original whitespace style ? display brief help Non-interactively, ARG should be a symbol or a list of symbols. *************** The valid symbols are: *** 1435,1441 **** space-mark toggle SPACEs before TAB visualization newline-mark toggle NEWLINE visualization ! whitespace-style restore `whitespace-style' value See `whitespace-style' and `indent-tabs-mode' for documentation." (interactive (whitespace-interactive-char nil)) --- 1553,1559 ---- space-mark toggle SPACEs before TAB visualization newline-mark toggle NEWLINE visualization ! whitespace-style restore original whitespace style See `whitespace-style' and `indent-tabs-mode' for documentation." (interactive (whitespace-interactive-char nil)) *************** The problems cleaned up are: *** 1466,1504 **** 1. empty lines at beginning of buffer. 2. empty lines at end of buffer. ! If `whitespace-style' includes the value `empty', remove all empty lines at beginning and/or end of buffer. 3. 8 or more SPACEs at beginning of line. ! If `whitespace-style' includes the value `indentation': replace 8 or more SPACEs at beginning of line by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `indentation::tab', replace 8 or more SPACEs at beginning of line by TABs. ! If `whitespace-style' includes the value `indentation::space', replace TABs by SPACEs. 4. SPACEs before TAB. ! If `whitespace-style' includes the value `space-before-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `space-before-tab::tab', replace SPACEs by TABs. ! If `whitespace-style' includes the value `space-before-tab::space', replace TABs by SPACEs. 5. SPACEs or TABs at end of line. ! If `whitespace-style' includes the value `trailing', remove all SPACEs or TABs at end of line. 6. 8 or more SPACEs after TAB. ! If `whitespace-style' includes the value `space-after-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `space-after-tab::tab', replace SPACEs by TABs. ! If `whitespace-style' includes the value `space-after-tab::space', replace TABs by SPACEs. See `whitespace-style', `indent-tabs-mode' and `tab-width' for --- 1584,1622 ---- 1. empty lines at beginning of buffer. 2. empty lines at end of buffer. ! If whitespace style includes the value `empty', remove all empty lines at beginning and/or end of buffer. 3. 8 or more SPACEs at beginning of line. ! If whitespace style includes the value `indentation': replace 8 or more SPACEs at beginning of line by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `indentation::tab', replace 8 or more SPACEs at beginning of line by TABs. ! If whitespace style includes the value `indentation::space', replace TABs by SPACEs. 4. SPACEs before TAB. ! If whitespace style includes the value `space-before-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `space-before-tab::tab', replace SPACEs by TABs. ! If whitespace style includes the value `space-before-tab::space', replace TABs by SPACEs. 5. SPACEs or TABs at end of line. ! If whitespace style includes the value `trailing', remove all SPACEs or TABs at end of line. 6. 8 or more SPACEs after TAB. ! If whitespace style includes the value `space-after-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `space-after-tab::tab', replace SPACEs by TABs. ! If whitespace style includes the value `space-after-tab::space', replace TABs by SPACEs. See `whitespace-style', `indent-tabs-mode' and `tab-width' for *************** documentation." *** 1525,1531 **** ;; PROBLEM 1: empty lines at bob ;; PROBLEM 2: empty lines at eob ;; ACTION: remove all empty lines at bob and/or eob ! (when (memq 'empty whitespace-style) (let (overwrite-mode) ; enforce no overwrite (goto-char (point-min)) (when (looking-at whitespace-empty-at-bob-regexp) --- 1643,1649 ---- ;; PROBLEM 1: empty lines at bob ;; PROBLEM 2: empty lines at eob ;; ACTION: remove all empty lines at bob and/or eob ! (when (memq 'empty (whitespace-style)) (let (overwrite-mode) ; enforce no overwrite (goto-char (point-min)) (when (looking-at whitespace-empty-at-bob-regexp) *************** documentation." *** 1547,1584 **** The problems cleaned up are: 1. 8 or more SPACEs at beginning of line. ! If `whitespace-style' includes the value `indentation': replace 8 or more SPACEs at beginning of line by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `indentation::tab', replace 8 or more SPACEs at beginning of line by TABs. ! If `whitespace-style' includes the value `indentation::space', replace TABs by SPACEs. 2. SPACEs before TAB. ! If `whitespace-style' includes the value `space-before-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `space-before-tab::tab', replace SPACEs by TABs. ! If `whitespace-style' includes the value `space-before-tab::space', replace TABs by SPACEs. 3. SPACEs or TABs at end of line. ! If `whitespace-style' includes the value `trailing', remove all SPACEs or TABs at end of line. 4. 8 or more SPACEs after TAB. ! If `whitespace-style' includes the value `space-after-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If `whitespace-style' includes the value `space-after-tab::tab', replace SPACEs by TABs. ! If `whitespace-style' includes the value `space-after-tab::space', replace TABs by SPACEs. ! See `whitespace-style', `indent-tabs-mode' and `tab-width' for documentation." (interactive "@r") (if buffer-read-only --- 1665,1702 ---- The problems cleaned up are: 1. 8 or more SPACEs at beginning of line. ! If whitespace style includes the value `indentation': replace 8 or more SPACEs at beginning of line by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `indentation::tab', replace 8 or more SPACEs at beginning of line by TABs. ! If whitespace style includes the value `indentation::space', replace TABs by SPACEs. 2. SPACEs before TAB. ! If whitespace style includes the value `space-before-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `space-before-tab::tab', replace SPACEs by TABs. ! If whitespace style includes the value `space-before-tab::space', replace TABs by SPACEs. 3. SPACEs or TABs at end of line. ! If whitespace style includes the value `trailing', remove all SPACEs or TABs at end of line. 4. 8 or more SPACEs after TAB. ! If whitespace style includes the value `space-after-tab': replace SPACEs by TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by SPACEs. ! If whitespace style includes the value `space-after-tab::tab', replace SPACEs by TABs. ! If whitespace style includes the value `space-after-tab::space', replace TABs by SPACEs. ! See whitespace style, `indent-tabs-mode' and `tab-width' for documentation." (interactive "@r") (if buffer-read-only *************** documentation." *** 1598,1604 **** ;; ACTION: replace 8 or more SPACEs at bol by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'indentation whitespace-style) (let ((regexp (whitespace-indentation-regexp))) (goto-char rstart) (while (re-search-forward regexp rend t) --- 1716,1722 ---- ;; ACTION: replace 8 or more SPACEs at bol by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'indentation (whitespace-style)) (let ((regexp (whitespace-indentation-regexp))) (goto-char rstart) (while (re-search-forward regexp rend t) *************** documentation." *** 1608,1625 **** (unless (eolp) (indent-to tmp))))) ;; ACTION: replace 8 or more SPACEs at bol by TABs. ! ((memq 'indentation::tab whitespace-style) (whitespace-replace-action 'tabify rstart rend (whitespace-indentation-regexp 'tab) 0)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'indentation::space whitespace-style) (whitespace-replace-action 'untabify rstart rend (whitespace-indentation-regexp 'space) 0))) ;; PROBLEM 3: SPACEs or TABs at eol ;; ACTION: remove all SPACEs or TABs at eol ! (when (memq 'trailing whitespace-style) (whitespace-replace-action 'delete-region rstart rend whitespace-trailing-regexp 1)) --- 1726,1743 ---- (unless (eolp) (indent-to tmp))))) ;; ACTION: replace 8 or more SPACEs at bol by TABs. ! ((memq 'indentation::tab (whitespace-style)) (whitespace-replace-action 'tabify rstart rend (whitespace-indentation-regexp 'tab) 0)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'indentation::space (whitespace-style)) (whitespace-replace-action 'untabify rstart rend (whitespace-indentation-regexp 'space) 0))) ;; PROBLEM 3: SPACEs or TABs at eol ;; ACTION: remove all SPACEs or TABs at eol ! (when (memq 'trailing (whitespace-style)) (whitespace-replace-action 'delete-region rstart rend whitespace-trailing-regexp 1)) *************** documentation." *** 1628,1644 **** ;; ACTION: replace 8 or more SPACEs by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'space-after-tab whitespace-style) (whitespace-replace-action (if whitespace-indent-tabs-mode 'tabify 'untabify) rstart rend (whitespace-space-after-tab-regexp) 1)) ;; ACTION: replace 8 or more SPACEs by TABs. ! ((memq 'space-after-tab::tab whitespace-style) (whitespace-replace-action 'tabify rstart rend (whitespace-space-after-tab-regexp 'tab) 1)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'space-after-tab::space whitespace-style) (whitespace-replace-action 'untabify rstart rend (whitespace-space-after-tab-regexp 'space) 1))) --- 1746,1762 ---- ;; ACTION: replace 8 or more SPACEs by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'space-after-tab (whitespace-style)) (whitespace-replace-action (if whitespace-indent-tabs-mode 'tabify 'untabify) rstart rend (whitespace-space-after-tab-regexp) 1)) ;; ACTION: replace 8 or more SPACEs by TABs. ! ((memq 'space-after-tab::tab (whitespace-style)) (whitespace-replace-action 'tabify rstart rend (whitespace-space-after-tab-regexp 'tab) 1)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'space-after-tab::space (whitespace-style)) (whitespace-replace-action 'untabify rstart rend (whitespace-space-after-tab-regexp 'space) 1))) *************** documentation." *** 1647,1664 **** ;; ACTION: replace SPACEs before TAB by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'space-before-tab whitespace-style) (whitespace-replace-action (if whitespace-indent-tabs-mode 'tabify 'untabify) rstart rend whitespace-space-before-tab-regexp (if whitespace-indent-tabs-mode 0 2))) ;; ACTION: replace SPACEs before TAB by TABs. ! ((memq 'space-before-tab::tab whitespace-style) (whitespace-replace-action 'tabify rstart rend whitespace-space-before-tab-regexp 0)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'space-before-tab::space whitespace-style) (whitespace-replace-action 'untabify rstart rend whitespace-space-before-tab-regexp 2))))) --- 1765,1782 ---- ;; ACTION: replace SPACEs before TAB by TABs, if ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs ;; by SPACEs. ! ((memq 'space-before-tab (whitespace-style)) (whitespace-replace-action (if whitespace-indent-tabs-mode 'tabify 'untabify) rstart rend whitespace-space-before-tab-regexp (if whitespace-indent-tabs-mode 0 2))) ;; ACTION: replace SPACEs before TAB by TABs. ! ((memq 'space-before-tab::tab (whitespace-style)) (whitespace-replace-action 'tabify rstart rend whitespace-space-before-tab-regexp 0)) ;; ACTION: replace TABs by SPACEs. ! ((memq 'space-before-tab::space (whitespace-style)) (whitespace-replace-action 'untabify rstart rend whitespace-space-before-tab-regexp 2))))) *************** non-nil. *** 1783,1789 **** If FORCE is non-nil or \\[universal-argument] was pressed just before calling `whitespace-report' interactively, it forces ! `whitespace-style' to have: empty trailing --- 1901,1907 ---- If FORCE is non-nil or \\[universal-argument] was pressed just before calling `whitespace-report' interactively, it forces ! whitespace style to have: empty trailing *************** non-nil. *** 1829,1835 **** 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 --- 1947,1953 ---- 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 *************** cleaning up these problems." *** 1865,1878 **** (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 --- 1983,1997 ---- (setq force (or current-prefix-arg force)) (save-excursion (save-match-data ;FIXME: Why? ! (let* ((style (whitespace-style)) ! (has-bogus nil) (rstart (min start end)) (rend (max start end)) (bogus-list (mapcar #'(lambda (option) (when force ! (add-to-list 'style (car option))) (goto-char rstart) (let ((regexp (cond *************** cleaning up these problems." *** 1909,1916 **** (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) --- 2028,2034 ---- (forward-line 3) (dolist (option whitespace-report-list) (forward-line 1) ! (whitespace-mark-x 27 (memq (car option) style)) (whitespace-mark-x 7 (car bogus-list)) (setq bogus-list (cdr bogus-list))) (forward-line 1) *************** cleaning up these problems." *** 1943,1949 **** (defconst whitespace-help-text "\ Whitespace Toggle Options | scroll up : SPC or > | ! | scroll down: M-SPC or < | FACES \\__________________________/ [] f - toggle face visualization [] t - toggle TAB visualization --- 2061,2067 ---- (defconst whitespace-help-text "\ Whitespace Toggle Options | scroll up : SPC or > | ! | scroll down: M-SPC or < | FACES \\__________________________/ [] f - toggle face visualization [] t - toggle TAB visualization *************** cleaning up these problems." *** 1968,1974 **** [] S - toggle SPACE and HARD SPACE visualization [] N - toggle NEWLINE visualization ! x - restore `whitespace-style' value ? - display this text\n\n" "Text for whitespace toggle options.") --- 2086,2092 ---- [] S - toggle SPACE and HARD SPACE visualization [] N - toggle NEWLINE visualization ! x - restore original whitespace style ? - display this text\n\n" "Text for whitespace toggle options.") *************** It accepts one of the following chars: *** 2092,2105 **** S toggle SPACE and HARD SPACE visualization N toggle NEWLINE visualization ! x restore `whitespace-style' value ? display brief help See also `whitespace-toggle-option-alist'." ! (let* ((is-off (not (if local-p ! whitespace-mode ! global-whitespace-mode))) ! (style (cond (is-off whitespace-style) ; use default value (local-p whitespace-active-style) (t whitespace-toggle-style))) (prompt --- 2210,2223 ---- S toggle SPACE and HARD SPACE visualization N toggle NEWLINE visualization ! x restore original whitespace style ? display brief help See also `whitespace-toggle-option-alist'." ! (let* ((is-off (not (if local-p whitespace-mode global-whitespace-mode))) ! (style (cond (is-off (if local-p ! (whitespace-style) ! whitespace-style)) (local-p whitespace-active-style) (t whitespace-toggle-style))) (prompt *************** ARG is a list of options to be toggled. *** 2146,2152 **** THE-LIST is a list of options. This list will be toggled and the resultant list will be returned." (unless (if local-p whitespace-mode global-whitespace-mode) ! (setq the-list whitespace-style)) (setq the-list (copy-sequence the-list)) ; keep original list (dolist (sym (if (listp arg) arg (list arg))) (cond --- 2264,2270 ---- THE-LIST is a list of options. This list will be toggled and the resultant list will be returned." (unless (if local-p whitespace-mode global-whitespace-mode) ! (setq the-list (if local-p (whitespace-style) whitespace-style))) (setq the-list (copy-sequence the-list)) ; keep original list (dolist (sym (if (listp arg) arg (list arg))) (cond *************** resultant list will be returned." *** 2154,2160 **** ((eq sym 'help-newline)) ;; restore default values ((eq sym 'whitespace-style) ! (setq the-list whitespace-style)) ;; toggle valid values ((memq sym whitespace-style-value-list) (setq the-list (if (memq sym the-list) --- 2272,2278 ---- ((eq sym 'help-newline)) ;; restore default values ((eq sym 'whitespace-style) ! (setq the-list (if local-p (whitespace-style) whitespace-style))) ;; toggle valid values ((memq sym whitespace-style-value-list) (setq the-list (if (memq sym the-list) *************** resultant list will be returned." *** 2181,2189 **** (set (make-local-variable 'whitespace-display-table) nil) (set (make-local-variable 'whitespace-display-table-was-local) nil) (set (make-local-variable 'whitespace-active-style) ! (if (listp whitespace-style) ! whitespace-style ! (list whitespace-style))) (set (make-local-variable 'whitespace-indent-tabs-mode) indent-tabs-mode) (set (make-local-variable 'whitespace-tab-width) --- 2299,2307 ---- (set (make-local-variable 'whitespace-display-table) nil) (set (make-local-variable 'whitespace-display-table-was-local) nil) (set (make-local-variable 'whitespace-active-style) ! (if (listp (whitespace-style)) ! (whitespace-style) ! (list (whitespace-style)))) (set (make-local-variable 'whitespace-indent-tabs-mode) indent-tabs-mode) (set (make-local-variable 'whitespace-tab-width) *************** Also refontify when necessary." *** 2520,2526 **** (and whitespace-buffer-changed (or ;; ... or inside eob whitespace region ! (>= whitespace-point whitespace-eob-marker) ;; ... or at eob whitespace region border (and (= whitespace-point (1- whitespace-eob-marker)) (= (following-char) ?\n))))))) --- 2638,2644 ---- (and whitespace-buffer-changed (or ;; ... or inside eob whitespace region ! (>= whitespace-point whitespace-eob-marker) ;; ... or at eob whitespace region border (and (= whitespace-point (1- whitespace-eob-marker)) (= (following-char) ?\n))))))) *************** Also refontify when necessary." *** 2579,2585 **** (setq buffer-display-table (make-display-table))) (dolist (entry whitespace-display-mappings) ;; check if it is to display this mark ! (when (memq (car entry) whitespace-style) ;; Get a displayable mapping. (setq vecs (cddr entry)) (while (and vecs --- 2697,2703 ---- (setq buffer-display-table (make-display-table))) (dolist (entry whitespace-display-mappings) ;; check if it is to display this mark ! (when (memq (car entry) (whitespace-style)) ;; Get a displayable mapping. (setq vecs (cddr entry)) (while (and vecs *************** Also refontify when necessary." *** 2618,2635 **** (defun whitespace-action-when-on () "Action to be taken always when local whitespace is turned on." ! (cond ((memq 'cleanup whitespace-action) (whitespace-cleanup)) ! ((memq 'report-on-bogus whitespace-action) (whitespace-report nil t)))) (defun whitespace-write-file-hook () "Action to be taken when buffer is written. It should be added buffer-locally to `write-file-functions'." ! (cond ((memq 'auto-cleanup whitespace-action) (whitespace-cleanup)) ! ((memq 'abort-on-bogus whitespace-action) (when (whitespace-report nil t) (error "Abort write due to whitespace problems in %s" (buffer-name))))) --- 2736,2753 ---- (defun whitespace-action-when-on () "Action to be taken always when local whitespace is turned on." ! (cond ((memq 'cleanup (whitespace-action)) (whitespace-cleanup)) ! ((memq 'report-on-bogus (whitespace-action)) (whitespace-report nil t)))) (defun whitespace-write-file-hook () "Action to be taken when buffer is written. It should be added buffer-locally to `write-file-functions'." ! (cond ((memq 'auto-cleanup (whitespace-action)) (whitespace-cleanup)) ! ((memq 'abort-on-bogus (whitespace-action)) (when (whitespace-report nil t) (error "Abort write due to whitespace problems in %s" (buffer-name))))) *************** It should be added buffer-locally to `wr *** 2638,2644 **** (defun whitespace-warn-read-only (msg) "Warn if buffer is read-only." ! (when (memq 'warn-if-read-only whitespace-action) (message "Can't %s: %s is read-only" msg (buffer-name)))) --- 2756,2762 ---- (defun whitespace-warn-read-only (msg) "Warn if buffer is read-only." ! (when (memq 'warn-if-read-only (whitespace-action)) (message "Can't %s: %s is read-only" msg (buffer-name)))) --=-=-= Content-Type: text/plain -- ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 09:27:30 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 14:27:30 +0000 Received: from localhost ([127.0.0.1]:41026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3SRl-000774-QH for submit@debbugs.gnu.org; Thu, 07 Feb 2013 09:27:30 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:65145) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3SRg-00076t-Cm for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 09:27:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZnt/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFFFpZnt/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="676386" Received: from 69-165-153-237.dsl.teksavvy.com (HELO pastel.home) ([69.165.153.237]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Feb 2013 09:26:01 -0500 Received: by pastel.home (Postfix, from userid 20848) id AA893592BB; Thu, 7 Feb 2013 09:26:01 -0500 (EST) From: Stefan Monnier To: Didier Verna Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions Message-ID: References: Date: Thu, 07 Feb 2013 09:26:01 -0500 In-Reply-To: (Didier Verna's message of "Thu, 07 Feb 2013 13:43:26 +0100") 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: 13646 Cc: 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) > the following patch extends whitespace.el with the ability to specify > styles and actions on a file or mode specific basis. Can't we already do that in the usual way (i.e. with file-local, dir-local, or mode hooks settings)? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 09:46:13 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 14:46:14 +0000 Received: from localhost ([127.0.0.1]:41042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Sjt-0007Wq-3D for submit@debbugs.gnu.org; Thu, 07 Feb 2013 09:46:13 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:45955) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Sjo-0007Wg-Tf for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 09:46:11 -0500 Received: from Scofield.local.free.fr (unknown [IPv6:2a01:e35:8b50:e80:5ab0:35ff:fe7b:9220]) by smtp1-g21.free.fr (Postfix) with ESMTP id 49A48940225; Thu, 7 Feb 2013 15:44:37 +0100 (CET) From: Didier Verna To: Stefan Monnier Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 09:26:01 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEU+HhuqjneJWUYMBQkM FQ+wbVFWVD/ExcXLh2hcAAACUklEQVQ4jU2UMW/jMAyFGTvVzQrg89oQsLoaJ+Hm4CR0jwB3Vjwo c6f8/XuklLaeAn9571EUaUpenpSCOVt5pi0zPx4Pig3EYK72U8HGPAPo+5B82K39nDt4e4KU0mW3 3Qrk3kESpw7shpDbE8DMLD8AN5DiDzB9gyDAm+X6jPgCMfpAla+TGiE7o16xEieCYmoClIt6W7k+ Cdg2FWx5+birVRg1fPsGv1VBxh1TMhBcm9W2OQFxWD6IqIGWngtAjAfr6AjF9ATZmVnAyzY5AXbq gIvRtv9DmZnYCsjsquFyV/AH/zvVRQ7BlUba86Fd1KqvFiTgaK6yPd0VxHWxU+6goDp7entor9Z9 /syVN7RkyjTAWEEMF4wBHOQAduINxmoVcPKda91bS8CtvTVgKgNUXrRNItEpCcG43QHs3ABO6c4N 8F5JJJwXEFSnIAVC9QCuS15hLFbJrxVAgnhBeKZqBglPEQAHewLenWlVRY/cKjWzDEhFC62CCw0I 6RJMDuMyFLwXAEgIwgUVOPNQ4E05sNRFUgCqrl0RjSoQT4YK7VxkpAHWOr7IjJUjiWjhMp/nBugm 91zH1QOgCXOzQnPPOshFrgai4dHDPZ1lJ9z+Sj4doz98AT/obZ+dC4SbDrcOcPQBN7fY+uqpHH0M qiHd88Hm66ke/aWgRSHq1aa2aBiaOvpQ0dTgR217J9dTwWKZkrCq618NB4CfqWPw/l1DxKxvlHwd ZEUvClJYG4j6zUi67phZbGv81RUN4QdO4mMK8Z36NwYxCWvtLzTCCzH/ARk//aW+Idv3AAAAAElF TkSuQmCC X-Face: compface: (warning) : excess data ignored X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Thu, 07 Feb 2013 15:44:35 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) Stefan Monnier wrote: >> the following patch extends whitespace.el with the ability to specify >> styles and actions on a file or mode specific basis. > > Can't we already do that in the usual way (i.e. with file-local, > dir-local, or mode hooks settings)? To some extend yes, but the extension I propose is more general because, for example, the matching on file names is done with regexps. Without this, you could end up duplicating a common setting in several dir/file local sections. Another (more personal) argument, is that in general, I don't like the idea of having settings for a single functionality scattered all over the place. I prefer to see those settings in a centralized place, say a customization buffer. -- ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 11:19:53 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 16:19:53 +0000 Received: from localhost ([127.0.0.1]:42216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3UCV-0001Su-Uj for submit@debbugs.gnu.org; Thu, 07 Feb 2013 11:19:52 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60611) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3UCO-0001SZ-5N; Thu, 07 Feb 2013 11:19:48 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r17GIDRq031355; Thu, 7 Feb 2013 11:18:13 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 337B7B4030; Thu, 7 Feb 2013 11:18:13 -0500 (EST) From: Stefan Monnier To: Didier Verna Subject: mode-specific and file-regexp-specific settings Message-ID: References: Date: Thu, 07 Feb 2013 11:18:12 -0500 In-Reply-To: (Didier Verna's message of "Thu, 07 Feb 2013 15:44:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4485=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4485> : streams <902222> : uri <1339282> X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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: -3.5 (---) retitle 13646 Mode-specific and file-regexp-specific settings thanks > Another (more personal) argument, is that in general, I don't like the > idea of having settings for a single functionality scattered all over > the place. I prefer to see those settings in a centralized place, say > a customization buffer. We all agree. Of course this is like "the expression problem", in that there are various ways to group settings. I think the idea is good, but I don't think the solution should be specific to whitespace.el. Maybe we should instead extend dir-local settings so you can specify a dir-local class via a regexp (and accept several dir-local classes for a given directory, or even allow mapping a directory-regexp directly to a set of vars without going through a class). Also, we should introduce a way to set variables to a value that is mode-dependent. Maybe something like (setq-modes whitespace-style (foo-mode 'face) (bar-mode 'trailing) (t 'tab-mark)) Which could turn into something akin to (setq-default whitespace-style 'tab-mark) (add-hook 'bar-mode-hook (lambda () (setq-local whitespace-style 'trailing))) (add-hook 'foo-mode-hook (lambda () (setq-local whitespace-style 'face))) Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 11:57:52 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 16:57:52 +0000 Received: from localhost ([127.0.0.1]:42259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3UnG-0004Ad-Vy for submit@debbugs.gnu.org; Thu, 07 Feb 2013 11:57:51 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:37549) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3UnD-0004AT-Ts for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 11:57:50 -0500 Received: from Scofield.local.free.fr (unknown [IPv6:2a01:e35:8b50:e80:5ab0:35ff:fe7b:9220]) by smtp1-g21.free.fr (Postfix) with ESMTP id 373B8940275; Thu, 7 Feb 2013 17:56:14 +0100 (CET) From: Didier Verna To: Stefan Monnier Subject: Re: mode-specific and file-regexp-specific settings In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 11:18:12 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEWSa0bu9eE+JQDi8/XT uX3l2eDFSihGOEGRHg359fX1k8d3AAACOUlEQVQ4jZWRvYvbQBDFB6EYpctyUaHODMG37SFcqNsL snPpzpxVXHccZtkyuEm7LMcyrbi40H+bt/JXHHAgg5Gl99v3ZneHFGpApUddD6eiI0j1fg0MzTUw /A9oroH6n+Cv5sMRvA9PCb6n1xNQZbtTN8NQjauavaMaeqW+8fR7v9eT/wiGT8z8BXKvqh5JzSnq 69Rv+b7vVV9dNs/IF7D063bxfAbVUOroJNw+70yRtysII4C70/FV+HZhHiSnRQVQ3ylV1c0vZhEJ hYQYnW+VGsFN3ewAfMY8czFKDP5+BHV9V2Y6AS1LKxJF/AGUaxODBJ4GWwg7EaZ6TCrXhUuAtRPY JEgCdd10RkQLc0BK2gVr6mCoV2sSdGadxKQnsILemeLnFmDKzglOildaqTkMJjdJL7DaWXGOA3Vd M18ZWnyb8nYMstHCFqjs6u4zkXqcbrMRvBD2YR2VT/Nnk39YrX9kBBBfPQUtAOqm68h87NYc3gqN fO+zmQVYzZtHKu53ABEyx43HvqwFuDPGrxdL3KvgLqKNm4doJ+iB1j67ZWwHhhGFSIQDPlJqF9J1 k5DjJQCilDK+GO8husBUWGmXMDtqW8IXErAueDIb2z6k81CqyQbTsa8zJOZiXzJNoiHLoZzmmRV+ M3netgEA4zkVhrUxOTI4OfQ4GZ0WYIj4ETlETdwYFMD2Q02DTD2sPTaRoM9/0M+A92DMJjnqWi6K vHV/xpzBRZNLMLEH00UaXbMkIBfgYPsN0UOtZUffaGQAAAAASUVORK5CYII= X-Face: compface: (warning) : excess data ignored Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXZm2zq5fNvNzWXJxiY fVIwIxD0+vXl6uBqAeO7AAACPElEQVQ4jW2SPW/jMAyGhcS5zF6SNdA56BqUEm4VLApeg0hEZwMH a62LQvr7R1n5aK+h48DiY369tJiulvgep3Zq230uJm5gGtt2bMv//4BtN+b0A4wlXZ6epJri4nhS YxdjTvEJmHLfbX+C3RQbwsuz4u8dXtwQd2n/DcTsjLD2zw+QPhFto8Ot3xtIkbD3DYW038evIH4E tEFoSDl+B2iajWoQfn0HMTd2DQBqPcxxvIORZwAHOoRmdQe7mVeRPkwB/izdS67KizS1MeWjVQxI IR0KKBGZhZveERDAwhGpY30XEFLM2JizZb+mDmWeK6BBrAit5wA6Um/0dl5GFxfvPZi1V07JlWlQ b3O7dEX8rldrODkKn4YrDYvqM4sAoJXXStPb3wPXebkCz4R/hK+U8/n3ht7q6kXxgj+Bc285Sb+B c95XUFJ5C7AacnKkdchVRI5YrtcuT/mDPIVcF8WKorVasxaZAYThAcwmcPUtnz4v8JLmOodyZ+FI WZAmN0ICdzsvk6/hjO5oLEnZU5AQtnMF3BRqsErxA/3mDmUdXXhQfNuT4Fr8ATEd5mtxU4A9WUQ8 NAC3CCKD7mRcsEp3RmjVd1hM6AIOJ3deG+5POF6VlAUQqV5yTR5FdwL1BasJIGIdeMzSHlpNBAa7 JaKQZbdalbUzgUt3BbxGPjJHXZ65NU5VX7piqH7osO6DV0U380XvXi6g2OKrFbgLeQeatOeLdD0+ AJSu/DXgVT6A93C34v+S6kGKX/4DrQdQpSOIo60AAAAASUVORK5CYII= X-Face: compface: (warning) : excess data ignored X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Thu, 07 Feb 2013 17:56:13 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) Stefan Monnier wrote: > I think the idea is good, but I don't think the solution should be > specific to whitespace.el. A general solution would be nice of course (but this is frightening; see below). I'm not familiar enough with the dir-local functionality (XEmacs doesn't have that) to comment on it though. > Also, we should introduce a way to set variables to a value that is > mode-dependent. Maybe something like > > (setq-modes whitespace-style > (foo-mode 'face) > (bar-mode 'trailing) > (t 'tab-mark)) This looks a bit hackish. If you're going down that road and want to be that general, why stop here ? Someday, someone will want window-specific values and what not and you'll end up with tons of setq variants. And then, you're gonna wish you had specifiers in the first place (and /that/ is frightening) :-) > Which could turn into something akin to > > (setq-default whitespace-style 'tab-mark) > (add-hook 'bar-mode-hook (lambda () (setq-local whitespace-style 'trailing))) > (add-hook 'foo-mode-hook (lambda () (setq-local whitespace-style 'face))) Question: if you have both the above and dir-local settings, which ones take precedence (I hope the dir-local ones) ? -- ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 12:27:18 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 17:27:19 +0000 Received: from localhost ([127.0.0.1]:42275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3VFm-0004qo-Ci for submit@debbugs.gnu.org; Thu, 07 Feb 2013 12:27:18 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:49076) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3VFh-0004qc-UQ for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 12:27:16 -0500 Received: from Scofield.local.free.fr (unknown [IPv6:2a01:e35:8b50:e80:5ab0:35ff:fe7b:9220]) by smtp1-g21.free.fr (Postfix) with ESMTP id 6180E940071; Thu, 7 Feb 2013 18:25:38 +0100 (CET) From: Didier Verna To: Stefan Monnier Subject: Re: mode-specific and file-regexp-specific settings In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 11:18:12 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEWSJRv77NT7+fb7+f/7 +/37//+nezr////Ct7o2JCPeWwoRAAACaUlEQVQ4jW2Uv4+bMBTHXxer3moGxMpTctx6uqvSmRKx c1hZ3Q5WGEuCWO86oNzGhPr+275n4JLqasUB+2N/3w/zDP3SCu7WHrjPDVZgGQkI77dApjrbn9bx DXgU8PgB8NwuUGmI+H/Q3oLDacdS/Uepw4ltiLu3gIOoqixrLdZ7W+3Z23rdUWB6Sbe5rcuNrZ8Y B1D2Z0zfaPqdWwzhrAEyKGMi+oN7m7KrbGj/bvxtGol+tpmJMMVN956ScwOgeQsml9cIMVu8Knsc wTGJUu/UxSC2K0hHpYHo9c3B0R0lJfaQ48YW34iAxXgXKFBHYwJot88PDFRDNDnmjAQ8Fd328KBH UJpG8EKEyRFsK7wXEU2TZhBEGewExAI4xhFAugbxqqvxfgAYGWgFYQP3jDNeY+JZh9dTMADiIpad LdPBEQUgpp1oAma5be/80fNgmh3SzpGGTWtzHJwZJqJFyEt2GNTRvfcmnqgJwHv2g31oz4hf/Cdz x1kk0VFehzDbHFPvf6QJkXKjA6eUnlgN9oixakwUC5AAvJJcOfha4YuH5OhHvZhWrMM/W7ES51UO ao5aiR0PJd4px+bkHETaESdBAnpuYzVnWg5dOQX+JUR/ahvPkiQZ1RyEd2EA8D13Yo6A9XiHZwgj q8EuH4jXNXrkPKpGsZr3A/Nsg8aYKLkck4tJfEOfB17nCXr8xR9LilEUySMZLp4V2O9T2WIUEG7y nP+jNDHx4Jf6sLZYCgbnZmCta2mhyjtb4VycnbU3ZHkRcJ231939P+B6YSxgHh7eS1lmAJdBtjz5 GpjLGcPMeeU9FoXcUP1fwXtjiKMGA3QAAAAASUVORK5CYII= X-Face: compface: (warning) : excess data ignored Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX70rD79vyjgSz7///8 +v+YKB8zJhWwsqskZ963AAACZElEQVQ4jW2UwW4iMQyGA6stV6yw6nWwlHBtNPMCo5kH6EZy9koj xVxpVy2vv38CLFRtEGjIN3F+/45j+suwfT/MM83X/6a/jXGmafgOYBXZLyDMmLW3l/4DxG/jKxjb /NdQm5HWLh7X34Glcll8AnawIYTHyMV3obc3ULMK9MHMbh/66QbCNFhaYp5T/hRqAFgr+8Ja7BTu Ng99eMjs8zLlH/cAz8Q7AGb5O4fhTm5YsXMiJbpX6Lttbp9O4iVlLNlegR17G+iBJZVUsvd7GjYz FJtxsrBIfcQKzawHQsEqINoQrVhYJIlnjfC37m4yrQ2/cXbFJdXIQvNZlXbG1dxEnCZ1nBYXr7QU LfFniT7rezXl9QpUpEaIXjPsimnbwGxSkZIkakz68nhwkn5XMMymaJUTlUUXT8hDX+qRAMAscmP1 /mBtKr7sbWihzsAV8VtrP1RTtmdLqhWA2GoxjA9aaupnIBHGpqT7NdEvlXwcpgvInc+QvABYFnkm OzRLkBj7mojrzOnUwNxMdAkgMauo06xyOF5sh56YxEkUhKsqtHoyjKakvFRxqHas5wp0C72EPKRj lFoiGMdalS30ho3RFNk/44S4KoNT9H8WRAPBXY4+YtIBrthjUVe7AQDFq67gW1dA+W5BfQCoQ86D a3kL714h9z3DWNS2MSe6e9udTsfeGpwFWr+xw5sJ+2hrOPSF2cxQB1prD7ZFbtQy30y1v0N9b7V7 76j2b20kM29aO+G5Bbm7Gc729xTw6S9tjlvFTPX3+hrVC+ICqB/PVw7hahhtO9B1S9NC1z/D2HQC NCX/AHjt/u58WpMqAAAAAElFTkSuQmCC X-Face: compface: (warning) : excess data ignored X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Thu, 07 Feb 2013 18:25:37 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) Stefan Monnier wrote: > Also, we should introduce a way to set variables to a value that is > mode-dependent. Maybe something like > > (setq-modes whitespace-style > (foo-mode 'face) > (bar-mode 'trailing) > (t 'tab-mark)) > > Which could turn into something akin to > > (setq-default whitespace-style 'tab-mark) > (add-hook 'bar-mode-hook (lambda () (setq-local whitespace-style 'trailing))) > (add-hook 'foo-mode-hook (lambda () (setq-local whitespace-style 'face))) Oh, and BTW this is not gonna work. What you're doing here is instantiating buffer-local values once and for all. If later on the user changes his mode-specific settings, they won't be propagated to the already existing buffers. On the contrary, what I do in whitespace.el (and I think what should be done in a general solution) is to dynamically retreive the file/mode-specific value everytime it's needed, so that user changes are visible everywhere immediately (this is what specifiers do in XEmacs in fact). -- ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 16:47:18 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 21:47:18 +0000 Received: from localhost ([127.0.0.1]:42533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZJN-0000dE-RG for submit@debbugs.gnu.org; Thu, 07 Feb 2013 16:47:18 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:49619) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZJM-0000d8-26 for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 16:47:16 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U3ZJL-0003sd-Ci; Thu, 07 Feb 2013 16:47:15 -0500 From: Glenn Morris To: Didier Verna Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions References: X-Spook: e-bomb Dateline bullion sweep offensive information X-Ran: 5>^:)k_[wW;$Qq"=+$Ur+KR0lTG5vO80F,P[]E/[<$fZ?Xuxz9%(zq"']!B%e8Ew8l&}B, X-Hue: green X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 07 Feb 2013 16:47:15 -0500 In-Reply-To: (Didier Verna's message of "Thu, 07 Feb 2013 15:44:35 +0100") Message-ID: 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: -4.2 (----) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, Stefan Monnier , viniciusjl@ig.com.br 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.9 (------) Didier Verna wrote: > Another (more personal) argument, is that in general, I don't like the > idea of having settings for a single functionality scattered all over > the place. I prefer to see those settings in a centralized place, say > a customization buffer. It hasn't been said explicitly in this report AFAICS, but you don't need a dir-locals.el file to use directory local settings. You can do it in .emacs with dir-locals-set-directory-class. See http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.htm But the directory has to be fully specified (ie can't use regexps). From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 16:48:44 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 21:48:44 +0000 Received: from localhost ([127.0.0.1]:42537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZKm-0000fU-5s for submit@debbugs.gnu.org; Thu, 07 Feb 2013 16:48:44 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:49649) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZKk-0000fN-Bn for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 16:48:43 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U3ZKk-00041H-0D; Thu, 07 Feb 2013 16:48:42 -0500 From: Glenn Morris To: Didier Verna Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions References: X-Spook: Hamas Adriatic counter intelligence Semtex fundamentalist X-Ran: rG"fAG (Glenn Morris's message of "Thu, 07 Feb 2013 16:47:15 -0500") Message-ID: <4jtxpn4wxy.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.0 (-----) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, Stefan Monnier , viniciusjl@ig.com.br 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.9 (------) Glenn Morris wrote: > http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.htm s/htm$/html/ From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 07 17:00:27 2013 Received: (at 13646) by debbugs.gnu.org; 7 Feb 2013 22:00:28 +0000 Received: from localhost ([127.0.0.1]:42543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZW3-0000xS-AU for submit@debbugs.gnu.org; Thu, 07 Feb 2013 17:00:27 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:57375) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3ZVv-0000xD-A9 for 13646@debbugs.gnu.org; Thu, 07 Feb 2013 17:00:21 -0500 Received: from Scofield.local.free.fr (unknown [IPv6:2a01:e35:8b50:e80:5ab0:35ff:fe7b:9220]) by smtp1-g21.free.fr (Postfix) with ESMTP id E60529400F2; Thu, 7 Feb 2013 23:00:03 +0100 (CET) From: Didier Verna To: Glenn Morris Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions In-Reply-To: (Glenn Morris's message of "Thu, 07 Feb 2013 16:47:15 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVfISi7uXMbIRbQ0c2x aVhqe1lYchlOh6WjAAACeklEQVQ4jVWUQdPiIAyGI9N6lgU8d5mv3BncPbcjehY1nLfdIf//J2xo q35LZ+rIw0uSN1GwvPq7XT6M8kFuC+rOzx8L2PF3L2VY1gqqonsiYlL/KXb3zrYaEUA0Sm0KaerB zqKM8XITXXop+JRF7G2qx7wWfVCfGAVdu14Q9EuygmT+biAcdvW9gWmWr/3g4bvi+HjtS3VI/g3w l3rtS3VqvynwLeDab+c3mKZ3BC3lkN4gvUJ4WcHuE+MF9Cgr+BT4+IRgsEQH0WbC8yYYoD3LoV8V k5lRBe9VON1Y3chhcQWgJDJKXkQTzI0tZWAfng0QvcxHpfwFgo4bWBSMSz4HCV0wnAnAyFd5z6CX mB+n9jaGg+iGCuxXVThbiD2sM2CGUTPQsFtsd7lkroM7OIDi/jJoRsOgHIk35VLGKEcdY8MtSUCI tHl4gtHrOEYYtMngiMoGdGx8bGIc4mgIiLDUCeGa+BK+iEHTmAJImZbR4TJqrhXENh0hZzZxAVwD sCgO1+cej0DSbOAk2BAWXOOY0QBNmWhthu5YcuUQpmCGkikXtY3UIskFUWbOav7T1/J8rEGaa7wk SjgzoLkQd+mp2CiAa3yOSJbqVQvgDvoqoWtCcgwoO5ftg4ffx2u9q0ThyM4wu0Ib0EuQ9uI4zzt7 VZ+nVHUMFwmnacsMuZq1gsDt7uDrlmdH+wookX5WoEWdHyAGAshazmo6MPF1LLsIaN295+D1wPS7 Q6zzZqGBVvQMsput5R4Kuy5o7H7GmSDb3Lo8hcO630G0gOXOWXXYt5iCXyXsr+1KuXPlhf8aHP8k zAaaoaNCM7DHPMs8WH6wVtQCtXAT2X/K7NQKPk4fSgAAAABJRU5ErkJggg== X-Face: compface: (warning) : excess data ignored X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Thu, 07 Feb 2013 23:00:02 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13646 Cc: 13646@debbugs.gnu.org, Stefan Monnier , viniciusjl@ig.com.br 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 (-) Glenn Morris wrote: > It hasn't been said explicitly in this report AFAICS, but you don't > need a dir-locals.el file to use directory local settings. You can do > it in .emacs with dir-locals-set-directory-class. See Yes indeed (I since read the relevant documentation). The problems that remain, AFAUI, are 1/ as you said, the (current) lack of support for regexp-based dir (or file, for that matter) specification, 2/ the fact that eventually, the settings turn into buffer-local variables. Also, correct me if I'm wrong but I think that Custom is totally unaware of the dir-locals feature, so this is less user-friendly than a package-specific solution. -- ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 12 03:56:01 2013 Received: (at 13646) by debbugs.gnu.org; 12 Feb 2013 08:56:01 +0000 Received: from localhost ([127.0.0.1]:51556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5Beh-0004Sh-MF for submit@debbugs.gnu.org; Tue, 12 Feb 2013 03:56:00 -0500 Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:44764 helo=uzeb.lrde.epita.fr) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5Bee-0004SZ-HR for 13646@debbugs.gnu.org; Tue, 12 Feb 2013 03:55:58 -0500 Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id 465CD16E13E2; Tue, 12 Feb 2013 09:55:29 +0100 (CET) From: Didier Verna To: Glenn Morris , Stefan Monnier , 13646@debbugs.gnu.org, viniciusjl@ig.com.br Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions In-Reply-To: (Didier Verna's message of "Thu, 07 Feb 2013 23:00:02 +0100") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXozbMPBQTMbimlTBMf GBDdk1kNDgpVnrg8AAACRElEQVQ4jW1UwW7rIBCkr0nvSCufKygf0AXfQ7zmnGLzAZaQ//8T3kAc KWo6kRJlh5mdXZwoBbwPadgBipPiJaWLOiCUWn2PlOZxJaGDOel9kEakutH8nUjqnUiyDV1SY40i usbYJacUd4nda5CtDlCQdIK2uj8AyRCFepct7Ul3qiIcQatT6/ITd6TdenO0GvClxlTVKdZt/4WK jOqElr+JBGP1Nmz0XByOd/Xxh4JEovpI9Lu+RQ0iJv0iiBJJ6e0llBa3iKo6xqeiyL6R8RxUO/Fc rkO8svVevTRI5P31iUiPRPvsDb8qNqrsR5/NqxUt1vjltUecnDHG/tF8HB1nf1htWvfBIsnMsLJQ ULsnHYk0ngOSq7eW2cqqcJYaxLoxFzYjW7u4WUBgZZomVxb0ZLM4M8V5FbX4eHnTU6saNg1OLnBV ZXEhxPJpDeY17BA2SFgvqpTirHe+IIrlknPJQd6mAKJxjO1wdp4/b6WsItPSquVcHrgpdVPniea1 EefzDS91A+5PeZiuQR3nGo6PbL8C3wlQRTXRHeecbVYe4Q/VnUCYjGk60XD4oTVWi5mUTL5P7MzY KPgV45x1ShDaA2wwZzODrW1W6hwmC7E370tYGSGwNJdL/5kzrqZRXub1ptgUrLoR/yCwzuQSfChl xJmyyJ3oyfKSvTj21pSVYidablwRdnzFjtFdaH8QuLs88mKW1TNnGvp/w7n7tFFwvYHH8hXr0Mft o2MQw+yM8/ZHJ+oEUrmMh2a0MyKtLsie/gO8xRIj3mMAJAAAAABJRU5ErkJggg== X-Face: %_h6{7j{G{a5eS.S+E5mfa-D78Ci>}HGu}.qvW{; M7$+@17`Z(}j,"yO_!z5|}W|]Es=P_> ^u*}:XpKb-U-D]ti~#Sf&L,tWu.YiUoG*.jbp:JfD; LnPS}U xm1D2)hIrF$O(T-`tV'AD{:xPQnpO#k]/[%"0vfL+c]^Mkp5J#nL>dcO~]> X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Tue, 12 Feb 2013 09:55:29 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13646 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 (-) I wrote: > Yes indeed (I since read the relevant documentation). The problems > that remain, AFAUI, are > > 1/ as you said, the (current) lack of support for regexp-based dir > (or file, for that matter) specification, > 2/ the fact that eventually, the settings turn into buffer-local > variables. > > Also, correct me if I'm wrong but I think that Custom is totally > unaware of the dir-locals feature, so this is less user-friendly than > a package-specific solution. I tried to play a little more with dir-locals and I see yet another limitation: it seems that there's no way to accumulate values across settings for different directories in the same tree. For example, I may create a class CLASS in my init file with some variable settings for it, and put "/usr/local/" in that class. However, since "/usr/local/src/emacs/emacs.git" has a .dir-locals.el file, my settings for "/usr/local" won't apply. Stefan, is there a chance to see my whitespace.el modifications applied eventually ? -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 12 09:10:52 2013 Received: (at 13646) by debbugs.gnu.org; 12 Feb 2013 14:10:52 +0000 Received: from localhost ([127.0.0.1]:51772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5GZP-00044h-N2 for submit@debbugs.gnu.org; Tue, 12 Feb 2013 09:10:52 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:47577) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5GZN-00044Z-2n for 13646@debbugs.gnu.org; Tue, 12 Feb 2013 09:10:49 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCoht/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GsR+QDpEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFMCoht/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GsR+QDpEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="1063970" Received: from 76-10-136-109.dsl.teksavvy.com (HELO pastel.home) ([76.10.136.109]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Feb 2013 09:10:21 -0500 Received: by pastel.home (Postfix, from userid 20848) id CC1BE59267; Tue, 12 Feb 2013 09:10:21 -0500 (EST) From: Stefan Monnier To: Didier Verna Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions Message-ID: References: Date: Tue, 12 Feb 2013 09:10:21 -0500 In-Reply-To: (Didier Verna's message of "Tue, 12 Feb 2013 09:55:29 +0100") 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: 13646 Cc: Glenn Morris , 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) > I tried to play a little more with dir-locals and I see yet another > limitation: it seems that there's no way to accumulate values across > settings for different directories in the same tree. > For example, I may create a class CLASS in my init file with some > variable settings for it, and put "/usr/local/" in that > class. However, since "/usr/local/src/emacs/emacs.git" has a > .dir-locals.el file, my settings for "/usr/local" won't apply. Indeed, it's another current limitation. It'd be good to lift it. > Stefan, is there a chance to see my whitespace.el modifications > applied eventually ? I really would much rather improve the generic settings code. But as for your specific patch, it's up to the whitespace.el maintainer. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 12 09:18:00 2013 Received: (at 13646) by debbugs.gnu.org; 12 Feb 2013 14:18:00 +0000 Received: from localhost ([127.0.0.1]:51791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5GgJ-0004Fj-M1 for submit@debbugs.gnu.org; Tue, 12 Feb 2013 09:17:59 -0500 Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:48674 helo=uzeb.lrde.epita.fr) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5GgH-0004Fb-9O for 13646@debbugs.gnu.org; Tue, 12 Feb 2013 09:17:58 -0500 Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id 6D84416E13DE; Tue, 12 Feb 2013 15:17:28 +0100 (CET) From: Didier Verna To: Stefan Monnier Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions In-Reply-To: (Stefan Monnier's message of "Tue, 12 Feb 2013 09:10:21 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXozbMPBQTMbimlTBMf GBDdk1kNDgpVnrg8AAACRElEQVQ4jW1UwW7rIBCkr0nvSCufKygf0AXfQ7zmnGLzAZaQ//8T3kAc KWo6kRJlh5mdXZwoBbwPadgBipPiJaWLOiCUWn2PlOZxJaGDOel9kEakutH8nUjqnUiyDV1SY40i usbYJacUd4nda5CtDlCQdIK2uj8AyRCFepct7Ul3qiIcQatT6/ITd6TdenO0GvClxlTVKdZt/4WK jOqElr+JBGP1Nmz0XByOd/Xxh4JEovpI9Lu+RQ0iJv0iiBJJ6e0llBa3iKo6xqeiyL6R8RxUO/Fc rkO8svVevTRI5P31iUiPRPvsDb8qNqrsR5/NqxUt1vjltUecnDHG/tF8HB1nf1htWvfBIsnMsLJQ ULsnHYk0ngOSq7eW2cqqcJYaxLoxFzYjW7u4WUBgZZomVxb0ZLM4M8V5FbX4eHnTU6saNg1OLnBV ZXEhxPJpDeY17BA2SFgvqpTirHe+IIrlknPJQd6mAKJxjO1wdp4/b6WsItPSquVcHrgpdVPniea1 EefzDS91A+5PeZiuQR3nGo6PbL8C3wlQRTXRHeecbVYe4Q/VnUCYjGk60XD4oTVWi5mUTL5P7MzY KPgV45x1ShDaA2wwZzODrW1W6hwmC7E370tYGSGwNJdL/5kzrqZRXub1ptgUrLoR/yCwzuQSfChl xJmyyJ3oyfKSvTj21pSVYidablwRdnzFjtFdaH8QuLs88mKW1TNnGvp/w7n7tFFwvYHH8hXr0Mft o2MQw+yM8/ZHJ+oEUrmMh2a0MyKtLsie/gO8xRIj3mMAJAAAAABJRU5ErkJggg== X-Face: %_h6{7j{G{a5eS.S+E5mfa-D78Ci>}HGu}.qvW{; M7$+@17`Z(}j,"yO_!z5|}W|]Es=P_> ^u*}:XpKb-U-D]ti~#Sf&L,tWu.YiUoG*.jbp:JfD; LnPS}U xm1D2)hIrF$O(T-`tV'AD{:xPQnpO#k]/[%"0vfL+c]^Mkp5J#nL>dcO~]> X-Attribution: dvl X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Date: Tue, 12 Feb 2013 15:17:28 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13646 Cc: Glenn Morris , 13646@debbugs.gnu.org, viniciusjl@ig.com.br 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 (-) Stefan Monnier wrote: > I really would much rather improve the generic settings code. I understand. Looks like a lot of work though, and in the meantime, I don't think it hurts to have a workaround, even package-specific. > But as for your specific patch, it's up to the whitespace.el maintainer. OK. No life sign yet. -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 12 12:01:37 2013 Received: (at submit) by debbugs.gnu.org; 12 Feb 2013 17:01:37 +0000 Received: from localhost ([127.0.0.1]:52419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5JEe-0008Ck-2H for submit@debbugs.gnu.org; Tue, 12 Feb 2013 12:01:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54734) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5JEb-0008Cd-U9 for submit@debbugs.gnu.org; Tue, 12 Feb 2013 12:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5JE0-0000UH-MV for submit@debbugs.gnu.org; Tue, 12 Feb 2013 12:01:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:41027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5JE0-0000U3-Ga for submit@debbugs.gnu.org; Tue, 12 Feb 2013 12:00:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5JDv-0002Hz-Fc for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 12:00:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5JDo-0000Qq-0g for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 12:00:51 -0500 Received: from ristopher.com ([146.185.21.93]:55541 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5JDn-0000QZ-7B for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 12:00:43 -0500 Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id 61C5420AAA; Tue, 12 Feb 2013 17:00:41 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1360688441; bh=TikIm1dt+nWrmoKiJaT7CiSVZQHxBDwd9EE3I1KCTEg=; h=From:To:Subject:In-Reply-To:Message-ID:References:MIME-Version: Content-Type:Date; b=IX31ZIMN3ma/iRMAZ8l0460DN6xgRyUgIzzLr+fUk7Dzxhf+xIyhbY1APFdKuoljK QLUPUnKwwqqEXlclC3/Oe+CBuekTA2ERQLwChCD42x4eWsVZRVqpK7mASOW7qpyf1g 0QQTyD15uR3eKVHMaSuUlmazG+ENjmGpGgGhsa9g= From: Christopher Schmidt To: bug-gnu-emacs@gnu.org Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions In-Reply-To: (Didier Verna's message of "Tue, 12 Feb 2013 15:17:28 +0100") Message-ID: <87r4klxy9s@ch.ristopher.com> References: Mail-Followup-To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain Date: Tue, 12 Feb 2013 17:00:41 +0000 (GMT) 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: -4.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: -5.5 (-----) Didier Verna writes: > Stefan Monnier wrote: > >> I really would much rather improve the generic settings code. > > I understand. Looks like a lot of work though, and in the meantime, I > don't think it hurts to have a workaround, even package-specific. -1 Having three user options that take precedence upon each other, with a subset of them being safe local variables, is scary. This can break regular user setups and third party packages big time. Even worse, the work around your workaround is not trivial. I do not see any need for such an intrusive change in the first place. You can easily implement what you did there using find-file-hook, after-change-major-mode-hook in combination with an independent global minor mode. Christopher From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 18 10:38:21 2020 Received: (at submit) by debbugs.gnu.org; 18 Sep 2020 14:38:21 +0000 Received: from localhost ([127.0.0.1]:43941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJHWn-0005d8-58 for submit@debbugs.gnu.org; Fri, 18 Sep 2020 10:38:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:43900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJHWl-0005d1-MP for submit@debbugs.gnu.org; Fri, 18 Sep 2020 10:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJHWl-0005am-FJ for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 10:38:19 -0400 Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:45034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJHWj-0003ET-Aw for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 10:38:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iIqmR7WZdYW6Jgr2KMDt5T8oCY0sNDRjdF0qw93FhKE=; b=u0UadyDDevRjA0iXj7JCywllZZ ppNdsGcVtzASyMXQEVGe/TiTRUqHXZ+d8IU/nHHJ6z2NUqeNkzwmvzx98JUjWkZz7m6p1xSXKBvp5 8dRMdWXalcTyYS8XOT/j79KUyMKiG1CMkWUJUYsKnK2Rx6klccfJDnj7bB5vYTqWAE/A=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJHWe-0006ti-7Z for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 16:38:14 +0200 From: Lars Ingebrigtsen To: bug-gnu-emacs@gnu.org Subject: Re: bug#13646: Whitespace support for file/mode-specific styles and actions References: <87r4klxy9s@ch.ristopher.com> X-Now-Playing: Saito Koji's _433-1_: "433_076" Date: Fri, 18 Sep 2020 16:38:11 +0200 In-Reply-To: <87r4klxy9s@ch.ristopher.com> (Christopher Schmidt's message of "Tue, 12 Feb 2013 17:00:41 +0000 (GMT)") Message-ID: <87d02jf8vg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Christopher Schmidt writes: >>> I really would much rather improve the generic settings code. >> >> I understand. Looks like a lot of work though, and in the meantime, I >> don't think it hurts to have a workaround, even package [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Christopher Schmidt writes: >>> I really would much rather improve the generic settings code. >> >> I understand. Looks like a lot of work though, and in the meantime, I >> don't think it hurts to have a workaround, even package-specific. > > -1 > > Having three user options that take precedence upon each other, with a > subset of them being safe local variables, is scary. This can break > regular user setups and third party packages big time. Even worse, the > work around your workaround is not trivial. > > I do not see any need for such an intrusive change in the first place. > You can easily implement what you did there using find-file-hook, > after-change-major-mode-hook in combination with an independent global > minor mode. It seems like there was little enthusiasm for this feature -- Christopher sums up the objections well, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 18 10:38:29 2020 Received: (at control) by debbugs.gnu.org; 18 Sep 2020 14:38:29 +0000 Received: from localhost ([127.0.0.1]:43944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJHWv-0005dU-FX for submit@debbugs.gnu.org; Fri, 18 Sep 2020 10:38:29 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJHWt-0005dG-Ba for control@debbugs.gnu.org; Fri, 18 Sep 2020 10:38:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f9ueP2V8yBevI6AyMldCUxWLVdW+ndUPc5eoT6U2LSM=; b=UjXAMEjW+6iC55WmZSonrdU+vC tK7a1q0rntWS1VnCZSGAS/If/yhzy339vGyUIRkRvUf3DP/7WIbRwAok/OzEiy7DftFteruYSuVMH VfQhl7ZkvTgjirEEcxqcmZE2cydsuFsKrxnbkBNcJdMfU+hWEjL98MUSwdBG4mglnaYc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJHWl-0006to-GH for control@debbugs.gnu.org; Fri, 18 Sep 2020 16:38:21 +0200 Date: Fri, 18 Sep 2020 16:38:18 +0200 Message-Id: <87bli3f8v9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #13646 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 13646 wontfix close 13646 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 13646 wontfix close 13646 quit From unknown Sat Aug 16 11:41:28 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, 17 Oct 2020 11: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