[elpa] externals/greader 0e1e600b26: greader.el: attempt to fix URL header.

2024-06-13 Thread ELPA Syncer
branch: externals/greader
commit 0e1e600b26299ebf867f3ad3c0b61e9a43f4bba9
Author: Michelangelo Rodriguez 
Commit: Michelangelo Rodriguez 

greader.el: attempt to fix URL header.
---
 greader.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/greader.el b/greader.el
index 730a96c4d0..66d525d1d2 100644
--- a/greader.el
+++ b/greader.el
@@ -5,7 +5,8 @@
 ;; package-requires: ((emacs "25"))
 ;; Author: Michelangelo Rodriguez 
 ;; Keywords: tools, accessibility
-;; URL: https://www.gitlab.com/michelangelo-rodriguez/greader
+;; URL: https://gitlab.com/michelangelo-rodriguez/greader
+
 ;; package-requires: ((google-translate))
 ;; Version: 0.11.2
 



[elpa] main df29bc50fb 1/3: * html/layout.css: (ol, ul) Enable bullets, numbers

2024-06-13 Thread Adam Porter
branch: main
commit df29bc50fbcdca91296f3169947c06d20e597e88
Author: Adam Porter 
Commit: Adam Porter 

* html/layout.css: (ol, ul) Enable bullets, numbers

This rule was causing ordered lists to be rendered without their
numbers.

I don't know why this rule was present; it may have been a stylistic
choice earlier in development, before ELPA was rendering packages'
readmes into the HTML, when it was likely that fewer types of elements
were present in ELPA's HTML, so the problem was not noticed.

Due to the way the rest of the page's layout is implemented, this
introduces a minor "ugliness": that, e.g. a numbered list's numbers
are aligned outside of the containing DIV.  This happens because all
of the DIVs on the page have their margin and padding set to
0, without which OLs and ULs would be naturally indented compared to
sibling paragraphs.  This will be handled in later commits which will
attempt to solve the margin/padding issues more "holistically."

(ol, ul): Delete list-style rule.
---
 html/layout.css | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/html/layout.css b/html/layout.css
index 0b22aad5ee..6bcac880df 100644
--- a/html/layout.css
+++ b/html/layout.css
@@ -40,9 +40,6 @@ footer, header, hgroup, menu, nav, section {
 body {
   line-height: 1;
 }
-ol, ul {
-  list-style: none;
-}
 blockquote, q {
   quotes: none;
 }



[elpa] main 9fc20ccdf6 2/3: * html/layout.css: Remove character accidentally inserted

2024-06-13 Thread Adam Porter
branch: main
commit 9fc20ccdf671e06fa82ea3a9df2d09bc0a596845
Author: Adam Porter 
Commit: Adam Porter 

* html/layout.css: Remove character accidentally inserted

A minor oops from 2ecaef9469bd46bf6433d9913bac9791559b12f9.
---
 html/layout.css | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/html/layout.css b/html/layout.css
index 6bcac880df..9dce403d46 100644
--- a/html/layout.css
+++ b/html/layout.css
@@ -1,4 +1,4 @@
-l/* Copyright (C) 2010-2022, 2024 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2022, 2024 Free Software Foundation, Inc.
 
 This file is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by



[elpa] main updated (8fc5653d2d -> d51fa370a9)

2024-06-13 Thread Adam Porter
blujay pushed a change to branch main.

  from  8fc5653d2d elpa-packages (loccur): Update URL
   new  df29bc50fb * html/layout.css: (ol, ul) Enable bullets, numbers
   new  9fc20ccdf6 * html/layout.css: Remove character accidentally inserted
   new  d51fa370a9 Set css-indent-offset to 2


Summary of changes:
 .dir-locals.el  |  9 +
 html/layout.css | 11 ---
 2 files changed, 9 insertions(+), 11 deletions(-)



[elpa] main d51fa370a9 3/3: Set css-indent-offset to 2

2024-06-13 Thread Adam Porter
branch: main
commit d51fa370a95eda45d142f97d45fa6e5f77b85cc3
Author: Adam Porter 
Commit: Adam Porter 

Set css-indent-offset to 2

This ensures consistent indentation of our CSS files across
developers (the default not being what this project uses).

Also, reindent a couple of blocks in layout.css accordingly.

(This change was made with "M-x add-dir-local-variable", which also
added the "no-byte-compile" line and reordered the modes.)

* .dir-locals.el: (css-mode) Set css-indent-offset to 2.
* html/layout.css: Reindent two blocks.
---
 .dir-locals.el  | 9 +
 html/layout.css | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 949deb6c78..e10580fd5a 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,17 +1,18 @@
-;;; Directory Local Variables
+;;; Directory Local Variables-*- no-byte-compile: t -*-
 ;;; For more information see (info "(emacs) Directory Variables")
 
 ((nil . ((tab-width . 8)
  (sentence-end-double-space . t)
  (fill-column . 70)
  (bug-reference-url-format . "https://debbugs.gnu.org/%s";)))
- (log-edit-mode . ((log-edit-font-lock-gnu-style . t)
-   (log-edit-setup-add-author . t)))
  (change-log-mode . ((add-log-time-zone-rule . t)
  (fill-column . 74)
  (mode . bug-reference)))
+ (css-mode . ((css-indent-offset . 2)))
  (diff-mode . ((mode . whitespace)))
  (lisp-data-mode . ((indent-tabs-mode . nil)
 (electric-quote-comment . nil)
 (electric-quote-string . nil)
-(mode . bug-reference-prog
+(mode . bug-reference-prog)))
+ (log-edit-mode . ((log-edit-font-lock-gnu-style . t)
+   (log-edit-setup-add-author . t
diff --git a/html/layout.css b/html/layout.css
index 9dce403d46..ef52bcf86a 100644
--- a/html/layout.css
+++ b/html/layout.css
@@ -190,7 +190,7 @@ dt {
 }
 
 .invisible {
-display: none;
+  display: none;
 }
 
 header, .header {
@@ -347,6 +347,6 @@ li {
 }
 
 .badge {
-float: right;
-display: block;
+  float: right;
+  display: block;
 }



[elpa] externals/org updated (959534ba11 -> a2ae069869)

2024-06-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  959534ba11 ob-sql: Quote all the shell arguments originating from 
Org buffer
   new  e4902995a0 org-babel: Reduce verbosity when running in batch mode
   new  14f176246f Merge branch 'bugfix'
   new  a2ae069869 ob-*: Do not emit redundant messages about code block 
evaluation


Summary of changes:
 lisp/ob-C.el   |  1 -
 lisp/ob-awk.el |  1 -
 lisp/ob-core.el| 57 --
 lisp/ob-ditaa.el   |  4 ++--
 lisp/ob-gnuplot.el |  5 +
 lisp/ob-groovy.el  |  1 -
 lisp/ob-maxima.el  |  2 --
 lisp/ob-screen.el  |  1 -
 lisp/ob-sed.el |  1 -
 9 files changed, 33 insertions(+), 40 deletions(-)



[elpa] externals/org a2ae069869 2/2: ob-*: Do not emit redundant messages about code block evaluation

2024-06-13 Thread ELPA Syncer
branch: externals/org
commit a2ae06986981e2588e0692c6b7bb048be7c2882d
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

ob-*: Do not emit redundant messages about code block evaluation

* lisp/ob-C.el (org-babel-C-header-to-C):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-prep-session:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-screen.el (org-babel-execute:screen):
* lisp/ob-sed.el (org-babel-execute:sed):
`org-babel-execute-src-block' already emits status messages about code
block evaluation.  Doing it from inside individual babel backends is
thus redundant.
---
 lisp/ob-C.el   | 1 -
 lisp/ob-awk.el | 1 -
 lisp/ob-ditaa.el   | 3 +--
 lisp/ob-gnuplot.el | 5 +
 lisp/ob-groovy.el  | 1 -
 lisp/ob-maxima.el  | 2 --
 lisp/ob-screen.el  | 1 -
 lisp/ob-sed.el | 1 -
 8 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index f7735ee72b..cecaa60e7d 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -482,7 +482,6 @@ int get_column_num (int nbcols, const char** header, const 
char* column)
 (defun org-babel-C-header-to-C (head type)
   "Convert an elisp list of header table into a C or D vector
 specifying a variable with the name of the table."
-  (unless noninteractive (message "%S" type))
   (let ((table (car head))
 (headers (cdr head))
 (typename (pcase type
diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index d94da405f0..0c07aec829 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -61,7 +61,6 @@
   "Execute a block of Awk code BODY with org-babel.
 PARAMS is a plist of src block parameters .
 This function is called by `org-babel-execute-src-block'."
-  (unless noninteractive (message "Executing Awk source code block"))
   (let* ((result-params (cdr (assq :result-params params)))
  (cmd-line (cdr (assq :cmd-line params)))
  (in-file (cdr (assq :in-file params)))
diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index 715d8ddf07..cc01d7e280 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -113,9 +113,8 @@ This function is called by `org-babel-execute-src-block'."
 (unless (file-exists-p org-ditaa-jar-path)
   (error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
 (with-temp-file in-file (insert body))
-(unless noninteractive (message cmd))
 (shell-command cmd)
-(when pdf-cmd (unless noninteractive (message pdf-cmd)) (shell-command 
pdf-cmd))
+(when pdf-cmd (shell-command pdf-cmd))
 nil)) ;; signal that output has already been written to file
 
 (defun org-babel-prep-session:ditaa (_session _params)
diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el
index 956763c587..1fe99dd162 100644
--- a/lisp/ob-gnuplot.el
+++ b/lisp/ob-gnuplot.el
@@ -210,7 +210,6 @@ This function is called by `org-babel-execute-src-block'."
   (let ((script-file (org-babel-temp-file "gnuplot-script-")))
 (with-temp-file script-file
   (insert (concat body "\n")))
-(unless noninteractive (message "gnuplot \"%s\"" script-file))
 (setq output
   (shell-command-to-string
   (format
@@ -218,8 +217,7 @@ This function is called by `org-babel-execute-src-block'."
(org-babel-process-file-name
 script-file
 (if (member system-type '(cygwin windows-nt ms-dos))
-t nil)
-(unless noninteractive (message "%s" output)))
+t nil))
 (with-temp-buffer
   (insert (concat body "\n"))
   (gnuplot-mode)
@@ -232,7 +230,6 @@ This function is called by `org-babel-execute-src-block'."
   "Prepare SESSION according to the header arguments in PARAMS."
   (let* ((session (org-babel-gnuplot-initiate-session session))
  (var-lines (org-babel-variable-assignments:gnuplot params)))
-(unless noninteractive (message "%S" session))
 (org-babel-comint-in-buffer session
   (dolist (var-line  var-lines)
(insert var-line)
diff --git a/lisp/ob-groovy.el b/lisp/ob-groovy.el
index d87ef4bb65..73b0d33fcf 100644
--- a/lisp/ob-groovy.el
+++ b/lisp/ob-groovy.el
@@ -52,7 +52,6 @@ parameters may be used, like groovy -v"
 (defun org-babel-execute:groovy (body params)
   "Execute Groovy BODY according to PARAMS.
 This function is called by `org-babel-execute-src-block'."
-  (unless noninteractive (message "Executing Groovy source code block"))
   (let* ((processed-params (org-babel-process-params params))
  (session (org-babel-groovy-initiate-session (nth 0 processed-params)))
  (result-params (nth 2 processed-params))
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index 681154adfb..afd615f8d0 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -131,7

[elpa] externals/aircon-theme 9f7c842394: Style font-lock faces for sh-mode

2024-06-13 Thread ELPA Syncer
branch: externals/aircon-theme
commit 9f7c8423945b7b2dff03f590afd6d338802e1c3f
Author: Gregory Chamberlain 
Commit: Gregory Chamberlain 

Style font-lock faces for sh-mode
---
 aircon-theme.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/aircon-theme.el b/aircon-theme.el
index e6cd8d65e8..91e1869170 100644
--- a/aircon-theme.el
+++ b/aircon-theme.el
@@ -340,6 +340,8 @@
  '(elfeed-log-info-level-face  ((t (:inherit (aircon-sapphire)
  '(elfeed-log-warn-level-face  ((t (:inherit (warning)
 
+ '(sh-heredoc  ((t (:inherit (aircon-goblin italic)
+ '(sh-quoted-exec  ((t (:inherit (aircon-hibiscus)
  )
 
 ;;;###autoload



[elpa] externals-release/org e4902995a0: org-babel: Reduce verbosity when running in batch mode

2024-06-13 Thread ELPA Syncer
branch: externals-release/org
commit e4902995a0643c7658fb51b14911eaff2891a1e3
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-babel: Reduce verbosity when running in batch mode

* lisp/ob-C.el (org-babel-C-header-to-C):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-core.el (org-babel-execute-src-block):
(org-babel-insert-result):
* lisp/ob-ditaa.el (org-babel-execute:ditaa):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-prep-session:gnuplot):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-maxima.el (org-babel-execute:maxima):
* lisp/ob-screen.el (org-babel-execute:screen):
* lisp/ob-sed.el (org-babel-execute:sed): Suppress progress messages
when running noninteractively (batch export, for example).  This
change follows the existing behavior of `org-babel-exp-src-block'.

Reported-by: Eli Zaretskii 
Link: https://yhetil.org/emacs-devel/868qzd9hjg@gnu.org/
---
 lisp/ob-C.el   |  2 +-
 lisp/ob-awk.el |  2 +-
 lisp/ob-core.el| 57 --
 lisp/ob-ditaa.el   |  5 +++--
 lisp/ob-gnuplot.el |  6 +++---
 lisp/ob-groovy.el  |  2 +-
 lisp/ob-maxima.el  |  4 ++--
 lisp/ob-screen.el  |  2 +-
 lisp/ob-sed.el |  2 +-
 9 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index d13c65d260..f7735ee72b 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -482,7 +482,7 @@ int get_column_num (int nbcols, const char** header, const 
char* column)
 (defun org-babel-C-header-to-C (head type)
   "Convert an elisp list of header table into a C or D vector
 specifying a variable with the name of the table."
-  (message "%S" type)
+  (unless noninteractive (message "%S" type))
   (let ((table (car head))
 (headers (cdr head))
 (typename (pcase type
diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index 9577a39ee6..d94da405f0 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -61,7 +61,7 @@
   "Execute a block of Awk code BODY with org-babel.
 PARAMS is a plist of src block parameters .
 This function is called by `org-babel-execute-src-block'."
-  (message "Executing Awk source code block")
+  (unless noninteractive (message "Executing Awk source code block"))
   (let* ((result-params (cdr (assq :result-params params)))
  (cmd-line (cdr (assq :cmd-line params)))
  (in-file (cdr (assq :in-file params)))
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 2e0e86f70c..0b329266a5 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -855,8 +855,9 @@ guess will be made."
(forward-line)
(skip-chars-forward " \t")
(let ((result (org-babel-read-result)))
- (message (format "Cached: %s"
-   (replace-regexp-in-string "%" "%%" (format "%S" 
result
+  (unless noninteractive
+   (message (format "Cached: %s"
+ (replace-regexp-in-string "%" "%%" (format 
"%S" result)
  result)))
 ((org-babel-confirm-evaluate info)
  (let* ((lang (nth 0 info))
@@ -879,18 +880,19 @@ guess will be made."
 result exec-start-time)
(unless (fboundp cmd)
  (error "No org-babel-execute function for %s!" lang))
-   (message "Executing %s %s %s..."
-(capitalize lang)
- (pcase executor-type
-   ('src-block "code block")
-   ('inline-src-block "inline code block")
-   ('babel-call "call")
-   ('inline-babel-call "inline call")
-   (e (symbol-name e)))
-(let ((name (nth 4 info)))
-  (if name
-   (format "(%s)" name)
- (format "at position %S" (nth 5 info)
+(unless noninteractive
+ (message "Executing %s %s %s..."
+  (capitalize lang)
+   (pcase executor-type
+ ('src-block "code block")
+ ('inline-src-block "inline code block")
+ ('babel-call "call")
+ ('inline-babel-call "inline call")
+ (e (symbol-name e)))
+  (let ((name (nth 4 info)))
+(if name
+ (format "(%s)" name)
+   (format "at position %S" (nth 5 info))
(setq exec-start-time (current-time)
   result
  (let ((r
@@ -2760,20 +2762,21 @@ INFO may provide the values of these header arguments 
(in the
   ;; In this case `table-align' does the work
   ;; for us.
   (not (and (listp result)
-(member "append" result-params

[elpa] externals/org 14f176246f 1/2: Merge branch 'bugfix'

2024-06-13 Thread ELPA Syncer
branch: externals/org
commit 14f176246f541a65f4a8499403a57af5aff492f8
Merge: 959534ba11 e4902995a0
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/ob-C.el   |  2 +-
 lisp/ob-awk.el |  2 +-
 lisp/ob-core.el| 57 --
 lisp/ob-ditaa.el   |  5 +++--
 lisp/ob-gnuplot.el |  6 +++---
 lisp/ob-groovy.el  |  2 +-
 lisp/ob-maxima.el  |  4 ++--
 lisp/ob-screen.el  |  2 +-
 lisp/ob-sed.el |  2 +-
 9 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index d13c65d260..f7735ee72b 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -482,7 +482,7 @@ int get_column_num (int nbcols, const char** header, const 
char* column)
 (defun org-babel-C-header-to-C (head type)
   "Convert an elisp list of header table into a C or D vector
 specifying a variable with the name of the table."
-  (message "%S" type)
+  (unless noninteractive (message "%S" type))
   (let ((table (car head))
 (headers (cdr head))
 (typename (pcase type
diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index 9577a39ee6..d94da405f0 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -61,7 +61,7 @@
   "Execute a block of Awk code BODY with org-babel.
 PARAMS is a plist of src block parameters .
 This function is called by `org-babel-execute-src-block'."
-  (message "Executing Awk source code block")
+  (unless noninteractive (message "Executing Awk source code block"))
   (let* ((result-params (cdr (assq :result-params params)))
  (cmd-line (cdr (assq :cmd-line params)))
  (in-file (cdr (assq :in-file params)))
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 2e0e86f70c..0b329266a5 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -855,8 +855,9 @@ guess will be made."
(forward-line)
(skip-chars-forward " \t")
(let ((result (org-babel-read-result)))
- (message (format "Cached: %s"
-   (replace-regexp-in-string "%" "%%" (format "%S" 
result
+  (unless noninteractive
+   (message (format "Cached: %s"
+ (replace-regexp-in-string "%" "%%" (format 
"%S" result)
  result)))
 ((org-babel-confirm-evaluate info)
  (let* ((lang (nth 0 info))
@@ -879,18 +880,19 @@ guess will be made."
 result exec-start-time)
(unless (fboundp cmd)
  (error "No org-babel-execute function for %s!" lang))
-   (message "Executing %s %s %s..."
-(capitalize lang)
- (pcase executor-type
-   ('src-block "code block")
-   ('inline-src-block "inline code block")
-   ('babel-call "call")
-   ('inline-babel-call "inline call")
-   (e (symbol-name e)))
-(let ((name (nth 4 info)))
-  (if name
-   (format "(%s)" name)
- (format "at position %S" (nth 5 info)
+(unless noninteractive
+ (message "Executing %s %s %s..."
+  (capitalize lang)
+   (pcase executor-type
+ ('src-block "code block")
+ ('inline-src-block "inline code block")
+ ('babel-call "call")
+ ('inline-babel-call "inline call")
+ (e (symbol-name e)))
+  (let ((name (nth 4 info)))
+(if name
+ (format "(%s)" name)
+   (format "at position %S" (nth 5 info))
(setq exec-start-time (current-time)
   result
  (let ((r
@@ -2760,20 +2762,21 @@ INFO may provide the values of these header arguments 
(in the
   ;; In this case `table-align' does the work
   ;; for us.
   (not (and (listp result)
-(member "append" result-params
+  (member "append" result-params
  (indent-rigidly beg end indent))
-(let ((time-info
-   ;; Only show the time when something other than
-   ;; 0s will be shown, i.e. check if the time is at
-   ;; least half of the displayed precision.
-   (if (and exec-time (> (float-time exec-time) 0.05))
-   (format " (took %.1fs)" (float-time exec-time))
- "")))
-  (if (null result)
-  (if (member "value" result-params)
-  (message "Code block returned no value%s." time-info)
-(message "Code block produced no output%s." time-

[elpa] externals/greader 0fe0302c36: greader version 0.11.3

2024-06-13 Thread ELPA Syncer
branch: externals/greader
commit 0fe0302c362543b267ed82173ce197498df42538
Author: Michelangelo Rodriguez 
Commit: Michelangelo Rodriguez 

greader version 0.11.3

Handling espeak possible emacspeak errors. too.
---
 greader-audiobook.el | 27 +++
 greader.el   |  2 +-
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/greader-audiobook.el b/greader-audiobook.el
index b154507c97..e1644275df 100644
--- a/greader-audiobook.el
+++ b/greader-audiobook.el
@@ -208,10 +208,13 @@ Return the generated file name, or nil if at end of the 
buffer."
  (setq text (greader-dehyphenate text))
  (when (or greader-dict-mode greader-dict-toggle-filters)
(setq text (greader-dict-check-and-replace text)))
- (setq output (call-process command nil nil nil rate language
+ (setq output (call-process command nil "*espeak-output*" nil
+rate language
 wave-file text))
- (when (= output 0)
-   (goto-char (cdr block)))
+ (if (= output 0)
+ (goto-char (cdr block))
+   (error "Espeak has generated an error.  Please see
+  *espeak-output* for more information"))
  filename)
   nil)))
 
@@ -256,7 +259,7 @@ COUNTER represents the current file name."
 (filename nil)
 (counter-chars 0))
 (while (< counter-chars (- (length
-total-blocks-string)
+   total-blocks-string)
   (length counter-string)))
   (setq filename (concat filename "0"))
   (setq counter-chars (+ counter-chars 1)))
@@ -266,10 +269,10 @@ COUNTER represents the current file name."
   "Compress given BOOK-DIRECTORY."
   (let ((zip-args (append (list "-rj")greader-audiobook-zip-args (list
  (concat
-   
(string-remove-suffix
-"/"
-book-directory)
-   ".zip"))
+  
(string-remove-suffix
+   "/"
+   
book-directory)
+  ".zip"))
  (list book-directory)))
(result nil))
 (setq result (apply 'call-process "zip" nil "*audiobook-zip*" nil
@@ -319,15 +322,15 @@ buffer without the extension, if any."
(make-directory default-directory))
  (unless greader-audiobook-buffer-quietly
(message "Starting conversion of %s ."
-  book-directory))
+book-directory))
  (while (greader-audiobook--get-block)
(setq output-file-name
  (greader-audiobook--calculate-file-name
   output-file-counter total-blocks))
(unless greader-audiobook-buffer-quietly
  (message "converting block %d of %d"
-output-file-counter
-total-blocks))
+  output-file-counter
+  total-blocks))
(setq output-file-name
  (greader-audiobook-convert-block output-file-name))
(if output-file-name
@@ -335,7 +338,7 @@ buffer without the extension, if any."
  (when greader-audiobook-transcode-wave-files
(unless greader-audiobook-buffer-quietly
  (message "Transcoding block to %s..."
-
greader-audiobook-transcode-format))
+  greader-audiobook-transcode-format))
(greader-audiobook-transcode-file
 output-file-name)
(when
diff --git a/greader.el b/greader.el
index 66d525d1d2..6640329f27 100644
--- a/greader.el
+++ b/greader.el
@@ -8,7 +8,7 @@
 ;; URL: https://gitlab.com/michelangelo-rodriguez/greader
 
 ;; package-requires: ((google-translate))
-;; Version: 0.11.2
+;; Version: 0.11.3
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by



[nongnu] scratch/editorconfig 676096fdae: (editorconfig--get-trailing-nl): Fix handling of `mode-require-final-newline`

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig
commit 676096fdaedf3bdc1b9326c6d0c24cd42d64db05
Author: Stefan Monnier 
Commit: Stefan Monnier 

(editorconfig--get-trailing-nl): Fix handling of 
`mode-require-final-newline`

`mode-require-final-newline` is the customization with which users can say
how they want to add trailing newlines in those modes that should and it
is used inside the main body of major modes to set
`require-final-newline`.  So setting it buffer-locally is at best useless
(and setting it via EditorConfig is too late anyway because the main
body of the major mode runs earlier).

Also, remove the FIXME that wants to remove final newlines, because
I don't know of a format that disallows a final newline, and in most
cases it's even hard to define what final newline would qualify: we'd need
to link it to something like a `trim_trailing_whitespace` except one that
applies to trailing empty lines rather than trailing spaces on lines.

* editorconfig.el (editorconfig--get-trailing-nl):
Obey `mode-require-final-newline` instead of setting it.
---
 editorconfig.el | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 25b5a3296d..68441d084e 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -605,16 +605,11 @@ This function will revert buffer when the coding-system 
has been changed."
   "Get the vars to require final newline according to FINAL-NEWLINE."
   (pcase final-newline
 ("true"
- ;; Keep prefs around how/when the nl is added, if set - otherwise add on
- ;; save
- `((require-final-newline . ,(or require-final-newline t))
-   ;; FIXME: Why do we set `mode-require-final-newline'?
-   (mode-require-final-newline . ,(or mode-require-final-newline t
+ ;; Keep prefs around how/when the nl is added, if set.
+ `((require-final-newline
+. ,(or require-final-newline mode-require-final-newline t
 ("false"
- ;; FIXME: Add functionality to actually REMOVE any trailing newlines here!
- ;; (rather than just making sure we don't automagically ADD a new one)
- `((require-final-newline . nil)
-   (mode-require-final-newline . nil)
+ `((require-final-newline . nil)
 
 (defun editorconfig--delete-trailing-whitespace ()
   "Call `delete-trailing-whitespace' unless the buffer is read-only."



[elpa] externals/aircon-theme d88978559c 2/2: Style transient-key faces used in Magit menus

2024-06-13 Thread ELPA Syncer
branch: externals/aircon-theme
commit d88978559cb1588e8a1811e9ed6e6b1fef0db150
Author: Gregory Chamberlain 
Commit: Gregory Chamberlain 

Style transient-key faces used in Magit menus
---
 aircon-theme.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/aircon-theme.el b/aircon-theme.el
index ac780a2220..8821e4d6e8 100644
--- a/aircon-theme.el
+++ b/aircon-theme.el
@@ -254,6 +254,11 @@
  '(magit-process-ok  ((t (:inherit (success)
  '(magit-process-ng  ((t (:inherit (error)
 
+ '(transient-key-exit((t (:inherit (error)
+ '(transient-key-noop((t (:inherit (shadow)
+ '(transient-key-return  ((t (:inherit (warning)
+ '(transient-key-stay((t (:inherit (success)
+
  '(dired-directory  ((t (:inherit (aircon-cello bold)
  '(dired-header ((t (:inherit (dired-directory)
  '(dired-symlink((t (:inherit (italic link)



[elpa] externals/aircon-theme updated (9f7c842394 -> d88978559c)

2024-06-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/aircon-theme.

  from  9f7c842394 Style font-lock faces for sh-mode
   new  eb91bfe734 Style magit-process faces
   new  d88978559c Style transient-key faces used in Magit menus


Summary of changes:
 aircon-theme.el | 8 
 1 file changed, 8 insertions(+)



[elpa] externals/aircon-theme eb91bfe734 1/2: Style magit-process faces

2024-06-13 Thread ELPA Syncer
branch: externals/aircon-theme
commit eb91bfe7348d3b97417a1a2d5cffd4bbd526f812
Author: Gregory Chamberlain 
Commit: Gregory Chamberlain 

Style magit-process faces
---
 aircon-theme.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/aircon-theme.el b/aircon-theme.el
index 91e1869170..ac780a2220 100644
--- a/aircon-theme.el
+++ b/aircon-theme.el
@@ -251,6 +251,9 @@
  '(magit-diff-file-heading-highlight ((t (:inherit (aircon-header)
  '(magit-diff-revision-summary-highlight ((t (:inherit (aircon-header)
 
+ '(magit-process-ok  ((t (:inherit (success)
+ '(magit-process-ng  ((t (:inherit (error)
+
  '(dired-directory  ((t (:inherit (aircon-cello bold)
  '(dired-header ((t (:inherit (dired-directory)
  '(dired-symlink((t (:inherit (italic link)



[elpa] externals-release/org updated (e4902995a0 -> d7b5c19daa)

2024-06-13 Thread ELPA Syncer
elpasync pushed a change to branch externals-release/org.

  from  e4902995a0 org-babel: Reduce verbosity when running in batch mode
   new  a13d8fe83b org-babel-exp-process-buffer: Fix edge case when src 
block ends at eob
   new  96113f3b59 org-export--set-variables: Fix variable assignment
   new  d7b5c19daa DnD: Create directory when `org-yank-image-save-method' 
is a directory


Summary of changes:
 lisp/ob-exp.el  | 10 ++
 lisp/org.el | 21 -
 lisp/ox.el  |  5 ++---
 testing/lisp/test-ox.el | 13 -
 4 files changed, 32 insertions(+), 17 deletions(-)



[elpa] externals/org 8f40da6bf6 1/2: Merge branch 'bugfix'

2024-06-13 Thread ELPA Syncer
branch: externals/org
commit 8f40da6bf6f2fea0b60592105fd05200d9f13603
Merge: a2ae069869 96113f3b59
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/ob-exp.el  | 10 ++
 lisp/ox.el  |  5 ++---
 testing/lisp/test-ox.el | 13 -
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 657cb2b526..5516530c5b 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -265,8 +265,9 @@ this template."
   (if (not (eq type 'babel-call))
   (progn (skip-chars-forward " \t")
  (point))
-(skip-chars-forward " \r\t\n")
-(line-beginning-position)
+ (unless (eobp)
+  (skip-chars-forward " \r\t\n")
+  (line-beginning-position))
   ((not rep)
;; Replacement code cannot be determined.
;; Leave the code block as is.
@@ -291,8 +292,9 @@ this template."
   (cond ((not replacement) (goto-char end))
 ((equal replacement "")
  (goto-char end)
- (skip-chars-forward " \r\t\n")
- (forward-line 0)
+  (unless (eobp)
+   (skip-chars-forward " \r\t\n")
+   (forward-line 0))
  (delete-region begin (point)))
 (t
  (if (org-src-preserve-indentation-p element)
diff --git a/lisp/ox.el b/lisp/ox.el
index 1c52ca2905..29390bf0e4 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1398,8 +1398,7 @@ external parameters overriding Org default settings, but 
still
 inferior to file-local settings."
   ;; First install #+BIND variables since these must be set before
   ;; global options are read.
-  (dolist (pair (org-export--list-bound-variables))
-(set (make-local-variable (car pair)) (nth 1 pair)))
+  (org-export--set-variables (org-export--list-bound-variables))
   ;; Get and prioritize export options...
   (org-combine-plists
;; ... from global variables...
@@ -2585,7 +2584,7 @@ Return the updated communication channel."
 (defun org-export--set-variables (variable-alist)
   "Set buffer-local variables according to VARIABLE-ALIST in current buffer."
   (pcase-dolist (`(,var . ,val) variable-alist)
-(set (make-local-variable var) val)))
+(set (make-local-variable var) (car val
 
 (cl-defun org-export-copy-buffer (&key to-buffer drop-visibility
drop-narrowing drop-contents
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 9b1b900ca4..0a39ddf2db 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -133,7 +133,18 @@ variable, and communication channel under `info'."
   (org-export-create-backend
:transcoders
'((section . (lambda (s c i)
-  (if (eq test-ox-var 'value) "Yes" "No")))
+  (if (eq test-ox-var 'value) "Yes" "No"))
+  ;; Seen from elisp code blocks as well.
+  (should
+   (string-match-p "::: \"test value\""
+  (org-test-with-temp-text "#+BIND: test-ox-var \"test value\"
+
+#+begin_src emacs-lisp :results value :exports results :eval yes
+(format \"::: %S\" test-ox-var)
+#+end_src"
+(let ((org-export-allow-bind-keywords t))
+  (org-export-as
+   (org-test-default-backend)))
 
 (ert-deftest test-org-export/parse-option-keyword ()
   "Test reading all standard #+OPTIONS: items."



[elpa] externals/org 6310bcd5ed 2/2: Merge branch 'bugfix'

2024-06-13 Thread ELPA Syncer
branch: externals/org
commit 6310bcd5ed1ed285d894ea60de9b9f05428d0b3d
Merge: 8f40da6bf6 d7b5c19daa
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/org.el | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index f50f0cff3d..8ef7c45e7f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20942,15 +20942,18 @@ SEPARATOR is the string to insert after each link."
('private (or org-yank-dnd-default-attach-method
  org-attach-method)
 (if separatep
-(funcall
- (pcase method
-   ('cp #'copy-file)
-   ('mv #'rename-file)
-   ('ln #'add-name-to-file)
-   ('lns #'make-symbolic-link))
- filename
- (expand-file-name (file-name-nondirectory filename)
-   org-yank-image-save-method))
+(progn
+  (unless (file-directory-p org-yank-image-save-method)
+(make-directory org-yank-image-save-method t))
+  (funcall
+   (pcase method
+ ('cp #'copy-file)
+ ('mv #'rename-file)
+ ('ln #'add-name-to-file)
+ ('lns #'make-symbolic-link))
+   filename
+   (expand-file-name (file-name-nondirectory filename)
+ org-yank-image-save-method)))
   (org-attach-attach filename nil method))
 (insert
  (org-link-make-string



[elpa] externals/greader d4f2503f92: greader version 0.11.4

2024-06-13 Thread ELPA Syncer
branch: externals/greader
commit d4f2503f92f5dadca60ffab3d6bf7766ad3097be
Author: Michelangelo Rodriguez 
Commit: Michelangelo Rodriguez 

greader version 0.11.4

More work on empty blocks.
---
 greader-audiobook.el | 2 ++
 greader.el   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/greader-audiobook.el b/greader-audiobook.el
index e1644275df..4ce4e58b36 100644
--- a/greader-audiobook.el
+++ b/greader-audiobook.el
@@ -161,6 +161,8 @@ Return a cons with start and end of the block or nil if at 
end of the buffer."
  (end (point-max)))
   (if (assq major-mode greader-audiobook-modes)
  (progn
+   (when (looking-at "\\W")
+ (setq start (re-search-forward "\\W*" nil 1)))
(re-search-forward
 (cdr (assq major-mode greader-audiobook-modes))
 nil t 1)
diff --git a/greader.el b/greader.el
index 6640329f27..82f4c1f6a7 100644
--- a/greader.el
+++ b/greader.el
@@ -8,7 +8,7 @@
 ;; URL: https://gitlab.com/michelangelo-rodriguez/greader
 
 ;; package-requires: ((google-translate))
-;; Version: 0.11.3
+;; Version: 0.11.4
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by



[elpa] externals-release/org a13d8fe83b 1/3: org-babel-exp-process-buffer: Fix edge case when src block ends at eob

2024-06-13 Thread ELPA Syncer
branch: externals-release/org
commit a13d8fe83b5d49a97ec3c60d5312549db1be9055
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-babel-exp-process-buffer: Fix edge case when src block ends at eob

* lisp/ob-exp.el (org-babel-exp-process-buffer): When src block ends
at eob, do not leave the #+end_src behind after replacement.
---
 lisp/ob-exp.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 657cb2b526..5516530c5b 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -265,8 +265,9 @@ this template."
   (if (not (eq type 'babel-call))
   (progn (skip-chars-forward " \t")
  (point))
-(skip-chars-forward " \r\t\n")
-(line-beginning-position)
+ (unless (eobp)
+  (skip-chars-forward " \r\t\n")
+  (line-beginning-position))
   ((not rep)
;; Replacement code cannot be determined.
;; Leave the code block as is.
@@ -291,8 +292,9 @@ this template."
   (cond ((not replacement) (goto-char end))
 ((equal replacement "")
  (goto-char end)
- (skip-chars-forward " \r\t\n")
- (forward-line 0)
+  (unless (eobp)
+   (skip-chars-forward " \r\t\n")
+   (forward-line 0))
  (delete-region begin (point)))
 (t
  (if (org-src-preserve-indentation-p element)



[elpa] externals-release/org 96113f3b59 2/3: org-export--set-variables: Fix variable assignment

2024-06-13 Thread ELPA Syncer
branch: externals-release/org
commit 96113f3b595ea24a7b133d61a5e668213224f157
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-export--set-variables: Fix variable assignment

* lisp/ox.el (org-export--set-variables): Assume that variables are
listed as (var value) - as a list.  Only use the second element of the
list as the value, following example in `org-export-get-environment'.
(org-export-get-environment): Use `org-export--set-variables'.
* testing/lisp/test-ox.el (test-org-export/bind-keyword): Add new
test.

Reported-by: Suhail Singh 
Link: https://orgmode.org/list/87cyonhuq3@gmail.com
---
 lisp/ox.el  |  5 ++---
 testing/lisp/test-ox.el | 13 -
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 1c52ca2905..29390bf0e4 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1398,8 +1398,7 @@ external parameters overriding Org default settings, but 
still
 inferior to file-local settings."
   ;; First install #+BIND variables since these must be set before
   ;; global options are read.
-  (dolist (pair (org-export--list-bound-variables))
-(set (make-local-variable (car pair)) (nth 1 pair)))
+  (org-export--set-variables (org-export--list-bound-variables))
   ;; Get and prioritize export options...
   (org-combine-plists
;; ... from global variables...
@@ -2585,7 +2584,7 @@ Return the updated communication channel."
 (defun org-export--set-variables (variable-alist)
   "Set buffer-local variables according to VARIABLE-ALIST in current buffer."
   (pcase-dolist (`(,var . ,val) variable-alist)
-(set (make-local-variable var) val)))
+(set (make-local-variable var) (car val
 
 (cl-defun org-export-copy-buffer (&key to-buffer drop-visibility
drop-narrowing drop-contents
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 9b1b900ca4..0a39ddf2db 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -133,7 +133,18 @@ variable, and communication channel under `info'."
   (org-export-create-backend
:transcoders
'((section . (lambda (s c i)
-  (if (eq test-ox-var 'value) "Yes" "No")))
+  (if (eq test-ox-var 'value) "Yes" "No"))
+  ;; Seen from elisp code blocks as well.
+  (should
+   (string-match-p "::: \"test value\""
+  (org-test-with-temp-text "#+BIND: test-ox-var \"test value\"
+
+#+begin_src emacs-lisp :results value :exports results :eval yes
+(format \"::: %S\" test-ox-var)
+#+end_src"
+(let ((org-export-allow-bind-keywords t))
+  (org-export-as
+   (org-test-default-backend)))
 
 (ert-deftest test-org-export/parse-option-keyword ()
   "Test reading all standard #+OPTIONS: items."



[elpa] externals/company 1a0fc12a9c: Mention `cape` as requested in https://github.com/company-mode/company-mode/commit/566c273678cae95db1541eb7b0ce1eddb26b8dfe#commitcomment-143075730

2024-06-13 Thread ELPA Syncer
branch: externals/company
commit 1a0fc12a9c3d25e28c22f319e7b097f435b1c27d
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Mention `cape` as requested in 
https://github.com/company-mode/company-mode/commit/566c273678cae95db1541eb7b0ce1eddb26b8dfe#commitcomment-143075730
---
 NEWS.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS.md b/NEWS.md
index 093f2bb3d7..4c518585ed 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -9,7 +9,8 @@
 * As such `company-capf` now interrupts computation on new user
   input. Completion tables that are incompatible with this behavior should get
   updated: bind `inhibit-quit` to non-nil around their sensitive sections, or
-  simply around the whole implementation (as a fallback).
+  simply around the whole implementation (e.g. using
+  `cape-capf-noninterruptible` from [cape](https://github.com/minad/cape/)).
 * `company-elisp` has been removed.  It's not needed since Emacs 24.4, with all
   of its features having been incorporated into the built-in Elisp completion.
 * `company-files` shows shorter completions.  Previously, the popup spanned



[elpa] externals-release/org d7b5c19daa 3/3: DnD: Create directory when `org-yank-image-save-method' is a directory

2024-06-13 Thread ELPA Syncer
branch: externals-release/org
commit d7b5c19daa4aece68c8ea97aa414fd4d4ec989df
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

DnD: Create directory when `org-yank-image-save-method' is a directory

* lisp/org.el (org--dnd-attach-file): Make sure that target directory
is created before copying file when `org-yank-image-save-method' is
set to specific directory (not 'attach).

Reported-by: ISouthRain 
Link: 
https://orgmode.org/list/tencent_aabb2debf7abfbc795348c288e0ebfcfd...@qq.com
---
 lisp/org.el | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1698399c42..795a4d51bb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20941,15 +20941,18 @@ SEPARATOR is the string to insert after each link."
('private (or org-yank-dnd-default-attach-method
  org-attach-method)
 (if separatep
-(funcall
- (pcase method
-   ('cp #'copy-file)
-   ('mv #'rename-file)
-   ('ln #'add-name-to-file)
-   ('lns #'make-symbolic-link))
- filename
- (expand-file-name (file-name-nondirectory filename)
-   org-yank-image-save-method))
+(progn
+  (unless (file-directory-p org-yank-image-save-method)
+(make-directory org-yank-image-save-method t))
+  (funcall
+   (pcase method
+ ('cp #'copy-file)
+ ('mv #'rename-file)
+ ('ln #'add-name-to-file)
+ ('lns #'make-symbolic-link))
+   filename
+   (expand-file-name (file-name-nondirectory filename)
+ org-yank-image-save-method)))
   (org-attach-attach filename nil method))
 (insert
  (org-link-make-string



[elpa] externals/org updated (a2ae069869 -> 6310bcd5ed)

2024-06-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  a2ae069869 ob-*: Do not emit redundant messages about code block 
evaluation
   new  a13d8fe83b org-babel-exp-process-buffer: Fix edge case when src 
block ends at eob
   new  96113f3b59 org-export--set-variables: Fix variable assignment
   new  8f40da6bf6 Merge branch 'bugfix'
   new  d7b5c19daa DnD: Create directory when `org-yank-image-save-method' 
is a directory
   new  6310bcd5ed Merge branch 'bugfix'


Summary of changes:
 lisp/ob-exp.el  | 10 ++
 lisp/org.el | 21 -
 lisp/ox.el  |  5 ++---
 testing/lisp/test-ox.el | 13 -
 4 files changed, 32 insertions(+), 17 deletions(-)



[nongnu] branch scratch/editorconfig-cc created (now 3764c87538)

2024-06-13 Thread Stefan Monnier via
monnier pushed a change to branch scratch/editorconfig-cc.

at  3764c87538 Fix text (#342)

This branch includes the following new commits:

   new  38ac903256 Erase initial commit content
   new  68ad326706 Update EditorConfig url.
   new  d744546fc6 Add root=true to the top .editorconfig.
   new  c45e871a5d Add properties link.
   new  a8ca8c46f7 Update EditorConfig Core URL.
   new  10be4fd165 provide feature, use symbol prefix, add commentary,
   new  45afbe1bc9 Add a link to `editorconfig.el` in README
   new  8ee7d0b533 Set indent_size for lisp mode and ruby mode.
   new  ef90cfda83 Update package information.
   new  e69ebeeaa1 Reset the indentation rule.
   new  9fdbf9ffdd Set indent value for AucTeX
   new  5dfbeb541e Fix indentation problem in the source file.
   new  d7a7b6af8e Add JS and HTML indent settings.
   new  fbe97a0824 Wrong way to indent html. Fixes it.
   new  ac28a9fd1d Bump version number
   new  4e2bf3ddd6 Add the package manager installation way to README
   new  5bc887b015 Support web-mode.
   new  6bdcaf89df Add cmake-mode support.
   new  56722d34df Add sh-indentation to the list of indent variable.
   new  d776cdc5ee Support max_line_length.
   new  9d1d236431 Don't set max_line_length if not specified.
   new  92519a8c25 Don't set indent size if the given value makes no sense.
   new  480a6bba47 Fix some issues caused by the previous commit.
   new  6c18a40b51 Make edconf-exec-path a customizable variable.
   new  c36ed4aeb7 Version 0.4
   new  e7a0874591 Add hook mechanism.
   new  7a7e1544c9 Update a few links in the README
   new  871a69ab90 Add Hong Xu to contributor list.
   new  b45ec732a2 Relicense to GPLv3+
   new  d068ec0546 Use \' instead of $
   new  46eb2863da Add autoload cookie
   new  a4b8e55bf4 Make EditorConfig core function pluggable
   new  0a319fab78 Add global minor mode
   new  cf6786403a Change symbol prefix: edconf -> editorconfig
   new  ab74eab0bc Update README
   new  16bd394d1f Add aliases for obsolete variables and bump version
   new  4a509abae7 Rename editorconfig-find-file-hook to editorconfig-apply
   new  a6ab681950 Apply settings on major mode change
   new  0efb6ea02f Add 10sr to the contributor list
   new  d1ea0124c5 Do nothing when current buffer does not visit any file
   new  9e9c4f706a Update .editorconfig for Makefile and .gitmodules
   new  b08e13aefa Add files used to test core functions
   new  d7a42c819c Add editorconfig-core el files
   new  2dbb864922 Update Makefile to run all tests including core
   new  242cc0ccea Use core in elisp as a fallback
   new  b3b2aef092 Update README for core elisp
   new  ebd09d700f Fix all indentation according to editorconfig
   new  cd38bdaa64 Prepare v0.6
   new  e93f45738c Add license header to executable
   new  ff1b4c2f65 Fix editorconfig-core commentary text
   new  527ff0b210 Fix some warnings reported by flycheck
   new  903e483a70 Make `editorconfig-apply' an interactive command
   new  701a5c0673 Fix indent of editorconfig.el according to .editorconfig
   new  10e648d326 Add document about running tests
   new  d83aba5206 Bump version: 0.6.1
   new  32fb0d6b9c Use `require` instead of `load` in usage example
   new  549d06a982 Add MELPA badges
   new  1b32452724 Use hook type for custom-hooks defcustom
   new  75139b95da Use dedicated functions to manipulate hook
   new  4fd932bb7c Check package metadata using ert framework
   new  98838dbc62 Fix names of ert test cases
   new  2ddf470e7b Bump version: 0.6.2
   new  21ea6f23c2 Support charset property
   new  ca854b55ff Update README for charset support
   new  675ea40668 Bump version: 0.7.0
   new  aea1b70fa7 I forgot to update editorconfig-core-version const
   new  4c583b154b Remove find-file-hook
   new  ee5b70f1e2 editorocnfig-core: Throw error when parsing 
.editorconfig failed
   new  3bdd68d5af Add tcl-mode indentation support
   new  381cf75a95 Add ps-mode indentation support
   new  17f14d982a Add ess-mode indentation support
   new  0b31539954 Throw error when editorconfig executable was not found
   new  6bfbea985c Catch error thrown from get-properties-function and 
display it
   new  8b5d83be82 Bump version: 0.7.1
   new  b4911d662f Already 2016 :) Happy new year!
   new  649e645106 Bump version to 0.7.2
   new  b1643c7360 Add support for scss-mode
   new  98999896aa Add octave-mode and matlab-mode support
   new  e300cdf937 Bump version to v0.7.3
   new  044453e7ac Add editorconfig-conf-mode
   new  031ef9c1c1 Add one variable editorconfig-properties-hash
   new  c02d94298b Add editorocnfig-display-current-properties
   new  de2b791957 Add editorconfig-exclude-modes
   new  13f3c49

[nongnu] scratch/editorconfig-cc ef90cfda83 009/351: Update package information.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit ef90cfda833faeeb8b92cd528bf9523762efa94e
Author: Hong Xu 
Commit: Stefan Monnier 

Update package information.
---
 editorconfig.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 646c80616b..d25d56fc0f 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -1,10 +1,14 @@
 ;;; editorconfig.el --- EditorConfig Emacs extension
 
-;; Copyright (C) 2011-2012 EditorConfig Team
+;; Copyright (C) 2011-2013 EditorConfig Team
 
-;; Author: Trey Hunner
+;; Author: EditorConfig Team 
 ;; Version: 0.1
-;; Homepage: http://editorconfig.org
+;; URL: http://editorconfig.org
+
+;; See
+;; http://github.com/editorconfig/editorconfig-emacs/graphs/contributors
+;; or the CONTRIBUTORS file for the list of contributors.
 
 ;; Redistribution and use in source and binary forms, with or without
 ;; modification, are permitted provided that the following conditions are met:



[nongnu] scratch/editorconfig-cc a8ca8c46f7 005/351: Update EditorConfig Core URL.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit a8ca8c46f75e76565d773c44cc9f36169beaa24c
Author: Hong Xu 
Commit: Stefan Monnier 

Update EditorConfig Core URL.
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index 7efe102e55..2a5127f32e 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
 [EditorConfig]: http://editorconfig.org
+[EditorConfig core]: https://github.com/editorconfig/editorconfig-core
 [properties]: http://editorconfig.org/#supported-properties



[nongnu] scratch/editorconfig-cc 6bfbea985c 073/351: Catch error thrown from get-properties-function and display it

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 6bfbea985c29952c7c763823639b5337304d539c
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Catch error thrown from get-properties-function and display it

This commit also fixes `display-warning' usage.
---
 editorconfig.el | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 014e5dc9e3..c3759ad837 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -248,16 +248,22 @@ It calls `editorconfig-get-properties-from-exec' if
   "Apply EditorConfig properties for current buffer."
   (interactive)
   (when buffer-file-name
-(let ((props (and (functionp editorconfig-get-properties-function)
-  (funcall editorconfig-get-properties-function
-  (if props
-(progn
-  (editorconfig-set-coding-system
-(gethash 'end_of_line props)
-(gethash 'charset props))
-  (editorconfig-set-line-length (gethash 'max_line_length props))
-  (run-hook-with-args 'editorconfig-custom-hooks props))
-(display-warning :error "EditorConfig core program is not available.  
Styles will not be applied.")
+(condition-case err
+  (progn
+(unless (functionp editorconfig-get-properties-function)
+  (error "Invalid editorconfig-get-properties-function value"))
+(let ((props (funcall editorconfig-get-properties-function)))
+  (progn
+(editorconfig-set-coding-system
+  (gethash 'end_of_line props)
+  (gethash 'charset props))
+(editorconfig-set-line-length (gethash 'max_line_length props))
+(run-hook-with-args 'editorconfig-custom-hooks props
+  (error
+(display-warning 'editorconfig
+  (concat (error-message-string err)
+".  Styles will not be applied.")
+  :error)
 
 ;;;###autoload
 (define-minor-mode editorconfig-mode



[nongnu] scratch/editorconfig-cc e69ebeeaa1 010/351: Reset the indentation rule.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit e69ebeeaa1dd8e4769d5a40e25323db8d8672e59
Author: Hong Xu 
Commit: Stefan Monnier 

Reset the indentation rule.
---
 .editorconfig   | 2 ++
 editorconfig.el | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index a615f13e81..770c115deb 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,3 +1,5 @@
 
 root = true
 
+[*.el]
+indent_style = space
diff --git a/editorconfig.el b/editorconfig.el
index d25d56fc0f..dbae64c884 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -47,8 +47,8 @@
 (defvar edconf-exec-path "editorconfig")
 
 (defun edconf-set-indentation (style &optional size tab_width)
- lisp-indent-offset size
- ruby-indent-level size
+  lisp-indent-offset size
+  ruby-indent-level size
   )
 
 (defun edconf-set-line-ending (end-of-line)



[nongnu] scratch/editorconfig-cc a4b8e55bf4 032/351: Make EditorConfig core function pluggable

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit a4b8e55bf4dea4567f165ad5f71694f659610b3d
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Make EditorConfig core function pluggable

Close #41

Squashed commit of the following:

commit e91aca6f38d9c42be19cc49aafc75ac086907b00
Author: 10sr <8slashes+...@gmail.com>
Date:   Sun Oct 25 03:19:26 2015 +0900

Fix typo in docstring

commit 76ce139cd0a0ff6bc250615ca7bb94868c85c41d
Author: 10sr <8slashes+...@gmail.com>
Date:   Tue Oct 13 13:51:13 2015 +0900

Implement edconf-get-properties-from-exec

commit 23baf520c83a7cb68634cd173ce28f9a6842f593
Author: 10sr <8slashes+...@gmail.com>
Date:   Mon Oct 12 03:18:54 2015 +0900

Add variable edconf-get-properties-function
---
 editorconfig.el | 24 
 1 file changed, 24 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index 6f5ce71cff..f362ea7061 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -44,6 +44,16 @@
   :type 'string
   :group 'editorconfig)
 
+(defcustom edconf-get-properties-function
+  'edconf-get-properties-from-exec
+  "Function to get EditorConofig properties for current buffer.
+This function will be called with no argument and should return a hash object
+containing properties, or nil if any core program is not available.
+The hash object should have symbols of property names as keys and strings of
+property values as values."
+  :type 'function
+  :group 'editorconfig)
+
 (defcustom edconf-custom-hooks ()
   "A list of custom hooks after loading common EditorConfig settings
 
@@ -104,10 +114,24 @@ property emacs_linum to decide whether to show line 
numbers on the left
 (defun edconf-parse-properties (props-string)
   )
 
+(defun edconf-get-properties-from-exec ()
+  "Get EditorConfig properties of current buffer by calling 
`edconf-exec-path'."
+  (if (executable-find edconf-exec-path)
+(edconf-parse-properties (edconf-get-properties))
+(display-warning :error
+  "Unable to find editorconfig executable.")
+nil))
+
 (defun edconf-find-file-hook ()
+  (let ((props (and (functionp edconf-get-properties-function)
+ (funcall edconf-get-properties-function
+(if props
+  (progn
   (edconf-set-line-length (gethash 'max_line_length props))
   (dolist (hook edconf-custom-hooks)
 (funcall hook props)))
+  (display-warning :error "EditorConfig core program is not available.  
Styles will not be applied."
+
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("/\\.editorconfig\\'" . conf-unix-mode))



[nongnu] scratch/editorconfig-cc 9e9c4f706a 041/351: Update .editorconfig for Makefile and .gitmodules

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 9e9c4f706a4becbaddf888abc7bb5db77d348946
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update .editorconfig for Makefile and .gitmodules
---
 .editorconfig | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/.editorconfig b/.editorconfig
index 9d29006ba1..80c923d711 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,6 +1,27 @@
-
 root = true
 
+[*]
+end_of_line = lf
+
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+
 [*.el]
 indent_style = space
 max_line_length = 80
+
+
+[Makefile]
+indent_style = tab
+tab_width = 4
+
+
+[.gitmodules]
+indent_style = tab
+tab_width = 4
+
+
+[*.yml]
+indent_style = space
+indent_size = 2



[nongnu] scratch/editorconfig-cc f263d8a45c 095/351: Update instructions about core program

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit f263d8a45cfff8f0c7c052d3b5ed96bc2889cfc1
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update instructions about core program
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index eff94ba376..4d46b55369 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
 
[![MELPA](http://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig)
 [![MELPA 
Stable](https://stable.melpa.org/packages/editorconfig-badge.svg)](https://stable.melpa.org/#/editorconfig)
 
-Or, when no Core executable is found, this plugin uses Emacs Lisp implemented
-Core as a fallback.
+This plugin also has a core library implemented in Emacs-Lisp, and fallback
+to it when no core executable is found.
 
 (require 'editorconfig)
 (editorconfig-mode 1)



[nongnu] scratch/editorconfig-cc de2b791957 083/351: Add editorconfig-exclude-modes

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit de2b7919571d374eaf5b9a68f747949b5072895b
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add editorconfig-exclude-modes
---
 editorconfig.el | 27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index e1de827889..0fb07b6af2 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -181,6 +181,11 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
   'editorconfig-indentation-alist
   "0.5")
 
+(defcustom editorconfig-exclude-modes ()
+  "List of major mode symbols not to apply properties."
+  :type '(repeat (symbol :tag "Major Mode"))
+  :group 'editorconfig)
+
 (defvar editorconfig-properties-hash nil
   "Hash object of EditorConfig properties for current buffer.
 Set by `editorconfig-apply' and nil if that is not invoked in current buffer
@@ -276,7 +281,9 @@ It calls `editorconfig-get-properties-from-exec' if
 
 ;;;###autoload
 (defun editorconfig-apply ()
-  "Apply EditorConfig properties for current buffer."
+  "Apply EditorConfig properties for current buffer.
+This function ignores `editorconfig-exclude-modes' and always applies available
+properties."
   (interactive)
   (when buffer-file-name
 (condition-case err
@@ -297,15 +304,27 @@ It calls `editorconfig-get-properties-from-exec' if
 ".  Styles will not be applied.")
   :error)
 
+(defun editorconfig-mode-apply ()
+  "Apply EditorConfig properties for current buffer.
+This function do the job only when the major mode is not listed in
+`editorconfig-exclude-modes'."
+  (when (and major-mode
+  (not (memq major-mode
+ editorconfig-exclude-modes)))
+(editorconfig-apply)))
+
 ;;;###autoload
 (define-minor-mode editorconfig-mode
-  "Toggle EditorConfig feature."
+  "Toggle EditorConfig feature.
+When enabled EditorConfig properties will be applied to buffers when first
+visiting files or changing major modes if the major mode is not listed in
+`editorconfig-exclude-modes'."
   :global t
   :lighter ""
   (dolist (hook '(after-change-major-mode-hook))
 (if editorconfig-mode
-  (add-hook hook 'editorconfig-apply)
-  (remove-hook hook 'editorconfig-apply
+  (add-hook hook 'editorconfig-mode-apply)
+  (remove-hook hook 'editorconfig-mode-apply
 
 
 



[nongnu] scratch/editorconfig-cc 5bc887b015 017/351: Support web-mode.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 5bc887b015d0c192133109448debcb1cd0a7b575
Author: Hong Xu 
Commit: Stefan Monnier 

Support web-mode.

Fix editorconfig/editorconfig#124
---
 editorconfig.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index b45aac0476..7bd2ba34fc 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -47,12 +47,16 @@
 (defvar edconf-exec-path "editorconfig")
 
 (defun edconf-set-indentation (style &optional size tab_width)
+  (setq web-mode-indent-style 2)
   LaTeX-indent-level size
   LaTeX-item-indent size
   TeX-brace-indent-level size
   js-indent-level size
   lisp-indent-offset size
   ruby-indent-level size
+   web-mode-markup-indent-offset size
+  web-mode-css-indent-offset size
+  web-mode-code-indent-offset size
   ;(make-local-variable 'sgml-basic-offset) size
   )
 



[nongnu] scratch/editorconfig-cc 031ef9c1c1 081/351: Add one variable editorconfig-properties-hash

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 031ef9c1c119b7e8157b3f47af2d922f43564f9a
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add one variable editorconfig-properties-hash
---
 editorconfig.el | 8 
 1 file changed, 8 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index 7d9ea968cd..3ea489d7a2 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -181,6 +181,13 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
   'editorconfig-indentation-alist
   "0.5")
 
+(defvar editorconfig-properties-hash nil
+  "Hash object of EditorConfig properties for current buffer.
+Set by `editorconfig-apply' and nil if that is not invoked in current buffer
+yet.")
+(make-variable-buffer-local 'editorconfig-properties-hash)
+
+
 (defun editorconfig-string-integer-p (string)
   "Return non-nil if STRING represents integer."
   (if (stringp string)
@@ -259,6 +266,7 @@ It calls `editorconfig-get-properties-from-exec' if
   (error "Invalid editorconfig-get-properties-function value"))
 (let ((props (funcall editorconfig-get-properties-function)))
   (progn
+(setq editorconfig-properties-hash props)
 (editorconfig-set-coding-system
   (gethash 'end_of_line props)
   (gethash 'charset props))



[nongnu] scratch/editorconfig-cc 871a69ab90 028/351: Add Hong Xu to contributor list.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 871a69ab908cb00e69fa5be0f7e4deaabcbe8b5d
Author: Hong Xu 
Commit: Stefan Monnier 

Add Hong Xu to contributor list.
---
 CONTRIBUTORS | 8 
 1 file changed, 8 insertions(+)

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
new file mode 100644
index 00..bd80c0cb6c
--- /dev/null
+++ b/CONTRIBUTORS
@@ -0,0 +1,8 @@
+Contributors to EditorConfig Emacs plugin:
+
+[Trey Hunner]
+Jonas Bernoulli
+[Johan Sundström]
+[Desmond O. Chang]
+[Steve Jordan]
+Hong Xu



[nongnu] scratch/editorconfig-cc c02d94298b 082/351: Add editorocnfig-display-current-properties

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit c02d94298babd6e5a01db4a3b80c1f3c791eff38
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add editorocnfig-display-current-properties

A function useful for debugging.
---
 editorconfig.el | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index 3ea489d7a2..e1de827889 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -256,6 +256,25 @@ It calls `editorconfig-get-properties-from-exec' if
 (editorconfig-get-propergies-from-exec)
 (editorconfig-core-get-properties-hash)))
 
+(defun editorconfig-display-current-properties ()
+  "Display EditorConfig properties extracted for current buffer."
+  (interactive)
+  (if editorconfig-properties-hash
+(let (
+   (buf (get-buffer-create "*EditorConfig Properties*"))
+   (file buffer-file-name)
+   (props editorconfig-properties-hash))
+  (with-current-buffer buf
+(erase-buffer)
+(insert (format "# EditorConfig for %s\n" file))
+(maphash (lambda (k v)
+   (insert (format "%S = %s\n" k v)))
+  props))
+  (display-buffer buf))
+(message "Properties are not applied to current buffer yet.")
+nil))
+
+;;;###autoload
 (defun editorconfig-apply ()
   "Apply EditorConfig properties for current buffer."
   (interactive)



[nongnu] scratch/editorconfig-cc 6f7137e593 113/351: Simplify definition of string-integer-p (#96)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 6f7137e59320014628133a8ae92487097a4dbf4a
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Simplify definition of string-integer-p (#96)
---
 editorconfig.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 73834e6bc5..bded6aa75f 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -203,9 +203,8 @@ yet.")
 
 (defun editorconfig-string-integer-p (string)
   "Return non-nil if STRING represents integer."
-  (if (stringp string)
-(string-match-p "\\`[0-9]+\\'" string)
-nil))
+  (and (stringp string)
+(string-match-p "\\`[0-9]+\\'" string)))
 
 (defun editorconfig-set-indentation/python-mode (size)
   "Set `python-mode' indent size to SIZE."



[nongnu] scratch/editorconfig-cc 9fdc9cc689 218/351: Add variable editorconfig-trim-whitespaces-mode

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 9fdc9cc689d33d8b5f5c510da80a155361a07fa4
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add variable editorconfig-trim-whitespaces-mode
---
 editorconfig.el | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index a9af423aa4..a3690589ea 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -248,9 +248,12 @@ properties."
   :type '(repeat string)
   :group 'editorconfig)
 
-(defcustom editorconfig-use-ws-butler nil
-  "Use command `ws-butler-mode' for trimming trailing whitespace."
-  :type 'boolean
+(defcustom editorconfig-trim-whitespaces-mode nil
+  "Buffer local minor-mode to use to trim trailing whitespaces.
+
+If set, enable that mode when `trim_trailing_whitespace` is set to true.
+Otherwise, use `delete-trailing-whitespace'."
+  :type 'symbol
   :group 'editorconfig)
 
 (defvar editorconfig-properties-hash nil
@@ -278,11 +281,6 @@ number - `lisp-indent-offset' is not set only if 
indent_size is
   (and (stringp string)
(string-match-p "\\`[0-9]+\\'" string)))
 
-(defun editorconfig-use-ws-butler-p ()
-  "Return non-nil if `editorconfig-use-ws-butler' is enabled and
-`ws-butler' is available."
-  (and editorconfig-use-ws-butler (fboundp 'ws-butler-mode)))
-
 (defun editorconfig-set-indentation/python-mode (size)
   "Set `python-mode' indent size to SIZE."
   )
@@ -333,12 +331,12 @@ number - `lisp-indent-offset' is not set only if 
indent_size is
  nil t
 
 (defun editorconfig-set-trailing-ws (trim-trailing-ws)
-(if (editorconfig-use-ws-butler-p)
-(ws-butler-mode 1)
+(if editorconfig-trim-whitespaces-mode
+(funcall editorconfig-trim-whitespaces-mode 1)
   ...)
-(if (editorconfig-use-ws-butler-p)
-(ws-butler-mode 0)
-  ...))
+(when editorconfig-trim-whitespaces-mode
+  (funcall editorconfig-trim-whitespaces-mode 0))
+...)
 
 (defun editorconfig-set-line-length (length)
   "Set the max line length (`fill-column') to LENGTH."



[nongnu] scratch/editorconfig-cc 13f3c4951c 084/351: Bump required editorconfi-core version

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 13f3c4951c2e33af319b1d33928d700e1cd89a28
Author: Hong Xu 
Commit: Stefan Monnier 

Bump required editorconfi-core version

Fix #80
---
 editorconfig.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 0fb07b6af2..cf997fc46b 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -5,7 +5,7 @@
 ;; Author: EditorConfig Team 
 ;; Version: 0.7.3
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
-;; Package-Requires: ((editorconfig-core "0.6.2"))
+;; Package-Requires: ((editorconfig-core "0.7.3"))
 
 ;; See
 ;; http://github.com/editorconfig/editorconfig-emacs/graphs/contributors



[nongnu] scratch/editorconfig-cc 2ddf470e7b 062/351: Bump version: 0.6.2

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 2ddf470e7b28ca67819b9627b625e54c46dc0228
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Bump version: 0.6.2

Also use stable version in Package-Requires: there should be no problem with
this.
---
 editorconfig-core-handle.el | 2 +-
 editorconfig-core.el| 4 ++--
 editorconfig-fnmatch.el | 2 +-
 editorconfig.el | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 45dea76a28..33623485d8 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2015 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.6.1
+;; Version: 0.6.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-core.el b/editorconfig-core.el
index 6a25adb0ce..398c9d22e9 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -3,9 +3,9 @@
 ;; Copyright (C) 2011-2015 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.6.1
+;; Version: 0.6.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
-;; Package-Requires: ((editorconfig-fnmatch "20151023.1021") (cl-lib "0.5"))
+;; Package-Requires: ((editorconfig-fnmatch "0.6.2") (cl-lib "0.5"))
 
 ;; See
 ;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors
diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index 1380211916..087e0b0e2b 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2015 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.6.1
+;; Version: 0.6.2
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
diff --git a/editorconfig.el b/editorconfig.el
index 11865547c7..9a7be9c969 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -3,9 +3,9 @@
 ;; Copyright (C) 2011-2015 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.6.1
+;; Version: 0.6.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
-;; Package-Requires: ((editorconfig-core "20151107.831"))
+;; Package-Requires: ((editorconfig-core "0.6.2"))
 
 ;; See
 ;; http://github.com/editorconfig/editorconfig-emacs/graphs/contributors



[nongnu] scratch/editorconfig-cc b1d254fd14 122/351: Add a :lighter "EditorConfig" for editorconfig-mode.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b1d254fd14cd31107e27dada98b7b43e1cc8d63e
Author: Hong Xu 
Commit: Stefan Monnier 

Add a :lighter "EditorConfig" for editorconfig-mode.
---
 editorconfig.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 984340eba7..7a954dbd98 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -332,7 +332,7 @@ When enabled EditorConfig properties will be applied to 
buffers when first
 visiting files or changing major modes if the major mode is not listed in
 `editorconfig-exclude-modes'."
   :global t
-  :lighter ""
+  :lighter "EditorConfig"
   (dolist (hook '(after-change-major-mode-hook))
 (if editorconfig-mode
   (add-hook hook 'editorconfig-mode-apply)



[nongnu] scratch/editorconfig-cc 381cf75a95 070/351: Add ps-mode indentation support

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 381cf75a9513dd72928ab12b946e99316d50e100
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add ps-mode indentation support
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index 2f348e1a59..008541eb68 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -120,6 +120,7 @@ property emacs_linum to decide whether to show line numbers 
on the left
  (objc-mode c-basic-offset)
  (perl-mode perl-indent-level)
  (pike-mode c-basic-offset)
+ (ps-mode ps-mode-tab)
  (puppet-mode puppet-indent-level)
  (python-mode . editorconfig-set-indentation/python-mode)
  (ruby-mode ruby-indent-level)



[nongnu] scratch/editorconfig-cc c36ed4aeb7 025/351: Version 0.4

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit c36ed4aeb7096abbe455fd91fd4708a413f0c16f
Author: Hong Xu 
Commit: Stefan Monnier 

Version 0.4
---
 editorconfig.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 989d8f5702..baeb8350cf 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2014 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.2
+;; Version: 0.4
 ;; URL: http://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See



[nongnu] scratch/editorconfig-cc de83e09632 243/351: Update docstring

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit de83e09632e119be9ec5cb3c04844a3895708965
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Update docstring
---
 README.md   |  2 +-
 editorconfig-core-handle.el |  2 +-
 editorconfig.el | 47 ++---
 3 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/README.md b/README.md
index dd957fa901..1680875a1f 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ only blocks of `web-mode`: it can be achieved by adding 
following to your init.e
 
 ```emacs-lisp
 (add-hook 'editorconfig-after-apply-functions
-  (lambda (hash) (setq web-mode-block-padding 0)))
+  (lambda (props) (setq web-mode-block-padding 0)))
 ```
 
 You can also define your own custom properties and enable them here.
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index aebc21d2cf..9685cc002b 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -57,7 +57,7 @@ Slots:
 (defun editorconfig-core-handle-section-get-properties (section file dir)
   "Return properties alist when SECTION name match FILE.
 
-DIR should be where the directory where .editorconfig which has SECTION exists.
+DIR should be the directory where .editorconfig file which has SECTION lives.
 IF not match, return nil."
   (when (editorconfig-core-handle--fnmatch-p
  file
diff --git a/editorconfig.el b/editorconfig.el
index 5730239328..453c8cd36b 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -61,9 +61,9 @@ coding styles between different editors and IDEs."
 
 (defcustom editorconfig-exec-path
   "editorconfig"
-  "EditorConfig executable name.
+  "Path to EditorConfig executable.
 
-This executable is invoked by `editorconfig-call-editorconfig-exec'."
+Used by `editorconfig-call-editorconfig-exec'."
   :type 'string
   :group 'editorconfig)
 (define-obsolete-variable-alias
@@ -77,16 +77,16 @@ This executable is invoked by 
`editorconfig-call-editorconfig-exec'."
 
 This function will be called with no argument and should return a
 hash object containing properties, or nil if any core program is
-not available.  The hash object should have symbols of property
-names as keys and strings of property values as values.
+not available.  Keys of this hash should be symbols of properties, and values
+should be strings of their values.
 
 
 For example, if you always want to use built-in core library instead
 of any EditorConfig executable to get properties, add following to
 your init.el:
 
-(set-variable 'editorconfig-get-properties-function
-  #'editorconfig-core-get-properties-hash)
+  (set-variable 'editorconfig-get-properties-function
+#'editorconfig-core-get-properties-hash)
 
 Possible known values are:
 
@@ -226,23 +226,18 @@ If INDENT-SPEC-LIST is provided, each element of it must 
have one of the
 following forms:
 
  1. VARIABLE
-
 It means (VARIABLE . 1).
 
  2. (VARIABLE . SPEC)
-
 Setting VARIABLE according to the type of SPEC:
 
   - Integer
-
 The value is (* SPEC INDENT-SIZE);
 
   - Function
-
 The value is (funcall SPEC INDENT-SIZE);
 
   - Any other type.
-
 The value is SPEC.
 
 NOTE: Only the **buffer local** value of VARIABLE will be set."
@@ -255,14 +250,17 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
   "0.5")
 
 (defcustom editorconfig-exclude-modes ()
-  "List of major mode symbols not to apply properties."
+  "Modes in which `editorconfig-mode-apply' will not run."
   :type '(repeat (symbol :tag "Major Mode"))
   :group 'editorconfig)
 
 (defcustom editorconfig-exclude-regexps
   (list (eval-when-compile
   (rx string-start (or "http" "https" "ftp" "sftp" "rsync") ":")))
-  "List of buffer filename prefix regexp patterns not to apply properties."
+  "List of regexp for buffer filenames `editorconfig-mode-apply' will not run.
+
+When variable `buffer-file-name' matches any of the regexps, then
+`editorconfig-mode-apply' will not do its work."
   :type '(repeat string)
   :group 'editorconfig)
 
@@ -275,7 +273,7 @@ Otherwise, use `delete-trailing-whitespace'."
   :group 'editorconfig)
 
 (defvar editorconfig-properties-hash nil
-  "Hash object of EditorConfig properties for current buffer.
+  "Hash object of EditorConfig properties that was enabled for current buffer.
 Set by `editorconfig-apply' and nil if that is not invoked in
 current buffer yet.")
 (make-variable-buffer-local 'editorconfig-properties-hash)
@@ -292,7 +290,7 @@ number - `lisp-indent-offset' is not set only if 
indent_size is
  `lisp-indent-offset'will not be set only if indent_size is 2.")
 
 (defconst editorconfig-unset-value "unset"
-  "String used to unset properties in .editorconfig .")
+  "String of value used to unset properties in .editorconfig .")
 
 (defun editorconfig-string-integer-p (string)
   "Return non-nil if STRING represents integer."
@@ -474,9 +472,9 @@ It calls `editorconf

[nongnu] scratch/editorconfig-cc 46eb2863da 031/351: Add autoload cookie

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 46eb2863daa2f391bda9b9f8b0db0db210922b32
Author: USAMI Kenta 
Commit: Stefan Monnier 

Add autoload cookie
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index 3c72fd0f02..6f5ce71cff 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -109,6 +109,7 @@ property emacs_linum to decide whether to show line numbers 
on the left
   (dolist (hook edconf-custom-hooks)
 (funcall hook props)))
 
+;;;###autoload
 (add-to-list 'auto-mode-alist '("/\\.editorconfig\\'" . conf-unix-mode))
 
 (provide 'editorconfig)



[nongnu] scratch/editorconfig-cc 21ea6f23c2 063/351: Support charset property

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 21ea6f23c2e9629dcb45e67a91a5326782464dd9
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Support charset property
---
 editorconfig.el | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 9a7be9c969..897ea7e909 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -193,9 +193,25 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
 (when (not (equal size "tab")) (setq size nil)))
   )
 
-(defun editorconfig-set-line-ending (end-of-line)
-  "Set line ending style to CR, LF, or CRLF by END-OF-LINE."
-  )
+(defun editorconfig-set-coding-system (end-of-line charset)
+  "Set buffer coding system by END-OF-LINE and CHARSET."
+  (let ((eol (cond
+   ((equal end-of-line "lf") 'undecided-unix)
+   ((equal end-of-line "cr") 'undecided-mac)
+   ((equal end-of-line "crlf") 'undecided-dos)
+   (t 'undecided)))
+ (cs (cond
+   ((equal charset "latin1") 'iso-latin-1)
+   ((equal charset "utf-8") 'utf-8)
+   ((equal charset "utf-8-bom") 'utf-8-with-signature)
+   ((equal charset "utf-16be") 'utf-16be)
+   ((equal charset "utf-16le") 'utf-16le)
+   (t 'undecided
+(set-buffer-file-coding-system (merge-coding-systems
+ cs
+ eol)
+  nil t)))
+
 
 (defun editorconfig-set-line-length (length)
   "Set the max line length (fill-column) to LENGTH."
@@ -234,6 +250,9 @@ It calls `editorconfig-get-properties-from-exec' if
   (funcall editorconfig-get-properties-function
   (if props
 (progn
+  (editorconfig-set-coding-system
+(gethash 'end_of_line props)
+(gethash 'charset props))
   (editorconfig-set-line-length (gethash 'max_line_length props))
   (run-hook-with-args 'editorconfig-custom-hooks props))
 (display-warning :error "EditorConfig core program is not available.  
Styles will not be applied.")



[nongnu] scratch/editorconfig-cc 9bd6af5f0e 097/351: Add EditorConfig group definition

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 9bd6af5f0e33e00f0d5af631e1ab13acd208eff4
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add EditorConfig group definition
---
 editorconfig.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index e3fe5e8f11..ac5d362cdf 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -45,6 +45,11 @@
   "editorconfig-core"
   nil)
 
+(defgroup editorconfig nil
+  "help developers define and maintain consistentcoding styles between 
different
+editors and IDEs"
+  :group 'tools)
+
 (defcustom editorconfig-exec-path
   "editorconfig"
   "EditorConfig executable name.



[nongnu] scratch/editorconfig-cc d7c6a8befd 128/351: Reidentation for all *.el files.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit d7c6a8befd4143aea671074ce839ac80ca1619c3
Author: Hong Xu 
Commit: Stefan Monnier 

Reidentation for all *.el files.
---
 editorconfig-conf-mode.el   |  60 +--
 editorconfig-core-handle.el | 174 +++---
 editorconfig-core.el|  90 
 editorconfig-fnmatch.el | 254 ++--
 4 files changed, 289 insertions(+), 289 deletions(-)

diff --git a/editorconfig-conf-mode.el b/editorconfig-conf-mode.el
index e7bf53e014..f544bfaf9e 100644
--- a/editorconfig-conf-mode.el
+++ b/editorconfig-conf-mode.el
@@ -43,50 +43,50 @@
   "Major mode for editing .editorconfig files."
   (set-variable 'indent-line-function 'indent-relative)
   (let ((key-property-list
-  '("charset"
-"end_of_line"
-"indent_size"
-"indent_style"
-"insert_final_newline"
-"max_line_length"
-"root"
-"tab_width"
-"trim_trailing_whitespace"))
+ '("charset"
+   "end_of_line"
+   "indent_size"
+   "indent_style"
+   "insert_final_newline"
+   "max_line_length"
+   "root"
+   "tab_width"
+   "trim_trailing_whitespace"))
 (key-value-list
-  '("true"
-"false"
-"lf"
-"cr"
-"crlf"
-"space"
-"tab"
-"latin1"
-"utf-8"
-"utf-8-bom"
-"utf-16be"
-"utf-16le"))
+ '("true"
+   "false"
+   "lf"
+   "cr"
+   "crlf"
+   "space"
+   "tab"
+   "latin1"
+   "utf-8"
+   "utf-8-bom"
+   "utf-16be"
+   "utf-16le"))
 (font-lock-value
-  '(("^[ \t]*\\[\\(.+?\\)\\]" 1 font-lock-type-face)
-("^[ \t]*\\(.+?\\)[ \t]*[=:]" 1 font-lock-variable-name-face
+ '(("^[ \t]*\\[\\(.+?\\)\\]" 1 font-lock-type-face)
+   ("^[ \t]*\\(.+?\\)[ \t]*[=:]" 1 font-lock-variable-name-face
 
 ;; Highlight all key values
 (dolist (key-value key-value-list)
   (add-to-list
-'font-lock-value
-`(,(format "[=:][ \t]*\\(%s\\)\\([ \t]\\|$\\)" key-value)
-  1 font-lock-constant-face)))
+   'font-lock-value
+   `(,(format "[=:][ \t]*\\(%s\\)\\([ \t]\\|$\\)" key-value)
+ 1 font-lock-constant-face)))
 ;; Highlight all key properties
 (dolist (key-property key-property-list)
   (add-to-list
-'font-lock-value
-`(,(format "^[ \t]*\\(%s\\)[ \t]*[=:]" key-property)
-  1 font-lock-builtin-face)))
+   'font-lock-value
+   `(,(format "^[ \t]*\\(%s\\)[ \t]*[=:]" key-property)
+ 1 font-lock-builtin-face)))
 
 (conf-mode-initialize "#" font-lock-value)))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist
-  '("/\\.editorconfig\\'" . editorconfig-conf-mode))
+ '("/\\.editorconfig\\'" . editorconfig-conf-mode))
 
 (provide 'editorconfig-conf-mode)
 
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index bfda7b92b8..42972a2e0d 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -68,20 +68,20 @@
 If CONF does not exist return nil."
   (when (file-readable-p conf)
 (let ((cached (gethash conf
-editorconfig-core-handle--cache-hash))
-   (mtime (nth 5
-(file-attributes conf
+   editorconfig-core-handle--cache-hash))
+  (mtime (nth 5
+  (file-attributes conf
   (if (and cached
-(equal (editorconfig-core-handle-mtime cached)
-  mtime))
-cached
+   (equal (editorconfig-core-handle-mtime cached)
+  mtime))
+  cached
 (let ((parsed (editorconfig-core-handle--parse-file conf)))
   (puthash conf
-(make-editorconfig-core-handle :top-prop (car parsed)
-  :prop (cdr parsed)
-  :mtime mtime
-  :path conf)
-editorconfig-core-handle--cache-hash))
+   (make-editorconfig-core-handle :top-prop (car parsed)
+  :prop (cdr parsed)
+  :mtime mtime
+  :path conf)
+   editorconfig-core-handle--cache-hash))
 
 (defun editorconfig-core-handle-root-p (handle)
   "Return non-nil if HANDLE represent root EditorConfig file.
@@ -89,9 +89,9 @@ If CONF does not exist return nil."
 If HANDLE is nil return nil."
   (when handle
 (string-equal "true"
-  (downcase (or (cdr (assoc "root"
-   (editorconfig-core-handle-top-prop handle)))
-  "")
+  (downcase (or (cdr (assoc "root"
+ 

[nongnu] scratch/editorconfig-cc e452e1d45b 086/351: Bump version to 0.7.4

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit e452e1d45bd27ee405887d40dd6eaeee93661798
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Bump version to 0.7.4

Only Package-Version in editoroconfig.el will be respected so remove
from other files.
---
 bin/editorconfig-el | 2 +-
 editorconfig-core-handle.el | 1 -
 editorconfig-core.el| 1 -
 editorconfig-fnmatch.el | 1 -
 editorconfig.el | 2 +-
 5 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/bin/editorconfig-el b/bin/editorconfig-el
index 5cd2667db0..01f365fa02 100755
--- a/bin/editorconfig-el
+++ b/bin/editorconfig-el
@@ -8,7 +8,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.3
+;; Version: 0.7.4
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 365031a385..2c557d268f 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -3,7 +3,6 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.3
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-core.el b/editorconfig-core.el
index e443ffbacd..4c2785682d 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -3,7 +3,6 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.3
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index c821008b6e..adeaaed1ec 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -3,7 +3,6 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.3
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig.el b/editorconfig.el
index 9eb4fa607e..3d68ceca73 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.3
+;; Version: 0.7.4
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 ;; Package-Requires: ((cl-lib "0.5"))
 



[nongnu] scratch/editorconfig-cc 92519a8c25 022/351: Don't set indent size if the given value makes no sense.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 92519a8c255cfd7d2b730842c7cb00304f992735
Author: Hong Xu 
Commit: Stefan Monnier 

Don't set indent size if the given value makes no sense.
---
 editorconfig.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index d7266c39e6..652f9eb173 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -46,7 +46,14 @@
 
 (defvar edconf-exec-path "editorconfig")
 
+(defun edconf-string-integer-p (string)
+  "Whether a string representing integer"
+  (string-match-p "\\`[0-9]+\\'" string))
+
 (defun edconf-set-indentation (style &optional size tab_width)
+  (if (and (edconf-string-integer-p size) (not (equal size "tab")))
+(setq size (string-to-number size))
+(setq size nil))
   (setq web-mode-indent-style 2)
   LaTeX-indent-level size
   LaTeX-item-indent size
@@ -67,7 +74,7 @@
 
 (defun edconf-set-line-length (length)
   "set the max line length (fill-column)"
-  (if length
+  (when (edconf-string-integer-p length)
 (set-fill-column (string-to-number length
 
 (defun edconf-get-properties ()



[nongnu] scratch/editorconfig-cc 39eca13316 279/351: Add Github Actions build.yaml

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 39eca13316180e5063a5ebaa3e6630d34006a811
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add Github Actions build.yaml
---
 .github/workflows/build.yaml | 40 
 1 file changed, 40 insertions(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 00..85d85b622d
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,40 @@
+---
+name: build
+
+on:
+  push:
+branches:
+  - master
+  pull_request:
+types: [opened, synchronize]
+branches:
+  - 'master'
+  release:
+types: [published]
+
+jobs:
+  test:
+runs-on: ubuntu-latest
+strategy:
+  matrix:
+emacs_version:
+  - "24.5"
+  - "25.3"
+  - "26.3"
+  - "27.1"
+experimental: [false]
+include:
+  - emacs_version: snapshot
+experimental: true
+continue-on-error: ${{ matrix.experimental }}
+steps:
+  - name: Checkout
+uses: actions/checkout@v1
+with:
+  submodules: recursive
+  - name: Setup Emacs
+uses: purcell/setup-emacs@master
+with:
+  version: ${{ matrix.emacs_version }}
+  - name: Run tests
+run: make test



[nongnu] scratch/editorconfig-cc 2dbb864922 044/351: Update Makefile to run all tests including core

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 2dbb8649227c34aa415c1b578839e284524bdca5
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update Makefile to run all tests including core
---
 Makefile | 65 
 1 file changed, 65 insertions(+)

diff --git a/Makefile b/Makefile
new file mode 100644
index 00..8f71fabeb7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,65 @@
+# -*- Makefile -*-
+
+EMACS = emacs
+
+PROJECT_ROOT_DIR = $(PWD)
+ERT_TESTS = $(wildcard $(PROJECT_ROOT_DIR)/ert-tests/*.el)
+
+BATCHFLAGS = -batch -q --no-site-file -L $(PROJECT_ROOT_DIR)
+
+SRCS = editorconfig.el editorconfig-core.el editorconfig-core-handle.el \
+   editorconfig-fnmatch.el
+OBJS = $(SRCS:.el=.elc)
+
+$(OBJS): %.elc: %.el
+   $(EMACS) $(BATCHFLAGS) -f batch-byte-compile $^
+
+.PHONY: all clean test test-travis test-ert test-core test-metadata
+
+test: test-ert test-core test-metadata $(OBJS)
+   $(EMACS) $(BATCHFLAGS) -l editorconfig.el
+
+
+
+
+# ert test
+test-ert: $(ERT_TESTS) $(OBJS)
+   $(EMACS) $(BATCHFLAGS) \
+   --eval "(require 'ert) (setq debug-on-error t)" \
+   $(ERT_TESTS:%=-l "%") \
+   -f ert-run-tests-batch-and-exit
+
+
+
+# Core test
+core-test/CMakeLists.txt:
+   git submodule update --init
+
+test-core: core-test/CMakeLists.txt $(OBJS)
+   cd $(PROJECT_ROOT_DIR)/core-test && \
+   cmake 
-DEDITORCONFIG_CMD="$(PROJECT_ROOT_DIR)/bin/editorconfig-el" .
+   cd $(PROJECT_ROOT_DIR)/core-test && \
+   EMACS_BIN=$(EMACS) 
EDITORCONFIG_CORE_LIBRARY_PATH="$(PROJECT_ROOT_DIR)" \
+   ctest --output-on-failure .
+
+
+# Check package metadata
+
+ELISP_GET_FILE_PACKAGE_METADATA = \
+   (lambda (f) \
+   (with-temp-buffer \
+   (insert-file-contents-literally f) \
+   (package-buffer-info)))
+
+ELISP_PRINT_METADATA = \
+   (mapc \
+   (lambda (f) \
+   (message \"Loading info: %s\" f) \
+   (message \"%S\" (funcall 
$(ELISP_GET_FILE_PACKAGE_METADATA) f))) \
+   command-line-args-left)
+
+test-metadata: $(SRCS)
+   $(EMACS) -batch -Q \
+   --eval "(require 'package)" \
+   --eval "$(ELISP_PRINT_METADATA)" \
+   $^



[nongnu] scratch/editorconfig-cc ac28a9fd1d 015/351: Bump version number

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit ac28a9fd1d5b4bd0130fe78d3428cc1e93bbff7a
Author: Hong Xu 
Commit: Stefan Monnier 

Bump version number
---
 editorconfig.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 6f60324c9e..b45aac0476 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -3,8 +3,8 @@
 ;; Copyright (C) 2011-2013 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.1
-;; URL: http://editorconfig.org
+;; Version: 0.2
+;; URL: http://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
 ;; http://github.com/editorconfig/editorconfig-emacs/graphs/contributors



[nongnu] scratch/editorconfig-cc 706348108c 181/351: Check editorconfig configs when read only state changes

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 706348108cb5a49743264e5c19b911b7411c8cb7
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Check editorconfig configs when read only state changes
---
 editorconfig.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 3cbca99f00..45ef0bae3a 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -439,7 +439,8 @@ mode is not listed in `editorconfig-exclude-modes'."
   :lighter " EditorConfig"
   ;; See https://github.com/editorconfig/editorconfig-emacs/issues/141 for why
   ;; not `after-change-major-mode-hook'
-  (dolist (hook '(change-major-mode-after-body-hook))
+  (dolist (hook '(change-major-mode-after-body-hook
+  read-only-mode-hook))
 (if editorconfig-mode
 (add-hook hook 'editorconfig-mode-apply)
   (remove-hook hook 'editorconfig-mode-apply



[nongnu] scratch/editorconfig-cc 52abce4b1e 268/351: 2020

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 52abce4b1e06ef7033eac4a682c80eb2ed5937fe
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

2020
---
 bin/editorconfig-el | 2 +-
 editorconfig-conf-mode.el   | 2 +-
 editorconfig-core-handle.el | 2 +-
 editorconfig-core.el| 2 +-
 editorconfig-fnmatch.el | 2 +-
 editorconfig.el | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/editorconfig-el b/bin/editorconfig-el
index 7a559eef58..781cba8083 100755
--- a/bin/editorconfig-el
+++ b/bin/editorconfig-el
@@ -5,7 +5,7 @@
 
 ;; editorconfig-el --- EditorConfig Core executable in Emacs Lisp
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig-conf-mode.el b/editorconfig-conf-mode.el
index dd3964fa60..0ff8dc15cb 100644
--- a/editorconfig-conf-mode.el
+++ b/editorconfig-conf-mode.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-conf-mode.el --- Major mode for editing .editorconfig files  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index bb152364d4..0a94d0301f 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-core-handle.el --- Handle Class for EditorConfig File  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 
diff --git a/editorconfig-core.el b/editorconfig-core.el
index 1f06130579..3ad0bd8cb0 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-core.el --- EditorConfig Core library in Emacs Lisp  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 
diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index da8df0a042..c4eb808c9a 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-fnmatch.el --- Glob pattern matching in Emacs lisp  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 
diff --git a/editorconfig.el b/editorconfig.el
index 9b395eed4e..5705cc2546 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -1,6 +1,6 @@
 ;;; editorconfig.el --- EditorConfig Emacs Plugin  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2019 EditorConfig Team
+;; Copyright (C) 2011-2020 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; Version: 0.8.1



[nongnu] scratch/editorconfig-cc 3a7bb0d820 185/351: Clear translate cache on file reload

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 3a7bb0d8209dbd4fd8cb5ab8825ae5278337adda
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Clear translate cache on file reload
---
 editorconfig-fnmatch.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index 8126060ef6..69a0c766dc 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -55,8 +55,11 @@
 (require 'cl-lib)
 
 (defvar editorconfig-fnmatch--cache-hashtable
-  (make-hash-table :test 'equal)
+  nil
   "Cache of shell pattern and its translation.")
+;; Clear cache on file reload
+(setq editorconfig-fnmatch--cache-hashtable
+  (make-hash-table :test 'equal))
 
 
 (defconst editorconfig-fnmatch--left-brace-regexp



[nongnu] scratch/editorconfig-cc 97c22ffe64 109/351: Remove link to Marmalade package repository

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 97c22ffe6407ad00fbaf39e06925aeecc7154639
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Remove link to Marmalade package repository

Recently we do not update the package in Marmalade repository.
---
 README.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/README.md b/README.md
index 03b3d0b545..aaf8593974 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,6 @@ to it when no core executable is found.
 ```
 
 Alternatively, you can find the package available on
-[Marmalade](http://marmalade-repo.org/packages/editorconfig) and
 [MELPA](http://melpa.org/#/editorconfig).
 
 ## Supported properties



[nongnu] scratch/editorconfig-cc 68ad326706 002/351: Update EditorConfig url.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 68ad326706a14a707395501aeb03b579aef83777
Author: Hong Xu 
Commit: Stefan Monnier 

Update EditorConfig url.
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
new file mode 100644
index 00..ae24132e20
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+[EditorConfig]: http://editorconfig.org



[nongnu] scratch/editorconfig-cc dbfe71c45c 165/351: Fix Makefile

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit dbfe71c45c05e3e9d7196fab114eae55f2c1f16f
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Fix Makefile
---
 Makefile | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 19a784af6d..85f5b4fbfd 100644
--- a/Makefile
+++ b/Makefile
@@ -20,15 +20,11 @@ $(OBJS): %.elc: %.el
 .PHONY: all clean test test-travis test-ert test-core test-metadata sandbox 
doc info
 
 
-doc: info
+doc: doc/editorconfig.texi
 
-info: doc/editorconfig.info
-
-doc/editorconfig.info: README.md
+doc/editorconfig.texi: README.md
mkdir -p doc
-   tail -n +4 $< | $(PANDOC) -s -f markdown -o $@.texi
-   echo >>$@.texi
-   $(MAKEINFO) --no-split $@.texi -o $@
+   tail -n +4 $< | $(PANDOC) -s -f markdown -o $@
 
 
 test: test-ert test-core test-metadata $(OBJS)



[nongnu] scratch/editorconfig-cc 0b31539954 072/351: Throw error when editorconfig executable was not found

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 0b31539954f777eaf50cd589db04888a09950e7b
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Throw error when editorconfig executable was not found
---
 editorconfig.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 8ce47d6fac..014e5dc9e3 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -232,9 +232,7 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
   "Get EditorConfig properties of current buffer by calling 
`editorconfig-exec-path'."
   (if (executable-find editorconfig-exec-path)
 (editorconfig-parse-properties (editorconfig-call-editorconfig-exec))
-(display-warning :error
-  "Unable to find editorconfig executable.")
-nil))
+(error "Unable to find editorconfig executable")))
 
 (defun editorconfig-get-properties ()
   "Get EditorConfig properties of current buffer.



[nongnu] scratch/editorconfig-cc b33e5568ff 172/351: Add test for various normal whitespace

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b33e5568ff166ed7ecdf2bb2734f68c862b2fc3b
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add test for various normal whitespace

Currently core-handle fails to parse files that contain whitespaces
like line breaks, horizontal space, vertical space, etc.

#161
---
 ert-tests/editorconfig-core-handle.el  |  6 ++
 ert-tests/whitespaces/example-editorconfig.txt | 12 
 2 files changed, 18 insertions(+)

diff --git a/ert-tests/editorconfig-core-handle.el 
b/ert-tests/editorconfig-core-handle.el
index de319fe1ae..41d96105fb 100644
--- a/ert-tests/editorconfig-core-handle.el
+++ b/ert-tests/editorconfig-core-handle.el
@@ -47,4 +47,10 @@
 (concat fixtures
 "a.js"))
'((("key" . "value"))
+
+  ;; For checking various normal whitespace (line breaks, horizontal space, 
vertical space, etc.)
+  (let* ((conf (concat default-directory
+   "ert-tests/whitespaces/example-editorconfig.txt"))
+ (handle (editorconfig-core-handle conf)))
+(should (editorconfig-core-handle-p handle)))
   )
diff --git a/ert-tests/whitespaces/example-editorconfig.txt 
b/ert-tests/whitespaces/example-editorconfig.txt
new file mode 100644
index 00..0472294c42
--- /dev/null
+++ b/ert-tests/whitespaces/example-editorconfig.txt
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+
+# Text encoding name.
+charset = utf-8
+
+# Page Break
+
+
+# Remove trailing whitespace on lines?
+trim_trailing_whitespace = true



[nongnu] scratch/editorconfig-cc 10be4fd165 006/351: provide feature, use symbol prefix, add commentary,

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 10be4fd165d39baa4394e26256f696a39ab01de3
Author: Jonas Bernoulli 
Commit: Stefan Monnier 

provide feature, use symbol prefix, add commentary,

remove url from summary
---
 editorconfig.el | 57 +
 1 file changed, 57 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index e69de29bb2..066c2f2c79 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -0,0 +1,57 @@
+;;; editorconfig.el --- EditorConfig Emacs extension
+
+;; Copyright (C) 2011-2012 EditorConfig Team
+
+;; Author: Trey Hunner
+;; Version: 0.1
+;; Homepage: http://editorconfig.org
+
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are met:
+;; 
+;; 1. Redistributions of source code must retain the above copyright notice,
+;;this list of conditions and the following disclaimer.
+;; 2. Redistributions in binary form must reproduce the above copyright notice,
+;;this list of conditions and the following disclaimer in the documentation
+;;and/or other materials provided with the distribution.
+
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+;; POSSIBILITY OF SUCH DAMAGE.
+
+;;; Commentary:
+
+;; EditorConfig helps developers define and maintain consistent
+;; coding styles between different editors and IDEs.
+
+;; The EditorConfig project consists of a file format for defining
+;; coding styles and a collection of text editor plugins that enable
+;; editors to read the file format and adhere to defined styles.
+;; EditorConfig files are easily readable and they work nicely with
+;; version control systems.
+
+;;; Code:
+
+(defvar edconf-exec-path "editorconfig")
+
+(defun edconf-set-indentation (style &optional size tab_width)
+  )
+
+(defun edconf-set-line-ending (end-of-line)
+  )
+
+(defun edconf-get-properties ()
+  )
+
+(defun edconf-parse-properties (props-string)
+  )
+
+(provide 'editorconfig)



[nongnu] scratch/editorconfig-cc d2963a3313 227/351: Use 0.8.0 for next version

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit d2963a3313955ab50d3a8ba50a3532bc12982b00
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Use 0.8.0 for next version
---
 editorconfig-core-handle.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index ebd800e27e..e14eaf213b 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -110,7 +110,7 @@ If HANDLE is nil return nil."
   (editorconfig-core-handle-prop handle)
 (make-obsolete 'editorconfig-core-handle-get-properties
'editorconfig-core-handle-get-properties-hash
-   "0.7.15")
+   "0.8.0")
 
 
 (defun editorconfig-core-handle-get-properties-hash (handle file)



[nongnu] scratch/editorconfig-cc b70817d18d 139/351: Catch error thrown from editorconfig-custom-hooks

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b70817d18dde84f9f2cde99646a7ac393a3d4b46
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Catch error thrown from editorconfig-custom-hooks

And show it as warning.
---
 editorconfig.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 5370ab6510..e8a42003a3 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -333,7 +333,13 @@ applies available properties."
(gethash 'end_of_line props)
(gethash 'charset props))
   (editorconfig-set-line-length (gethash 'max_line_length props))
-  (run-hook-with-args 'editorconfig-custom-hooks props
+  (condition-case err
+  (run-hook-with-args 'editorconfig-custom-hooks props)
+(error
+ (display-warning 'editorconfig-custom-hooks
+  (concat (error-message-string err)
+  ". Stop running hook.")
+  :warning))
   (error
(display-warning 'editorconfig
 (concat (error-message-string err)



[nongnu] scratch/editorconfig-cc baa846c702 226/351: Remove unused tests

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit baa846c702bc6f659bbe6482d7dfe4e96f92636a
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Remove unused tests
---
 ert-tests/editorconfig-core.el | 9 -
 1 file changed, 9 deletions(-)

diff --git a/ert-tests/editorconfig-core.el b/ert-tests/editorconfig-core.el
index f85e2ba48e..a09d38b2f8 100644
--- a/ert-tests/editorconfig-core.el
+++ b/ert-tests/editorconfig-core.el
@@ -1,14 +1,5 @@
 (require 'editorconfig-core)
 
-(ert-deftest test-editorconfig-core--remove-duplicate ()
-  (should (equal (editorconfig-core--remove-duplicate '(("a" . 1) ("b" . 2) 
("c" . 3) ("b" . 4)))
- '(("a" . 1) ("b" . 4) ("c" . 3
-  (should (equal (editorconfig-core--remove-duplicate '(("a" . 1) ("b" . 2) 
("c" . 3)))
- '(("a" . 1) ("b" . 2) ("c" . 3
-  (should (equal (editorconfig-core--remove-duplicate nil)
- nil))
-  )
-
 
 (ert-deftest test-editorconfig-core--get-handles ()
   (let* ((fixtures (concat default-directory



[nongnu] scratch/editorconfig-cc ee5b70f1e2 068/351: editorocnfig-core: Throw error when parsing .editorconfig failed

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit ee5b70f1e2c4abba5cdf691b957fec337915f8ba
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

editorocnfig-core: Throw error when parsing .editorconfig failed
---
 editorconfig-core-handle.el | 42 ++
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 6591772fe9..c175e85d76 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -165,26 +165,28 @@ If CONF is not found return nil."
 (setq props nil))
   (setq pattern (match-string 1 line)))
 
-((string-match-p "=\\|:"
-   line)
-  ;; NOTE: Using match-string does not work as expected
-  (let* (
-  (idx (string-match "=\\|:"
- line))
-  (key (downcase (editorconfig-core-handle--string-trim 
(substring line
-  0
-  
idx
-  (value (editorconfig-core-handle--string-trim (substring 
line
-  (1+ 
idx
-  )
-(when (and (< (length key) 51)
-(< (length value) 256))
-  (if pattern
-(when (< (length pattern) 4097)
-  (setq props
-`(,@props (,key . ,value
-(setq top-props
-  `(,@top-props (,key . ,value)))
+(t
+  (let ((idx (string-match "=\\|:"
+   line)))
+(unless idx
+  (error (format "Failed to parse file: %s"
+   conf)))
+(let (
+   (key (downcase (editorconfig-core-handle--string-trim
+(substring line
+  0
+  idx
+   (value (editorconfig-core-handle--string-trim
+(substring line
+  (1+ idx)
+  (when (and (< (length key) 51)
+  (< (length value) 256))
+(if pattern
+  (when (< (length pattern) 4097)
+(setq props
+  `(,@props (,key . ,value
+  (setq top-props
+`(,@top-props (,key . ,value
 )
   (forward-line 1))
 (when pattern



[nongnu] scratch/editorconfig-cc 5986c305c9 167/351: Remove .info and add .texi

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 5986c305c9b7fe98c5b60a64997f914555e1a121
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Remove .info and add .texi
---
 doc/editorconfig.info | 283 --
 doc/editorconfig.texi | 250 
 2 files changed, 250 insertions(+), 283 deletions(-)

diff --git a/doc/editorconfig.info b/doc/editorconfig.info
deleted file mode 100644
index 7afd4498d2..00
--- a/doc/editorconfig.info
+++ /dev/null
@@ -1,283 +0,0 @@
-This is docs/editorconfig.info, produced by makeinfo version 4.8 from
-docs/editorconfig.info.texi.
-
-
-File: editorconfig.info,  Node: Top,  Next: EditorConfig Emacs Plugin,  Up: 
(dir)
-
-Top
-***
-
-* Menu:
-
-* EditorConfig Emacs Plugin::
-
-
-File: editorconfig.info,  Node: EditorConfig Emacs Plugin,  Prev: Top,  Up: Top
-
-1 EditorConfig Emacs Plugin
-***
-
-This is an EditorConfig (http://editorconfig.org) plugin for Emacs
-(https://www.gnu.org/software/emacs/).
-
-* Menu:
-
-* Installation::
-* Supported properties::
-* Customize::
-* Testing::
-* Submitting Bugs and Feature Requests::
-* License::
-
-
-File: editorconfig.info,  Node: Installation,  Next: Supported properties,  
Up: EditorConfig Emacs Plugin
-
-1.1 Installation
-
-
-Download the EditorConfig C Core
-(https://github.com/editorconfig/editorconfig-core-c) and follow the
-instructions in the README and INSTALL files to install it.
-
-This plugin also has a built-in core library implemented in Emacs-Lisp,
-and fallback to it when no core executable is found.
-
-In either case, copy `.el' files in this repository to
-`~/.emacs.d/lisp' and add the following to your `~/.emacs' file:
-
-
-(add-to-list 'load-path "~/.emacs.d/lisp")
-(require 'editorconfig)
-(editorconfig-mode 1)
-
-Alternatively, you can find the package available on MELPA
-(http://melpa.org/#/editorconfig) and MELPA Stable
-(http://stable.melpa.org/#/editorconfig) (The Marmalade package
-(http://marmalade-repo.org/packages/editorconfig) is deprecated).
-
-Or if you use *use-package*
-(https://www.emacswiki.org/emacs/UsePackage):
-
-
-(use-package editorconfig
-  :ensure t
-  :config
-  (editorconfig-mode 1))
-
-
-File: editorconfig.info,  Node: Supported properties,  Next: Customize,  Prev: 
Installation,  Up: EditorConfig Emacs Plugin
-
-1.2 Supported properties
-
-
-Current Emacs plugin coverage for EditorConfig's properties
-(http://editorconfig.org/#supported-properties):
-
-   * `indent_style'
-
-   * `indent_size'
-
-   * `tab_width'
-
-   * `end_of_line'
-
-   * `charset'
-
-   * `trim_trailing_whitespace'
-
-   * `insert_final_newline = true' is supported
-
-   * `insert_final_newline = false' is not enforced (as in trailing
- newlines actually being removed automagically), we just
- buffer-locally override any preferences that would auto-add them
- to files `.editorconfig' marks as trailing-newline-free
-
-   * `max_line_length'
-
-   * `file_type_emacs' (Experimental)
-
-   * `root' (only used by EditorConfig core)
-
-Not yet covered properties marked with over-strike - pull requests
-implementing missing features warmly welcomed! Typically, you will want
-to tie these to native functionality, or the configuration of existing
-packages handling the feature.
-
-As several packages have their own handling of, say, indention, we might
-not yet cover some mode you use, but we try to add the ones that show up
-on our radar. Similarly, we don't yet hook in to all different packages
-for whitespace trimming to inform them about editorconfig settings, but
-aim for better coverage of things like ws-trim
-(ftp://ftp.lysator.liu.se/pub/emacs/ws-trim.el).
-
-This plugin also has an experimental support for `file_type_emacs',
-which specifies "file types" for files. As for Emacs, it means
-`major-mode' can be specified: for example, when `file_type_emacs' is
-set to `markdown' for `a.txt', `markdown-mode' will be enabled when
-opening `a.txt'. This property is experimental and its meaning might
-change in the future updates.
-
-
-File: editorconfig.info,  Node: Customize,  Next: Testing,  Prev: Supported 
properties,  Up: EditorConfig Emacs Plugin
-
-1.3 Customize
-=
-
-* Menu:
-
-* editorconfig-custom-hooks::
-* editorconfig-indentation-alist::
-* editorconfig-exec-path::
-* editorconfig-get-properties-function::
-
-
-File: editorconfig.info,  Node: editorconfig-custom-hooks,  Next: 
editorconfig-indentation-alist,  Up: Customize
-
-1.3.1 `editorconfig-custom-hooks'
--
-
-A list of custom hooks after loading common EditorConfig settings, where
-you can set some custom variables or overwrite existing properties.
-
-For example, `web-mode' has several variables for indentation offset
-size and EditorConfig sets them at once by `indent_size'.  You may want
-to stop indenting only blocks of `web-mode': it ca

[nongnu] scratch/editorconfig-cc e0d8fdbdbb 248/351: Use https for melpa badge

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit e0d8fdbdbb9a9ce9cb584d3251b6cdbe451b0888
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Use https for melpa badge
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 153aa42eac..90292465d9 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![MELPA](http://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig)
+[![MELPA](https://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig)
 [![MELPA 
Stable](https://stable.melpa.org/packages/editorconfig-badge.svg)](https://stable.melpa.org/#/editorconfig)
 
 ## Setup



[nongnu] scratch/editorconfig-cc 56722d34df 019/351: Add sh-indentation to the list of indent variable.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 56722d34df673387597dd68e3dd2c179fb0fcb96
Author: Hong Xu 
Commit: Stefan Monnier 

Add sh-indentation to the list of indent variable.
---
 editorconfig.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index a40a3922d0..a8d458a827 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -55,7 +55,8 @@
   js-indent-level size
   lisp-indent-offset size
   ruby-indent-level size
-   web-mode-markup-indent-offset size
+  sh-indentation size
+  web-mode-markup-indent-offset size
   web-mode-css-indent-offset size
   web-mode-code-indent-offset size
   ;(make-local-variable 'sgml-basic-offset) size



[nongnu] scratch/editorconfig-cc 649e645106 076/351: Bump version to 0.7.2

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 649e64510605f829f5404b6416d528a51b452ef4
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Bump version to 0.7.2
---
 bin/editorconfig-el | 2 +-
 editorconfig-core-handle.el | 2 +-
 editorconfig-core.el| 4 ++--
 editorconfig-fnmatch.el | 2 +-
 editorconfig.el | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/editorconfig-el b/bin/editorconfig-el
index 6e63e04f35..5bba164bae 100755
--- a/bin/editorconfig-el
+++ b/bin/editorconfig-el
@@ -8,7 +8,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.1
+;; Version: 0.7.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 5076f5c21c..bf56d44160 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.1
+;; Version: 0.7.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
 ;; See
diff --git a/editorconfig-core.el b/editorconfig-core.el
index c00a5a0f82..2db6a83415 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.1
+;; Version: 0.7.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 ;; Package-Requires: ((editorconfig-fnmatch "0.6.2") (cl-lib "0.5"))
 
@@ -71,7 +71,7 @@
 
 
 (defconst editorconfig-core-version
-  "0.7.1"
+  "0.7.2"
   "EditorConfig core version.")
 
 (defun editorconfig-core--remove-duplicate (alist)
diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index f98363879b..d7b1dc57d0 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.1
+;; Version: 0.7.2
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 
diff --git a/editorconfig.el b/editorconfig.el
index c826c0983c..ff0f662587 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2011-2016 EditorConfig Team
 
 ;; Author: EditorConfig Team 
-;; Version: 0.7.1
+;; Version: 0.7.2
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
 ;; Package-Requires: ((editorconfig-core "0.6.2"))
 



[nongnu] scratch/editorconfig-cc 32fb0d6b9c 056/351: Use `require` instead of `load` in usage example

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 32fb0d6b9c8d177a0209972af880eebdc573
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Use `require` instead of `load` in usage example
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index 48512e1c75..22e39cbef7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 Or, when no Core executable is found, this plugin uses Emacs Lisp implemented
 Core as a fallback.
 
+(require 'editorconfig)
 (editorconfig-mode 1)
 
 Alternatively, you can find the package available on



[nongnu] scratch/editorconfig-cc 4e5526d1d9 149/351: Add file_type_emacs entry for .editorconfig

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 4e5526d1d970001e2396ddeaf14a31ed4be74d0d
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add file_type_emacs entry for .editorconfig
---
 .editorconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.editorconfig b/.editorconfig
index 80c923d711..a15267d35a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -25,3 +25,6 @@ tab_width = 4
 [*.yml]
 indent_style = space
 indent_size = 2
+
+[.editorconfig]
+file_type_emacs = editorconfig-conf



[nongnu] scratch/editorconfig-cc e7a0874591 026/351: Add hook mechanism.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit e7a0874591b23885e10dc322211ff9f77b944dae
Author: Hong Xu 
Commit: Stefan Monnier 

Add hook mechanism.
---
 editorconfig.el | 25 -
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index baeb8350cf..c09496a74a 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -50,6 +50,27 @@
   :type 'string
   :group 'editorconfig)
 
+(defcustom edconf-custom-hooks ()
+  "A list of custom hooks after loading common EditorConfig settings
+
+Each element in this list is a hook function. This hook function takes one
+parameter, which is a property hash table. The value of properties can be
+obtained through gethash function.
+
+The hook does not have to be coding style related; you can add whatever
+functionality you want. For example, the following is an example to add a new
+property emacs_linum to decide whether to show line numbers on the left
+
+(add-to-list 'edconf-custom-hooks
+  '(lambda (props)
+ (let ((show-line-num (gethash 'emacs_linum props)))
+   (cond ((equal show-line-num \"true\") (linum-mode 1))
+ ((equal show-line-num \"false\") (linum-mode 0))
+
+"
+  :type '(lambda (properties) (body))
+  :group 'editorconfig)
+
 (defun edconf-string-integer-p (string)
   "Whether a string representing integer"
   (if (stringp string)
@@ -90,6 +111,8 @@
   )
 
 (defun edconf-find-file-hook ()
-  (edconf-set-line-length (gethash 'max_line_length props)))
+  (edconf-set-line-length (gethash 'max_line_length props))
+  (dolist (hook edconf-custom-hooks)
+(funcall hook props)))
 
 (provide 'editorconfig)



[nongnu] scratch/editorconfig-cc d8742edc38 168/351: Fix make doc command

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit d8742edc38f6e51cca1fe89e54fa3dc5f9f66cf7
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Fix make doc command
---
 Makefile   | 5 +++--
 doc/header.txt | 4 
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 85f5b4fbfd..b68198f209 100644
--- a/Makefile
+++ b/Makefile
@@ -22,9 +22,10 @@ $(OBJS): %.elc: %.el
 
 doc: doc/editorconfig.texi
 
-doc/editorconfig.texi: README.md
+doc/editorconfig.texi: README.md doc/header.txt
mkdir -p doc
-   tail -n +4 $< | $(PANDOC) -s -f markdown -o $@
+   tail -n +4 $< | $(PANDOC) -s -f markdown -t texinfo -o $@.body
+   cat doc/header.txt $@.body >$@
 
 
 test: test-ert test-core test-metadata $(OBJS)
diff --git a/doc/header.txt b/doc/header.txt
new file mode 100644
index 00..84eceb02b5
--- /dev/null
+++ b/doc/header.txt
@@ -0,0 +1,4 @@
+@dircategory Emacs
+@direntry
+* EditorConfig: (editorconfig). EditorConfig Emacs Plugin.
+@end direntry



[nongnu] scratch/editorconfig-cc 903e483a70 052/351: Make `editorconfig-apply' an interactive command

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 903e483a700aed386468944809c83979e5d6133a
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Make `editorconfig-apply' an interactive command
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index 9f9c672e05..489e34d54d 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -228,6 +228,7 @@ It calls `editorconfig-get-properties-from-exec' if
 
 (defun editorconfig-apply ()
   "Apply EditorConfig properties for current buffer."
+  (interactive)
   (when buffer-file-name
 (let ((props (and (functionp editorconfig-get-properties-function)
   (funcall editorconfig-get-properties-function



[nongnu] scratch/editorconfig-cc 0efb6ea02f 039/351: Add 10sr to the contributor list

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 0efb6ea02f52aa8e643fbb0d631bca85af247ff0
Author: Hong Xu 
Commit: Stefan Monnier 

Add 10sr to the contributor list
---
 CONTRIBUTORS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index bd80c0cb6c..6e525baa0e 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -6,3 +6,4 @@ Jonas Bernoulli
 [Desmond O. Chang]
 [Steve Jordan]
 Hong Xu
+10sr



[nongnu] scratch/editorconfig-cc b5f1eab15e 169/351: Update texi

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b5f1eab15ea70f1547fb14916fffdb15d7e202b4
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Update texi
---
 doc/editorconfig.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/doc/editorconfig.texi b/doc/editorconfig.texi
index 7488a2d203..4744238ee4 100644
--- a/doc/editorconfig.texi
+++ b/doc/editorconfig.texi
@@ -1,3 +1,7 @@
+@dircategory Emacs
+@direntry
+* EditorConfig: (editorconfig). EditorConfig Emacs Plugin.
+@end direntry
 \input texinfo
 @documentencoding UTF-8
 



[nongnu] scratch/editorconfig-cc 17ba04ab68 141/351: Update editorconfig-conf-mode lighter text

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 17ba04ab68144e74022a2039310732563554b0a1
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update editorconfig-conf-mode lighter text
---
 editorconfig-conf-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editorconfig-conf-mode.el b/editorconfig-conf-mode.el
index f5419179ff..cbc403241c 100644
--- a/editorconfig-conf-mode.el
+++ b/editorconfig-conf-mode.el
@@ -39,7 +39,7 @@
   "Syntax table in use in `editorconfig-conf-mode' buffers.")
 
 ;;;###autoload
-(define-derived-mode editorconfig-conf-mode conf-unix-mode "EditorConfig"
+(define-derived-mode editorconfig-conf-mode conf-unix-mode "Conf[EditorConfig]"
   "Major mode for editing .editorconfig files."
   (set-variable 'indent-line-function 'indent-relative)
   (let ((key-property-list



[nongnu] scratch/editorconfig-cc ca7aeff4b3 159/351: Add variable to disable indent_size when conditions are met for lisp

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit ca7aeff4b38bcb028d3529d8e3902cc0374d3611
Author: Jay Kamat 
Commit: Stefan Monnier 

Add variable to disable indent_size when conditions are met for lisp
---
 editorconfig.el | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index a2cd19746c..5564d18a34 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -232,6 +232,16 @@ Set by `editorconfig-apply' and nil if that is not invoked 
in
 current buffer yet.")
 (make-variable-buffer-local 'editorconfig-properties-hash)
 
+(defvar editorconfig-lisp-use-default-indent nil
+  "Selectively ignore the value of indent_sizefor Lisp files.
+Prevents `lisp-indent-offset' from being set selectively.
+
+nil - `lisp-indent-offset' is always set normally.
+t   - `lisp-indent-offset' is never set normally
+   (always use default indent for lisps).
+number - `lisp-indent-offset' is not set only if indent_size is
+ equal to this number.  For example, if this is set to 2,
+ `lisp-indent-offset'will not be set only if indent_size is 2.")
 
 (defun editorconfig-string-integer-p (string)
   "Return non-nil if STRING represents integer."
@@ -246,6 +256,19 @@ current buffer yet.")
   "Set `latex-mode' indent size to SIZE."
   )
 
+(defun editorconfig--should-set (size symbol)
+  "Determines if editorconfig should set SYMBOL using SIZE."
+  (if (eq symbol 'lisp-indent-offset)
+  (cond
+   ((eql nil editorconfig-lisp-use-default-indent)
+t)
+   ((eql t editorconfig-lisp-use-default-indent)
+nil)
+   ((numberp editorconfig-lisp-use-default-indent)
+(not (eql size editorconfig-lisp-use-default-indent)))
+   (t t))
+t))
+
 (defun editorconfig-set-indentation (style &optional size tab_width)
   "Set indentation type from STYLE, SIZE and TAB_WIDTH."
   (if (editorconfig-string-integer-p size)



[nongnu] scratch/editorconfig-cc d02b7027ae 132/351: Add plugin-tests submodule

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit d02b7027aef8c88fef495db18e58174659249cfc
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add plugin-tests submodule
---
 .gitmodules| 3 +++
 ert-tests/plugin-tests | 1 +
 2 files changed, 4 insertions(+)

diff --git a/.gitmodules b/.gitmodules
index 8941e6ddf6..4adcf24d01 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "editorconfig-core-test"]
path = core-test
url = https://github.com/editorconfig/editorconfig-core-test.git
+[submodule "editorconfig-plugin-tests"]
+   path = ert-tests/plugin-tests
+   url = https://github.com/editorconfig/editorconfig-plugin-tests.git
diff --git a/ert-tests/plugin-tests b/ert-tests/plugin-tests
new file mode 16
index 00..3f2121e34a
--- /dev/null
+++ b/ert-tests/plugin-tests
@@ -0,0 +1 @@
+Subproject commit 3f2121e34a7baf360acbcf322c2d05f29f69cac7



[nongnu] scratch/editorconfig-cc 96123213ed 229/351: Add support for Emacs24.5

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 96123213ed4ff3d5e39242a54f854cb93cc84f34
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add support for Emacs24.5
---
 .travis.yml | 1 +
 editorconfig-core-handle.el | 2 ++
 editorconfig.el | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 87aefe8e4b..9923bb4800 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,7 @@ before_install:
   - ./.evm/bin/evm config path /tmp
   - ./.evm/bin/evm install emacs-$EMACS_VERSION-travis --use
   - ./.evm/bin/emacs --version
+  - if [[ "$EMACS_VERSION" == 24.5 ]]; then curl 
"http://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/packages/cl-generic/cl-generic.el?id=a1cdea05e8cbfe15ba075c64417db20b814e48e8";
 >cl-generic.el; fi
 
 script:
   make test EMACS=$PWD/.evm/bin/emacs
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index e36fb69683..85ccf01c50 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -32,6 +32,8 @@
 ;;; Code:
 
 (require 'cl-lib)
+;; Require explicit load for Emacs<25
+(require 'cl-generic)
 
 (require 'editorconfig-fnmatch)
 
diff --git a/editorconfig.el b/editorconfig.el
index cee7392b79..2f928daeb4 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -5,7 +5,7 @@
 ;; Author: EditorConfig Team 
 ;; Version: 0.7.14
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
-;; Package-Requires: ((cl-lib "0.5"))
+;; Package-Requires: ((cl-lib "0.5") (cl-generic "0.3"))
 
 ;; See
 ;; http://github.com/editorconfig/editorconfig-emacs/graphs/contributors



[nongnu] scratch/editorconfig-cc 4fd932bb7c 060/351: Check package metadata using ert framework

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 4fd932bb7cfbe54c93d21811f8142db921737dcd
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Check package metadata using ert framework
---
 Makefile  | 23 +--
 ert-tests/metadata.el | 12 
 2 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index 8f71fabeb7..2d6ae079f3 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ test: test-ert test-core test-metadata $(OBJS)
 test-ert: $(ERT_TESTS) $(OBJS)
$(EMACS) $(BATCHFLAGS) \
--eval "(require 'ert) (setq debug-on-error t)" \
+   --eval "(setq metadata-el-files '($(SRCS:%=\"%\")))" \
$(ERT_TESTS:%=-l "%") \
-f ert-run-tests-batch-and-exit
 
@@ -41,25 +42,3 @@ test-core: core-test/CMakeLists.txt $(OBJS)
cd $(PROJECT_ROOT_DIR)/core-test && \
EMACS_BIN=$(EMACS) 
EDITORCONFIG_CORE_LIBRARY_PATH="$(PROJECT_ROOT_DIR)" \
ctest --output-on-failure .
-
-
-# Check package metadata
-
-ELISP_GET_FILE_PACKAGE_METADATA = \
-   (lambda (f) \
-   (with-temp-buffer \
-   (insert-file-contents-literally f) \
-   (package-buffer-info)))
-
-ELISP_PRINT_METADATA = \
-   (mapc \
-   (lambda (f) \
-   (message \"Loading info: %s\" f) \
-   (message \"%S\" (funcall 
$(ELISP_GET_FILE_PACKAGE_METADATA) f))) \
-   command-line-args-left)
-
-test-metadata: $(SRCS)
-   $(EMACS) -batch -Q \
-   --eval "(require 'package)" \
-   --eval "$(ELISP_PRINT_METADATA)" \
-   $^
diff --git a/ert-tests/metadata.el b/ert-tests/metadata.el
new file mode 100644
index 00..d762752209
--- /dev/null
+++ b/ert-tests/metadata.el
@@ -0,0 +1,12 @@
+(require 'package)
+
+(defvar metadata-el-files nil)
+
+(ert-deftest test-metadata ()
+  (dolist (el metadata-el-files)
+(message "Loading info: %s"
+  el)
+(with-temp-buffer
+  (insert-file-contents el)
+  (message "%S"
+(package-buffer-info)



[nongnu] scratch/editorconfig-cc 9beb04599a 350/351: Refactor find-file advices (#340)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 9beb04599ac4e94b434cb4db2e2e68239e7d12cd
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Refactor find-file advices (#340)

* Add coding-system test

* Refactor find-file advices

* Fix test

* Fix test

* Update

* Update
---
 editorconfig.el   | 54 +++
 ert-tests/editorconfig.el | 13 
 2 files changed, 40 insertions(+), 27 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 681ba115c9..7466bc3a5c 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -642,11 +642,11 @@ This function also executes 
`editorconfig-after-apply-functions' functions."
 (format "Error while running 
`editorconfig-after-apply-functions': %S"
 err))
 
-(defvar editorconfig--cons-filename-codingsystem nil
+(defvar editorconfig--filename-codingsystem-hash (make-hash-table :test 'equal)
   "Used interally.
 
-`editorconfig--advice-find-file-noselect' will set this variable, and
-`editorconfig--advice-insert-file-contents' will use this variable to set
+`editorconfig--advice-find-file-noselect' will put value to this hash, and
+`editorconfig--advice-insert-file-contents' will use the value to set
 `coding-system-for-read' value.")
 
 (defun editorconfig--advice-insert-file-contents (f filename &rest args)
@@ -654,26 +654,23 @@ This function also executes 
`editorconfig-after-apply-functions' functions."
 
 This function should be added as an advice function to `insert-file-contents'.
 F is that function, and FILENAME and ARGS are arguments passed to F."
-  ;; This function uses `editorconfig--cons-filename-codingsystem' to decide 
what coding-system
+  ;; This function uses `editorconfig--filename-codingsystem-hash' to decide 
what coding-system
   ;; should be used, which will be set by 
`editorconfig--advice-find-file-noselect'.
   (display-warning '(editorconfig editorconfig--advice-insert-file-contents)
(format "editorconfig--advice-insert-file-contents: 
filename: %S args: %S codingsystem: %S bufferfilename: %S"
filename args
-   editorconfig--cons-filename-codingsystem
+   editorconfig--filename-codingsystem-hash
buffer-file-name)
:debug)
-  (if (and (stringp filename)
-   (stringp (car editorconfig--cons-filename-codingsystem))
-   (string= (expand-file-name filename)
-(car editorconfig--cons-filename-codingsystem))
-   (cdr editorconfig--cons-filename-codingsystem)
-   (not (eq (cdr editorconfig--cons-filename-codingsystem)
-'undecided)))
-  (let ((coding-system-for-read (cdr 
editorconfig--cons-filename-codingsystem))
-;; (coding-system-for-read 'undecided)
-)
-(apply f filename args))
-(apply f filename args)))
+  (let ((coding-system (and (stringp filename)
+(gethash (expand-file-name filename)
+ 
editorconfig--filename-codingsystem-hash
+(if (and coding-system
+ (not (eq coding-system
+  'undecided)))
+(let ((coding-system-for-read coding-system))
+  (apply f filename args))
+  (apply f filename args
 
 (defun editorconfig--advice-find-file-noselect (f filename &rest args)
   "Get EditorConfig properties and apply them to buffer to be visited.
@@ -689,36 +686,39 @@ F is that function, and FILENAME and ARGS are arguments 
passed to F."
   (setq props (editorconfig-call-get-properties-function filename))
   (setq coding-system
 (editorconfig-merge-coding-systems (gethash 'end_of_line props)
-   (gethash 'charset props
+   (gethash 'charset props)))
+  (puthash (expand-file-name filename)
+   coding-system
+   editorconfig--filename-codingsystem-hash))
   (error
(display-warning '(editorconfig editorconfig--advice-find-file-noselect)
 (format "Failed to get properties, styles will not be 
applied: %S"
 err)
 :warning)))
 
-(let ((editorconfig--cons-filename-codingsystem (cons (expand-file-name 
filename)
-  coding-system)))
-  (setq ret (apply f filename args)))
+(setq ret (apply f filename args))
+(clrhash editorconfig--filename-codingsystem-hash)
 
 (condition-case err
 (with-current-buffer ret
   (when (and props
  ;; filename has already been checked
  (not (editorconfig--disabled-for-majormode major-mode)))
+
+

[nongnu] scratch/editorconfig-cc cf6786403a 034/351: Change symbol prefix: edconf -> editorconfig

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit cf6786403ac486bcea5e9feb9eb419852564d407
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Change symbol prefix: edconf -> editorconfig
---
 editorconfig.el | 141 
 1 file changed, 102 insertions(+), 39 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 488b6aa882..3058144c0c 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -38,14 +38,14 @@
 
 ;;; Code:
 
-(defcustom edconf-exec-path
+(defcustom editorconfig-exec-path
   "editorconfig"
   "EditorConfig command"
   :type 'string
   :group 'editorconfig)
 
-(defcustom edconf-get-properties-function
-  'edconf-get-properties-from-exec
+(defcustom editorconfig-get-properties-function
+  'editorconfig-get-properties-from-exec
   "Function to get EditorConofig properties for current buffer.
 This function will be called with no argument and should return a hash object
 containing properties, or nil if any core program is not available.
@@ -54,7 +54,7 @@ property values as values."
   :type 'function
   :group 'editorconfig)
 
-(defcustom edconf-custom-hooks ()
+(defcustom editorconfig-custom-hooks ()
   "A list of custom hooks after loading common EditorConfig settings
 
 Each element in this list is a hook function. This hook function takes one
@@ -65,7 +65,7 @@ The hook does not have to be coding style related; you can 
add whatever
 functionality you want. For example, the following is an example to add a new
 property emacs_linum to decide whether to show line numbers on the left
 
-(add-to-list 'edconf-custom-hooks
+(add-to-list 'editorconfig-custom-hooks
   '(lambda (props)
  (let ((show-line-num (gethash 'emacs_linum props)))
(cond ((equal show-line-num \"true\") (linum-mode 1))
@@ -75,73 +75,136 @@ property emacs_linum to decide whether to show line 
numbers on the left
   :type '(lambda (properties) (body))
   :group 'editorconfig)
 
-(defun edconf-string-integer-p (string)
+(defcustom editorconfig-indentation-alist
+  '((awk-mode c-basic-offset)
+(c++-mode c-basic-offset)
+(c-mode c-basic-offset)
+(cmake-mode cmake-tab-width)
+(coffee-mode coffee-tab-width)
+(cperl-mode cperl-indent-level)
+(css-mode css-indent-offset)
+(emacs-lisp-mode lisp-indent-offset)
+(erlang-mode erlang-indent-level)
+(groovy-mode c-basic-offset)
+(haskell-mode haskell-indent-spaces
+  haskell-indent-offset
+  shm-indent-spaces)
+(idl-mode c-basic-offset)
+(java-mode c-basic-offset)
+(js-mode js-indent-level)
+(js2-mode js2-basic-offset)
+(js3-mode js3-indent-level)
+(json-mode js-indent-level)
+(latex-mode . editorconfig-set-indentation/latex-mode)
+(lisp-mode lisp-indent-offset)
+(livescript-mode livescript-tab-width)
+(mustache-mode mustache-basic-offset)
+(nxml-mode nxml-child-indent (nxml-attribute-indent . 2))
+(objc-mode c-basic-offset)
+(perl-mode perl-indent-level)
+(pike-mode c-basic-offset)
+(puppet-mode puppet-indent-level)
+(python-mode . editorconfig-set-indentation/python-mode)
+(ruby-mode ruby-indent-level)
+(scala-mode scala-indent:step)
+(sgml-mode sgml-basic-offset)
+(sh-mode sh-basic-offset sh-indentation)
+(web-mode (web-mode-indent-style . (lambda (size) 2))
+  web-mode-markup-indent-offset
+  web-mode-css-indent-offset
+  web-mode-code-indent-offset
+  web-mode-script-padding
+  web-mode-style-padding)
+(yaml-mode yaml-indent-offset))
+  "Alist of indentation setting methods by modes.
+
+Each element looks like (MODE . FUNCTION) or (MODE . INDENT-SPEC-LIST).
+
+If FUNCTION is provided, it will be called when setting the indentation.  The
+indent size will be passed.
+
+If INDENT-SPEC-LIST is provided, each element of it must have one of the
+following forms:
+
+ 1. VARIABLE
+
+It means (VARIABLE . 1).
+
+ 2. (VARIABLE . SPEC)
+
+Setting VARIABLE according to the type of SPEC:
+
+  - Integer
+
+The value is (* SPEC INDENT-SIZE);
+
+  - Function
+
+The value is (funcall SPEC INDENT-SIZE);
+
+  - Any other type.
+
+The value is SPEC.
+
+NOTE: Only the **buffer local** value of VARIABLE will be set."
+  :type '(alist :key-type symbol :value-type sexp)
+  :risky t
+  :group 'editorconfig)
+
+(defun editorconfig-string-integer-p (string)
   "Whether a string representing integer"
   (if (stringp string)
 (string-match-p "\\`[0-9]+\\'" string)
 nil))
 
-(defun edconf-set-indentation (style &optional size tab_width)
-  (if (edconf-string-integer-p size)
+(defun editorconfig-set-indentation (style &optional size tab_width)
+  (if (editorconfig-string-integer-p size)
 (setq size (string-to-number size))
 (when (not (equal size "tab")) (setq size nil)))
-  (setq web-mode-indent-style 2)
-  LaTeX-indent-level size
-  LaTeX-item-indent 

[nongnu] scratch/editorconfig-cc 625073f793 224/351: Implement --hash-merge

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 625073f793eb45502c9c655e1db0e9e2de7d17cb
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Implement --hash-merge
---
 editorconfig-core.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/editorconfig-core.el b/editorconfig-core.el
index 512d7d8dfb..a49841aca3 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -186,6 +186,18 @@ This functions returns alist of properties.  Each element 
will look like
 
 result))
 
+(defun editorconfig-core--hash-merge (into update)
+  "Merge to hashes INTO and UPDATE.
+
+This is a destructive function, hash INTO will be modified.
+When the same key exists in both two hashes, values of UPDATE takes 
precedence."
+  (maphash (lambda (key value)
+ (puthash key
+  value
+  into))
+   update)
+  into)
+
 ;;;###autoload
 (defun editorconfig-core-get-properties-hash (&optional file confname 
confversion)
   "Get EditorConfig properties for FILE.



[nongnu] scratch/editorconfig-cc 20c8ea8cc9 174/351: Update travis config file

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 20c8ea8cc95411853829bf42c9bc38a21df5168b
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Update travis config file
---
 .travis.yml | 17 +
 1 file changed, 17 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00..0df2296aca
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+language: generic
+sudo: false
+
+env:
+  matrix:
+- EMACS_VERSION=26-pretest
+- EMACS_VERSION=25.3
+- EMACS_VERSION=24.5
+
+before_install:
+  - git clone --depth=1 https://github.com/rejeep/evm.git ./.evm
+  - ./.evm/bin/evm config path /tmp
+  - ./.evm/bin/evm install emacs-$EMACS_VERSION-travis --use
+  - ./.evm/bin/emacs --version
+
+script:
+  make test EMACS=$PWD/.evm/bin/emacs



[nongnu] scratch/editorconfig-cc e5bfa5284c 280/351: Do not init submodule in Makefile

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit e5bfa5284cc42031c5b30199913ede7610cdafd1
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Do not init submodule in Makefile
---
 Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Makefile b/Makefile
index c787fe4e6c..74dbfdd153 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,6 @@ test: test-ert test-core test-metadata $(OBJS)
 
 # ert test
 test-ert: $(ERT_TESTS) $(OBJS)
-   git submodule init
$(EMACS) $(BATCHFLAGS) \
--eval "(setq debug-on-error t)" \
--eval "(require 'ert)" \



[nongnu] scratch/editorconfig-cc 24c8272763 321/351: Add bash-ts-mode to editorconfig-indentation-alist (#296)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 24c8272763ab9ba274784c6f6335e2955a16ae87
Author: Mohsin Kaleem 
Commit: Stefan Monnier 

Add bash-ts-mode to editorconfig-indentation-alist (#296)

Co-authored-by: Hong Xu 
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index a92407f1c1..e965741a00 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -236,6 +236,7 @@ This hook will be run even when there are no matching 
sections in
 (scss-mode css-indent-offset)
 (sgml-mode sgml-basic-offset)
 (sh-mode sh-basic-offset sh-indentation)
+(bash-ts-mode sh-basic-offset sh-indentation)
 (tcl-mode tcl-indent-level
   tcl-continued-indent-level)
 (toml-ts-mode toml-ts-mode-indent-offset)



[nongnu] scratch/editorconfig-cc 4b3784445a 180/351: Add trim-trailing-ws tests

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 4b3784445a0ea21dc49221cdb2a44873824a4812
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add trim-trailing-ws tests

With case where read-only-mode is enabled
---
 ert-tests/editorconfig.el | 13 +
 1 file changed, 13 insertions(+)

diff --git a/ert-tests/editorconfig.el b/ert-tests/editorconfig.el
index 4aebde67cf..cd57f2e26d 100644
--- a/ert-tests/editorconfig.el
+++ b/ert-tests/editorconfig.el
@@ -52,3 +52,16 @@
"2_space.el")
   (should (eq lisp-indent-offset 2
   (editorconfig-mode -1))
+
+(ert-deftest test-trim-trailing-ws nil
+  (editorconfig-mode 1)
+  (with-visit-file (concat editorconfig-ert-dir
+   "trim.txt")
+(should (memq 'delete-trailing-whitespace
+  write-file-functions)))
+  (with-visit-file (concat editorconfig-ert-dir
+   "trim.txt")
+(read-only-mode 1)
+(should (not (memq 'delete-trailing-whitespace
+   write-file-functions
+  (editorconfig-mode -1))



[nongnu] scratch/editorconfig-cc 8a2e9be119 131/351: Fix indentations of ert-tests/

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 8a2e9be119b0ff4d063b4034347e8081f48b943f
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Fix indentations of ert-tests/

See #111
---
 ert-tests/editorconfig-core-handle.el |  60 +-
 ert-tests/editorconfig-core.el|  20 ++--
 ert-tests/editorconfig-fnmatch.el | 202 +-
 ert-tests/metadata.el |   4 +-
 4 files changed, 143 insertions(+), 143 deletions(-)

diff --git a/ert-tests/editorconfig-core-handle.el 
b/ert-tests/editorconfig-core-handle.el
index 2133fafd2b..de319fe1ae 100644
--- a/ert-tests/editorconfig-core-handle.el
+++ b/ert-tests/editorconfig-core-handle.el
@@ -3,48 +3,48 @@
 (ert-deftest test-editorconfig-core-handle ()
   ;; handle.ini
   (let* ((fixtures (concat default-directory
- "ert-tests/fixtures/"))
-  (conf (concat fixtures
-  "handle.ini"))
-  (handle (editorconfig-core-handle conf)))
+   "ert-tests/fixtures/"))
+ (conf (concat fixtures
+   "handle.ini"))
+ (handle (editorconfig-core-handle conf)))
 (should (editorconfig-core-handle-root-p handle))
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "b.js"))
-  '((("key2" . "value2")
+(concat fixtures
+"b.js"))
+   '((("key2" . "value2")
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "a.js"))
-  '((("key1" . "value1")) (("key2" . "value2"))
+(concat fixtures
+"a.js"))
+   '((("key1" . "value1")) (("key2" . "value2"))
   ;; Test twice for checking cache
   (let* ((fixtures (concat default-directory
- "ert-tests/fixtures/"))
-  (conf (concat fixtures
-  "handle.ini"))
-  (handle (editorconfig-core-handle conf)))
+   "ert-tests/fixtures/"))
+ (conf (concat fixtures
+   "handle.ini"))
+ (handle (editorconfig-core-handle conf)))
 (should (editorconfig-core-handle-root-p handle))
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "b.js"))
-  '((("key2" . "value2")
+(concat fixtures
+"b.js"))
+   '((("key2" . "value2")
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "a.js"))
-  '((("key1" . "value1")) (("key2" . "value2"))
+(concat fixtures
+"a.js"))
+   '((("key1" . "value1")) (("key2" . "value2"))
 
   ;; handle2.ini
   (let* ((fixtures (concat default-directory
- "ert-tests/fixtures/"))
-  (conf (concat fixtures
-  "handle2.ini"))
-  (handle (editorconfig-core-handle conf)))
+   "ert-tests/fixtures/"))
+ (conf (concat fixtures
+   "handle2.ini"))
+ (handle (editorconfig-core-handle conf)))
 (should-not (editorconfig-core-handle-root-p handle))
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "b.js"))
-  nil))
+(concat fixtures
+"b.js"))
+   nil))
 (should (equal (editorconfig-core-handle-get-properties handle
- (concat fixtures
-   "a.js"))
-  '((("key" . "value"))
+(concat fixtures
+"a.js"))
+   '((("key" . "value"))
   )
diff --git a/ert-tests/editorconfig-core.el b/ert-tests/editorconfig-core.el
index aec80beba2..f85e2ba48e 100644
--- a/ert-tests/editorconfig-core.el
+++ b/ert-tests/editorconfig-core.el
@@ -2,23 +2,23 @@
 
 (ert-deftest test-editorconfig-core--remove-duplicate ()
   (should (equal (editorconfig-core--remove-duplicate '(("a" . 1) ("b" . 2) 
("c" . 3) ("b" . 4)))
-'(("a" . 1) ("b" . 4) ("c" . 3
+ '(("a" . 1) ("b" . 4) ("

[nongnu] scratch/editorconfig-cc 05f63eca50 136/351: Update year in copyright

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 05f63eca5063a5111a4b87fc2e8a24ed668f8f21
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update year in copyright
---
 bin/editorconfig-el | 2 +-
 editorconfig-conf-mode.el   | 2 +-
 editorconfig-core-handle.el | 2 +-
 editorconfig-core.el| 2 +-
 editorconfig-fnmatch.el | 2 +-
 editorconfig.el | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/editorconfig-el b/bin/editorconfig-el
index 28810588ba..452e0b51d3 100755
--- a/bin/editorconfig-el
+++ b/bin/editorconfig-el
@@ -5,7 +5,7 @@
 
 ;; editorconfig-el --- EditorConfig Core executable in Emacs Lisp
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig-conf-mode.el b/editorconfig-conf-mode.el
index f544bfaf9e..f5419179ff 100644
--- a/editorconfig-conf-mode.el
+++ b/editorconfig-conf-mode.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-conf-mode.el --- Major mode for editing .editorconfig files
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 42972a2e0d..72f0eacb8d 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-core-handle.el --- Handle Class for EditorConfig File
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig-core.el b/editorconfig-core.el
index 4f69c774f6..831b15dcc2 100644
--- a/editorconfig-core.el
+++ b/editorconfig-core.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-core.el --- EditorConfig Core library in Emacs Lisp
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el
index 91765ca8f7..257c2773b8 100644
--- a/editorconfig-fnmatch.el
+++ b/editorconfig-fnmatch.el
@@ -1,6 +1,6 @@
 ;;; editorconfig-fnmatch.el --- Glob pattern matching in Emacs lisp
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
diff --git a/editorconfig.el b/editorconfig.el
index 7c212e949d..903beb9cf6 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -1,6 +1,6 @@
 ;;; editorconfig.el --- EditorConfig Emacs Plugin
 
-;; Copyright (C) 2011-2016 EditorConfig Team
+;; Copyright (C) 2011-2017 EditorConfig Team
 
 ;; Author: EditorConfig Team 
 ;; Version: 0.7.8



[nongnu] scratch/editorconfig-cc 06b57e1fb7 309/351: Add emacs 28.1 to test target (#270)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 06b57e1fb73cdbe1ad9474272b9885acd64cfc3e
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add emacs 28.1 to test target (#270)
---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 35245b9c78..a8b8a4de3f 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -22,6 +22,7 @@ jobs:
   - "25.3"
   - "26.3"
   - "27.1"
+  - "28.1"
 experimental: [false]
 include:
   - emacs_version: snapshot



[nongnu] scratch/editorconfig-cc 49c0563f03 285/351: Do not run editorconfig-apply on recentf-save-file (#241)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 49c0563f03c145a77bb01befbeebf58fecc35394
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Do not run editorconfig-apply on recentf-save-file (#241)
---
 editorconfig.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index 6fbde1e678..1ea235d87c 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -270,6 +270,11 @@ When variable `buffer-file-name' matches any of the 
regexps, then
 `editorconfig-mode-apply' will not do its work."
   :type '(repeat string)
   :group 'editorconfig)
+(with-eval-after-load 'recentf
+  (add-to-list 'editorconfig-exclude-regexps
+   (rx-to-string '(seq string-start
+   (eval (expand-file-name recentf-save-file)))
+ t)))
 
 (defcustom editorconfig-trim-whitespaces-mode nil
   "Buffer local minor-mode to use to trim trailing whitespaces.



[nongnu] scratch/editorconfig-cc 87d78d5746 106/351: Add examples for core-handle members

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 87d78d5746bf09d3eb1fc215dfaafbc81fa8bb7b
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Add examples for core-handle members
---
 editorconfig-core-handle.el | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el
index 0d664cbdc2..9a69e32220 100644
--- a/editorconfig-core-handle.el
+++ b/editorconfig-core-handle.el
@@ -41,11 +41,25 @@
   "Hash of EditorConfig filename and its `editorconfig-core-handle' instance.")
 
 (cl-defstruct editorconfig-core-handle
+  ;; Alist of top propetties
+  ;; e.g. (("root" . "true"))
   (top-prop nil)
+
+  ;; Alist of properties
+  ;; Key: Section name
+  ;; Value: Alist of properties for each section name
+  ;; e.g.
+  ;; (
+  ;;  ("*" ("end_of_line" . "lf") ("indent_style" . "space"))
+  ;;  ("Makefile" ("indent_style" . "tab"))
+  ;; )
   (prop nil)
+
+  ;; e.g. (22310 59113 203882 991000)
   (mtime nil)
-  (path nil))
 
+  ;; e.g. "/home/a/b/.editorconfig"
+  (path nil))
 
 
 (defun editorconfig-core-handle (conf)



[nongnu] scratch/editorconfig-cc b902de5bb4 294/351: Add debug message to -set-coding-system

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b902de5bb4af12f829c3d7f77e2d55b98cc753c6
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Add debug message to -set-coding-system
---
 editorconfig.el | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index 030802304f..5e2b941ce2 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -388,6 +388,13 @@ Make a message by passing ARGS to `format-message'."
   "Set buffer coding system by END-OF-LINE and CHARSET."
   (let ((coding-system (editorconfig-merge-coding-systems end-of-line
   charset)))
+(display-warning '(editorconfig editorconfig-set-coding-system)
+ (format "buffer-file-name: %S | 
buffer-file-coding-system: %S | coding-system: %S | apply-currently: %S"
+ buffer-file-name
+ buffer-file-coding-system
+ coding-system
+ editorconfig--apply-coding-system-currently)
+ :debug)
 (when (eq coding-system 'undecided)
   (cl-return-from editorconfig-set-coding-system))
 (unless (file-readable-p buffer-file-name)



[nongnu] scratch/editorconfig-cc d744546fc6 003/351: Add root=true to the top .editorconfig.

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit d744546fc6864c0a2a4b524804982656988526b9
Author: Hong Xu 
Commit: Stefan Monnier 

Add root=true to the top .editorconfig.
---
 .editorconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00..a615f13e81
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,3 @@
+
+root = true
+



[nongnu] scratch/editorconfig-cc 0b314fcbea 135/351: Update README for some variables

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 0b314fcbea9d3d3193de5a2d366916431464ed3b
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier 

Update README for some variables
---
 README.md | 35 +--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 00e484c469..77fff42692 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
 
[![MELPA](http://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig)
 [![MELPA 
Stable](https://stable.melpa.org/packages/editorconfig-badge.svg)](https://stable.melpa.org/#/editorconfig)
 
-This plugin also has a core library implemented in Emacs-Lisp, and fallback
-to it when no core executable is found.
+This plugin also has a built-in core library implemented in Emacs-Lisp, and
+fallback to it when no core executable is found.
 
 ```emacs-lisp
 (require 'editorconfig)
@@ -54,6 +54,37 @@ You can also modify this variable with the command
 M-x customize-variable [RET] editorconfig-indentation-alist [RET].
 For a bit more compilicated cases please take a look at the docstring of this 
variable.
 
+### `editorconfig-exec-path`
+
+String of `editorconfig` executable name (command name or full path to
+the executable).
+
+
+### `editorconfig-get-properties-function`
+
+Function to use to get EditorConfig properties.
+
+For example, if you always want to use built-in core library instead
+of any EditorConfig executable to get properties, add following to
+your init.el:
+
+``` emacs-lisp
+(set-variable 'editorconfig-get-properties-function
+  #'editorconfig-core-get-properties-hash)
+```
+
+Possible known values are:
+
+* `editorconfig-get-properties` (default)
+  * Use `editorconfig-get-properties-from-exec` when
+`editorconfig-exec-path` executable is found, otherwise use
+`editorconfig-core-get-properties-hash`
+* `editorconfig-get-properties-from-exec`
+  * Get properties by executing EditorConfig executable specified in
+`editorconfig-exec-path`
+* `editorconfig-core-get-properties-hash`
+  * Always use built-in Emacs-Lisp implementation to get properties
+
 ## Testing
 
 Make and [CMake](https://cmake.org) must be installed to run the tests.



[nongnu] scratch/editorconfig-cc b1643c7360 077/351: Add support for scss-mode

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit b1643c736013da7ceef9f86fa8343b634c6eeb78
Author: Hong Xu 
Commit: Stefan Monnier 

Add support for scss-mode
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index ff0f662587..0315db7e3e 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -126,6 +126,7 @@ property emacs_linum to decide whether to show line numbers 
on the left
  (python-mode . editorconfig-set-indentation/python-mode)
  (ruby-mode ruby-indent-level)
  (scala-mode scala-indent:step)
+ (scss-mode css-indent-offset)
  (sgml-mode sgml-basic-offset)
  (sh-mode sh-basic-offset sh-indentation)
  (tcl-mode tcl-indent-level



[nongnu] scratch/editorconfig-cc 0f54515c82 325/351: Load subr-x when compiling (#302)

2024-06-13 Thread Stefan Monnier via
branch: scratch/editorconfig-cc
commit 0f54515c82be1b031ec2a2a9c3981ad3c5f694c7
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier 

Load subr-x when compiling (#302)

`when-let` depends on this.
---
 editorconfig.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/editorconfig.el b/editorconfig.el
index 8956c5be9d..03d8a5345a 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -47,6 +47,7 @@
 
 (eval-when-compile
   (require 'rx)
+  (require 'subr-x)
   (defvar tex-indent-basic)
   (defvar tex-indent-item)
   (defvar tex-indent-arg)



  1   2   3   4   >