[elpa] externals/posframe updated (f8cb9d6 -> e1552c8)

2020-11-30 Thread Feng Shu
tumashu pushed a change to branch externals/posframe.

  from  f8cb9d6   Version 0.8.3
   new  cae2864   Fix focus-in-hook warn
   new  9e9b16b   use version< instead of string>
   new  e1552c8   * posframe.el (posframe-show): Fix docstring


Summary of changes:
 posframe.el | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)



[elpa] externals/posframe cae2864 1/3: Fix focus-in-hook warn

2020-11-30 Thread Feng Shu
branch: externals/posframe
commit cae286410a94c52836e0aa279e8b063443fef47d
Author: Feng Shu 
Commit: Feng Shu 

Fix focus-in-hook warn
---
 posframe.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/posframe.el b/posframe.el
index c48fd36..d089f6b 100644
--- a/posframe.el
+++ b/posframe.el
@@ -685,7 +685,9 @@ posframe from catching keyboard input if the window manager 
selects it."
  (frame-parameter (selected-frame) 'no-accept-focus))
 (redirect-frame-focus posframe--frame (frame-parent
 
-(add-hook 'focus-in-hook #'posframe--redirect-posframe-focus)
+(if (string> emacs-version "27.1")
+(add-function :after after-focus-change-function 
#'posframe--redirect-posframe-focus)
+  (add-hook 'focus-in-hook #'posframe--redirect-posframe-focus))
 
 (defun posframe--mouse-banish (parent-frame  posframe)
   "Banish mouse to the (0 . 0) of PARENT-FRAME.



[elpa] externals/posframe 9e9b16b 2/3: use version< instead of string>

2020-11-30 Thread Feng Shu
branch: externals/posframe
commit 9e9b16b0b27d1ca1973773db9bcdfada9475f34a
Author: Feng Shu 
Commit: Feng Shu 

use version< instead of string>
---
 posframe.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/posframe.el b/posframe.el
index d089f6b..daad961 100644
--- a/posframe.el
+++ b/posframe.el
@@ -685,9 +685,9 @@ posframe from catching keyboard input if the window manager 
selects it."
  (frame-parameter (selected-frame) 'no-accept-focus))
 (redirect-frame-focus posframe--frame (frame-parent
 
-(if (string> emacs-version "27.1")
-(add-function :after after-focus-change-function 
#'posframe--redirect-posframe-focus)
-  (add-hook 'focus-in-hook #'posframe--redirect-posframe-focus))
+(if (version< emacs-version "27.1")
+(add-hook 'focus-in-hook #'posframe--redirect-posframe-focus)
+  (add-function :after after-focus-change-function 
#'posframe--redirect-posframe-focus))
 
 (defun posframe--mouse-banish (parent-frame  posframe)
   "Banish mouse to the (0 . 0) of PARENT-FRAME.



[elpa] externals/posframe e1552c8 3/3: * posframe.el (posframe-show): Fix docstring

2020-11-30 Thread Feng Shu
branch: externals/posframe
commit e1552c82dffaadc5e7de09a44880a498197ffbee
Author: Feng Shu 
Commit: Feng Shu 

* posframe.el (posframe-show): Fix docstring
---
 posframe.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/posframe.el b/posframe.el
index daad961..7af9391 100644
--- a/posframe.el
+++ b/posframe.el
@@ -422,10 +422,10 @@ position.  Its argument is a plist of the following form:
:parent-window xxx
:parent-window-width  xxx
:parent-window-height xxx
-   :minibuffer-height
-   :mode-line-height
-   :header-line-height
-   :tab-line-height
+   :minibuffer-height xxx
+   :mode-line-height  xxx
+   :header-line-height xxx
+   :tab-line-height xxx
:x-pixel-offset xxx
:y-pixel-offset xxx)
 



[elpa] externals/slime-volleyball f1ce0b0: slime-volleyball.el: Bump version to 1.1.7

2020-11-30 Thread Thomas Fitzsimmons
branch: externals/slime-volleyball
commit f1ce0b0ec798ce74e8303ecae2ad338fb90e4eee
Author: Thomas Fitzsimmons 
Commit: Thomas Fitzsimmons 

slime-volleyball.el: Bump version to 1.1.7

* slime-volleyball.el: Bump version to 1.1.7.
---
 slime-volleyball.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slime-volleyball.el b/slime-volleyball.el
index c8653ae..5c53e89 100644
--- a/slime-volleyball.el
+++ b/slime-volleyball.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2013-2020  Free Software Foundation, Inc.
 
 ;; Author: Thomas Fitzsimmons 
-;; Version: 1.1.6
+;; Version: 1.1.7
 ;; Keywords: games
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Package-Type: multi



[elpa] externals/mines 97e0a05 43/43: * mines.el: Adjust docs for the @ => SPC change

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 97e0a054523de2a313d9c9e678f77985b284ca3c
Author: Stefan Monnier 
Commit: Stefan Monnier 

* mines.el: Adjust docs for the @ => SPC change
---
 mines.el | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/mines.el b/mines.el
index 6ae3f97..9562e09 100644
--- a/mines.el
+++ b/mines.el
@@ -38,8 +38,8 @@
 ;;contain a number: the number of bombs at distance 1 from this cell.
 ;;If you reveal the content of this cell, then this number is shown.
 ;;
-;; 3. Cells without a bomb at distance > 1 from any bomb contain '@'.
-;;If you reveal the content of this cell, then '@' is shown and
+;; 3. Cells without a bomb at distance > 1 from any bomb contain ' '.
+;;If you reveal the content of this cell, then ' ' is shown and
 ;;all adjacent cells are recursively revealed.
 ;;
 ;;
@@ -670,23 +670,21 @@ Called with a prefix prompt for the difficulty level."
   "Major mode for playing Minesweeper.
 
 The target of the game is discover which cells contain mines.
-You reveal the content of the mine at point with \\[mines-dig\].
+You reveal the content of the mine at point with \\[mines-dig].
 1. If you look at one cell containing a mine you lost.
 
 2. A cell without a mine with N neighbour cells containing mines
shows N when you look at it.
 
 3. A cell without a mine and without neighbour cells having mines
-   shows the character `@' when you look at it; all adjacent cells
+   shows the character ` ' when you look at it; all adjacent cells
are recursively revealed.
 
 For instance, following is a possible configuration:
 
-@ @ @ @ @
-1 2 2 1 @
-1 x x 1 @
-1 2 2 1 @
-@ @ @ @ @
+1 2 2 1
+1 x x 1
+1 2 2 1
 
 You can move between cells using the arrow keys, or using vi
 or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).



[elpa] externals/mines bea3ad8 42/43: * packages/mines/mines.el (mines-auto-flag): New custom var

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit bea3ad84032648c6bcfa1cf6be69196d6f895b51
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/mines/mines.el (mines-auto-flag): New custom var

(mines-empty-cell-char): Use SPC instead, it makes the board more legible.
(mines--show-all): Disable mines-auto-flag while revealing all the bombs.
(mines--update-cell): Implement mines-auto-flag.
---
 mines.el | 34 +-
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/mines.el b/mines.el
index 7ca2c65..6ae3f97 100644
--- a/mines.el
+++ b/mines.el
@@ -54,6 +54,12 @@
 
 ;;; Code:
 
+;; TODO:
+;; - Arrange for the remaining number of mines to be displayed in the
+;;   modeline.
+;; - Center the board in the window (when smaller than the window).
+;; - Add colors to the numbers
+
 (require 'gamegrid)
 (require 'cl-lib)
 (require 'cookie1) ; For `cookie-shuffle-vector'.
@@ -75,6 +81,10 @@
   :type 'hook
   :version "27.1")
 
+(defcustom mines-auto-flag t
+  "Auto-add flags when they're obvious."
+  :type 'boolean)
+
 (defvar mines-uncover-cell-char ?.
   ;; FIXME: "uncover" means to remove the cover, so this is counter-intuitive,
   ;; because I think of this "." as covering the cell and `mines-dig' as
@@ -85,7 +95,7 @@
 (defvar mines-flagged-cell-char ?!
   "Char to display flagged cells as maybe having a mine.")
 
-(defvar mines-empty-cell-char ?@
+(defvar mines-empty-cell-char ?\s
   "Char to display a cell without mine nor numbers.")
 
 (defvar mines-empty-cell-mine ?x ;FIXME: Use ? when a glyph is available!
@@ -358,10 +368,11 @@ Each cell can be either:
 
 (defun mines--show-all ()
   "Show all mines after game over."
-  (dotimes (idx mines-number-cells)
-(when (and (eq 'bomb (aref mines-grid idx))
-   (aref mines-state idx))
-  (mines--update-cell idx nil
+  (let ((mines-auto-flag nil))
+(dotimes (idx mines-number-cells)
+  (when (and (eq 'bomb (aref mines-grid idx))
+ (aref mines-state idx))
+(mines--update-cell idx nil)
 
 (defun mines-game-over ()
   "Offer play a new game after uncover a bomb."
@@ -494,6 +505,19 @@ If called again then unflag it."
   (cl-pushnew nidx mines-undone-neighbours
 (delete-region from to)
 (mines--insert elt idx)
+(when (and mines-auto-flag (eq newstate nil))
+  (dolist (nidx (cons idx (mines-get-neighbours idx)))
+(when (null (aref mines-state nidx))
+  (let ((nc 0)  ;Number of neighbors still covered.
+(nb (aref mines-grid nidx))) ;Number of bomb in neighbors.
+(when (integerp nb)
+  (dolist (nidx (mines-get-neighbours nidx))
+(unless (null (aref mines-state nidx))
+  (cl-incf nc)))
+  (when (eql nc nb)
+(dolist (nidx (mines-get-neighbours nidx))
+  (when (eq t (aref mines-state nidx))
+(mines--update-cell nidx 'flag)
 (mines-goto idx)))
 
 (defun mines--clear-first-move (idx)



[elpa] externals/mines f11e546 41/43: * mines.el (mines-mode-map): Add mouse bindings

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit f11e54651d98592006c69296e31702bd6d04
Author: Stefan Monnier 
Commit: Stefan Monnier 

* mines.el (mines-mode-map): Add mouse bindings

(mines--insert): Add mouse-face to the cells.
(mines-flag-cell): Make it work when bound to a mouse event.
(mines-dig): Make it work when bound to a mouse event.
Straighten out the control flow.
---
 mines.el | 70 +++-
 1 file changed, 34 insertions(+), 36 deletions(-)

diff --git a/mines.el b/mines.el
index fce9f64..7ca2c65 100644
--- a/mines.el
+++ b/mines.el
@@ -327,6 +327,7 @@ Each cell can be either:
  (pos (point))
  (inhibit-read-only t))
 (insert (format " %c " char))
+(add-text-properties pos (point) `(mouse-face ,(list 'highlight)))
 (when (= (cadr (mines-index-2-matrix idx)) (1- mines-number-cols))
   (backward-delete-char 1)
   (insert "\n"))
@@ -465,10 +466,11 @@ After sorting, games completed with shorter times appear 
first."
 (message (format "Well done %s, you have completed it in %s!"
  user-login-name elapsed-time
 
-(defun mines-flag-cell ()
+(defun mines-flag-cell ( event)
   "Flag current cell as having a mine.
 If called again then unflag it."
-  (interactive)
+  (interactive (list last-nonmenu-event))
+  (if event (posn-set-point (event-end event)))
   (let* ((idx (mines-current-pos))
  (state (aref mines-state idx)))
 (if (null state)
@@ -518,45 +520,39 @@ If called again then unflag it."
   ;; Update the numbers on neighbour cells.
   (mines-set-numbers
 
-(defun mines-dig ()
+(defun mines-dig ( event)
   "Reveal the content of the cell at point."
-  (interactive)
+  (interactive (list last-nonmenu-event))
+  (if event (posn-set-point (event-end event)))
   (if mines-game-over
   (user-error "Current game is over.  Try `%s' to start a new one"
   (substitute-command-keys "\\[mines]"))
 (mines-goto (mines-current-pos)); Set point in the center of the cell.
-(cl-labels ((uncover-fn
- ()
- (let* ((idx (mines-current-pos))
-(inhibit-read-only t)
-(state (aref mines-state idx))
-(done (null state)))
-   (cond (done (message "Nothing new here")) ; Already updated.
- (t
-  (let ((elt (aref mines-grid idx)))
-(cl-flet ((game-end-fn
-   ()
-   ;; Check for end of game.
-   (cond ((eq elt 'bomb)
-  ;; We lost the game; show all 
the mines.
-  (mines-game-over))
- (t
-  (when (mines-end-p)
-(mines-game-completed))
-  ;; Don't end the game in the first trial when
-  ;; `mines-protect-first-move' is non-nil.
-  (when (and mines-protect-first-move
- (mines-first-move-p)
- elt)
-(mines--clear-first-move idx)
-(setq elt nil))
-  (cond ((and (eq 'flag state)
-  ;; If the cell is flagged ask for 
confirmation.
-  (not (yes-or-no-p "This cell is 
flagged as having a bomb.  Uncover it? ")))
- (message "OK, canceled"))
-(t
- (mines--update-cell idx nil)
- (game-end-fn))
+(cl-flet ((uncover-fn
+   ()
+   (let* ((idx (mines-current-pos))
+  (inhibit-read-only t)
+  (state (aref mines-state idx)))
+ (cond ((null state)
+(message "Nothing new here")) ; Already updated.
+   ((and (eq 'flag state)
+ ;; If the cell is flagged ask for confirmation.
+ ;; FIXME: I personally find this prompt annoying.
+ (not (yes-or-no-p "This cell is flagged as having 
a bomb.  Uncover it? ")))
+(message "OK, canceled"))
+   (t
+(let ((elt (aref mines-grid idx)))
+  ;; Don't end the game in the first trial when
+  ;; `mines-protect-first-move' is non-nil.
+  (when (and mines-protect-first-move
+

[elpa] branch externals/hook-helpers created (now 56e2ea3)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/hook-helpers.

at  56e2ea3   Small mod to documentation

No new revisions were added by this update.



[elpa] externals/mines e090a90 40/43: * mines.el: Make sure the first move is successful

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit e090a90ab863c24b4278269a624fcb639522e5e6
Author: Stefan Monnier 
Commit: Stefan Monnier 

* mines.el: Make sure the first move is successful

(mines--insert): Don't do the "uncover neighbors here"...
(mines--update-cell): ...but here instead.  Be careful not to add
duplicates to mines-undone-neighbours.
(mines--update-cell): New function.
(mines-dig): Use it.  Unify two equal branches.
Remove unused arg `show-mines`.  Don't do nothing silently.
---
 mines.el | 80 ++--
 1 file changed, 48 insertions(+), 32 deletions(-)

diff --git a/mines.el b/mines.el
index a2847e7..fce9f64 100644
--- a/mines.el
+++ b/mines.el
@@ -66,7 +66,7 @@
   :prefix "mines-")
 
 (defcustom mines-protect-first-move t
-  "Non-nil avoid game over in the first cell revealed."
+  "If non-nil, make sure first move reveals an empty cell."
   :type 'boolean
   :version "27.1")
 
@@ -310,11 +310,6 @@ Each cell can be either:
 (defun mines--insert (elt idx)
   (let* ((face nil)
  (char (cond ((null elt)
- ;; Uncover all its uncovered neighbours.
- (save-excursion
-   (dolist (x (mines-get-neighbours idx))
- (when (aref mines-state x)
-   (push x mines-undone-neighbours
  mines-empty-cell-char)
 ((eq elt t)
  mines-uncover-cell-char)
@@ -485,15 +480,45 @@ If called again then unflag it."
   (cl-assert (aref mines-state idx));Once uncovered, can't change it!
   (cl-assert (not (eql newstate (aref mines-state idx ;Actual change!
   (mines-goto idx)
-  (let ((from (or (previous-single-property-change (point) 'idx) (point-min)))
-(to (or (next-single-property-change (point) 'idx) (point-max)))
-(inhibit-read-only t))
+  (let* ((from (or (previous-single-property-change (point) 'idx) (point-min)))
+ (to (or (next-single-property-change (point) 'idx) (point-max)))
+ (inhibit-read-only t)
+ (elt (or newstate (aref mines-grid idx
 (setf (aref mines-state idx) newstate)
+(when (null elt)
+  ;; Uncovered an empty cell: uncover neighbors.
+  (dolist (nidx (mines-get-neighbours idx))
+(when (aref mines-state nidx)   ;Still covered.
+  (cl-pushnew nidx mines-undone-neighbours
 (delete-region from to)
-(mines--insert (or newstate (aref mines-grid idx)) idx)
+(mines--insert elt idx)
 (mines-goto idx)))
 
-(defun mines-dig ( show-mines)
+(defun mines--clear-first-move (idx)
+  "Make sure IDX has no bomb and zero neighbors with bombs."
+  ;; Getting a bomb on the first move is just annoying.
+  ;; And getting a cell with a number is frustrating because it still
+  ;; doesn't let you use reasoning rather than luck to make progress.
+  ;; So let's make sure that the first move actually uncovers a pristine
+  ;; area so the user doesn't need luck to get started.
+  (let ((val (aref mines-grid idx)))
+(cl-assert val)
+(let ((cells (mines-get-neighbours idx))
+  (bombs (if (integerp val) val (1+ (mines--near-bombs idx)
+  (push idx cells)
+  (while (> bombs 0)
+(let (nidx)
+  (while (progn (setq nidx (random mines-number-cells))
+(or (eq 'bomb (aref mines-grid nidx))
+(memql nidx cells
+  (setf (aref mines-grid nidx) 'bomb) ;Add bomb elsewhere.
+  (cl-decf bombs)))
+  (dolist (cell cells)
+(setf (aref mines-grid cell) nil)) ;Remove nearby bombs.
+  ;; Update the numbers on neighbour cells.
+  (mines-set-numbers
+
+(defun mines-dig ()
   "Reveal the content of the cell at point."
   (interactive)
   (if mines-game-over
@@ -506,38 +531,29 @@ If called again then unflag it."
 (inhibit-read-only t)
 (state (aref mines-state idx))
 (done (null state)))
-   (cond (done nil) ; Already updated.
+   (cond (done (message "Nothing new here")) ; Already updated.
  (t
   (let ((elt (aref mines-grid idx)))
 (cl-flet ((game-end-fn
()
;; Check for end of game.
-   (cond ((and (not show-mines) (eq elt 
'bomb))
+   (cond ((eq elt 'bomb)
   ;; We lost the game; show all 
the mines.
   (mines-game-over))
  (t
-  (when (and (not show-mines) 
(mines-end-p))
+  (when (mines-end-p)
  

[elpa] externals/mines 2241dcd 36/43: * mines/mines.el: Various minor changes, wave 1

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 2241dcdc72ff611101057f89acd3b5d2d8afd841
Author: Stefan Monnier 
Commit: Stefan Monnier 

* mines/mines.el: Various minor changes, wave 1

(mines-mode-hook): Remove redundant :group.
(mines-grid, mines-state): Remove unused default vector.
(mines-goto): Prefer point-min to 1.
(mines--near-bombs): Rewrite using mines-get-neighbours.
(mines-set-numbers): Work without intermediate vector.
(mines--insert): Always set `idx` and `face` properties.
(mines-show): Remove redundant \n insertion already done in
mines--insert, and text-property addition now done in mines--insert.
(mines--update-cell): Remove `idx` property now inserted
unconditionally by mines--insert.
(mines-dig): Tweak mines-grid in-place.
(mines--read-multiple-choice): Share `choices` between the two branches.
(mines-mode-map): New var, extracted from the major mode definition.
(mines-mode): Use it (implicitly).
---
 mines.el | 197 +--
 1 file changed, 91 insertions(+), 106 deletions(-)

diff --git a/mines.el b/mines.el
index 00604ea..80411a0 100644
--- a/mines.el
+++ b/mines.el
@@ -1,6 +1,6 @@
 ;;; mines.el --- Minesweeper game -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2019 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
@@ -73,10 +73,13 @@
 (defcustom mines-mode-hook nil
   "Hook run by mines mode."
   :type 'hook
-  :group 'mines
   :version "27.1")
 
 (defvar mines-uncover-cell-char ?.
+  ;; FIXME: "uncover" means to remove the cover, so this is counter-intuitive,
+  ;; because I think of this "." as covering the cell and `mines-dig' as
+  ;; uncovering them.  Similarly the use of "uncovered" in the Commentary
+  ;; is confusing.
   "Char to display uncover cells.")
 
 (defvar mines-flagged-cell-char ?!
@@ -85,7 +88,7 @@
 (defvar mines-empty-cell-char ?@
   "Char to display a cell without mine nor numbers.")
 
-(defvar mines-empty-cell-mine ?x
+(defvar mines-empty-cell-mine ?x ;FIXME: Use ? when a glyph is available!
   "Char to display a cell with a mine.")
 
 (defvar mines-buffer nil "Buffer where play minesweeper.")
@@ -116,10 +119,14 @@ If `custom' then ask user for these numbers."
(set sym val)))
   :version "27.1")
 
-(defvar mines-grid (make-vector mines-number-cells nil)
-  "Game configuration.")
+(defvar mines-grid nil
+  "Game configuration.
+Each cell can hold either:
+- t to mean there's a bomb at that position.
+- nil if there's no bomb here nor in any neighbor.
+- an integer indicating the number of neighbors with bombs.")
 
-(defvar mines-state (make-vector mines-number-cells nil)
+(defvar mines-state nil
   "Game state.")
 
 (defvar mines-mine-positions nil "Mine positions.")
@@ -185,9 +192,9 @@ If `custom' then ask user for these numbers."
 
 (defun mines-goto (idx)
   "Move to cell at IDX."
-  (goto-char 1)
+  (goto-char (point-min))
   (let ((cidx (mines-current-pos)))
-(ignore-errors
+(ignore-errors ;;FIXME: Why?
   (while (not (= cidx idx))
 (goto-char (next-single-property-change (point) 'idx))
 (setq cidx (mines-current-pos)))
@@ -274,44 +281,27 @@ If `custom' then ask user for these numbers."
   (setq mines-state (make-vector mines-number-cells nil))
   (let ((numbers (append
   (cookie-shuffle-vector
-   (vconcat (number-sequence 0 (1- mines-number-cells 
nil)))
+   (vconcat (number-sequence 0 (1- mines-number-cells
+  nil)))
 (dotimes (_ mines-number-mines)
   (aset mines-grid (pop numbers) t))
 (setq mines-mine-positions (mines--find-pos t mines-grid
 
-(defun mines--near-bombs (i j)
-  (let ((numb 0))
-;; Horizontal neighbours.
-(when (> j 0)
-  (and (aref mines-grid (mines-matrix-2-index i (1- j))) (cl-incf numb)))
-(when (< j (1- mines-number-cols))
-  (and (aref mines-grid (mines-matrix-2-index i (1+ j))) (cl-incf numb)))
-;; Previous row neighbours.
-(when (> i 0)
-  (and (aref mines-grid (mines-matrix-2-index (1- i) j)) (cl-incf numb))
-  (when (> j 0)
-(and (aref mines-grid (mines-matrix-2-index (1- i) (1- j))) (cl-incf 
numb)))
-  (when (< j (1- mines-number-cols))
-(and (aref mines-grid (mines-matrix-2-index (1- i) (1+ j))) (cl-incf 
numb
-;; Next row neighbours.
-(when (< i (1- mines-number-rows))
-  (and (aref mines-grid (mines-matrix-2-index (1+ i) j)) (cl-incf numb))
-  (when (> j 0)
-(and (aref mines-grid (mines-matrix-2-index (1+ i) (1- j))) (cl-incf 
numb)))
-  (when (< j (1- mines-number-cols))
-(and (aref mines-grid (mines-matrix-2-index (1+ i) (1+ j))) (cl-incf 
numb
-numb))
+(defun mines--near-bombs (idx)
+  (let ((n 0))
+(dolist (nidx (mines-get-neighbours idx))
+  (when (eq t (aref mines-grid nidx))
+

[elpa] externals/mines 868e9b9 35/43: * mines.el: Bump version to v1.6

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 868e9b9650be1bcc1a5e6ff5a66806eccd1fe26e
Author: tino calancha 
Commit: tino calancha 

* mines.el: Bump version to v1.6
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index 6ac8015..00604ea 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.5
+;; Version: 1.6
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 



[elpa] externals/mines 5920f2d 37/43: * mines/mines.el (mines-grid): Use `bomb` instead of t

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 5920f2da9827194e41309f3abef3b5c3fefc8e3f
Author: Stefan Monnier 
Commit: Stefan Monnier 

* mines/mines.el (mines-grid): Use `bomb` instead of t

(mines-mine-positions): Remove.
(mines--show-all): Cycle through all cells instead.
(mines-dig): No need to update mines-mine-positions any more.
---
 mines.el | 36 +++-
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/mines.el b/mines.el
index 80411a0..b0ad1a2 100644
--- a/mines.el
+++ b/mines.el
@@ -122,14 +122,13 @@ If `custom' then ask user for these numbers."
 (defvar mines-grid nil
   "Game configuration.
 Each cell can hold either:
-- t to mean there's a bomb at that position.
+- `bomb' to mean there's a bomb at that position.
 - nil if there's no bomb here nor in any neighbor.
 - an integer indicating the number of neighbors with bombs.")
 
 (defvar mines-state nil
   "Game state.")
 
-(defvar mines-mine-positions nil "Mine positions.")
 (defvar mines-gap-positions nil "Empty cell positions.")
 (defvar mines-init-time nil "Initial time of the game.")
 (defvar mines-end-time nil "End time of the game.")
@@ -284,13 +283,12 @@ Each cell can hold either:
(vconcat (number-sequence 0 (1- mines-number-cells
   nil)))
 (dotimes (_ mines-number-mines)
-  (aset mines-grid (pop numbers) t))
-(setq mines-mine-positions (mines--find-pos t mines-grid
+  (aset mines-grid (pop numbers) 'bomb
 
 (defun mines--near-bombs (idx)
   (let ((n 0))
 (dolist (nidx (mines-get-neighbours idx))
-  (when (eq t (aref mines-grid nidx))
+  (when (eq 'bomb (aref mines-grid nidx))
 (cl-incf n)))
 n))
 
@@ -299,7 +297,7 @@ Each cell can hold either:
   (dotimes (i mines-number-rows)
 (dotimes (j mines-number-cols)
   (let ((idx (mines-matrix-2-index i j)))
-(unless (eq t (aref mines-grid idx))
+(unless (eq 'bomb (aref mines-grid idx))
   (let ((n (mines--near-bombs idx)))
 (setf (aref mines-grid idx) (unless (zerop n) n
 
@@ -371,12 +369,13 @@ Each cell can hold either:
 
 (defun mines--show-all ()
   "Show all mines after game over."
-  (dolist (to mines-mine-positions)
-(save-excursion
-  (mines-goto to)
+  (dotimes (idx mines-number-cells)
+(when (and (eq 'bomb (aref mines-grid idx))
+   (eq nil (aref mines-state idx)))
+  (mines-goto idx)
   ;; Drop all flags before show the mines; that drop the flag faces.
   (when (eq (following-char) mines-flagged-cell-char)
-(mines--update-cell to mines-uncover-cell-char 'unflag))
+(mines--update-cell idx mines-uncover-cell-char 'unflag))
   (mines-dig 'show-mines
 
 (defun mines-game-over ()
@@ -533,7 +532,7 @@ If called again then unflag it."
   (cl-flet ((game-end-fn
  ()
  ;; Check for end of game.
- (cond ((and (not show-mines) (eq elt 
t))
+ (cond ((and (not show-mines) (eq elt 
'bomb))
 ;; We lost the game; show all 
the mines.
 (mines-game-over))
(t
@@ -541,17 +540,12 @@ If called again then unflag it."
   (mines-game-completed))
   ;; Don't end the game in the first trial when
   ;; `mines-protect-first-move' is non-nil.
-  (when (and (eq elt t) mines-protect-first-move 
(mines-first-move-p))
-(let ((ok-pos (cl-position-if-not (lambda (x) 
(eq t x)) mines-grid)))
+  (when (and (eq elt 'bomb)
+ mines-protect-first-move 
(mines-first-move-p))
+(let ((ok-pos (cl-position-if-not (lambda (x) 
(eq 'bomb x))
+  mines-grid)))
   (message "Avoided game over in the first 
move")
-  ;; Update mine positions.
-  (setf (nth (cl-position idx 
mines-mine-positions)
- mines-mine-positions)
-ok-pos)
-  ;; We must update `mines-grid' further: the 
neighbour cells
-  ;; to IDX must show now a lower number of 
near bombs; the
-  ;; cells near the new position of the bomb 
must increase their
-  ;; numbers.
+  ;; Update `mines-grid'.
   (setf (aref 

[elpa] externals/mines e127c84 30/43: Add fallback function for read-multiple-choice

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit e127c8487994ca08a3116aee3d5eccf32d404428
Author: Tino Calancha 
Commit: Tino Calancha 

Add fallback function for read-multiple-choice

read-multiple-choice appeared in Emacs 26.  Add fallback
function for Emacs < 26.
* mines.el (mines--read-multiple-choice): New function.
(mines): Use it.
* mines-test.el (mines-test-read-multiple-choice): Add test.
---
 mines-tests.el | 16 
 mines.el   | 41 +++--
 2 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/mines-tests.el b/mines-tests.el
index 9bdf9ca..c5deca1 100644
--- a/mines-tests.el
+++ b/mines-tests.el
@@ -229,6 +229,22 @@
   (should (= numb (mines--near-bombs row col
 (when (buffer-live-p buf) (kill-buffer buf
 
+(ert-deftest mines-test-read-multiple-choice ()
+  (if (> emacs-major-version 25)
+  (dolist (char '(?e ?m ?h ??))
+(cl-letf* (((symbol-function #'read-char) (lambda () char))
+   (str (cdr (assoc char '((?e . "Easy") (?m . "Medium") (?h . 
"Hard") (?? . "Help"))
+  (should (equal (list char str)
+ (read-multiple-choice "Choose level "
+   '((?e "Easy") (?m "Medium") (?h 
"Hard") (?? "Help")))
+(cl-block :help
+  ;; When char is ? `mines--read-multiple-choice' enter a loop until char
+  ;; is a different character.  Exit the loop.
+  (dolist (char '(?e ?m ?h ??))
+(cl-letf (((symbol-function #'read-char)
+   (lambda ( _) (if (eq char ??) (cl-return-from :help 
nil) char
+  (should (mines--read-multiple-choice)))
+
 
 (provide 'mines-tests)
 ;;; mines-tests.el ends here
diff --git a/mines.el b/mines.el
index 7cb9496..744ce4d 100644
--- a/mines.el
+++ b/mines.el
@@ -509,18 +509,47 @@ If called again then unflag it."
 (mines-goto to)
 (uncover-fn)
 
+;; `read-multiple-choice' requires Emacs > 25.
+(defun mines--read-multiple-choice ()
+  (let (choice)
+(if (> emacs-major-version 25)
+(setq choice
+  (read-multiple-choice "Choose difficulty level: "
+'((?e "Easy" "8 columns x 8 rows and 10 
mines")
+  (?m "Medium" "16 columns x 16 rows and 
40 mines")
+  (?h "Hard" "30 columns x 16 rows and 99 
mines")
+  (?c "Custom" "C columns x R rows and M 
mines"
+  (let ((help-msg "Choose difficulty level: 
+
+e: [e] Easy  m: Mediumh: [h] Hard  c: 
[c] Custom
+8 columns x 8 rows   16 columns x 16 rows 30 columns x 16 rows C 
columns x R rows
+and 10 mines and 40 mines and 99 mines and 
M mines
+")   
+(answer
+ (read-char "Choose difficulty level:  ([e] Easy, [m] Medium, [h] 
Hard, [c] Custom, [?]): ")))
+(cl-flet ((show-help ()
+ (when (eq answer ??)
+   (let ((help-buf (get-buffer-create "*Multiple 
Choice Help*")))
+ (setq answer nil)
+ (with-current-buffer help-buf
+   (and (zerop (buffer-size)) (insert 
help-msg))
+   (display-buffer help-buf))
+  (if (eq answer ??) (show-help))
+  (while (not (memq answer '(?e ?m ?h ?c ??)))
+(setq answer (read-char "Choose difficulty level:  ([e] Easy, [m] 
Medium, [h] Hard, [c] Custom, [?]): "))
+(show-help))
+  (cond ((eq answer ?e) (list ?e "Easy" "8 columns x 8 rows and 10 
mines"))
+((eq answer ?m) (list ?m "Medium" "16 columns x 16 rows and 40 
mines"))
+((eq answer ?h) (list ?h "Hard" "30 columns x 16 rows and 99 
mines"))
+((eq answer ?c) (list ?c "Custom" "C columns x R rows and M 
mines"
+
 ;;;###autoload
 (defun mines ( arg)
   "Play the minesweeper game.
 Called with a prefix prompt for the difficulty level."
   (interactive
(let* ((prefix current-prefix-arg)
-  (choice (and prefix
-   (read-multiple-choice "Choose difficulty level: "
- '((?e "Easy" "8 columns x 8 rows 
and 10 mines")
-   (?m "Medium" "16 columns x 16 
rows and 40 mines")
-   (?h "Hard" "30 columns x 16 
rows and 99 mines")
-   (?c "Custom" "C columns x R 
rows and M mines"))
+  (choice (and prefix (mines--read-multiple-choice
  (when choice
(mines-init (eq ?e (car choice))
(eq ?m (car 

[elpa] externals/mines 34d088c 34/43: Reimplement mines-end-p

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 34d088c92427af72567113305a4ab7f46a03067a
Author: tino calancha 
Commit: tino calancha 

Reimplement mines-end-p

`mines-end-p' sometimes fails to detect a completed game.
The current implemention checks for a sufficient but not
necessary condition for the game to be completed.

Assuming a board with N cells, with M of those cells
(N > M) containing a mine; if the user already have
uncovered N - M mine-free cells, then the game
is completed.  That means is necessary and sufficient
to check that
M = 'number of uncovered cells' .

* mines.el (mines-end-p): End game if the number of uncovered
cells equals `mines-number-mines'.

Problem reported by Rolf Ade here
https://github.com/calancha/Minesweeper/issues/2
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index b82fa71..6ac8015 100644
--- a/mines.el
+++ b/mines.el
@@ -709,7 +709,7 @@ call this command again, the cell is unflagged."
 
 (defun mines-end-p ()
   "Return non-nil when the game is completed."
-  (equal mines-mine-positions (mines--find-pos nil mines-state)))
+  (= mines-number-mines (length (mines--find-pos nil mines-state
 
 (defun mines-first-move-p ()
   "Return non-nil if any cell has been revealed yet."



[elpa] externals/mines 92399df 29/43: * packages/mines/mines.el: Bump version to 1.2

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 92399df355dc47652ca243e48f05b6928f41567d
Author: Tino Calancha 
Commit: Tino Calancha 

* packages/mines/mines.el: Bump version to 1.2
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index acc491c..7cb9496 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.1
+;; Version: 1.2
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 



[elpa] externals/mines 9b07cb6 33/43: Do not uncover flagged cells if the user dont want that

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 9b07cb6deae160ef5aaff617102001f28bb55a5f
Author: Tino Calancha 
Commit: Tino Calancha 

Do not uncover flagged cells if the user dont want that

If the user ask to uncover a flagged cell, we ask for
confirmation; then, the user might change his mind or
go ahead and uncover the cell.

There is a bug in the logic and the cell is uncovered even
after the user cancel this action.  This commit fix that.
Bump version to 1.5
* mines.el (mines-dig): Do not uncover one flagged cell if the
user cancel this action.
---
 mines.el | 35 ---
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/mines.el b/mines.el
index 63096a3..b82fa71 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.4
+;; Version: 1.5
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 
@@ -545,6 +545,15 @@ If called again then unflag it."
(done nil) ; Already updated.
(t
 (let ((elt (aref mines-grid idx)))
+  (cl-flet ((game-end-fn
+ ()
+ ;; Check for end of game.
+ (cond ((and (not show-mines) (eq elt 
t))
+;; We lost the game; show all 
the mines.
+(mines-game-over))
+   (t
+(when (and (not show-mines) 
(mines-end-p))
+  (mines-game-completed))
   ;; Don't end the game in the first trial when
   ;; `mines-protect-first-move' is non-nil.
   (when (and (eq elt t) mines-protect-first-move 
(mines-first-move-p))
@@ -565,21 +574,17 @@ If called again then unflag it."
   (mines-set-numbers)
   ;; Update current element.
   (setq elt (aref mines-grid idx
-  ;; If the cell is flagged ask for confirmation.
-  (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
-  (if (yes-or-no-p "This cell is flagged as 
having a bomb.  Uncover it? ")
-  (progn ; Unflag first.
-(mines--update-cell idx 
mines-uncover-cell-char 'unflag)
-(mines--update-cell idx elt))
-(message "OK, canceled"))
-(mines--update-cell idx elt))
-  ;; Check for end of game.
-  (cond ((and (not show-mines) (eq elt t))
- ;; We lost the game; show all the mines.
- (mines-game-over))
+  (cond ((and (not show-mines) (eq 
(following-char) mines-flagged-cell-char))
+ ;; If the cell is flagged ask for 
confirmation.
+ (cond ((yes-or-no-p "This cell is flagged 
as having a bomb.  Uncover it? ")
+;; Unflag first.
+(mines--update-cell idx 
mines-uncover-cell-char 'unflag)
+(mines--update-cell idx elt)
+(game-end-fn))
+   (t (message "OK, canceled"
 (t
- (when (and (not show-mines) (mines-end-p))
-   (mines-game-completed))
+ (mines--update-cell idx elt)
+ (game-end-fn))
 (uncover-fn)
 (when mines-undone-neighbours
   (while mines-undone-neighbours



[elpa] externals/mines 3308a99 38/43: * packages/mines/mines.el: Keep flag in mines-state

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 3308a99e2255cdefebdd8123767704c3d668e766
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/mines/mines.el: Keep flag in mines-state

(mines-go-left): Use `eobp'.
(mines--count-covered): New function.
(mines-end-p): Use it.
(mines--find-pos): Remove.
(mines-state): Reverse cell value meaning (non-nil means covered).
(mines--insert): Remove `props` argument since `flag` and `done` text
properties are not used any more.  Use `font-loc
(mines-current-pos): Signal error if out of cell.
(mines--update-cell): Take `newstate` arg instad of elt and flag-or-unflag.
Remove useless remove-text-properties just before deleting that same text.
Set mines-state before calling mines--insert.
---
 mines.el | 106 +--
 1 file changed, 48 insertions(+), 58 deletions(-)

diff --git a/mines.el b/mines.el
index b0ad1a2..38c8811 100644
--- a/mines.el
+++ b/mines.el
@@ -127,7 +127,11 @@ Each cell can hold either:
 - an integer indicating the number of neighbors with bombs.")
 
 (defvar mines-state nil
-  "Game state.")
+  "Game state.
+Each cell can be either:
+- t to mean it's covered
+- nil to mean it's been uncovered
+- `flag' to mean that it's covered and flag'd.")
 
 (defvar mines-gap-positions nil "Empty cell positions.")
 (defvar mines-init-time nil "Initial time of the game.")
@@ -217,7 +221,7 @@ Each cell can hold either:
 (defun mines-go-left ()
   "Move 1 cell to the left."
   (interactive)
-  (if (= (point) (point-max))
+  (if (eobp)
   (goto-char (1- (point)))
 (let* ((idx (mines-current-pos))
(row-col (mines-index-2-matrix idx))
@@ -259,25 +263,17 @@ Each cell can hold either:
 
 ;;; Main Functions.
 
-(defun mines--find-pos (elt vec)
-  (let ((pos 0) res)
-(while (setq pos
- (cl-position-if
-  (lambda (x)
-(cond ((null elt)
-   ;; Check if the cell is empty or flagged.
-   (or (null x) (eq mines-flagged-cell-char x)))
-  (t (eq elt x
-  vec :start pos))
-  (push pos res)
-  (cl-incf pos))
-(nreverse res)))
+(defun mines--count-covered ()
+  (let ((count 0))
+  (dotimes (idx mines-number-cells)
+(when (aref mines-state idx) (cl-incf count)))
+  count))
 
 (defun mines-start ()
   "Set mine positions for a new game."
   ;; Erase vector.
   (setq mines-grid (make-vector mines-number-cells nil))
-  (setq mines-state (make-vector mines-number-cells nil))
+  (setq mines-state (make-vector mines-number-cells t))
   (let ((numbers (append
   (cookie-shuffle-vector
(vconcat (number-sequence 0 (1- mines-number-cells
@@ -312,7 +308,7 @@ Each cell can hold either:
rows cols mines)
   (list rows cols mines
 
-(defun mines--insert (elt idx  props null-str flag-or-unflag)
+(defun mines--insert (elt idx  null-str flag-or-unflag)
   (let* ((face nil)
  (str (cond ((null elt)
  (if (null null-str)
@@ -320,13 +316,12 @@ Each cell can hold either:
;; Uncover all its uncovered neighbours.
(save-excursion
  (dolist (x (mines-get-neighbours idx))
-   (mines-goto x)
-   (unless (get-text-property (point) 'done)
+   (when (aref mines-state x)
  (push x mines-undone-neighbours
(format " %s " null-str)))
 ((eq flag-or-unflag 'unflag)
  (format " %c " mines-uncover-cell-char))
-((and (memq 'flag props) (eq flag-or-unflag 'flag))
+((eq flag-or-unflag 'flag)
  (setq face 'warning)
  (format " %c " mines-flagged-cell-char))
 ((integerp elt)
@@ -342,7 +337,7 @@ Each cell can hold either:
 (when (= (cadr (mines-index-2-matrix idx)) (1- mines-number-cols))
   (backward-delete-char 1)
   (insert "\n"))
-(add-text-properties pos (point) `(idx ,idx face ,face ,@props))
+(add-text-properties pos (point) `(idx ,idx face ,face))
 (goto-char (1+ (point)
 
 (defun mines-show ()
@@ -359,23 +354,23 @@ Each cell can hold either:
 (dotimes (j mines-number-cols)
   (let* ((idx (+ (* i mines-number-cols) j))
  (elt (aref mines-state idx)))
-(mines--insert elt idx))
+(mines--insert nil idx))
   (display-buffer mines-buffer '(display-buffer-same-window))
   (set-window-point (get-buffer-window mines-buffer) mines-start-pos))
 
 (defun mines-current-pos ()
   "Return the index of the cell at point."
-  (get-text-property (point) 'idx))
+  (or (get-text-property (point) 'idx) (user-error "Wrong position!")))
 
 (defun 

[elpa] externals/mines 7660b39 21/43: Add test suite

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 7660b39ca6ac353bb5d423e36eb452f7036cbf13
Author: Tino Calancha 
Commit: Tino Calancha 

Add test suite

* mines-tests.el
* Makefile
* .travis.yml: Add file.
---
 .travis.yml|  22 ++
 Makefile   |  16 
 mines-tests.el | 234 +
 3 files changed, 272 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000..098eca7
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,22 @@
+language: emacs-lisp
+
+notifications:
+  email:
+on_success: never
+on_failure: always
+
+env:
+  - EVM_EMACS=emacs-24.3-travis
+  - EVM_EMACS=emacs-24.4-travis
+  - EVM_EMACS=emacs-24.5-travis
+  - EVM_EMACS=emacs-git-snapshot-travis
+
+before_install:
+  - git clone https://github.com/rejeep/evm.git $HOME/.evm
+  - export PATH=$HOME/.evm/bin:$PATH
+
+  - evm config path /tmp
+  - evm install $EVM_EMACS --use --skip
+
+script:
+  - make test
diff --git a/Makefile b/Makefile
new file mode 100644
index 000..97718b7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+emacs ?= emacs
+
+LOAD = -l mines.el
+
+all: test
+
+test:
+   $(emacs) -batch $(LOAD) -l mines-tests.el -f 
ert-run-tests-batch-and-exit
+
+compile:
+   $(emacs) -batch --eval "(progn (add-to-list 'load-path 
default-directory) (byte-compile-file \"mines.el\"))"
+
+clean:
+   rm -f *.elc
+
+.PHONY: all compile clean test
diff --git a/mines-tests.el b/mines-tests.el
new file mode 100644
index 000..e19c557
--- /dev/null
+++ b/mines-tests.el
@@ -0,0 +1,234 @@
+;;; mines-tests.el --- Tests for mines.el  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Tino Calancha ,
+;; Keywords:
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;;
+
+;;; code:
+
+(require 'ert)
+(require 'mines)
+(require 'cl-lib)
+
+(ert-deftest mines-test-gameover ()
+  (mines)
+  (let ((buf (get-buffer "*Mines*"))
+(grid-orig (copy-sequence mines-grid))
+(idx-bomb (cl-position t mines-grid))
+idx-ok grid-new)
+(with-current-buffer buf
+  (mines-goto idx-bomb) ; Go to first mine.
+  (setq idx-ok (cl-position-if-not (lambda (x) (eq t x)) mines-grid))
+  (should (mines-first-move-p))
+  (should-not (mines-dig)) ; Not gameover in first trial.
+  (setq grid-new (copy-sequence mines-grid))
+  ;; Adjacent cells to bombs must be updated as well.
+  (should-not (equal grid-orig
+ (cl-rotatef (aref grid-new idx-bomb)
+ (aref grid-new idx-ok
+  (mines-goto (cl-position t mines-grid))
+  (should-not (mines-first-move-p))
+  ;; 2nd trial might end the game.
+  (cl-letf (((symbol-function 'yes-or-no-p)
+ (lambda ( arg) (error "Fail"
+(should-error (mines-dig
+(when (buffer-live-p buf) (kill-buffer buf
+
+(ert-deftest mines-test-find-pos ()
+  (mines)
+  (let* ((buf (get-buffer "*Mines*"))
+ (empty-pos (mines--find-pos nil mines-grid))
+ (non-empty-pos (cl-set-difference
+ (number-sequence 0 (1- mines-number-cells))
+ empty-pos)))
+(with-current-buffer buf
+  (dolist (idx empty-pos)
+(should-not (aref mines-grid idx)))
+  (dolist (idx non-empty-pos)
+(should (aref mines-grid idx
+(when (buffer-live-p buf) (kill-buffer buf
+
+(ert-deftest mines-test-game-completed ()
+  (mines)
+  (let ((buf (get-buffer "*Mines*"))
+(empty-pos (mines--find-pos nil mines-grid))
+uncover-pos)
+(with-current-buffer buf
+  (should (mines-mines-mode-p))
+  ;; Uncover all empty cells.
+  (dolist (idx empty-pos)
+(mines-goto idx)
+(mines-dig))
+  (setq uncover-pos (mines--find-pos nil mines-state))
+  ;; Exclude mines from `uncover-pos'.
+  (dolist (idx mines-mine-positions)
+(setq uncover-pos (delete idx uncover-pos)))
+  ;; Uncover all but the first element in `uncover-pos'.
+  (dolist (idx (cdr uncover-pos))
+(mines-goto idx)
+(mines-dig))
+  (should-not (mines-end-p))
+  (mines-goto (car uncover-pos))
+  (mines-dig) ; Uncover the last one.
+  (should (mines-end-p)) ; Game completed.
+  (when 

[elpa] externals/mines 179ed77 32/43: Dont prompt user when updating the score file

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 179ed77dac7a81016947c2f7d40a0ae94228ba93
Author: Tino Calancha 
Commit: Tino Calancha 

Dont prompt user when updating the score file

Bump version to 1.4
* mines.el (mines--sort-score-file): Revert the buffer visiting the
score file and set it read only.
---
 mines.el | 28 
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/mines.el b/mines.el
index 24ee5e8..63096a3 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.3
+;; Version: 1.4
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 
@@ -453,14 +453,20 @@ Instead, in this file the score is the number of seconds 
to complete
 the game, i.e., getting a shorter score means a better result.
 After sorting, games completed with shorter times appear first."
   (when (file-exists-p file)
-(with-temp-file file
-  (insert
-   (with-temp-buffer
- (insert-file-contents file) (buffer-string)))
-  (sort-fields 1 (point-min) (point-max))
-  (goto-char (point-min))
-  (forward-line (or limit gamegrid-score-file-length))
-  (delete-region (point) (point-max)
+(let ((buf (get-file-buffer file)))
+  (with-temp-file file
+(insert
+ (with-temp-buffer
+   (insert-file-contents file) (buffer-string)))
+(sort-fields 1 (point-min) (point-max))
+(goto-char (point-min))
+(forward-line (or limit gamegrid-score-file-length))
+(delete-region (point) (point-max)))
+  ;; If there is a buffer visiting FILE, then revert it.
+  (when buf
+(with-current-buffer buf
+  (revert-buffer nil 'noconfirm)
+  (read-only-mode 1))
 
 (defun mines-game-completed ()
   (setq mines-end-time (current-time))
@@ -485,9 +491,7 @@ After sorting, games completed with shorter times appear 
first."
   ;; save score
   (gamegrid-add-score score-file score)
   ;; Sort `score-file' again and update the buffer visiting it.
-  (mines--sort-score-file score-file)
-  (with-current-buffer (find-buffer-visiting score-file)
-(revert-buffer nil 'noconfirm)))
+  (mines--sort-score-file score-file))
 (message (format "Well done %s, you have completed it in %s!"
  user-login-name elapsed-time
 



[elpa] externals/mines 7133550 28/43: * mines/mines.el (mines-mode): Move the docstring to where it belongs.

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 7133550459f5101680112f8990c6bc4e3e101bfb
Author: Stefan Monnier 
Commit: Tino Calancha 

* mines/mines.el (mines-mode): Move the docstring to where it belongs.
---
 mines.el | 40 
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/mines.el b/mines.el
index ae926a7..acc491c 100644
--- a/mines.el
+++ b/mines.el
@@ -541,25 +541,6 @@ Called with a prefix prompt for the difficulty level."
   (mines-show))
 
 (define-derived-mode mines-mode special-mode "mines"
-  (let ((map mines-mode-map))
-(define-key map [right] 'mines-go-right)
-(define-key map "f" 'mines-go-right)
-(define-key map "l" 'mines-go-right)
-(define-key map [left] 'mines-go-left)
-(define-key map "b" 'mines-go-left)
-(define-key map "h" 'mines-go-left)
-(define-key map "p" 'mines-go-up)
-(define-key map "k" 'mines-go-up)
-(define-key map [up] 'mines-go-up)
-(define-key map [down] 'mines-go-down)
-(define-key map "n" 'mines-go-down)
-(define-key map "j" 'mines-go-down)
-(define-key map "x" 'mines-dig)
-(define-key map "c" 'mines-dig)
-;; (define-key map "a" 'mines-flag-cell)
-(define-key map "1" 'mines-flag-cell)
-(define-key map "m" 'mines-flag-cell)
-(define-key map "r" 'mines))
   "Major mode for playing Minesweeper.
 
 The target of the game is discover which cells contain mines.
@@ -585,7 +566,26 @@ You can move between cells using the arrow keys, or using 
vi
 or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
 
 You can flag a cell as having a mine with \\[mines-flag-cell\]; if you
-call this command again, the cell is unflagged.")
+call this command again, the cell is unflagged."
+  (let ((map mines-mode-map))
+(define-key map [right] 'mines-go-right)
+(define-key map "f" 'mines-go-right)
+(define-key map "l" 'mines-go-right)
+(define-key map [left] 'mines-go-left)
+(define-key map "b" 'mines-go-left)
+(define-key map "h" 'mines-go-left)
+(define-key map "p" 'mines-go-up)
+(define-key map "k" 'mines-go-up)
+(define-key map [up] 'mines-go-up)
+(define-key map [down] 'mines-go-down)
+(define-key map "n" 'mines-go-down)
+(define-key map "j" 'mines-go-down)
+(define-key map "x" 'mines-dig)
+(define-key map "c" 'mines-dig)
+;; (define-key map "a" 'mines-flag-cell)
+(define-key map "1" 'mines-flag-cell)
+(define-key map "m" 'mines-flag-cell)
+(define-key map "r" 'mines)))
 
 
 ;;; Predicates



[elpa] externals/mines 7247335 20/43: * mines.el: Assign copyright to FSF

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 72473350b0acbe14232b90798599f7cf4ded52c2
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el: Assign copyright to FSF
---
 mines.el | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/mines.el b/mines.el
index 50869aa..d4b08cc 100644
--- a/mines.el
+++ b/mines.el
@@ -1,23 +1,22 @@
 ;;; mines.el --- Minesweeper game -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017  Tino Calancha
+;; Copyright (C) 2017 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha 
-;; Maintainer: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
 ;; Version: 1.0
 ;; Package-Requires: ((emacs "24.3") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 
-;; This file is NOT part of GNU Emacs.
+;; This file is part of GNU Emacs.
 
-;; This program is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation, either version 3 of the License, or
 ;; (at your option) any later version.
 
-;; This program is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.



[elpa] externals/mines 8eaf131 27/43: * mines.el: Bump version to 1.1

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 8eaf1319915f2be217de2b531022354940a8ea07
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el: Bump version to 1.1
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index bcdace7..ae926a7 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.0
+;; Version: 1.1
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 



[elpa] externals/mines bf577b0 31/43: Sort the score file from better to worst results

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit bf577b01486880424e424c6e412fa9e0f27d90c9
Author: Tino Calancha 
Commit: Tino Calancha 

Sort the score file from better to worst results

`gamegrid-add-score' assumes that a higher score in the game
means a better result.  That is not true in this game, where
the score is the number of seconds to complete the puzzle.

We sort the score file from shorter to larger scores.  This
ensures that if we have already `gamegrid-score-file-length'
records, then we discard the worst result before saving a new
score.
Bump version to 1.3.
* mines.el (mines--score-file): New defun extracted from
`gamegrid-add-score-with-update-game-score'.

(mines--sort-score-file): Sort results from shorter to larger
scores.  Limit the number of records in the file to
`gamegrid-score-file-length'.

(mines-game-completed): Sort score file before and after
update it with the new score.
---
 mines.el | 91 ++--
 1 file changed, 83 insertions(+), 8 deletions(-)

diff --git a/mines.el b/mines.el
index 744ce4d..24ee5e8 100644
--- a/mines.el
+++ b/mines.el
@@ -5,7 +5,7 @@
 ;; Author: Tino Calancha 
 ;; Created: 2017-10-28
 ;; Keywords: games
-;; Version: 1.2
+;; Version: 1.3
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 
@@ -401,18 +401,93 @@ If `custom' then ask user for these numbers."
 (mines)
   (setq mines-game-over t
 
+;; Extracted from `gamegrid-add-score-with-update-game-score'.
+(defun mines--score-file (file)
+  "Return full filename of score file."
+  (let ((gamegrid-shared-game-dir
+(not (zerop (logand (or (file-modes
+ (expand-file-name 
"update-game-score"
+   
exec-directory))
+0)
+#o6000)
+(cond ((file-name-absolute-p file) file)
+ ((and gamegrid-shared-game-dir
+   (file-exists-p (expand-file-name file 
shared-game-score-directory)))
+   (expand-file-name file shared-game-score-directory))
+ ;; Else: Use a score file in the user's home directory.
+ (t
+  (unless (file-exists-p
+   (directory-file-name 
gamegrid-user-score-file-directory))
+(make-directory gamegrid-user-score-file-directory t))
+   (expand-file-name file gamegrid-user-score-file-directory)
+
+(defun mines--number-of-records (file)
+  "Return number of records in FILE."
+  (if (file-exists-p file)
+  (with-temp-buffer
+(insert-file-contents file)
+(count-lines (point-min) (point-max)))
+0))
+
+(defun mines--worst-score (file)
+  "Return worst score in FILE."
+  (when (file-exists-p file)
+(with-temp-buffer
+  (insert-file-contents file)
+  (when (/= (point-min) (point-max))
+(goto-char (point-max))
+(while (and (looking-at "^$") (/= (point) (point-min)))
+  (forward-line -1))
+(unless (looking-at "^$")
+  (read (current-buffer)))
+
+(defun mines--sort-score-file (file  limit)
+  "Sort FILE lexicographically using the score column.
+Keep LIMIT number of records in the file; default to
+`gamegrid-score-file-length'.
+
+Note that `gamegrid-add-score' assumes that the score file is a
+high-score-file, i.e., getting a higher score means a better result.
+
+Instead, in this file the score is the number of seconds to complete
+the game, i.e., getting a shorter score means a better result.
+After sorting, games completed with shorter times appear first."
+  (when (file-exists-p file)
+(with-temp-file file
+  (insert
+   (with-temp-buffer
+ (insert-file-contents file) (buffer-string)))
+  (sort-fields 1 (point-min) (point-max))
+  (goto-char (point-min))
+  (forward-line (or limit gamegrid-score-file-length))
+  (delete-region (point) (point-max)
+
 (defun mines-game-completed ()
   (setq mines-end-time (current-time))
   (let* ((score (time-to-seconds
  (time-subtract mines-end-time mines-init-time)))
  (elapsed-time (format-seconds "%Y, %D, %H, %M, %z%S"
-   score)))
-;; save score
-(gamegrid-add-score (format "mines-rows-%d-cols-%d-mines-%d-scores"
-mines-number-rows
-mines-number-cols
-mines-number-mines)
-score)
+   score))
+ (score-file (mines--score-file
+  (format "mines-rows-%d-cols-%d-mines-%d-scores"
+  mines-number-rows
+  mines-number-cols
+

[elpa] externals/mines 4bbe9a4 14/43: * mines.el (mines-dig): Fix update of board when touch a bomb at first trial

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 4bbe9a471d343b33f528335c2b9bb202557beb46
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-dig): Fix update of board when touch a bomb at first trial
---
 mines.el | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index 8ceddd2..7f55e50 100644
--- a/mines.el
+++ b/mines.el
@@ -476,7 +476,19 @@ If called again then unflag it."
 (let ((ok-pos (cl-position-if-not (lambda (x) 
(eq t x)) mines-grid)))
   (message "Avoided game over in the first 
move")
   (setq elt (aref mines-grid ok-pos))
-  (cl-rotatef (aref mines-grid idx) (aref 
mines-grid ok-pos
+  ;; Update mine positions.
+  (setf (nth (cl-position idx 
mines-mine-positions)
+ mines-mine-positions) ok-pos)
+  ;; We must update `mines-grid' further: the 
neighbour cells
+  ;; to IDX must show now a lower number of 
near bombs; the
+  ;; cells near the new position of the bomb 
must increase their
+  ;; numbers.
+  (setq mines-grid (make-vector 
mines-number-cells nil))
+  ;; Add the mine positions.
+  (dolist (pos mines-mine-positions)
+(aset mines-grid pos t))
+  ;; Update the numbers on neighbour cells.
+  (mines-set-numbers)))
   ;; If the cell is flagged ask for confirmation.
   (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
   (if (yes-or-no-p "This cell is flagged as 
having a bomb.  Uncover it? ")



[elpa] externals/mines b490060 39/43: * packages/mines/mines.el: Streamline mines--insert

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit b49006055b338b08539b5ee8ba1eae4d180c9264
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/mines/mines.el: Streamline mines--insert

(mines-list-game-conditions): Work also outside of the mines buffer.
(mines--insert): Remove null-str and flag-or-unflag args.
Use info from `elt` instead.  Consolidate the SPC-char-SPC format in
a single place.  Use `font-lock-face` rather than `face` so the colors
can be disabled via font-lock-mode.
(mines-show): Adjust call to mines--insert.
(mines--show-all): No need to "unflag" before uncovering and no need to
use mines-dig to uncover.
(mines-game-over): Set mines-game-over before prompting the user.
(mines-flag-cell): Don't do nothing silently.
(mines--update-cell): Add assertions.  Go to the specified cell.
Adjust call to mines--insert.
(mines-dig): Use mines-goto rather than assume the [:blank:] won't
match any of the cell's representation.  No need to unflag
before uncovering.
---
 mines.el | 150 ---
 1 file changed, 67 insertions(+), 83 deletions(-)

diff --git a/mines.el b/mines.el
index 38c8811..a2847e7 100644
--- a/mines.el
+++ b/mines.el
@@ -300,44 +300,42 @@ Each cell can be either:
 (defun mines-list-game-conditions ()
   "Return number of rows, columns and mines for current game."
   (interactive)
-  (when (mines-mines-mode-p)
-(let ((rows mines-number-rows)
-  (cols mines-number-cols)
-  (mines mines-number-mines))
-  (message "%d rows x %d columns with %d mines"
-   rows cols mines)
-  (list rows cols mines
-
-(defun mines--insert (elt idx  null-str flag-or-unflag)
+  (let ((rows mines-number-rows)
+(cols mines-number-cols)
+(mines mines-number-mines))
+(message "%d rows x %d columns with %d mines"
+ rows cols mines)
+(list rows cols mines)))
+
+(defun mines--insert (elt idx)
   (let* ((face nil)
- (str (cond ((null elt)
- (if (null null-str)
- (format " %c " mines-uncover-cell-char)
-   ;; Uncover all its uncovered neighbours.
-   (save-excursion
- (dolist (x (mines-get-neighbours idx))
-   (when (aref mines-state x)
- (push x mines-undone-neighbours
-   (format " %s " null-str)))
-((eq flag-or-unflag 'unflag)
- (format " %c " mines-uncover-cell-char))
-((eq flag-or-unflag 'flag)
+ (char (cond ((null elt)
+ ;; Uncover all its uncovered neighbours.
+ (save-excursion
+   (dolist (x (mines-get-neighbours idx))
+ (when (aref mines-state x)
+   (push x mines-undone-neighbours
+ mines-empty-cell-char)
+((eq elt t)
+ mines-uncover-cell-char)
+((eq elt 'flag)
  (setq face 'warning)
- (format " %c " mines-flagged-cell-char))
+ mines-flagged-cell-char)
 ((integerp elt)
  ;; FIXME: Set face here so each number gets
  ;; a different color.
- (format " %d " elt))
+ (+ ?0 elt))
 (t
+ (cl-assert (eq elt 'bomb))
  (setq face 'error)
- (format " %c " mines-empty-cell-mine
+ mines-empty-cell-mine)))
  (pos (point))
  (inhibit-read-only t))
-(insert str)
+(insert (format " %c " char))
 (when (= (cadr (mines-index-2-matrix idx)) (1- mines-number-cols))
   (backward-delete-char 1)
   (insert "\n"))
-(add-text-properties pos (point) `(idx ,idx face ,face))
+(add-text-properties pos (point) `(idx ,idx font-lock-face ,face))
 (goto-char (1+ (point)
 
 (defun mines-show ()
@@ -354,7 +352,7 @@ Each cell can be either:
 (dotimes (j mines-number-cols)
   (let* ((idx (+ (* i mines-number-cols) j))
  (elt (aref mines-state idx)))
-(mines--insert nil idx))
+(mines--insert (or elt (aref mines-grid idx)) idx))
   (display-buffer mines-buffer '(display-buffer-same-window))
   (set-window-point (get-buffer-window mines-buffer) mines-start-pos))
 
@@ -367,20 +365,16 @@ Each cell can be either:
   (dotimes (idx mines-number-cells)
 (when (and (eq 'bomb (aref mines-grid idx))
(aref mines-state idx))
-  (mines-goto idx)
-  ;; Drop all flags before show the mines; that drop the flag faces.
-  (when (eq 'flag (aref mines-state idx))
-(mines--update-cell idx t))
-  (mines-dig 'show-mines
+ 

[elpa] externals/mines 6e7fc5c 24/43: * mines.el: Update dependency to Emacs-24.4

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 6e7fc5cc1a12105c154c5ca3e9f129048c0f8e50
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el: Update dependency to Emacs-24.4
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index d4b08cc..02bfc9b 100644
--- a/mines.el
+++ b/mines.el
@@ -6,7 +6,7 @@
 ;; Created: 2017-10-28
 ;; Keywords: games
 ;; Version: 1.0
-;; Package-Requires: ((emacs "24.3") (cl-lib "0.5"))
+;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; url: https://github.com/calancha/Minesweeper
 
 ;; This file is part of GNU Emacs.



[elpa] externals/mines abc8c9d 26/43: Move game documentation into `mines-mode' docstring

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit abc8c9d0f8e2798b8c229ec550a6b9346dd6
Author: Tino Calancha 
Commit: Tino Calancha 

Move game documentation into `mines-mode' docstring

* mines.el (mines)
(mines-mode): Update docstring.
---
 mines.el | 56 +++-
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/mines.el b/mines.el
index 9304622..bcdace7 100644
--- a/mines.el
+++ b/mines.el
@@ -511,35 +511,8 @@ If called again then unflag it."
 
 ;;;###autoload
 (defun mines ( arg)
-  ;; FIXME: I think most of this doc should be moved to `mines-mode' so it
-  ;; is shown to the user when he uses the standard `describe-mode' command.
   "Play the minesweeper game.
-Called with a prefix prompt for the difficulty level.
-
-The target of the game is discover which cells contain mines.
-You reveal the content of the mine at point with \\[mines-dig\].
-1. If you look at one cell containing a mine you lost.
-
-2. A cell without a mine having N neighbour cells containing mines
-   shows N when you look at it.
-
-3. A cell without a mine and without neighbour cells having mines
-   shows the character `@' when you look at it; all adjacent cells
-   are recursively revealed.
-
-For instance, following is a possible configuration:
-
-@ @ @ @ @
-1 2 2 1 @
-1 x x 1 @
-1 2 2 1 @
-@ @ @ @ @
-
-You can move between cells using the arrow keys, or using vi
-or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
-
-You can flag a cell as having a mine with \\[mines-flag-cell\]; if you
-call this command again, the cell is unflagged."
+Called with a prefix prompt for the difficulty level."
   (interactive
(let* ((prefix current-prefix-arg)
   (choice (and prefix
@@ -587,7 +560,32 @@ call this command again, the cell is unflagged."
 (define-key map "1" 'mines-flag-cell)
 (define-key map "m" 'mines-flag-cell)
 (define-key map "r" 'mines))
-  "Major mode for playing Minesweeper.")
+  "Major mode for playing Minesweeper.
+
+The target of the game is discover which cells contain mines.
+You reveal the content of the mine at point with \\[mines-dig\].
+1. If you look at one cell containing a mine you lost.
+
+2. A cell without a mine with N neighbour cells containing mines
+   shows N when you look at it.
+
+3. A cell without a mine and without neighbour cells having mines
+   shows the character `@' when you look at it; all adjacent cells
+   are recursively revealed.
+
+For instance, following is a possible configuration:
+
+@ @ @ @ @
+1 2 2 1 @
+1 x x 1 @
+1 2 2 1 @
+@ @ @ @ @
+
+You can move between cells using the arrow keys, or using vi
+or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
+
+You can flag a cell as having a mine with \\[mines-flag-cell\]; if you
+call this command again, the cell is unflagged.")
 
 
 ;;; Predicates



[elpa] externals/mines 226776a 25/43: * mines: Fix compilation warnings

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 226776ad14bb45d17c947b59b9d4ac47afa853e9
Author: Stefan Monnier 
Commit: Tino Calancha 

* mines: Fix compilation warnings
---
 mines-tests.el | 21 +++--
 mines.el   | 10 ++
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/mines-tests.el b/mines-tests.el
index e19c557..9bdf9ca 100644
--- a/mines-tests.el
+++ b/mines-tests.el
@@ -50,7 +50,7 @@
   (should-not (mines-first-move-p))
   ;; 2nd trial might end the game.
   (cl-letf (((symbol-function 'yes-or-no-p)
- (lambda ( arg) (error "Fail"
+ (lambda ( _) (error "Fail"
 (should-error (mines-dig
 (when (buffer-live-p buf) (kill-buffer buf
 
@@ -94,19 +94,20 @@
   (when (buffer-live-p buf) (kill-buffer buf)
 
 (ert-deftest mines-test-indices ()
-  (= 0 (mines-matrix-2-index 0 0))
-  (= 1 (mines-matrix-2-index 0 1))
-  (= (1- mines-number-cols)
- (mines-matrix-2-index 0 (1- mines-number-cols)))
-  (= (* mines-number-cols (1- mines-number-rows))
- (mines-matrix-2-index (1- mines-number-rows) 0))
-  (= (1- mines-number-cells)
- (mines-matrix-2-index (1- mines-number-rows) (1- mines-number-cols)))
+  (should (= 0 (mines-matrix-2-index 0 0)))
+  (should (= 1 (mines-matrix-2-index 0 1)))
+  (should (= (1- mines-number-cols)
+ (mines-matrix-2-index 0 (1- mines-number-cols
+  (should (= (* mines-number-cols (1- mines-number-rows))
+ (mines-matrix-2-index (1- mines-number-rows) 0)))
+  (should (= (1- mines-number-cells)
+ (mines-matrix-2-index (1- mines-number-rows)
+   (1- mines-number-cols
   ;; `mines-matrix-2-index' consistent with `mines-index-2-matrix'.
   (dolist (idx (list 0 1 (1- mines-number-cols)
  (* mines-number-cols (1- mines-number-rows))
  (1- mines-number-cells)))
-(= idx (apply #'mines-matrix-2-index (mines-index-2-matrix idx)
+(should (= idx (apply #'mines-matrix-2-index (mines-index-2-matrix 
idx))
 
 (ert-deftest mines-test-neighbours ()
   (cl-flet ((set-equalp (x y)
diff --git a/mines.el b/mines.el
index 02bfc9b..9304622 100644
--- a/mines.el
+++ b/mines.el
@@ -454,8 +454,8 @@ If called again then unflag it."
   (interactive)
   (when (mines-mines-mode-p)
 (if mines-game-over
-(user-error "Current game is over.  Try `%s' to start a new one."
-(substitute-command-keys "\\[mines\]"))
+(user-error "Current game is over.  Try `%s' to start a new one"
+(substitute-command-keys "\\[mines]"))
   (skip-chars-forward "[:blank:]") ; Set point in the center of the cell.
   (cl-labels ((uncover-fn
()
@@ -484,7 +484,7 @@ If called again then unflag it."
 (aset mines-grid pos t))
   ;; Update the numbers on neighbour cells.
   (mines-set-numbers)
-  ;; Update current element. 
+  ;; Update current element.
   (setq elt (aref mines-grid idx
   ;; If the cell is flagged ask for confirmation.
   (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
@@ -511,6 +511,8 @@ If called again then unflag it."
 
 ;;;###autoload
 (defun mines ( arg)
+  ;; FIXME: I think most of this doc should be moved to `mines-mode' so it
+  ;; is shown to the user when he uses the standard `describe-mode' command.
   "Play the minesweeper game.
 Called with a prefix prompt for the difficulty level.
 
@@ -534,7 +536,7 @@ For instance, following is a possible configuration:
 @ @ @ @ @
 
 You can move between cells using the arrow keys, or using vi
-or emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
+or Emacs keystrokes (↑↓→←) = (kjlh) = (pnfb).
 
 You can flag a cell as having a mine with \\[mines-flag-cell\]; if you
 call this command again, the cell is unflagged."



[elpa] externals/mines dd8b0e3 11/43: Delete screenshots

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit dd8b0e31a20809f0b175ae7e2d55fcaf77ab6fb4
Author: Tino Calancha 
Commit: Tino Calancha 

Delete screenshots
---
 screenshots/screenshot-minesweeper-gameover.png | Bin 122887 -> 0 bytes
 screenshots/screenshot-minesweeper.png  | Bin 114073 -> 0 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/screenshot-minesweeper-gameover.png 
b/screenshots/screenshot-minesweeper-gameover.png
deleted file mode 100644
index 79d6808..000
Binary files a/screenshots/screenshot-minesweeper-gameover.png and /dev/null 
differ
diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
deleted file mode 100644
index 0058fc4..000
Binary files a/screenshots/screenshot-minesweeper.png and /dev/null differ



[elpa] externals/mines 3de39fb 22/43: * README.md: Show build state

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 3de39fba9e8c02a52dc218935453c59dfa0538e0
Author: Tino Calancha 
Commit: Tino Calancha 

* README.md: Show build state
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index b1132f6..2cf3aed 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 # Minesweeper
 Play minesweeper in Emacs
 
+[![Build 
Status](https://api.travis-ci.org/calancha/Minesweeper.svg?branch=master)](https://travis-ci.org/calancha/Minesweeper)
+
 This is an elisp implementation of the classical minesweeper game.
 The target is localize all hidden mines (bombs) in a rectangular board
 without detonating them.  You reveal the content of a cell with the



[elpa] externals/mines 909152f 19/43: * mines.el (mines-dig): Update element at point after avoid gameover in 1st trial

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 909152fd6226b6d4eeb0e86d31bfcc078c5c4cc6
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-dig): Update element at point after avoid gameover in 1st 
trial
---
 mines.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mines.el b/mines.el
index a88386a..50869aa 100644
--- a/mines.el
+++ b/mines.el
@@ -472,7 +472,6 @@ If called again then unflag it."
   (when (and (eq elt t) mines-protect-first-move 
(mines-first-move-p))
 (let ((ok-pos (cl-position-if-not (lambda (x) 
(eq t x)) mines-grid)))
   (message "Avoided game over in the first 
move")
-  (setq elt (aref mines-grid ok-pos))
   ;; Update mine positions.
   (setf (nth (cl-position idx 
mines-mine-positions)
  mines-mine-positions) ok-pos)
@@ -485,7 +484,9 @@ If called again then unflag it."
   (dolist (pos mines-mine-positions)
 (aset mines-grid pos t))
   ;; Update the numbers on neighbour cells.
-  (mines-set-numbers)))
+  (mines-set-numbers)
+  ;; Update current element. 
+  (setq elt (aref mines-grid idx
   ;; If the cell is flagged ask for confirmation.
   (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
   (if (yes-or-no-p "This cell is flagged as 
having a bomb.  Uncover it? ")



[elpa] externals/mines 9f7404e 07/43: Delete file

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 9f7404eb04599b2ad729ad4df5c5fb0124a44ac7
Author: Tino Calancha 
Commit: Tino Calancha 

Delete file
---
 screenshots/screenshot-minesweeper.png | Bin 114073 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
deleted file mode 100644
index 0058fc4..000
Binary files a/screenshots/screenshot-minesweeper.png and /dev/null differ



[elpa] externals/mines 5ee08ac 15/43: * mines.el (mines-mode): Initialize mode map in the body

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 5ee08ac05ffbc5aab129f9942593f9574fc79bc6
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-mode): Initialize mode map in the body
---
 mines.el | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/mines.el b/mines.el
index 7f55e50..0039ed4 100644
--- a/mines.el
+++ b/mines.el
@@ -568,8 +568,8 @@ call this command again, the cell is unflagged."
   (mines-set-numbers)
   (mines-show))
 
-(defvar mines-mode-map
-  (let ((map (make-sparse-keymap 'mines-mode-map)))
+(define-derived-mode mines-mode special-mode "mines"
+  (let ((map mines-mode-map))
 (define-key map [right] 'mines-go-right)
 (define-key map "f" 'mines-go-right)
 (define-key map "l" 'mines-go-right)
@@ -587,11 +587,7 @@ call this command again, the cell is unflagged."
 ;; (define-key map "a" 'mines-flag-cell)
 (define-key map "1" 'mines-flag-cell)
 (define-key map "m" 'mines-flag-cell)
-(define-key map "r" 'mines)
-map)
-  "Mode map for `mines-mode'.")
-
-(define-derived-mode mines-mode special-mode "mines"
+(define-key map "r" 'mines))
   "Major mode for playing Minesweeper.")
 
 



[elpa] externals/mines 1cf5d85 23/43: * .travis.yml: Dont test for Emacs-24.3

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 1cf5d85f40019c6bb36d5af83ec7c384b8340427
Author: Tino Calancha 
Commit: Tino Calancha 

* .travis.yml: Dont test for Emacs-24.3
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 098eca7..1401cb1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ notifications:
 on_failure: always
 
 env:
-  - EVM_EMACS=emacs-24.3-travis
+  # - EVM_EMACS=emacs-24.3-travis # cookie1 needed.
   - EVM_EMACS=emacs-24.4-travis
   - EVM_EMACS=emacs-24.5-travis
   - EVM_EMACS=emacs-git-snapshot-travis



[elpa] externals/mines 82f1a92 17/43: Refactor code

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 82f1a92db82ddaac97bf7dfa76b98f3a6442d2dc
Author: Tino Calancha 
Commit: Tino Calancha 

Refactor code

* mines.el (mines--near-bombs): New defun.
(mines-set-numbers): Use it.
---
 mines.el | 58 ++
 1 file changed, 26 insertions(+), 32 deletions(-)

diff --git a/mines.el b/mines.el
index dc9f702..6771975 100644
--- a/mines.el
+++ b/mines.el
@@ -277,44 +277,38 @@ If `custom' then ask user for these numbers."
   (aset mines-grid (pop numbers) t))
 (setq mines-mine-positions (mines--find-pos t mines-grid
 
+(defun mines--near-bombs (i j)
+  (let ((numb 0))
+;; Horizontal neighbours.
+(when (> j 0)
+  (and (aref mines-grid (mines-matrix-2-index i (1- j))) (cl-incf numb)))
+(when (< j (1- mines-number-cols))
+  (and (aref mines-grid (mines-matrix-2-index i (1+ j))) (cl-incf numb)))
+;; Previous row neighbours.
+(when (> i 0)
+  (and (aref mines-grid (mines-matrix-2-index (1- i) j)) (cl-incf numb))
+  (when (> j 0)
+(and (aref mines-grid (mines-matrix-2-index (1- i) (1- j))) (cl-incf 
numb)))
+  (when (< j (1- mines-number-cols))
+(and (aref mines-grid (mines-matrix-2-index (1- i) (1+ j))) (cl-incf 
numb
+;; Next row neighbours.
+(when (< i (1- mines-number-rows))
+  (and (aref mines-grid (mines-matrix-2-index (1+ i) j)) (cl-incf numb))
+  (when (> j 0)
+(and (aref mines-grid (mines-matrix-2-index (1+ i) (1- j))) (cl-incf 
numb)))
+  (when (< j (1- mines-number-cols))
+(and (aref mines-grid (mines-matrix-2-index (1+ i) (1+ j))) (cl-incf 
numb
+numb))
+
 (defun mines-set-numbers ()
   "Set numbers for cells adjacent to cells with bombs."
   (let ((tmp-grid (copy-sequence mines-grid)))
 (dotimes (i mines-number-rows)
   (dotimes (j mines-number-cols)
-(let ((idx (mines-matrix-2-index i j))
-  (numb 0))
+(let ((idx (mines-matrix-2-index i j)))
   (unless (aref mines-grid idx)
-;; Horizontal neighbours.
-(when (> j 0)
-  (let ((tmp-idx (mines-matrix-2-index i (1- j
-(and (aref mines-grid tmp-idx) (cl-incf numb
-(when (< j (1- mines-number-cols))
-  (let ((tmp-idx (mines-matrix-2-index i (1+ j
-(and (aref mines-grid tmp-idx) (cl-incf numb
-;; Previous row neighbours.
-(when (> i 0)
-  (let ((tmp-idx (mines-matrix-2-index (1- i) j)))
-(and (aref mines-grid tmp-idx) (cl-incf numb)))
-  (when (> j 0)
-(let ((tmp-idx (mines-matrix-2-index (1- i) (1- j
-  (and (aref mines-grid tmp-idx) (cl-incf numb
-  (when (< j (1- mines-number-cols))
-(let ((tmp-idx (mines-matrix-2-index (1- i) (1+ j
-  (and (aref mines-grid tmp-idx) (cl-incf numb)
-;; Next row neighbours.
-(when (< i (1- mines-number-rows))
-  (let ((tmp-idx (mines-matrix-2-index (1+ i) j)))
-(and (aref mines-grid tmp-idx) (cl-incf numb)))
-  (when (> j 0)
-(let ((tmp-idx (mines-matrix-2-index (1+ i) (1- j
-  (and (aref mines-grid tmp-idx) (cl-incf numb
-  (when (< j (1- mines-number-cols))
-(let ((tmp-idx (mines-matrix-2-index (1+ i) (1+ j
-  (and (aref mines-grid tmp-idx) (cl-incf numb)
-;; Update `mines-grid'.
-(unless (zerop numb)
-  (aset tmp-grid idx numb))
+(let ((numb (mines--near-bombs i j)))
+  (unless (zerop numb) (aset tmp-grid idx numb)))
 (setq mines-grid tmp-grid)))
 
 (defun mines-list-game-conditions ()



[elpa] externals/mines 5ada7d3 06/43: * Readme: Add more screenshots

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 5ada7d30fc2c83c493e15253e2d55c26f8060e0b
Author: Tino Calancha 
Commit: Tino Calancha 

* Readme: Add more screenshots
---
 README.md   |   4 
 screenshots/screenshot-minesweeper-gameover.png | Bin 0 -> 122887 bytes
 screenshots/screenshot-minesweeper.png  | Bin 105128 -> 114073 bytes
 3 files changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 7a3ef37..0b6ac9f 100644
--- a/README.md
+++ b/README.md
@@ -28,4 +28,8 @@ when the only uncovered cells equals the number of hidden 
mines.
 
 ### Screenshots
 
+minesweeper screenshot:
 ![ScreenShot](/screenshots/screenshot-minesweeper.png)
+
+Game over screenshot:
+![ScreenShot](/screenshots/screenshot-minesweeper-gameover.png)
diff --git a/screenshots/screenshot-minesweeper-gameover.png 
b/screenshots/screenshot-minesweeper-gameover.png
new file mode 100644
index 000..79d6808
Binary files /dev/null and b/screenshots/screenshot-minesweeper-gameover.png 
differ
diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
index c42b290..0058fc4 100644
Binary files a/screenshots/screenshot-minesweeper.png and 
b/screenshots/screenshot-minesweeper.png differ



[elpa] externals/mines 4d800e0 09/43: * mines.el (mines--insert): Display flags with a different face

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 4d800e0f0c14518e96153ff013d673177ab3e0d5
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines--insert): Display flags with a different face
---
 mines.el | 64 +---
 1 file changed, 37 insertions(+), 27 deletions(-)

diff --git a/mines.el b/mines.el
index 2526735..3a092de 100644
--- a/mines.el
+++ b/mines.el
@@ -329,25 +329,29 @@ If `custiom' then ask user for these numbers."
   (list rows cols mines
 
 (defun mines--insert (elt idx  props null-str flag-or-unflag)
-  (let ((str (cond ((null elt)
-(if (null null-str)
-(format " %c " mines-uncover-cell-char)
-  ;; Uncover all its uncovered neighbours.
-  (save-excursion
-(dolist (x (mines-get-neighbours idx))
-  (mines-goto x)
-  (unless (get-text-property (point) 'done)
-(push x mines-undone-neighbours
-  (format " %s " null-str)))
-   ((eq flag-or-unflag 'unflag)
-(format " %c " mines-uncover-cell-char))
-   ((and (memq 'flag props) (eq flag-or-unflag 'flag))
-(format " %c " mines-flagged-cell-char))
-   ((integerp elt) (format " %d " elt))
-   (t (format " %c " mines-empty-cell-mine
-(pos (point))
-(inhibit-read-only t))
-(insert str)
+  (let* ((face nil)
+ (str (cond ((null elt)
+ (if (null null-str)
+ (format " %c " mines-uncover-cell-char)
+   ;; Uncover all its uncovered neighbours.
+   (save-excursion
+ (dolist (x (mines-get-neighbours idx))
+   (mines-goto x)
+   (unless (get-text-property (point) 'done)
+ (push x mines-undone-neighbours
+   (format " %s " null-str)))
+((eq flag-or-unflag 'unflag)
+ (format " %c " mines-uncover-cell-char))
+((and (memq 'flag props) (eq flag-or-unflag 'flag))
+ (setq face 'warning)
+ (format " %c " mines-flagged-cell-char))
+((integerp elt) (format " %d " elt))
+(t (format " %c " mines-empty-cell-mine
+ (pos (point))
+ (inhibit-read-only t))
+(if face
+(insert (propertize str 'font-lock-face face))
+  (insert str))
 (when (= (cadr (mines-index-2-matrix idx)) (1- mines-number-cols))
   (backward-delete-char 1)
   (insert "\n"))
@@ -387,6 +391,9 @@ If `custiom' then ask user for these numbers."
   (dolist (to mines-mine-positions)
 (save-excursion
   (mines-goto to)
+  ;; Drop all flags before show the mines; that drop the flag faces.
+  (when (eq (following-char) mines-flagged-cell-char)
+(mines--update-cell to mines-uncover-cell-char 'unflag))
   (mines-dig 'show-mines
 
 (defun mines-game-over ()
@@ -438,6 +445,9 @@ If called again then unflag it."
 (inhibit-read-only t))
 (when (eq flag-or-unflag 'unflag)
   (setq prop `(idx ,idx)))
+;; If unflagging, then remove additional text properties.
+(when (eq flag-or-unflag 'unflag)
+  (remove-text-properties (point) to '(font-lock-face flag)))
 (delete-region (point) to)
 (mines--insert elt idx prop (string mines-empty-cell-char) flag-or-unflag)
 (unless flag-or-unflag (aset mines-state idx '@))
@@ -455,8 +465,7 @@ If called again then unflag it."
()
(let ((idx (mines-current-pos))
  (inhibit-read-only t)
- (done (get-text-property (point) 'done))
- abort)
+ (done (get-text-property (point) 'done)))
  (cond ((null idx) (user-error "Wrong position!"))
(done nil) ; Already updated.
(t
@@ -469,18 +478,19 @@ If called again then unflag it."
   (setq elt (aref mines-grid ok-pos))
   (cl-rotatef (aref mines-grid idx) (aref 
mines-grid ok-pos
   ;; If the cell is flagged ask for confirmation.
-  (if (eq (following-char) mines-flagged-cell-char)
+  (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
   (if (yes-or-no-p "This cell is flagged as 
having a bomb.  Uncover it? ")
-  (mines--update-cell idx elt)
-(message "OK, canceled")
-(setq abort t))
+  

[elpa] externals/mines b419959 18/43: * mines.el (mines-init): Preserve board settings after restart game

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit b419959bb29a0534a8d26b0800bceaa6d3769eb6
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-init): Preserve board settings after restart game
---
 mines.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/mines.el b/mines.el
index 6771975..a88386a 100644
--- a/mines.el
+++ b/mines.el
@@ -139,16 +139,19 @@ If `custom' then ask user for these numbers."
  (cond (,cond1
 (setq mines-number-cols 8
   mines-number-rows 8
-  mines-number-mines 10))
+  mines-number-mines 10
+  mines-difficulty-level 'easy))
(,cond2
 (setq mines-number-cols 16
   mines-number-rows 16
-  mines-number-mines 40))
+  mines-number-mines 40
+  mines-difficulty-level 'medium))
(,cond3
 (setq mines-number-cols 30
   mines-number-rows 16
-  mines-number-mines 99))
-   (,cond4 ,@body))
+  mines-number-mines 99
+  mines-difficulty-level 'hard))
+   (,cond4 (setq mines-difficulty-level 'custom) ,@body))
  (setq mines-number-cells (* mines-number-rows mines-number-cols
 
 



[elpa] externals/mines 1efe0e0 12/43: updated screenshots

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 1efe0e0ec934355d4d2075c9f3c61c1776f4457f
Author: Tino Calancha 
Commit: Tino Calancha 

updated screenshots
---
 screenshots/screenshot-minesweeper-gameover.png | Bin 0 -> 80414 bytes
 screenshots/screenshot-minesweeper.png  | Bin 0 -> 57540 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/screenshot-minesweeper-gameover.png 
b/screenshots/screenshot-minesweeper-gameover.png
new file mode 100644
index 000..f26293f
Binary files /dev/null and b/screenshots/screenshot-minesweeper-gameover.png 
differ
diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
new file mode 100644
index 000..b8713bf
Binary files /dev/null and b/screenshots/screenshot-minesweeper.png differ



[elpa] externals/mines 0fb75df 16/43: * mines.el (mines-set-numbers): Use mines-matrix-2-index

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 0fb75df6903a5f6535dce17575eba53588140eb5
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-set-numbers): Use mines-matrix-2-index
---
 mines.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/mines.el b/mines.el
index 0039ed4..dc9f702 100644
--- a/mines.el
+++ b/mines.el
@@ -282,35 +282,35 @@ If `custom' then ask user for these numbers."
   (let ((tmp-grid (copy-sequence mines-grid)))
 (dotimes (i mines-number-rows)
   (dotimes (j mines-number-cols)
-(let ((idx (+ (* i mines-number-cols) j))
+(let ((idx (mines-matrix-2-index i j))
   (numb 0))
   (unless (aref mines-grid idx)
 ;; Horizontal neighbours.
 (when (> j 0)
-  (let ((tmp-idx (+ (* i mines-number-cols) (1- j
+  (let ((tmp-idx (mines-matrix-2-index i (1- j
 (and (aref mines-grid tmp-idx) (cl-incf numb
 (when (< j (1- mines-number-cols))
-  (let ((tmp-idx (+ (* i mines-number-cols) (1+ j
+  (let ((tmp-idx (mines-matrix-2-index i (1+ j
 (and (aref mines-grid tmp-idx) (cl-incf numb
 ;; Previous row neighbours.
 (when (> i 0)
-  (let ((tmp-idx (+ (* (1- i) mines-number-cols) j)))
+  (let ((tmp-idx (mines-matrix-2-index (1- i) j)))
 (and (aref mines-grid tmp-idx) (cl-incf numb)))
   (when (> j 0)
-(let ((tmp-idx (+ (* (1- i) mines-number-cols) (1- j
+(let ((tmp-idx (mines-matrix-2-index (1- i) (1- j
   (and (aref mines-grid tmp-idx) (cl-incf numb
   (when (< j (1- mines-number-cols))
-(let ((tmp-idx (+ (* (1- i) mines-number-cols) (1+ j
+(let ((tmp-idx (mines-matrix-2-index (1- i) (1+ j
   (and (aref mines-grid tmp-idx) (cl-incf numb)
 ;; Next row neighbours.
 (when (< i (1- mines-number-rows))
-  (let ((tmp-idx (+ (* (1+ i) mines-number-cols) j)))
+  (let ((tmp-idx (mines-matrix-2-index (1+ i) j)))
 (and (aref mines-grid tmp-idx) (cl-incf numb)))
   (when (> j 0)
-(let ((tmp-idx (+ (* (1+ i) mines-number-cols) (1- j
+(let ((tmp-idx (mines-matrix-2-index (1+ i) (1- j
   (and (aref mines-grid tmp-idx) (cl-incf numb
   (when (< j (1- mines-number-cols))
-(let ((tmp-idx (+ (* (1+ i) mines-number-cols) (1+ j
+(let ((tmp-idx (mines-matrix-2-index (1+ i) (1+ j
   (and (aref mines-grid tmp-idx) (cl-incf numb)
 ;; Update `mines-grid'.
 (unless (zerop numb)



[elpa] externals/mines d9241c9 08/43: Add file

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit d9241c910376bdcee83e9e5df10500d8466597ab
Author: Tino Calancha 
Commit: Tino Calancha 

Add file
---
 screenshots/screenshot-minesweeper.png | Bin 0 -> 114073 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
new file mode 100644
index 000..0058fc4
Binary files /dev/null and b/screenshots/screenshot-minesweeper.png differ



[elpa] externals/mines 735b30d 02/43: First commit

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 735b30d157b40d10d60e3fa4d0714a2fcd5a4e03
Author: Tino Calancha 
Commit: GitHub 

First commit

* mines.el:
* README.md: Add files.
---
 README.md |  27 +++
 mines.el  | 592 ++
 2 files changed, 619 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 000..1052c65
--- /dev/null
+++ b/README.md
@@ -0,0 +1,27 @@
+# Minesweeper
+Play minesweeper in Emacs
+
+This is an elisp implementation of the classical minesweeper game.
+The target is localize all hidden mines (bombs) in a rectangular board
+without detonating them.  You reveal the content of a cell with the
+command **mines-dig**.
+
+1. Cells with a bomb contain the character **x**; if you call **mines-dig**
+   in these cells then you lost the game.
+
+2. Cells without bomb at distance 1 from any cell with a mine
+   contain a number: the number of bombs at distance 1 from this cell.
+   If you reveal the content of this cell, then this number is shown.
+
+3. Cells without a bomb at distance > 1 from any bomb contain **@**.
+   If you reveal the content of this cell, then **@** is shown and
+   all adjacent cells are recursively revealed.
+
+
+If you think that an uncovered cell has a mine, you might flag it
+with **mines-flag-cell**; if you call this command again in the same
+cell the cell is unflagged.  This is useful to visualize your
+progress in the game.
+
+The game is completed once all mine-free cells are revealed, that is,
+when the only uncovered cells equals the number of hidden mines.
diff --git a/mines.el b/mines.el
new file mode 100644
index 000..10fd6c5
--- /dev/null
+++ b/mines.el
@@ -0,0 +1,592 @@
+;;; mines.el --- Minesweeper game -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017  Tino Calancha
+
+;; Author: Tino Calancha 
+;; Maintainer: Tino Calancha 
+;; Created: 2017-10-28
+;; Keywords: games
+;; Version: 1.0
+;; Package-Requires: ((emacs "24.3") (cl-lib "0.5"))
+;; url: https://github.com/calancha/Minesweeper
+
+;; This file is NOT part of GNU Emacs.
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; This is an elisp implementation of the classical minesweeper game.
+;; The target is localize all hidden mines (bombs) in a rectangular board
+;; without detonating them.  You reveal the content of a cell with the
+;; command `mines-dig'.
+;;
+;; 1. Cells with a bomb contain the character 'x'; if you call `mines-dig'
+;;in these cells then you lost the game.
+
+;; 2. Cells without bomb at distance 1 from any cell with a mine
+;;contain a number: the number of bombs at distance 1 from this cell.
+;;If you reveal the content of this cell, then this number is shown.
+;;
+;; 3. Cells without a bomb at distance > 1 from any bomb contain '@'.
+;;If you reveal the content of this cell, then '@' is shown and
+;;all adjacent cells are recursively revealed.
+;;
+;;
+;; If you think that an uncovered cell has a mine, you might flag it
+;; with `mines-flag-cell'; if you call this command again in the same
+;; cell the cell is unflagged.  This is useful to visualize your
+;; progress in the game.
+;;
+;; The game is completed once all mine-free cells are revealed, that is,
+;; when the only uncovered cells equals the number of hidden mines.
+;;
+
+;;; Code:
+
+(require 'gamegrid)
+(require 'cl-lib)
+(require 'cookie1) ; For `cookie-shuffle-vector'.
+
+
+;;; Internal variables.
+(defgroup mines nil
+  "Play minessweeper."
+  :group 'games
+  :prefix "mines-")
+
+(defcustom mines-protect-first-move t
+  "Non-nil avoid game over in the first cell revealed."
+  :type 'boolean
+  :version "27.1")
+
+(defcustom mines-mode-hook nil
+  "Hook run by mines mode."
+  :type 'hook
+  :group 'mines
+  :version "27.1")
+
+(defvar mines-uncover-cell-char ?.
+  "Char to display uncover cells.")
+
+(defvar mines-flagged-cell-char ?!
+  "Char to display flagged cells as maybe having a mine.")
+
+(defvar mines-empty-cell-char ?@
+  "Char to display a cell without mine nor numbers.")
+
+(defvar mines-empty-cell-mine ?x
+  "Char to display a cell with a mine.")
+
+(defvar mines-buffer nil "Buffer where play minesweeper.")
+(defvar mines-start-pos 2 "Initial prompt position.")
+(defvar mines-number-mines 10 "Number of mines.")
+(defvar mines-number-rows 8 "Nmber of rows.")
+(defvar 

[elpa] externals/mines 9a1a1a4 13/43: * README.md: Update file

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 9a1a1a41d64dfa444505bffda5d08eaf9f679166
Author: Tino Calancha 
Commit: Tino Calancha 

* README.md: Update file
---
 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 0b6ac9f..b1132f6 100644
--- a/README.md
+++ b/README.md
@@ -19,9 +19,9 @@ command **mines-dig**.
 
 
 If you think that an uncovered cell has a mine, you might flag it
-with **mines-flag-cell**; if you call this command again in the same
-cell the cell is unflagged.  This is useful to visualize your
-progress in the game.
+with **mines-flag-cell**: the character **!** is shown in that cell.
+If you call this command again in the same cell then unflags it.  This is
+useful to visualize your progress in the game.
 
 The game is completed once all mine-free cells are revealed, that is,
 when the only uncovered cells equals the number of hidden mines.



[elpa] externals/mines 92fb132 05/43: * Readme: Add screenshot

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 92fb132182b9a04c0c8f320b6c2954e49bf27030
Author: Tino Calancha 
Commit: Tino Calancha 

* Readme: Add screenshot
---
 README.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 1052c65..7a3ef37 100644
--- a/README.md
+++ b/README.md
@@ -25,3 +25,7 @@ progress in the game.
 
 The game is completed once all mine-free cells are revealed, that is,
 when the only uncovered cells equals the number of hidden mines.
+
+### Screenshots
+
+![ScreenShot](/screenshots/screenshot-minesweeper.png)



[elpa] externals/mines 4adcc96 10/43: * mines.el (mines-difficulty-level): Fix docstring

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 4adcc96f71ddd54931f04a0998375745c04a3c1c
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-difficulty-level): Fix docstring
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index 3a092de..8ceddd2 100644
--- a/mines.el
+++ b/mines.el
@@ -102,7 +102,7 @@
 If `easy' we have 8 columns x 8 columns and 10 mines.
 If `medium' we have 16 columns x 16 columns and 40 mines.
 If `hard' we have 30 columns x 16 columns and 99 mines.
-If `custiom' then ask user for these numbers."
+If `custom' then ask user for these numbers."
   :type '(choice (const :tag "Easy" easy)
  (const :tag "Medium" medium)
  (const :tag "Hard" hard)



[elpa] externals/mines 4da0c1d 04/43: * screenshots/screenshot-minesweeper.png: Add screenshot

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 4da0c1dd082076c178b0e5c2be02476d7e5ba8a8
Author: Tino Calancha 
Commit: Tino Calancha 

* screenshots/screenshot-minesweeper.png: Add screenshot
---
 screenshots/screenshot-minesweeper.png | Bin 0 -> 105128 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/screenshots/screenshot-minesweeper.png 
b/screenshots/screenshot-minesweeper.png
new file mode 100644
index 000..c42b290
Binary files /dev/null and b/screenshots/screenshot-minesweeper.png differ



[elpa] externals/mines 3fdc08a 03/43: * mines.el (mines-game-over): Set face correctly

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit 3fdc08a571de0c27f3e24778c719f21c3f609960
Author: Tino Calancha 
Commit: Tino Calancha 

* mines.el (mines-game-over): Set face correctly
---
 mines.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mines.el b/mines.el
index 10fd6c5..2526735 100644
--- a/mines.el
+++ b/mines.el
@@ -392,7 +392,7 @@ If `custiom' then ask user for these numbers."
 (defun mines-game-over ()
   "Offer play a new game after uncover a bomb."
   (let ((inhibit-read-only t))
-(put-text-property (point) (1+ (point)) 'face '(error fontified t))
+(put-text-property (point) (1+ (point)) 'face 'error)
 (mines--show-all)
 (if (yes-or-no-p "Game over! Play again? ")
 (mines)



[elpa] branch externals/mines created (now 97e0a05)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/mines.

at  97e0a05   * mines.el: Adjust docs for the @ => SPC change

This branch includes the following new commits:

   new  c52a0bd   Initial commit
   new  735b30d   First commit
   new  3fdc08a   * mines.el (mines-game-over): Set face correctly
   new  4da0c1d   * screenshots/screenshot-minesweeper.png: Add screenshot
   new  92fb132   * Readme: Add screenshot
   new  5ada7d3   * Readme: Add more screenshots
   new  9f7404e   Delete file
   new  d9241c9   Add file
   new  4d800e0   * mines.el (mines--insert): Display flags with a 
different face
   new  4adcc96   * mines.el (mines-difficulty-level): Fix docstring
   new  dd8b0e3   Delete screenshots
   new  1efe0e0   updated screenshots
   new  9a1a1a4   * README.md: Update file
   new  4bbe9a4   * mines.el (mines-dig): Fix update of board when touch a 
bomb at first trial
   new  5ee08ac   * mines.el (mines-mode): Initialize mode map in the body
   new  0fb75df   * mines.el (mines-set-numbers): Use mines-matrix-2-index
   new  82f1a92   Refactor code
   new  b419959   * mines.el (mines-init): Preserve board settings after 
restart game
   new  909152f   * mines.el (mines-dig): Update element at point after 
avoid gameover in 1st trial
   new  7247335   * mines.el: Assign copyright to FSF
   new  7660b39   Add test suite
   new  3de39fb   * README.md: Show build state
   new  1cf5d85   * .travis.yml: Dont test for Emacs-24.3
   new  6e7fc5c   * mines.el: Update dependency to Emacs-24.4
   new  226776a   * mines: Fix compilation warnings
   new  abc8c9d   Move game documentation into `mines-mode' docstring
   new  8eaf131   * mines.el: Bump version to 1.1
   new  7133550   * mines/mines.el (mines-mode): Move the docstring to 
where it belongs.
   new  92399df   * packages/mines/mines.el: Bump version to 1.2
   new  e127c84   Add fallback function for read-multiple-choice
   new  bf577b0   Sort the score file from better to worst results
   new  179ed77   Dont prompt user when updating the score file
   new  9b07cb6   Do not uncover flagged cells if the user dont want that
   new  34d088c   Reimplement mines-end-p
   new  868e9b9   * mines.el: Bump version to v1.6
   new  2241dcd   * mines/mines.el: Various minor changes, wave 1
   new  5920f2d   * mines/mines.el (mines-grid): Use `bomb` instead of t
   new  3308a99   * packages/mines/mines.el: Keep flag in mines-state
   new  b490060   * packages/mines/mines.el: Streamline mines--insert
   new  e090a90   * mines.el: Make sure the first move is successful
   new  f11e546   * mines.el (mines-mode-map): Add mouse bindings
   new  bea3ad8   * packages/mines/mines.el (mines-auto-flag): New custom 
var
   new  97e0a05   * mines.el: Adjust docs for the @ => SPC change




[elpa] externals/mines c52a0bd 01/43: Initial commit

2020-11-30 Thread Stefan Monnier
branch: externals/mines
commit c52a0bd2984f9a05cd39087ab415a2967636fbc9
Author: Tino Calancha 
Commit: GitHub 

Initial commit
---
 LICENSE | 674 
 1 file changed, 674 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..94a9ed0
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily 

[elpa] externals/loccur b232bc3 2/2: * packages/loccur/loccur.el: Updated to version 1.2.4

2020-11-30 Thread Stefan Monnier
branch: externals/loccur
commit b232bc34d4f684ea32ba532b1d24bcbebcc4e375
Author: Alexey Veretennikov 
Commit: Stefan Monnier 

* packages/loccur/loccur.el: Updated to version 1.2.4

- The actions to perform then the loccur-mode was disactivated
were incomplete.

- Then loccur or loccur-no-highlight are called with universal prefix,
i.e. with C-u before the command, the currently selected value is
ignored.

Then people want this behavior by default, it is better wrap the call
to loccur with universal prefix, i.e. by implementing a helper function
like this:

(defun loccur-no-selection ()
  (interactive)
(let ((current-prefix-arg 1))
(call-interactively
 'loccur)))

And then just call this function instead of loccur.
---
 loccur.el | 69 ++-
 1 file changed, 46 insertions(+), 23 deletions(-)

diff --git a/loccur.el b/loccur.el
index e4293f4..b184eb2 100644
--- a/loccur.el
+++ b/loccur.el
@@ -5,11 +5,11 @@
 ;; Author: Alexey Veretennikov 
 ;;
 ;; Created: 2009-09-08
-;; Version: 1.2.3
-;; Package-Requires: ((cl-lib "0"))
+;; Version: 1.2.4
+;; Package-Requires: ((emacs "24.3"))
 ;; Keywords: matching
 ;; URL: https://github.com/fourier/loccur
-;; Compatibility: GNU Emacs 23.x, GNU Emacs 24.x
+;; Compatibility: GNU Emacs 24.3
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -45,6 +45,24 @@
 ;;
 ;;; Change Log:
 ;;
+;; 2019-10-22 (1.2.4)
+;;+ Added fix for the issue when the actions to perform
+;;  then the loccur-mode was disactivated were incomplete.
+;;+ Then loccur or loccur-no-highlight are called with universal prefix,
+;;  i.e. with C-u before the command, the currently selected value is
+;;  ignored.
+;;  Then people want this behavior by default, it is better wrap the call
+;;  to loccur with universal prefix, i.e. by implementing a helper
+;;  function like this:
+;;
+;;  (defun loccur-no-selection ()
+;;(interactive)
+;;  (let ((current-prefix-arg 1))
+;;  (call-interactively
+;;   'loccur)))
+;;
+;;  And then just call this function instead of loccur.
+;;
 ;; 2016-12-26 (1.2.3)
 ;;+ Removed empty line in the beginning of the buffer.
 ;;+ Added 'Tips and tricks' session to the README.md file
@@ -96,6 +114,9 @@ a new window."
   :lighter " loccur"
   (if loccur-mode
   (loccur-1 loccur-current-search)
+;; remove current search and turn off loccur mode
+;; to allow to call `loccur' multiple times
+(setf loccur-current-search nil)
 (loccur-remove-overlays)
 (recenter)))
 
@@ -175,22 +196,20 @@ unhides lines again.
 
 When called interactively, either prompts the user for REGEXP or,
 when called with an active region, uses the content of the
-region."
+region, unless called with the universal prefix (C-u)"
   (interactive
(cond ((region-active-p)
   (list (buffer-substring (mark) (point
  (loccur-mode
   (list nil))
  (t
-  (list (read-string "Loccur: " (loccur-prompt) 'loccur-history)
+  (list (read-string "Loccur: "
+ (loccur-prompt)
+ 'loccur-history)
   (when (region-active-p) (deactivate-mark))
   (if (or loccur-mode
   (= (length regex) 0))
-  (progn
-;; remove current search and turn off loccur mode
-;; to allow to call `loccur' multiple times
-(setf loccur-current-search nil)
-(loccur-mode 0))
+  (loccur-mode 0)
 ;; otherwise do as usual
 ;; if the regex argument is not equal to previous search
 (when (not (string-equal regex loccur-current-search))
@@ -205,20 +224,24 @@ region."
   "Return the default value of the prompt.
 
 Default value for prompt is a current word or active region(selection),
-if its size is 1 line"
-  (let ((prompt
- (if (and transient-mark-mode
-  mark-active)
- (let ((pos1 (region-beginning))
-   (pos2 (region-end)))
-   ;; Check if the start and the end of an active region is on
-   ;; the same line
-   (when (save-excursion
-   (goto-char pos1)
-   (<= pos2 (line-end-position)))
+if its size is 1 line.
+When the universal prefix is used, i.e. loccur called
+with C-u prefix, returns empty string"
+  (if current-prefix-arg
+  ""
+(let ((prompt
+   (if (and transient-mark-mode
+mark-active)
+   (let ((pos1 (region-beginning))
+ (pos2 (region-end)))
+ ;; Check if the start and the end of an active region is on
+ ;; the same line
+ (when (save-excursion
+ (goto-char pos1)
+ (<= pos2 

[elpa] externals/loccur ca9c215 1/2: * packages/loccur/loccur.el (loccur, loccur-current): Autoload.

2020-11-30 Thread Stefan Monnier
branch: externals/loccur
commit ca9c2159f35d251a70cd03a3b2cfd3760565f3c7
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/loccur/loccur.el (loccur, loccur-current): Autoload.

Suggested by Paul .

(loccur-mode): Don't autoload any more.
---
 loccur.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/loccur.el b/loccur.el
index 2cd7bee..e4293f4 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,6 +1,6 @@
 ;;; loccur.el --- Perform an occur-like folding in current buffer -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2016 Free Software Foundation, Inc
+;; Copyright (C) 2009-2019 Free Software Foundation, Inc
 ;;
 ;; Author: Alexey Veretennikov 
 ;;
@@ -30,13 +30,12 @@
 ;;
 ;; Add the following to your .emacs file:
 ;;
-;; (require 'loccur)
-;; ;; defines shortcut for loccur of the current word
-;; (define-key global-map [(control o)] 'loccur-current)
-;; ;; defines shortcut for the interactive loccur command
-;; (define-key global-map [(control meta o)] 'loccur)
-;; ;; defines shortcut for the loccur of the previously found word
-;; (define-key global-map [(control shift o)] 'loccur-previous-match)
+;; ;; defines shortcut for loccur of the current word
+;; (define-key global-map [(control o)] 'loccur-current)
+;; ;; defines shortcut for the interactive loccur command
+;; (define-key global-map [(control meta o)] 'loccur)
+;; ;; defines shortcut for the loccur of the previously found word
+;; (define-key global-map [(control shift o)] 'loccur-previous-match)
 ;;
 ;;; Issues:
 ;; Using with smooth-scrolling.el sometimes
@@ -90,7 +89,6 @@
 map)
   "Keymap for the variable `loccur-mode'.")
 
-;;;###autoload
 (define-minor-mode loccur-mode
   "Minor mode for navigating through the file.
 Hides all lines without matches like `occur' does, but without opening
@@ -136,6 +134,7 @@ Default: t"
 (defvar-local loccur-current-search nil
   "The expression to search in the current active mode.")
 
+;;;###autoload
 (defun loccur-current ()
   "Call `loccur' for the current word."
   (interactive)
@@ -166,6 +165,7 @@ REGEX is regexp to search"
   (when (overlay-get ovl loccur-overlay-visible-property-name)
 (overlay-put ovl 'face (if loccur-highlight-matching-regexp 
'loccur-face nil))
 
+;;;###autoload
 (defun loccur (regex)
   "Perform a simple grep in current buffer.
 



[elpa] branch externals/loccur created (now b232bc3)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/loccur.

at  b232bc3   * packages/loccur/loccur.el: Updated to version 1.2.4

This branch includes the following new commits:

   new  ca9c215   * packages/loccur/loccur.el (loccur, loccur-current): 
Autoload.
   new  b232bc3   * packages/loccur/loccur.el: Updated to version 1.2.4




[elpa] branch externals/loc-changes created (now 4d1dcdf)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/loc-changes.

at  4d1dcdf   Remove autoloads and "postion" -> "line-number" ...

No new revisions were added by this update.



[elpa] externals/load-relative 5bd5632 1/6: * packages/load-relative/load-relative.el (__FILE__): bytecomp-filename problem.

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit 5bd56327669678c4d40018c633298a4602acf0ba
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/load-relative/load-relative.el (__FILE__): bytecomp-filename 
problem.
Fix other details mentioned by `checkdoc-current-buffer'.
---
 ChangeLog|  7 ++-
 load-relative.el | 38 --
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5f20404..ff5aa1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-26  Stefan Monnier  
+
+   * load-relative.el (__FILE__): Mention the bytecomp-filename problem.
+   Fix other details mentioned by `checkdoc-current-buffer'.
+
 2010-09-30  rocky 
 
* .gitignore: git Administrivia.
@@ -9,7 +14,7 @@
 
 2010-09-30  rocky 
 
-   * .gitignore, COPYING, Makefile.am, README, configure.ac: 
+   * .gitignore, COPYING, Makefile.am, README, configure.ac:
Administrivia. Add COPYING, update README and .gitignore, bump
version number.
 
diff --git a/load-relative.el b/load-relative.el
index fe01cb3..dccd3d7 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -26,12 +26,12 @@
 
 ;; Here we provide functions which facilitate writing multi-file Emacs
 ;; packages and facilitate running from the source tree without having
-;; to "install" code or fiddle with evil `load-path'. See
+;; to "install" code or fiddle with evil `load-path'.  See
 ;; https://github.com/rocky/emacs-load-relative/wiki/NYC-Lisp-talk for
 ;; the the rationale behind this.
 ;;
 ;; The functions we add are relative versions of `load', `require' and
-;; `find-file-no-select' and versions which take list arguments. We also add a
+;; `find-file-no-select' and versions which take list arguments.  We also add a
 ;; `__FILE__' function and a `provide-me' macro.
 
 ;; The latest version of this code is at:
@@ -39,13 +39,13 @@
 
 ;; `__FILE__' returns the file name that that the calling program is
 ;; running.  If you are `eval''ing a buffer then the file name of that
-;; buffer is used. The name was selected to be analogous to the name
+;; buffer is used.  The name was selected to be analogous to the name
 ;; used in C, Perl, Python, and Ruby.
 
 ;; `load-relative' loads an Emacs Lisp file relative to another
-;; (presumably currently running) Emacs Lisp file. For example suppose
+;; (presumably currently running) Emacs Lisp file.  For example suppose
 ;; you have Emacs Lisp files "foo.el" and "bar.el" in the same
-;; directory. To load "bar.el" from inside Emacs lisp file "foo.el":
+;; directory.  To load "bar.el" from inside Emacs Lisp file "foo.el":
 ;;
 ;; (require 'load-relative)
 ;; (load-relative "baz")
@@ -70,7 +70,7 @@
 ;; `load_relative'.
 ;;
 ;; Use `require-relative-list' when you have a list of files you want
-;; to `require'. To `require-relative' them all in one shot:
+;; to `require'.  To `require-relative' them all in one shot:
 ;;
 ;; (require-relative-list '("dbgr-init" "dbgr-fringe"))
 ;;
@@ -83,9 +83,9 @@
 ;; the filename, but I consider that a good thing.
 ;;
 ;; The function `find-file-noselect-relative' provides a way of accessing
-;; resources which are located relative to the currently running Emacs lisp
-;; file. This is probably most useful when running Emacs as a scripting engine
-;; for batch processing or with tests cases. For example, this form will find
+;; resources which are located relative to the currently running Emacs Lisp
+;; file.  This is probably most useful when running Emacs as a scripting engine
+;; for batch processing or with tests cases.  For example, this form will find
 ;; the README file for this package.
 ;;
 ;; (find-file-noselect-relative "README.md")
@@ -109,9 +109,9 @@
   "Return the string name of file/buffer that is currently begin executed.
 
 The first approach for getting this information is perhaps the
-most pervasive and reliable. But it the most low-level and not
+most pervasive and reliable.  But it the most low-level and not
 part of a public API, so it might change in future
-implementations. This method uses the name that is recorded by
+implementations.  This method uses the name that is recorded by
 readevalloop of `lread.c' as the car of variable
 `current-load-list'.
 
@@ -157,6 +157,7 @@ methods work we will use the file-name value find via
;; When byte compiling. FIXME: use a more thorough precondition like
;; byte-compile-file is somehwere in the backtrace or that
;; bytecomp-filename comes from that routine?
+   ;; FIXME: `bytecomp-filename' doesn't exist any more (since Emacs-24.1).
((boundp 'bytecomp-filename) bytecomp-filename)
 
(t (symbol-file symbol) ;; last resort
@@ -169,7 +170,7 @@ methods work we will use the file-name value find via
 the process of being loaded or eval'd.
 
 
-Define FUNCTION to autoload from FILE. FUNCTION is a symbol.
+Define FUNCTION to autoload from FILE.  FUNCTION is a symbol.
 
 FILE is a string to 

[elpa] externals/load-relative a674f65 3/6: Add how to configure/test from emacs..

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit a674f657d9f194b6c7f7e37ec62312edfaf33481
Author: rocky 
Commit: Stefan Monnier 

Add how to configure/test from emacs..

update copyright
---
 README.md| 3 ---
 autogen.sh   | 6 ++
 load-relative.el | 8 +++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index c250d4e..36afb3b 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,3 @@
-[![Build 
Status](https://travis-ci.org/rocky/emacs-load-relative.png)](https://travis-ci.org/rocky/emacs-load-relative)
-
 # Emacs multi-file develop/run-from-of-source routines
 
 The rational behind module is to be able to write small Emacs
@@ -133,4 +131,3 @@ relative file.
(with-relative-file "README.md"
  (buffer-substring))
 ```
- 
diff --git a/autogen.sh b/autogen.sh
index 8a72837..fce38da 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,10 @@
 #!/bin/sh
+# An autoconf setup script.
+# From inside emacs, make sure test-simple is installed and then
+# Press C-x C-e at the end of the next line run this script
+# (test-simple-run "EMACSLOADPATH=%s ./autogen.sh"  (mapconcat 'identity 
load-path ":"))
+ln -fs README.md README
+touch common.mk
 autoreconf -vi && \
 autoconf && {
   echo "Running configure with --enable-maintainer-mode $@"
diff --git a/load-relative.el b/load-relative.el
index dccd3d7..c0fe46c 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/rocky/emacs-load-relative
 ;; Compatibility: GNU Emacs 23.x
 
-;; Copyright (C) 2015, 2016 Free Software Foundation, Inc
+;; Copyright (C) 2015, 2016, 2017 Free Software Foundation, Inc
 
 ;; This program is free software: you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -104,6 +104,12 @@
 
 ;;; Code:
 
+;; Press C-x C-e at the end of the next line configure the program in
+;; for building via "make" to get set up.
+;; (compile (format "EMACSLOADPATH=:%s ./autogen.sh" "."))
+;; After that you can run:
+;; (compile "make check")
+
 ;;;###autoload
 (defun __FILE__ ( symbol)
   "Return the string name of file/buffer that is currently begin executed.



[elpa] externals/load-relative 184df86 4/6: Bump version ..

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit 184df8649e069741347ab36fd78700560cdfdefb
Author: rocky 
Commit: Stefan Monnier 

Bump version ..

and small doc type
---
 load-relative.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/load-relative.el b/load-relative.el
index c0fe46c..a7aab4c 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -1,7 +1,7 @@
 ;;; load-relative.el --- relative file load (within a multi-file Emacs package)
 
 ;; Author: Rocky Bernstein 
-;; Version: 1.2
+;; Version: 1.3
 ;; Keywords: internal
 ;; URL: http://github.com/rocky/emacs-load-relative
 ;; Compatibility: GNU Emacs 23.x
@@ -104,7 +104,7 @@
 
 ;;; Code:
 
-;; Press C-x C-e at the end of the next line configure the program in
+;; Press C-x C-e at the end of the next line configure the program in GNU emacs
 ;; for building via "make" to get set up.
 ;; (compile (format "EMACSLOADPATH=:%s ./autogen.sh" "."))
 ;; After that you can run:



[elpa] externals/load-relative 1a4da93 6/6: Some small lint-like things.

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit 1a4da9350ff052adc7e20fd8975e6022ada407bd
Author: rocky 
Commit: Stefan Monnier 

Some small lint-like things.

Sync version numbers in confifure.ac and load-relative.el
Try lexical binding (when available).
Thank Stefan.
---
 THANKS   |  1 +
 configure.ac |  8 +---
 load-relative.el | 14 +++---
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/THANKS b/THANKS
index f74a3ef..60303e8 100644
--- a/THANKS
+++ b/THANKS
@@ -1,2 +1,3 @@
 Phil Lord - Contribute find-file-noselect-relative, and with-relative-file
 Lars Anderson - Melapa packaging, among other things
+Stefan Monnier  - Elisp guidance
diff --git a/configure.ac b/configure.ac
index b37b817..489f120 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,15 @@
-AC_INIT(emacs-load-relative, 1.2,)
+AC_INIT(emacs-load-relative, 1.3.1,)
 AC_CONFIG_SRCDIR(load-relative.el)
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
 AM_MAINTAINER_MODE
 AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir)
 
 AC_PATH_PROG(EMACS, emacs, no)
+AC_ARG_WITH(emacs, AC_HELP_STRING([--with-emacs],
+  [location of emacs program]), EMACS=$withval)
 if test x$EMACS != xno ; then
   $EMACS -batch -q -no-site-file -eval \
-  '(if (<= emacs-major-version 22)
+  '(if (< emacs-major-version 23)
  (progn
(error "You need GNU Emacs 23 or better for this package.")
(kill-emacs 1)
diff --git a/load-relative.el b/load-relative.el
index 4397f82..e1a7bfe 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -1,7 +1,7 @@
-;;; load-relative.el --- relative file load (within a multi-file Emacs package)
+;;; load-relative.el --- Relative file load (within a multi-file Emacs 
package) -*- lexical-binding: t -*-
 
 ;; Author: Rocky Bernstein 
-;; Version: 1.3
+;; Version: 1.3.1
 ;; Keywords: internal
 ;; URL: http://github.com/rocky/emacs-load-relative
 ;; Compatibility: GNU Emacs 23.x
@@ -122,9 +122,9 @@ readevalloop of `lread.c' as the car of variable
 `current-load-list'.
 
 Failing that, we use `load-file-name' which should work in some
-subset of the same places that the first method works. However
-`load-file-name' will be nil for code that is eval'd. To cover
-those cases, we try `buffer-file-name' which is initially
+subset of the same places that the first method works.  However
+`load-file-name' will be nil for code that is eval'd.  To cover
+those cases, we try function `buffer-file-name' which is initially
 correct, for eval'd code, but will change and may be wrong if the
 code sets or switches buffers after the initial execution.
 
@@ -173,8 +173,8 @@ methods work we will use the file-name value find via
   file  docstring interactive type
   symbol)
   ;; FIXME: Docstring talks of FUNCTION but argname is `function-or-list'.
-  "Autoload an Emacs Lisp file relative to Emacs Lisp code that is in
-the process of being loaded or eval'd.
+  "Autoload an Emacs Lisp file relative to Emacs Lisp code that is in the 
process
+of being loaded or eval'd.
 
 
 Define FUNCTION to autoload from FILE.  FUNCTION is a symbol.



[elpa] branch externals/load-relative created (now 1a4da93)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/load-relative.

at  1a4da93   Some small lint-like things.

This branch includes the following new commits:

   new  5bd5632   * packages/load-relative/load-relative.el (__FILE__): 
bytecomp-filename problem. Fix other details mentioned by 
`checkdoc-current-buffer'.
   new  6f9f93e   * test/subdir/test-require-list-from-subdir.el: Don't 
byte-compile
   new  a674f65   Add how to configure/test from emacs..
   new  184df86   Bump version ..
   new  a4e90b6   * load-relative.el (require-relative-list): Don't 
spuriously require `cl`.
   new  1a4da93   Some small lint-like things.




[elpa] externals/load-relative 6f9f93e 2/6: * test/subdir/test-require-list-from-subdir.el: Don't byte-compile

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit 6f9f93eece0831a5551350e739b72ce5c4532c79
Author: Stefan Monnier 
Commit: Stefan Monnier 

* test/subdir/test-require-list-from-subdir.el: Don't byte-compile
---
 test/subdir/test-require-list-from-subdir.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/subdir/test-require-list-from-subdir.el 
b/test/subdir/test-require-list-from-subdir.el
index 880b4f3..cf4a91f 100644
--- a/test/subdir/test-require-list-from-subdir.el
+++ b/test/subdir/test-require-list-from-subdir.el
@@ -1,4 +1,6 @@
-;; Copyright (C) 2015 Free Software Foundation, Inc
+;; Can't find the "test-unit" package, so: -*- no-byte-compile:t -*-
+
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein 
 



[elpa] externals/load-relative a4e90b6 5/6: * load-relative.el (require-relative-list): Don't spuriously require `cl`.

2020-11-30 Thread Stefan Monnier
branch: externals/load-relative
commit a4e90b6c8fb8a8393182e83b306c3211a296757a
Author: Stefan Monnier 
Commit: Stefan Monnier 

* load-relative.el (require-relative-list): Don't spuriously require `cl`.

Use `eval-and-compile` to simplify the code.
(autoload-relative): Use `mapc` since we don't care about the return value.
---
 load-relative.el | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/load-relative.el b/load-relative.el
index a7aab4c..4397f82 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/rocky/emacs-load-relative
 ;; Compatibility: GNU Emacs 23.x
 
-;; Copyright (C) 2015, 2016, 2017 Free Software Foundation, Inc
+;; Copyright (C) 2015-2019 Free Software Foundation, Inc
 
 ;; This program is free software: you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -172,6 +172,7 @@ methods work we will use the file-name value find via
 (defun autoload-relative (function-or-list
   file  docstring interactive type
   symbol)
+  ;; FIXME: Docstring talks of FUNCTION but argname is `function-or-list'.
   "Autoload an Emacs Lisp file relative to Emacs Lisp code that is in
 the process of being loaded or eval'd.
 
@@ -182,7 +183,7 @@ FILE is a string to pass to `load'.
 
 DOCSTRING is documentation for the function.
 
-INTERACATIVE if non-nil says function can be called
+INTERACTIVE if non-nil says function can be called
 interactively.
 
 TYPE indicates the type of the object: nil or omitted says
@@ -197,10 +198,14 @@ defined (as given by `symbol-file' is used if other 
methods of
 finding __FILE__ don't work."
 
   (if (listp function-or-list)
-  (mapcar (lambda(function)
-(autoload function-or-list
-  (relative-expand-file-name file symbol)
-  docstring interactive type))
+  ;; FIXME: This looks broken:
+  ;; - Shouldn't it iterate on `function-or-list' instead of `file'?
+  ;; - Shouldn't the `autoload' take `function' rather than
+  ;;   `function-or-list' as argument?
+  (mapc (lambda(_function)
+  (autoload function-or-list
+(relative-expand-file-name file symbol)
+docstring interactive type))
   file)
 (autoload function-or-list (relative-expand-file-name file symbol)
   docstring interactive type))
@@ -283,11 +288,7 @@ buffer-setting or buffer changing operations."
 (defmacro require-relative-list (list  opt-prefix)
   "Run `require-relative' on each name in LIST which should be a list of
 strings, each string being the relative name of file you want to run."
-  `(progn
- (eval-when-compile
-   (require 'cl
-(dolist (rel-file ,list)
-  (require-relative rel-file (__FILE__) ,opt-prefix
+  `(eval-and-compile
  (dolist (rel-file ,list)
(require-relative rel-file (__FILE__) ,opt-prefix
 



[elpa] branch externals/hydra created (now 4532f40)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/hydra.

at  4532f40   Fix some quoting problems in doc strings

This branch includes the following new commits:

   new  c554597   * packages/gnome-c-style/gnome-c-tests.el: Add copyright 
blurb
   new  4532f40   Fix some quoting problems in doc strings




[elpa] externals/hydra c554597 1/2: * packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb

2020-11-30 Thread Stefan Monnier
branch: externals/hydra
commit c554597c3bfbbaf88eec34c82c8ddb2cdb96a35a
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb
---
 hydra.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hydra.el b/hydra.el
index e3b3703..c837e0f 100644
--- a/hydra.el
+++ b/hydra.el
@@ -1377,6 +1377,8 @@ DOC defaults to TOGGLE-NAME split and capitalized."
0
  i)
 
+(require 'ring)
+
 (defvar hydra-pause-ring (make-ring 10)
   "Ring for paused hydras.")
 



[elpa] externals/hydra 4532f40 2/2: Fix some quoting problems in doc strings

2020-11-30 Thread Stefan Monnier
branch: externals/hydra
commit 4532f40ae40665f1e4faea3dda5e51486f08aeb5
Author: Paul Eggert 
Commit: Stefan Monnier 

Fix some quoting problems in doc strings

Most of these are minor issues involving, e.g., quoting `like this'
instead of 'like this'.  A few involve escaping ` and ' with a
preceding \= when the characters should not be turned into curved single
quotes.
---
 hydra-test.el | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/hydra-test.el b/hydra-test.el
index ffbfa24..4618d6b 100644
--- a/hydra-test.el
+++ b/hydra-test.el
@@ -327,7 +327,7 @@ The body can be accessed via `hydra-error/body'."
 \"t\":`toggle-truncate-lines',
 \"f\":`auto-fill-mode',
 \"a\":`abbrev-mode',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-toggle/body'.
 
@@ -349,7 +349,7 @@ Call the head: `toggle-truncate-lines'."
 \"t\":`toggle-truncate-lines',
 \"f\":`auto-fill-mode',
 \"a\":`abbrev-mode',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-toggle/body'.
 
@@ -370,7 +370,7 @@ Call the head: `auto-fill-mode'."
 \"t\":`toggle-truncate-lines',
 \"f\":`auto-fill-mode',
 \"a\":`abbrev-mode',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-toggle/body'.
 
@@ -391,11 +391,11 @@ Call the head: `abbrev-mode'."
 \"t\":`toggle-truncate-lines',
 \"f\":`auto-fill-mode',
 \"a\":`abbrev-mode',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-toggle/body'.
 
-Call the head: `nil'."
+Call the head: nil."
 (interactive)
 (hydra-default-pre)
 (hydra-keyboard-quit)
@@ -407,7 +407,7 @@ Call the head: `nil'."
 \"t\":`toggle-truncate-lines',
 \"f\":`auto-fill-mode',
 \"a\":`abbrev-mode',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-toggle/body'."
 (interactive)
@@ -498,7 +498,7 @@ The body can be accessed via `hydra-toggle/body'."
 
 \"j\":`next-line',
 \"k\":`previous-line',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-vi/body'.
 
@@ -534,7 +534,7 @@ Call the head: `next-line'."
 
 \"j\":`next-line',
 \"k\":`previous-line',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-vi/body'.
 
@@ -570,11 +570,11 @@ Call the head: `previous-line'."
 
 \"j\":`next-line',
 \"k\":`previous-line',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-vi/body'.
 
-Call the head: `nil'."
+Call the head: nil."
 (interactive)
 (hydra-default-pre)
 (set-cursor-color "#e52b50")
@@ -586,7 +586,7 @@ Call the head: `nil'."
 
 \"j\":`next-line',
 \"k\":`previous-line',
-\"q\":`nil'
+\"q\":nil
 
 The body can be accessed via `hydra-vi/body'."
 (interactive)



[elpa] branch externals/company-statistics created (now e62157d)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/company-statistics.

at  e62157d   Bump version

No new revisions were added by this update.



[elpa] branch externals/beacon created (now 729338b)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/beacon.

at  729338b   Fix off-by-1 error causing the beacon to wrap lines

No new revisions were added by this update.



[elpa] externals/avy 16ba742 1/5: Fix some quoting problems in doc strings

2020-11-30 Thread Stefan Monnier
branch: externals/avy
commit 16ba74229903aff719c8e442293035abdaaf6a50
Author: Paul Eggert 
Commit: Stefan Monnier 

Fix some quoting problems in doc strings

Most of these are minor issues involving, e.g., quoting `like this'
instead of 'like this'.  A few involve escaping ` and ' with a
preceding \= when the characters should not be turned into curved single
quotes.
---
 avy.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/avy.el b/avy.el
index 25d89e9..8b258da 100644
--- a/avy.el
+++ b/avy.el
@@ -225,10 +225,10 @@ pressed during the dispatch, ACTION is set to replace the 
default
   :type 'boolean)
 
 (defcustom avy-word-punc-regexp "[!-/:-@[-`{-~]"
-  "Regexp of punctuation chars that count as word starts for `avy-goto-word-1.
+  "Regexp of punctuation chars that count as word starts for `avy-goto-word-1'.
 When nil, punctuation chars will not be matched.
 
-\"[!-/:-@[-`{-~]\" will match all printable punctuation chars."
+\"[!-/:-@[-\\=`{-~]\" will match all printable punctuation chars."
   :type 'regexp)
 
 (defcustom avy-goto-word-0-regexp "\\b\\sw"
@@ -902,14 +902,14 @@ multiple OVERLAY-FN invocations."
 (null (assoc invisible buffer-invisibility-spec)
 
 (defun avy--next-visible-point ()
-  "Return the next closest point without 'invisible property."
+  "Return the next closest point without `invisible' property."
   (let ((s (point)))
 (while (and (not (= (point-max) (setq s (next-char-property-change s
 (not (avy--visible-p s
 s))
 
 (defun avy--next-invisible-point ()
-  "Return the next closest point with 'invisible property."
+  "Return the next closest point with `invisible' property."
   (let ((s (point)))
 (while (and (not (= (point-max) (setq s (next-char-property-change s
 (avy--visible-p s)))



[elpa] externals/avy c4adda8 5/5: * avy/targets/checkdoc.el, ivy/doc/scripts.el: copyright tweak

2020-11-30 Thread Stefan Monnier
branch: externals/avy
commit c4adda8ca5d43d5d31e0a680b294fd292331800c
Author: Stefan Monnier 
Commit: Stefan Monnier 

* avy/targets/checkdoc.el, ivy/doc/scripts.el: copyright tweak
---
 targets/checkdoc.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/targets/checkdoc.el b/targets/checkdoc.el
index be3823b..eb2e9f6 100644
--- a/targets/checkdoc.el
+++ b/targets/checkdoc.el
@@ -1,2 +1,4 @@
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
 (checkdoc-file "avy-test.el")
 (checkdoc-file "avy.el")



[elpa] externals/avy 6cbbf1e 3/5: .dir-locals.el: Enforce sentence-end-double-space

2020-11-30 Thread Stefan Monnier
branch: externals/avy
commit 6cbbf1e41d61fef19ac2e418e0ea688a15bb7c02
Author: Basil L. Contovounesios 
Commit: Stefan Monnier 

.dir-locals.el: Enforce sentence-end-double-space

Make the existing convention official.

Fixes #1291
---
 .dir-locals.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index acba84e..e82741b 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -3,4 +3,5 @@
 
 ((emacs-lisp-mode
   (indent-tabs-mode . nil)
-  (outline-regexp . ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|(")))
+  (outline-regexp . ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|(")
+  (sentence-end-double-space . t)))



[elpa] externals/avy ecb9e4b 2/5: Set `outline-regexp' directory local

2020-11-30 Thread Stefan Monnier
branch: externals/avy
commit ecb9e4b0ae5e3014f69f5945ad7a57e21feec50b
Author: Jonas Bernoulli 
Commit: Stefan Monnier 

Set `outline-regexp' directory local
---
 .dir-locals.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 3bcda92..acba84e 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -2,4 +2,5 @@
 ;;; For more information see (info "(emacs) Directory Variables")
 
 ((emacs-lisp-mode
-  (indent-tabs-mode . nil)))
+  (indent-tabs-mode . nil)
+  (outline-regexp . ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|(")))



[elpa] externals/avy 6537ba3 4/5: .dir-locals.el: Suggest common-lisp-indent-function

2020-11-30 Thread Stefan Monnier
branch: externals/avy
commit 6537ba305c4071b26c0994ac733c7ac10a36cd3a
Author: Oleh Krehel 
Commit: Stefan Monnier 

.dir-locals.el: Suggest common-lisp-indent-function

Don't want to put it directly because Emacs complains it's risky.

Re #1290
---
 .dir-locals.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index e82741b..8b24b64 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -4,4 +4,6 @@
 ((emacs-lisp-mode
   (indent-tabs-mode . nil)
   (outline-regexp . ";;\\([;*]+ [^\s\t\n]\\|###autoload\\)\\|(")
-  (sentence-end-double-space . t)))
+  (sentence-end-double-space . t)
+  ;; (lisp-indent-function . common-lisp-indent-function)
+  ))



[elpa] branch externals/avy created (now c4adda8)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/avy.

at  c4adda8   * avy/targets/checkdoc.el, ivy/doc/scripts.el: copyright 
tweak

This branch includes the following new commits:

   new  16ba742   Fix some quoting problems in doc strings
   new  ecb9e4b   Set `outline-regexp' directory local
   new  6cbbf1e   .dir-locals.el: Enforce sentence-end-double-space
   new  6537ba3   .dir-locals.el: Suggest common-lisp-indent-function
   new  c4adda8   * avy/targets/checkdoc.el, ivy/doc/scripts.el: copyright 
tweak




[elpa] branch externals/ahungry-theme created (now a038d91)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/ahungry-theme.

at  a038d91   Add link colors, don't use bold on rainbow-delim/block

No new revisions were added by this update.



[elpa] branch externals/ace-window created (now 97a2f93)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/ace-window.

at  97a2f93   Small changes to README

No new revisions were added by this update.



[elpa] externals/ada-mode e4a40ea 28/48: Warn about transfer.fsckObjects

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit e4a40ea3947a599e589a273a56c444938f875c4b
Author: Paul Eggert 
Commit: Paul Eggert 

Warn about transfer.fsckObjects
---
 ada-mode.texi | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ada-mode.texi b/ada-mode.texi
index 05e6e77..b6ca48f 100755
--- a/ada-mode.texi
+++ b/ada-mode.texi
@@ -2254,16 +2254,19 @@ Gnu ELPA via git:
 
 @example
 cd /Projects
-git clone git://git.savannah.gnu.org/emacs/elpa.git
+git -c fetch.fsckObjects=false clone git://git.savannah.gnu.org/emacs/elpa.git
 @end example
 
 If you have an Emacs Savannah developer account, you can use:
 
 @example
 cd /Projects
-git clone @@git.savannah.gnu.org/emacs/elpa.git
+git -c fetch.fsckObjects=false clone 
@@git.savannah.gnu.org/emacs/elpa.git
 @end example
 
+The @samp{fetch.fsckObjects} setting works around a
+@url{https://debbugs.gnu.org/22690, glitch in the ELPA repository}.
+
 @file{build/Makefile} contains targets for copying Ada mode source to
 the elpa workspace, and for building the elpa archive there.
 



[elpa] externals/ada-mode 6d77bd0 19/48: * packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 6d77bd0afba198cd19f394f1b2d95db52329b98c
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb
---
 ada-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ada-mode.el b/ada-mode.el
index 3fca118..8fb112a 100644
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -2598,8 +2598,8 @@ If POSTFIX and JUSTIFY are non-nil, 
`ada-fill-comment-postfix' is appended
 to each line filled and justified.
 The paragraph is indented on the first line."
   (interactive "P")
-  (if (and (not (ada-in-comment-p))
-  (not (looking-at "[ \t]*--")))
+  (if (not (or (ada-in-comment-p)
+   (looking-at "[ \t]*--")))
   (error "Not inside comment"))
 
   ;; fill-region-as-paragraph leaves comment text exposed (without



[elpa] externals/ada-mode 04ed297 29/48: * packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs hack-local-variables

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 04ed297fa24b82182ad7c98f12fc72cfbd33e002
Author: Stephen Leake 
Commit: Stephen Leake 

* packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs hack-local-variables
---
 ada-mode.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ada-mode.el b/ada-mode.el
index efd2c4f..5e86e14 100755
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -1,12 +1,12 @@
 ;;; ada-mode.el --- major-mode for editing Ada sources  -*- lexical-binding:t 
-*-
 ;;
-;; Copyright (C) 1994, 1995, 1997 - 2017  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1997 - 2018  Free Software Foundation, Inc.
 ;;
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
 ;; Keywords: languages
 ;;  ada
-;; Version: 5.3.1
+;; Version: 5.3.2
 ;; package-requires: ((wisi "1.1.6") (cl-lib "0.4") (emacs "24.3"))
 ;; url: http://www.nongnu.org/ada-mode/
 ;;
@@ -2933,7 +2933,11 @@ The paragraph is indented on the first line."
 
   (when (< emacs-major-version 25) (syntax-propertize (point-max)))
 
-  (add-hook 'hack-local-variables-hook 'ada-mode-post-local-vars nil t)
+  (if (<= emacs-major-version 25)
+  ;; run-mode-hooks does _not_ call hack-local-variables
+  (add-hook 'hack-local-variables-hook 'ada-mode-post-local-vars nil t)
+;; >= 26; run-mode-hooks _does_ call hack-local-variables
+(ada-mode-post-local-vars))
   )
 
 (defun ada-mode-post-local-vars ()



[elpa] externals/ada-mode a3be258 27/48: Release Ada mode 5.3.1, wisi 1.1.6

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit a3be25872848f7a96a216a5676b5693430429728
Author: Stephen Leake 
Commit: Stephen Leake 

Release Ada mode 5.3.1, wisi 1.1.6

* packages/ada-mode/*: Release Ada mode 5.3.1.

* packages/ada-mode/ada_mode_gps_indent.gpr: Rename to
ada_mode_gps_indent.gpr.gp; generate .gpr via gnatprep.

* packages/ada-mode/build.sh: New file.

* packages/wisi/parse_table-mode.el: New file.

* packages/wisi/wisi.el: Release wisi 1.1.6.
---
 NEWS   |  35 +
 README |   2 +-
 ada-gnat-compile.el|  50 ---
 ada-gnat-xref.el   |   6 +-
 ada-mode.el| 109 ++
 ada-mode.info  | 165 -
 ada-mode.texi  |  97 +++-
 ada-skel.el|   2 +-
 ada-wisi.el|  15 +-
 ...de_gps_indent.gpr => ada_mode_gps_indent.gpr.gp |   5 +-
 build.sh   |  24 +++
 gnat-core.el   |  16 +-
 gpr-mode.info  |   2 +-
 gpr_query-process_refresh.adb.gp   |   2 +-
 gpr_query.gpr.gp   |   2 +-
 15 files changed, 369 insertions(+), 163 deletions(-)

diff --git a/NEWS b/NEWS
index e9f0990..fea6ed8 100755
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,41 @@
 GNU Emacs Ada mode NEWS -- history of user-visible changes.
 
 
+* Ada mode 5.3.1
+3 Oct 2017
+
+** Ada mode 5.2.2 should have been numbered 5.3.0, since it introduced
+   the GPS indentation backend major feature.
+
+** GNAT GPL 2017 is supported for gpr_query and ada_mode_gps_indent;
+   see ada_mode.info for installation instructions.
+
+** New Ada-mode submenu "Select Project" lists all loaded Ada-mode
+   project, making it easier to switch between them.
+
+** New Ada-mode menu entry "Delete project..." allows deleting a
+   loaded project, to reduce clutter in the new "Select Project"
+   menu.
+
+** `ada-add-log-for-current-function' (for a revision control commit)
+   will return a type name. However, `ada-which-function' will not.
+
+** New option `ada-fill-comment-adaptive', if non-nil, causes all
+   comments to be filled to the same width, rather than to the same
+   column. This looks better in deeply nested code.
+
+** When 'ada-auto-case' is nil, 'ada-case-adjust-at-point' used to do
+   nothing; it now capitalizes the word at point. This helps with some
+   alternate casing styles.
+
+** Improve handling of GPR_PROJECT_PATH in 'compilation-environment'
+   when selecting/deselection ada-mode project files.
+
+** ada-gnat-xref-all (used by ada-show-references) now preserves point
+   when appending more references.
+
+** Minor bug fixes.
+
 * Ada mode 5.2.2
 9 Jul 2017
 
diff --git a/README b/README
index fee5577..4568a1b 100755
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Emacs Ada mode version 5.2.2
+Emacs Ada mode version 5.3.1
 
 Ada mode provides auto-casing, fontification, navigation, and
 indentation for Ada source code files.
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
index 87833a8..93338b3 100755
--- a/ada-gnat-compile.el
+++ b/ada-gnat-compile.el
@@ -306,20 +306,6 @@ Prompt user if more than one."
   t)
 
  strings
- ((looking-at "package \"Ada\" is hidden")
-  (pop-to-buffer source-buffer)
-  (forward-word -1)
-  (insert "Standard.")
-  t)
-
- ((looking-at (concat "\\(?:possible \\)?misspelling of " 
ada-gnat-quoted-name-regexp))
-  (let ((expected-name (match-string 1)))
-(pop-to-buffer source-buffer)
-(looking-at ada-name-regexp)
-(delete-region (match-beginning 1) (match-end 1))
-(insert expected-name))
-  t)
-
  ((looking-at (concat "\"end " ada-name-regexp ";\" expected"))
   (let ((expected-name (match-string 1)))
 (pop-to-buffer source-buffer)
@@ -358,6 +344,11 @@ Prompt user if more than one."
   (forward-line 1)
   (move-to-column message-column)
   (cond
+   ((looking-at "found procedure name")
+(pop-to-buffer source-buffer)
+(forward-word 1)
+(insert "'Access")
+t)
((looking-at "found type access")
 (pop-to-buffer source-buffer)
 (if (looking-at "'Access")
@@ -401,6 +392,14 @@ Prompt user if more than one."
 (insert (concat stuff)));; if missing ")", don't need space; 
otherwise do?
   t)
 
+ ((looking-at (concat "\\(?:possible \\)?misspelling of " 
ada-gnat-quoted-name-regexp))
+  (let ((expected-name (match-string 1)))
+(pop-to-buffer source-buffer)
+

[elpa] externals/ada-mode f292e14 20/48: fix executable bits

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit f292e1423120babef8329c87d0c7197baf949538
Author: Stephen Leake 
Commit: Stephen Leake 

fix executable bits
---
 NEWS   | 0
 ada-ref-man.el | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
old mode 100755
new mode 100644
diff --git a/ada-ref-man.el b/ada-ref-man.el
old mode 100755
new mode 100644



[elpa] externals/ada-mode b27dd06 17/48: * ada-mode: Use lexical-binding since it requires Emacs-24.2 anyway

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit b27dd06f9e4f8f3a10ae45ca78ea800b5a5af855
Author: Stefan Monnier 
Commit: Stefan Monnier 

* ada-mode: Use lexical-binding since it requires Emacs-24.2 anyway

* ada-mode/ada-mode-compat-23.4.el: Remove.
* ada-mode/ada-build.el: Remove redundant :group arg on defcustoms.
* ada-mode/ada-gnat-compile.el (ada-gnat-fix-error): Remove unused vars
`ident', `type', and `param'.
* ada-mode/ada-gnat-xref.el (ada-gnat-xref-other): Remove unused var 
`status'.
(ada-gnat-xref-parents): Remove unused vars `found-file', `found-line',
and `found-col'.
(ada-gnat-xref-all): Rename (dynbound) mode-name to (lexbound) mode.
* ada-mode/ada-indent-user-options.el: Remove redundant :group arg
on defcustoms.
* ada-mode/ada-mode.el: Remove redundant :group arg on defcustoms.
(ada-case-exception-file, ada-case-keyword): Comment-out dangerous :safep.
(ada-language-version): Remove redundant calls to 
make-variable-buffer-local.
(ada-prj-current-file): Declare.
(ada-identifier-at-point): Remove unused var `identifier'.
* ada-mode/gnat-core.el (ada-gnat-ada-name-from-file-name):
Remove unused var `status'.
---
 ada-build.el   | 21 ---
 ada-fix-error.el   |  2 +-
 ada-gnat-compile.el| 14 +++
 ada-gnat-xref.el   | 11 ++
 ada-grammar-wy.el  |  4 +-
 ada-imenu.el   |  6 +--
 ada-indent-user-options.el | 34 ++---
 ada-mode-compat-23.4.el| 41 
 ada-mode-compat-24.2.el|  4 +-
 ada-mode.el| 93 +-
 ada-prj.el |  2 +-
 ada-ref-man.el |  4 +-
 ada-skel.el|  6 +--
 ada-stmt.el|  2 +-
 ada-wisi-opentoken.el  |  4 +-
 ada-wisi.el|  2 +-
 ada-xref.el|  2 +-
 gnat-core.el   |  7 ++--
 gnat-inspect.el| 11 +++---
 gpr-grammar-wy.el  |  4 +-
 gpr-mode.el|  4 +-
 gpr-query.el   | 11 +++---
 gpr-skel.el| 14 +++
 gpr-wisi.el|  4 +-
 24 files changed, 116 insertions(+), 191 deletions(-)

diff --git a/ada-build.el b/ada-build.el
index 6166836..c54cae2 100644
--- a/ada-build.el
+++ b/ada-build.el
@@ -1,7 +1,7 @@
-;;; ada-build.el --- extensions to ada-mode for compiling and running
-;;; Ada projects without 'make' or similar tool
+;;; ada-build.el --- Extensions to ada-mode for compiling and running  -*- 
lexical-binding:t -*-
+;; Ada projects without 'make' or similar tool
 ;;
-;;; Copyright (C) 1994, 1995, 1997 - 2014  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1997 - 2015  Free Software Foundation, Inc.
 ;;
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
@@ -52,35 +52,30 @@
 (const prompt-default)
 (const prompt-exist)
 (const error))
-  :group 'ada-build
-  :safe  'symbolp)
+  :safe  #'symbolp)
 
 (defcustom ada-build-confirm-command nil
   "If non-nil, prompt for confirmation/edit of each command before it is run."
   :type  'boolean
-  :group 'ada-build
-  :safe  'booleanp)
+  :safe  #'booleanp)
 
 (defcustom ada-build-check-cmd
   (concat "${cross_prefix}gnatmake -u -c -gnatc ${gnatmake_opt} 
${full_current} -cargs -I${src_dir} ${comp_opt}")
   "Default command to syntax check a single file.
 Overridden by project variable 'check_cmd'."
-  :type 'string
-  :group 'ada-build)
+  :type 'string)
 
 (defcustom ada-build-make-cmd
   (concat "${cross_prefix}gnatmake -P${gpr_file} -o ${main} ${main} 
${gnatmake_opt} "
  "-cargs -I${src_dir} ${comp_opt} -bargs ${bind_opt} -largs 
${link_opt}")
   "Default command to compile the application.
 Overridden by project variable 'make_cmd'."
-  :type 'string
-  :group 'ada-build)
+  :type 'string)
 
 (defcustom ada-build-run-cmd "./${main}"
   "Default command to run the application, in a spawned shell.
 Overridden by project variable 'run_cmd'."
-  :type 'string
-  :group 'ada-build)
+  :type 'string)
 
  code
 
diff --git a/ada-fix-error.el b/ada-fix-error.el
index 3e648ee..8008104 100644
--- a/ada-fix-error.el
+++ b/ada-fix-error.el
@@ -1,4 +1,4 @@
-;;; ada-fix-error.el --- utilities for automatically fixing
+;;; ada-fix-error.el --- utilities for automatically fixing  -*- 
lexical-binding:t -*-
 ;; errors reported by the compiler.
 
 ;; Copyright (C) 1999-2009, 2012-2015 Free Software Foundation, Inc.
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
index f3d69ac..a09c482 100644
--- a/ada-gnat-compile.el
+++ b/ada-gnat-compile.el
@@ -1,5 +1,5 @@
-;; Ada mode compiling functionality provided by the 'gnat'
-;; tool. Includes related functions, such as gnatprep support.
+;; ada-gnat-compile.el --- Ada mode compiling functionality provided by 'gnat' 
 -*- lexical-binding:t -*-
+;; Includes related functions, such as gnatprep support.
 ;;
 ;; These tools are 

[elpa] externals/ada-mode 4e2f1e3 13/48: release ada-mode 5.1.7, wisi 1.1.0; minor format changes in ada-ref-man

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 4e2f1e304496f48c3de15b9c23250f9c0ed0a745
Author: Stephen Leake 
Commit: Stephen Leake 

release ada-mode 5.1.7, wisi 1.1.0; minor format changes in ada-ref-man
---
 ada-prj.el  | 4 
 ada-stmt.el | 4 
 ada-xref.el | 4 
 3 files changed, 12 insertions(+)

diff --git a/ada-prj.el b/ada-prj.el
new file mode 100644
index 000..c05afbf
--- /dev/null
+++ b/ada-prj.el
@@ -0,0 +1,4 @@
+;; dummy file to hide obsolete bundled version
+(require 'ada-mode)
+(provide 'ada-prj)
+(message "'ada-prj' is obsolete; use 'ada-mode' instead")
diff --git a/ada-stmt.el b/ada-stmt.el
new file mode 100644
index 000..163c1de
--- /dev/null
+++ b/ada-stmt.el
@@ -0,0 +1,4 @@
+;; dummy file to hide obsolete bundled version
+(require 'ada-mode)
+(provide 'ada-stmt)
+(message "'ada-stmt' is obsolete; use 'ada-mode' instead")
diff --git a/ada-xref.el b/ada-xref.el
new file mode 100644
index 000..be8edc2
--- /dev/null
+++ b/ada-xref.el
@@ -0,0 +1,4 @@
+;; dummy file to hide obsolete bundled version
+(require 'ada-mode)
+(provide 'ada-xref)
+(message "'ada-xref' is obsolete; use 'ada-mode' instead")



[elpa] externals/ada-mode 7e7262b 25/48: * ada-mode/ada-mode.el (ada-case-activate-keys): Fix compiler warning.

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 7e7262b4124d8223f0d7b258781ae28d4f678585
Author: Stefan Monnier 
Commit: Stefan Monnier 

* ada-mode/ada-mode.el (ada-case-activate-keys): Fix compiler warning.
---
 ada-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ada-mode.el b/ada-mode.el
index c3373a8..bf93b28 100644
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -1,6 +1,6 @@
 ;;; ada-mode.el --- major-mode for editing Ada sources  -*- lexical-binding:t 
-*-
 ;;
-;; Copyright (C) 1994, 1995, 1997 - 2016  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1997 - 2017  Free Software Foundation, Inc.
 ;;
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
@@ -335,7 +335,7 @@ Values defined by cross reference packages.")
 map
 (char-to-string key)
 'ada-case-adjust-interactive)))
-   '( ?_ ?% ?& ?* ?( ?) ?- ?= ?+
+   '( ?_ ?% ?& ?* ?\( ?\) ?- ?= ?+
  ?| ?\; ?: ?' ?\" ?< ?, ?. ?> ?/ ?\n 32 ?\r ))
   )
 
@@ -2937,4 +2937,4 @@ The paragraph is indented on the first line."
 (when (featurep 'imenu)
   (require 'ada-imenu))
 
-;;; end of file
+;;; ada-mode.el ends here



[elpa] externals/ada-mode 89747cb 12/48: * packages/ada-mode: Miscellaneous cleanups.

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 89747cb0a4556871e9a9f7a9f306bc0febf8b2d7
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/ada-mode: Miscellaneous cleanups.

* ada-mode/gpr-skel.el (skeleton-hippie-try): Don't quote error name.
* ada-mode/gpr-query.el (gpr-query-get-src-dirs, gpr-query-get-prj-dirs):
Avoid add-to-list on local vars.
(gpr-query-compilation): Use font-lock-ensure when available.
* ada-mode/gnat-inspect.el (gnat-inspect-compilation): Use
font-lock-ensure when available.
* ada-mode/gnat-core.el (gnat-prj-add-prj-dir)
(gnat-prj-parse-emacs-final, gnat-get-paths-1, ada-gnat-make-package-body):
Avoid add-to-list and `set' on local vars.
(gnat-get-paths-1): Don't quote error name.
* ada-mode/ada-wisi.el (ada-wisi-scan-paramlist): Avoid add-to-list on
local var.
* ada-mode/ada-skel.el (ada-skel-hippie-try): Don't quote error name.
* ada-mode/ada-mode.el (ada-format-paramlist): Fix typo.
(ada-case-read-exceptions, ada-case-add-exception, ada-prj-parse-file-1)
(ada-case-merge-exceptions): Avoid add-to-list on local var.
(ada-prj-parse-file-1): Avoid `set' on local var.
(cl-case): Don't quote alternatives.
* ada-mode/ada-gnat-compile.el (ada-gnat-fix-error): Avoid add-to-list on
local var.  Simplify.
* ada-mode/ada-build.el (ada-build-prompt-select-prj-file): Remove
unused var `err'.
---
 ada-build.el|  4 ++--
 ada-gnat-compile.el | 21 -
 ada-mode.el | 32 
 ada-skel.el |  2 +-
 ada-wisi.el |  8 ++--
 gnat-core.el| 35 ++-
 gnat-inspect.el |  7 ++-
 gpr-query.el| 21 ++---
 gpr-skel.el |  2 +-
 9 files changed, 68 insertions(+), 64 deletions(-)

diff --git a/ada-build.el b/ada-build.el
index 5a5af5f..1cc935f 100644
--- a/ada-build.el
+++ b/ada-build.el
@@ -185,7 +185,7 @@ Returns non-nil if a file is selected, nil otherwise."
   (interactive)
   (let ((ext (append ada-prj-file-extensions ada-prj-file-ext-extra))
filename)
-(condition-case err
+(condition-case nil
(setq filename
  (read-file-name
   "Project file: " ; prompt
@@ -199,7 +199,7 @@ Returns non-nil if a file is selected, nil otherwise."
 ;; return a directory.
 (or (file-accessible-directory-p name)
 (member (file-name-extension name) ext)
-  (err
+  (err  ;FIXME: Shouldn't this be `error'?
(setq filename nil))
   )
 
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
index b17ebe9..98f6580 100644
--- a/ada-gnat-compile.el
+++ b/ada-gnat-compile.el
@@ -222,25 +222,20 @@ Prompt user if more than one."
(< pos limit
   (when (not done)
 (let* ((item (get-text-property pos 'ada-secondary-error))
-   (unit-file (nth 0 item)))
-  (add-to-list 'choices (ada-ada-name-from-file-name 
unit-file))
+   (unit-file (nth 0 item))
+(choice (ada-ada-name-from-file-name unit-file)))
+   (unless (member choice choices) (push choice choices))
   (goto-char (1+ pos))
   (goto-char (1+ (next-single-property-change (point) 
'ada-secondary-error nil limit)))
   (when (eolp) (forward-line 1))
   ))
   )));; unless while let
 
-(cond
- ((= 0 (length choices))
-  (setq unit-name nil))
-
- ((= 1 (length choices))
-  (setq unit-name (car choices)))
-
- (t ;; multiple choices
-  (setq unit-name
-(completing-read "package name: " choices)))
- );; cond
+(setq unit-name (cond
+  ((= 0 (length choices)) nil)
+  ((= 1 (length choices)) (car choices))
+  (t ;; multiple choices
+   (completing-read "package name: " choices
 
 (when unit-name
   (pop-to-buffer source-buffer)
diff --git a/ada-mode.el b/ada-mode.el
index 3248e13..cd9460a 100644
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -628,7 +628,7 @@ Function is called with no arguments.")
   (ada-goto-open-paren)
   (funcall indent-line-function); so new list is indented properly
 
-  (let* ((inibit-modification-hooks t)
+  (let* ((inhibit-modification-hooks t)
 (begin (point))
 (delend (progn (forward-sexp) (point))); just after matching closing 
paren
 (end (progn (backward-char) (forward-comment (- (point))) (point))); 
end of last parameter-declaration
@@ -938,11 +938,11 @@ Return (cons full-exceptions partial-exceptions)."

[elpa] externals/ada-mode 0a42145 16/48: * packages/ada-mode: Miscellaneous tweaks to fix warnings

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 0a42145fefaa2fbdfc6d350afde6a8cec91fa4a9
Author: Stefan Monnier 
Commit: Stefan Monnier 

* packages/ada-mode: Miscellaneous tweaks to fix warnings

* packages/ada-mode/ada-mode.el (ada-in-numeric-literal-p): Refine call to
looking-back.
(): Fix broken use of cl-case.

* packages/ada-mode/ada-skel.el: Use #' to quote function names.

* packages/ada-mode/ada-wisi.el (ada-wisi-which-function-1): Remove unused 
var
`region' and avoid unneeded setq.

* packages/ada-mode/gnat-inspect.el (gnat-inspect-compilation):
* packages/ada-mode/gpr-query.el (gpr-query-compilation): Silence warning.
---
 ada-mode.el |  6 +++---
 ada-skel.el | 10 +-
 ada-wisi.el |  9 +++--
 gnat-inspect.el |  4 ++--
 gpr-query.el|  2 +-
 5 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/ada-mode.el b/ada-mode.el
index 57e5ebc..fc3552e 100644
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -1071,7 +1071,7 @@ User is prompted to choose a file from project variable 
casing if it is a list."
 (defun ada-in-numeric-literal-p ()
   "Return t if point is after a prefix of a numeric literal."
   ;; FIXME: this is actually a based numeric literal; excludes 1234
-  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
+  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position)))
 
 (defvar ada-keywords nil
   "List of Ada keywords for current `ada-language-version'.")
@@ -2818,8 +2818,8 @@ The paragraph is indented on the first line."
 
 (unless (featurep 'ada-xref-tool)
   (cl-case ada-xref-tool
-((nil 'gnat) (require 'ada-gnat-xref))
-('gpr_query (require 'gpr-query))
+((nil gnat) (require 'ada-gnat-xref))
+(gpr_query (require 'gpr-query))
 ))
 
 (unless (featurep 'ada-compiler)
diff --git a/ada-skel.el b/ada-skel.el
index 9544222..e6c5430 100644
--- a/ada-skel.el
+++ b/ada-skel.el
@@ -1,6 +1,6 @@
 ;;; ada-skel.el --- an extension to Ada mode for inserting statement skeletons
 
-;; Copyright (C) 1987, 1993, 1994, 1996-2014  Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1993, 1994, 1996-2015  Free Software Foundation, Inc.
 
 ;; Authors: Stephen Leake 
 
@@ -453,10 +453,10 @@ it is a name, and use the word before that as the token."
 (provide 'ada-skeletons)
 (provide 'ada-skel)
 
-(setq ada-expand 'ada-skel-expand)
-(setq ada-next-placeholder 'ada-skel-next-placeholder)
-(setq ada-prev-placeholder 'ada-skel-prev-placeholder)
+(setq ada-expand #'ada-skel-expand)
+(setq ada-next-placeholder #'ada-skel-next-placeholder)
+(setq ada-prev-placeholder #'ada-skel-prev-placeholder)
 
-(add-hook 'ada-mode-hook 'ada-skel-setup)
+(add-hook 'ada-mode-hook #'ada-skel-setup)
 
 ;;; ada-skel.el ends here
diff --git a/ada-wisi.el b/ada-wisi.el
index a325b0f..7bb3bd9 100644
--- a/ada-wisi.el
+++ b/ada-wisi.el
@@ -1571,12 +1571,9 @@ Also return cache at start."
 paramlist))
 
 (defun ada-wisi-which-function-1 (keyword add-body)
-  "used in `ada-wisi-which-function'."
-  (let (region
-   result
-   (cache (wisi-forward-find-class 'name (point-max
-
-(setq result (wisi-cache-text cache))
+  "Used in `ada-wisi-which-function'."
+  (let* ((cache (wisi-forward-find-class 'name (point-max)))
+ (result (wisi-cache-text cache)))
 
 (when (not ff-function-name)
   (setq ff-function-name
diff --git a/gnat-inspect.el b/gnat-inspect.el
index 5fb2d4b..eb1c488 100644
--- a/gnat-inspect.el
+++ b/gnat-inspect.el
@@ -4,7 +4,7 @@
 ;;; gnatinspect supports Ada and any gcc language that supports the
 ;;; -fdump-xref switch (which includes C, C++).
 ;;
-;;; Copyright (C) 2013, 2014  Free Software Foundation, Inc.
+;;; Copyright (C) 2013-2015  Free Software Foundation, Inc.
 
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
@@ -215,7 +215,7 @@ set compilation-mode with compilation-error-regexp-alist 
set to COMP-ERR."
   (setq result-count (- (line-number-at-pos) 1))
   (if (fboundp 'font-lock-ensure)
   (font-lock-ensure)
-(font-lock-fontify-buffer))
+(with-no-warnings (font-lock-fontify-buffer)))
   ;; font-lock-fontify-buffer applies compilation-message text properties
   ;; NOTE: Won't be needed in 24.5 any more, since compilation-next-error
   ;; will apply compilation-message text properties on the fly.
diff --git a/gpr-query.el b/gpr-query.el
index 06ebbb0..7fa91bd 100644
--- a/gpr-query.el
+++ b/gpr-query.el
@@ -256,7 +256,7 @@ set compilation-mode with compilation-error-regexp-alist 
set to COMP-ERR."
 
   (if (fboundp 'font-lock-ensure)
   (font-lock-ensure)
-(font-lock-fontify-buffer))
+(with-no-warnings (font-lock-fontify-buffer)))
   ;; font-lock-fontify-buffer applies compilation-message text properties
   ;; FIXME: Won't be needed in 24.5 any more, since compilation-next-error
   ;; will apply compilation-message text properties on the fly.



[elpa] externals/ada-mode 5118a86 10/48: remove bogus execute priv

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 5118a86d0d11212c436d902e79fb5143e5032b16
Author: Stephen Leake 
Commit: Stephen Leake 

remove bogus execute priv
---
 README | 0
 ada-build.el   | 0
 ada-fix-error.el   | 0
 ada-gnat-compile.el| 0
 ada-gnat-xref.el   | 0
 ada-grammar-wy.el  | 0
 ada-imenu.el   | 0
 ada-indent-user-options.el | 0
 ada-mode-compat-23.4.el| 0
 ada-mode-compat-24.2.el| 0
 ada-mode.el| 0
 ada-mode.texi  | 0
 ada-skel.el| 0
 ada-wisi-opentoken.el  | 0
 ada-wisi.el| 0
 ada_license.text   | 0
 gnat-core.el   | 0
 gnat-inspect.el| 0
 gpr-grammar-wy.el  | 0
 gpr-mode.el| 0
 gpr-mode.texi  | 0
 gpr-query.el   | 0
 gpr-skel.el| 0
 gpr-wisi.el| 0
 24 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/README b/README
old mode 100755
new mode 100644
diff --git a/ada-build.el b/ada-build.el
old mode 100755
new mode 100644
diff --git a/ada-fix-error.el b/ada-fix-error.el
old mode 100755
new mode 100644
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
old mode 100755
new mode 100644
diff --git a/ada-gnat-xref.el b/ada-gnat-xref.el
old mode 100755
new mode 100644
diff --git a/ada-grammar-wy.el b/ada-grammar-wy.el
old mode 100755
new mode 100644
diff --git a/ada-imenu.el b/ada-imenu.el
old mode 100755
new mode 100644
diff --git a/ada-indent-user-options.el b/ada-indent-user-options.el
old mode 100755
new mode 100644
diff --git a/ada-mode-compat-23.4.el b/ada-mode-compat-23.4.el
old mode 100755
new mode 100644
diff --git a/ada-mode-compat-24.2.el b/ada-mode-compat-24.2.el
old mode 100755
new mode 100644
diff --git a/ada-mode.el b/ada-mode.el
old mode 100755
new mode 100644
diff --git a/ada-mode.texi b/ada-mode.texi
old mode 100755
new mode 100644
diff --git a/ada-skel.el b/ada-skel.el
old mode 100755
new mode 100644
diff --git a/ada-wisi-opentoken.el b/ada-wisi-opentoken.el
old mode 100755
new mode 100644
diff --git a/ada-wisi.el b/ada-wisi.el
old mode 100755
new mode 100644
diff --git a/ada_license.text b/ada_license.text
old mode 100755
new mode 100644
diff --git a/gnat-core.el b/gnat-core.el
old mode 100755
new mode 100644
diff --git a/gnat-inspect.el b/gnat-inspect.el
old mode 100755
new mode 100644
diff --git a/gpr-grammar-wy.el b/gpr-grammar-wy.el
old mode 100755
new mode 100644
diff --git a/gpr-mode.el b/gpr-mode.el
old mode 100755
new mode 100644
diff --git a/gpr-mode.texi b/gpr-mode.texi
old mode 100755
new mode 100644
diff --git a/gpr-query.el b/gpr-query.el
old mode 100755
new mode 100644
diff --git a/gpr-skel.el b/gpr-skel.el
old mode 100755
new mode 100644
diff --git a/gpr-wisi.el b/gpr-wisi.el
old mode 100755
new mode 100644



[elpa] externals/ada-mode ce778fa 24/48: Clear executable bit for Emacs Lisp files.

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit ce778fa536ce85caefe1d862237f0419ec041106
Author: Thien-Thi Nguyen 
Commit: Thien-Thi Nguyen 

Clear executable bit for Emacs Lisp files.

BTW, this was done w/ shell command:
find . -type f -name '*.el' -perm /u+x -exec chmod -x '{}' \;

* admin/archive-contents.el: ‘chmod -x’.

* packages/ada-mode/ada-gnat-compile.el: ‘chmod -x’.
* packages/ada-mode/ada-gnat-xref.el: Likewise.
* packages/ada-mode/ada-grammar-wy.el: Likewise.
* packages/ada-mode/ada-mode.el: Likewise.
* packages/ada-mode/ada-wisi-opentoken.el: Likewise.
* packages/ada-mode/ada-wisi.el: Likewise.
* packages/ada-mode/gpr-grammar-wy.el: Likewise.
* packages/ada-mode/gpr-query.el: Likewise.
* packages/other-frame-window/other-frame-window.el: Likewise.
* packages/register-list/register-list.el: Likewise.
* packages/windresize/windresize.el: Likewise.
---
 ada-gnat-compile.el   | 0
 ada-gnat-xref.el  | 0
 ada-grammar-wy.el | 0
 ada-mode.el   | 0
 ada-wisi-opentoken.el | 0
 ada-wisi.el   | 0
 gpr-grammar-wy.el | 0
 gpr-query.el  | 0
 8 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
old mode 100755
new mode 100644
diff --git a/ada-gnat-xref.el b/ada-gnat-xref.el
old mode 100755
new mode 100644
diff --git a/ada-grammar-wy.el b/ada-grammar-wy.el
old mode 100755
new mode 100644
diff --git a/ada-mode.el b/ada-mode.el
old mode 100755
new mode 100644
diff --git a/ada-wisi-opentoken.el b/ada-wisi-opentoken.el
old mode 100755
new mode 100644
diff --git a/ada-wisi.el b/ada-wisi.el
old mode 100755
new mode 100644
diff --git a/gpr-grammar-wy.el b/gpr-grammar-wy.el
old mode 100755
new mode 100644
diff --git a/gpr-query.el b/gpr-query.el
old mode 100755
new mode 100644



[elpa] externals/ada-mode 2d17566 21/48: Fix some quoting problems in doc strings

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 2d17566a3c452ffcc1774d2fd4e025f70ad9b0bf
Author: Paul Eggert 
Commit: Paul Eggert 

Fix some quoting problems in doc strings

Most of these are minor issues involving, e.g., quoting `like this'
instead of 'like this'.  A few involve escaping ` and ' with a
preceding \= when the characters should not be turned into curved single
quotes.
---
 ada-build.el   | 14 +++---
 ada-fix-error.el   |  6 +++---
 ada-gnat-compile.el|  2 +-
 ada-gnat-xref.el   |  4 ++--
 ada-indent-user-options.el | 18 +-
 ada-mode.el| 20 ++--
 gnat-core.el   |  2 +-
 gpr-query.el   |  4 ++--
 8 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/ada-build.el b/ada-build.el
index 0553454..158773a 100644
--- a/ada-build.el
+++ b/ada-build.el
@@ -60,14 +60,14 @@
 (defcustom ada-build-check-cmd
   (concat "${cross_prefix}gnatmake -u -c -gnatc ${gnatmake_opt} 
${full_current} -cargs -I${src_dir} ${comp_opt}")
   "Default command to syntax check a single file.
-Overridden by project variable 'check_cmd'."
+Overridden by project variable `check_cmd'."
   :type 'string)
 
 (defcustom ada-build-make-cmd
   (concat "${cross_prefix}gnatmake -P${gpr_file} -o ${main} ${main} 
${gnatmake_opt} "
  "-cargs -I${src_dir} ${comp_opt} -bargs ${bind_opt} -largs 
${link_opt}")
   "Default command to compile the application.
-Overridden by project variable 'make_cmd'."
+Overridden by project variable `make_cmd'."
   :type 'string)
 
 ;; FIXME: make this more intelligent to work on Windows cmd shell?
@@ -75,7 +75,7 @@ Overridden by project variable 'make_cmd'."
 ;; runtime.
 (defcustom ada-build-run-cmd "./${main}"
   "Default command to run the application, in a spawned shell.
-Overridden by project variable 'run_cmd'."
+Overridden by project variable `run_cmd'."
   :type 'string)
 
  code
@@ -85,11 +85,11 @@ Overridden by project variable 'run_cmd'."
 ${var} is a project variable or environment variable, $var an
 environment variable.
 
-A prefix may be specified with the format '-${var}'; then
+A prefix may be specified with the format `-${var}'; then
 the value is expanded with the prefix prepended. If the value is
 a list, the prefix is prepended to each list element. For
-example, if src_dir contains 'dir_1 dir_2', '-I${src_dir}'
-expands to '-Idir_1 -Idir_2'.
+example, if src_dir contains `dir_1 dir_2', `-I${src_dir}'
+expands to `-Idir_1 -Idir_2'.
 
 As a special case, ${full_current} is replaced by the current
 buffer file name including the directory and extension."
@@ -153,7 +153,7 @@ buffer file name including the directory and extension."
 (defun ada-build-find-select-prj-file ()
   "Search for a project file in the current directory, parse and select it.
 The file must have the same basename as the project variable
-'main' or the current buffer if 'main' is nil, and extension from
+`main' or the current buffer if `main' is nil, and extension from
 `ada-prj-file-extensions'.  Returns non-nil if a file is
 selected, nil otherwise."
   (let* ((base-file-name (file-name-base
diff --git a/ada-fix-error.el b/ada-fix-error.el
index 6ec0fd7..130bb3e 100644
--- a/ada-fix-error.el
+++ b/ada-fix-error.el
@@ -31,7 +31,7 @@
 (require 'compile)
 
 (defcustom ada-fix-sort-context-clause t
-  "*If non-nil, sort context clause when inserting 'with'"
+  "*If non-nil, sort context clause when inserting `with'"
   :type 'boolean
   :group 'ada)
 
@@ -155,7 +155,7 @@ extend a with_clause to include CHILD-NAME  .   "
   )))
 
 (defun ada-fix-add-use-type (type)
-  "Insert 'use type' clause for TYPE at start of declarative part for current 
construct."
+  "Insert `use type' clause for TYPE at start of declarative part for current 
construct."
   (ada-goto-declarative-region-start); leaves point after 'is'
   (newline)
   (insert "use type " type ";")
@@ -164,7 +164,7 @@ extend a with_clause to include CHILD-NAME  .   "
   (indent-according-to-mode))
 
 (defun ada-fix-add-use (package)
-  "Insert 'use' clause for PACKAGE at start of declarative part for current 
construct."
+  "Insert `use' clause for PACKAGE at start of declarative part for current 
construct."
   (ada-goto-declarative-region-start); leaves point after 'is'
   (newline)
   (insert "use " package ";")
diff --git a/ada-gnat-compile.el b/ada-gnat-compile.el
index ee4b12a..c0d2156 100644
--- a/ada-gnat-compile.el
+++ b/ada-gnat-compile.el
@@ -616,7 +616,7 @@ Prompt user if more than one."
   )
 
 (defun ada-gnat-compile ()
-  "Set Ada mode global vars to use 'gnat' for compiling."
+  "Set Ada mode global vars to use `gnat' for compiling."
   (add-to-list 'ada-prj-file-ext-extra "gpr")
   (add-to-list 'ada-prj-parser-alist   '("gpr" . gnat-parse-gpr))
   (add-to-list 'ada-select-prj-compiler'(gnat  . 
ada-gnat-compile-select-prj))
diff --git a/ada-gnat-xref.el b/ada-gnat-xref.el
index 

[elpa] externals/ada-mode a3e1d6a 05/48: * packages/ada-mode: version 5.1.1: fix wisi packaging bug, add -a in gnat-find

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit a3e1d6a933c8f079ecf6375aeea088496d5b15c9
Author: Stephen Leake 
Commit: Stephen Leake 

* packages/ada-mode: version 5.1.1: fix wisi packaging bug, add -a in 
gnat-find

* packages/wisi/wisi.el: bump version to reflect change.
---
 README   |  2 +-
 ada-gnat-xref.el | 13 -
 ada-mode.el  |  6 +++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 7e9e126..f4bfcb7 100755
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Emacs Ada mode version 5.1.0
+Emacs Ada mode version 5.1.1
 
 Ada mode requires Emacs 24.2 or greater
 
diff --git a/ada-gnat-xref.el b/ada-gnat-xref.el
index 4f0d716..7144540 100755
--- a/ada-gnat-xref.el
+++ b/ada-gnat-xref.el
@@ -6,7 +6,7 @@
 ;;
 ;; GNAT is provided by AdaCore; see http://libre.adacore.com/
 ;;
-;;; Copyright (C) 2012, 2013  Free Software Foundation, Inc.
+;;; Copyright (C) 2012 - 2014  Free Software Foundation, Inc.
 ;;
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
@@ -53,7 +53,9 @@
 )
 
   (let* ((arg (format "%s:%s:%d:%d" identifier file line col))
-(switches (when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext
+(switches (concat
+"-a"
+(when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext)
 status
 (result nil))
 (with-current-buffer (gnat-run-buffer)
@@ -96,13 +98,14 @@
   "For `ada-xref-parents-function', using 'gnat find', which is Ada-specific."
 
   (let* ((arg (format "%s:%s:%d:%d" identifier file line col))
-(switches (concat
+(switches (list
+"-a"
"-d"
(when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext)))
))
 (result nil))
 (with-current-buffer (gnat-run-buffer)
-  (gnat-run-gnat "find" (list switches arg))
+  (gnat-run-gnat "find" (append switches (list arg)))
 
   (goto-char (point-min))
   (forward-line 2); skip GPR_PROJECT_PATH, 'gnat find'
@@ -149,7 +152,7 @@
   ;; is asynchronous, and automatically runs the compilation error
   ;; filter.
 
-  (let* ((cmd (format "gnat find -r %s:%s:%d:%d" identifier file line col)))
+  (let* ((cmd (format "gnat find -a -r %s:%s:%d:%d" identifier file line col)))
 
 (with-current-buffer (gnat-run-buffer); for default-directory
   (let ((compilation-environment (ada-prj-get 'proc_env))
diff --git a/ada-mode.el b/ada-mode.el
index 7a2c6b9..3e7b8cb 100755
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -5,8 +5,8 @@
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
 ;; Keywords FIXME: languages, ada ELPA broken for multiple keywords
-;; Version: 5.1.0
-;; package-requires: ((wisi "1.0.1") (cl-lib "0.4") (emacs "24.2"))
+;; Version: 5.1.1
+;; package-requires: ((wisi "1.0.2") (cl-lib "0.4") (emacs "24.2"))
 ;; url: http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html
 ;;
 ;; (Gnu ELPA requires single digits between dots in versions)
@@ -167,7 +167,7 @@
 (defun ada-mode-version ()
   "Return Ada mode version."
   (interactive)
-  (let ((version-string "5.1.0"))
+  (let ((version-string "5.1.1"))
 ;; must match:
 ;; ada-mode.texi
 ;; README



[elpa] externals/ada-mode ba2a346 06/48: ada-mode, wisi: bump versions again; forgot to add some files to git

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit ba2a3468a27169a2bd74913d3f68cf0bd557f701
Author: Stephen Leake 
Commit: Stephen Leake 

ada-mode, wisi: bump versions again; forgot to add some files to git

* packages/ada-mode/README:
* packages/ada-mode/ada-mode.el: version 5.1.2

* packages/wisi/wisi.el: version 1.0.3

* packages/ada-mode/NEWS: New file.

* packages/ada-mode/ada-mode-compat-24.2.el: New file.

* packages/ada-mode/dir: New file.

* packages/wisi/NEWS: New file.

* packages/wisi/wisi-compat-24.2.el: New file.
---
 NEWS| 64 +
 README  |  2 +-
 ada-mode-compat-24.2.el | 31 
 ada-mode.el |  6 ++---
 dir | 20 
 5 files changed, 119 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
new file mode 100755
index 000..786c58c
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,64 @@
+GNU Emacs Ada mode NEWS -- history of user-visible changes.
+
+Copyright (C) 2014 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+Please send Emacs Ada mode bug reports to bug-gnu-em...@gnu.org, with
+'ada-mode' in the subject. If possible, use M-x report-emacs-bug.
+
+
+* Ada mode 5.1.2
+16 Mar 2014
+
+** fix another packaging bug; forgot to add files to ELPA git!
+
+* Ada mode 5.1.1
+14 Mar 2014
+
+** require wisi-1.0.2, to fix packaging bug
+
+** gnat-find now called with -a to include read-only .ali files in the results.
+
+* Ada mode 5.1.0
+13 Mar 2014
+
+** Emacs 24.2 supported, via cl-lib in Gnu ELPA
+
+** Better handling of aspects.
+
+** 'record' is aligned with 'type' in derived types
+
+** Several minor indentation bugs have been fixed.
+
+** Added "2.2 Upgrading from previous versions" to the user guide.
+
+** ada-align now properly handles subprograms with the opening paren
+   on the same line as the preceding code and code on the same line as
+   the closing paren:
+
+function Foo (Param_1 : Integer;
+  Param_2 : Integer) return Integer;
+
+** When no project file is selected, the default variables are
+   consistently used instead. Previously, the default variables were
+   only used when parsing a project file.
+
+** info files are properly visible in main info menu
+
+** 'C-c ;' used to run `comment-dim', which is bound to 'M-;' in the
+   global keymap. 'C-c ;' now gives an error with a message saying
+   'use M-; instead'.
+
+* Ada mode 5.0.1
+Feb 2 2014
+
+First public release, via ELPA
+
+* Ada mode 5.0.0
+Dec 24 2013
+
+** first release in ELPA
+
+** Previous version was 4.00, in Emacs core. 5.0.1 is a complete
+   rewrite, using a generalized LALR parser that caches syntactic
+   information in text properties.
diff --git a/README b/README
index f4bfcb7..7a6e7cf 100755
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Emacs Ada mode version 5.1.1
+Emacs Ada mode version 5.1.2
 
 Ada mode requires Emacs 24.2 or greater
 
diff --git a/ada-mode-compat-24.2.el b/ada-mode-compat-24.2.el
new file mode 100755
index 000..aa152db
--- /dev/null
+++ b/ada-mode-compat-24.2.el
@@ -0,0 +1,31 @@
+;;; ada-mode-compat-24.2.el --- Implement current Emacs features not present 
in Emacs 24.2
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;; using cl-lib 0.4 from Gnu ELPA
+
+(defun file-name-base ( filename)
+  "Return the base name of the FILENAME: no directory, no extension.
+FILENAME defaults to `buffer-file-name'."
+  (file-name-sans-extension
+   (file-name-nondirectory (or filename (buffer-file-name)
+
+
+(provide 'ada-mode-compat-24.2)
+
+;; end of file
diff --git a/ada-mode.el b/ada-mode.el
index 3e7b8cb..4d6a71b 100755
--- a/ada-mode.el
+++ b/ada-mode.el
@@ -5,8 +5,8 @@
 ;; Author: Stephen Leake 
 ;; Maintainer: Stephen Leake 
 ;; Keywords FIXME: languages, ada ELPA broken for multiple keywords
-;; Version: 5.1.1
-;; package-requires: ((wisi "1.0.2") (cl-lib "0.4") (emacs "24.2"))
+;; Version: 5.1.2
+;; package-requires: ((wisi "1.0.3") (cl-lib "0.4") (emacs "24.2"))
 ;; url: http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html
 ;;
 ;; (Gnu ELPA requires single digits between dots in versions)
@@ -167,7 +167,7 @@
 (defun ada-mode-version ()
   "Return Ada mode 

[elpa] externals/ada-mode 1181f8d 02/48: Fix up copyright notices.

2020-11-30 Thread Stefan Monnier
branch: externals/ada-mode
commit 1181f8d89a9ef3abd51f258bdec6ece02c99c408
Author: Stefan Monnier 
Commit: Stefan Monnier 

Fix up copyright notices.
---
 ada-fix-error.el|  2 +-
 ada-grammar-wy.el   |  2 +-
 ada-mode-compat-23.4.el | 19 ++-
 ada-skel.el |  4 +---
 ada-wisi-opentoken.el   | 30 ++
 gpr-grammar-wy.el   |  8 +++-
 gpr-mode.el |  3 +--
 gpr-skel.el |  3 +--
 8 files changed, 52 insertions(+), 19 deletions(-)

diff --git a/ada-fix-error.el b/ada-fix-error.el
index 1c8df93..db43473 100755
--- a/ada-fix-error.el
+++ b/ada-fix-error.el
@@ -1,7 +1,7 @@
 ;;; ada-fix-error.el --- utilities for automatically fixing
 ;; errors reported by the compiler.
 
-;; Copyright (C) 1999-2009, 2012, 2013 Stephen Leake.
+;; Copyright (C) 1999-2009, 2012-2013 Free Software Foundation, Inc.
 
 ;; Author : Stephen Leake  
 ;; Maintainer : Stephen Leake  
diff --git a/ada-grammar-wy.el b/ada-grammar-wy.el
index 790997c..839bde3 100755
--- a/ada-grammar-wy.el
+++ b/ada-grammar-wy.el
@@ -1,6 +1,6 @@
 ;;; ada-grammar-wy.el --- Generated parser support file
 
-;; Copyright (C) 2013 Stephen Leake.  All Rights Reserved.
+;; Copyright (C) 2013  Free Software Foundation, Inc.
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
diff --git a/ada-mode-compat-23.4.el b/ada-mode-compat-23.4.el
index 236d607..8f78797 100755
--- a/ada-mode-compat-23.4.el
+++ b/ada-mode-compat-23.4.el
@@ -1,4 +1,21 @@
-;;; Implement current Emacs features not present in Emacs 23.4
+;;; ada-mode-compat-23.4.el --- Implement current Emacs features not present 
in Emacs 23.4
+
+;; Copyright (C) 2013  Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
 
 (defvar compilation-filter-start (make-marker)
   "")
diff --git a/ada-skel.el b/ada-skel.el
index 398f314..53c513e 100755
--- a/ada-skel.el
+++ b/ada-skel.el
@@ -1,8 +1,6 @@
 ;;; ada-skel.el --- an extension to Ada mode for inserting statement skeletons
 
-;; Copyright (C) 1987, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1993, 1994, 1996-2013  Free Software Foundation, Inc.
 
 ;; Authors: Stephen Leake 
 
diff --git a/ada-wisi-opentoken.el b/ada-wisi-opentoken.el
index 08d3b4d..1812a49 100755
--- a/ada-wisi-opentoken.el
+++ b/ada-wisi-opentoken.el
@@ -1,7 +1,27 @@
-;;; An indentation function for ada-wisi that indents OpenToken
-;;; grammar statements nicely.
-;;;
-;;; This is an example of a user-added indentation rule.
+;;; ada-wisi-opentoken.el --- An indentation function for ada-wisi that 
indents OpenToken
+;; grammar statements nicely.
+
+;; Copyright (C) 2013  Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+
+;;; Commentary:
+
+;; This is an example of a user-added indentation rule.
 ;;
 ;; In ~/.emacs (or project-specific config):
 ;; (require 'ada-wisi-opentoken)
@@ -12,6 +32,8 @@
 ;; ada-indent-opentoken: t
 ;; End:
 
+;;; Code:
+
 (require 'ada-mode)
 (require 'wisi)
 
diff --git a/gpr-grammar-wy.el b/gpr-grammar-wy.el
index 4b1d45f..b0ae6fd 100755
--- a/gpr-grammar-wy.el
+++ b/gpr-grammar-wy.el
@@ -1,10 +1,10 @@
 ;;; gpr-grammar-wy.el --- Generated parser support file
 
-;; Copyright (C) 2013 Stephen Leake.  All Rights Reserved.
+;; Copyright (C) 2013  Free Software Foundation, Inc.
 
 ;; 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 the Free Software 

[elpa] branch externals/ada-mode created (now 05d6105)

2020-11-30 Thread Stefan Monnier
monnier pushed a change to branch externals/ada-mode.

at  05d6105   * .gitignore: New file

This branch includes the following new commits:

   new  065c038   Add ada-mode, wisi packages
   new  1181f8d   Fix up copyright notices.
   new  6549abd   update to Ada mode version 5.0.1
   new  a56d7e8   release ada-mode 5.1.0, wisi 1.0.1
   new  a3e1d6a   * packages/ada-mode: version 5.1.1: fix wisi packaging 
bug, add -a in gnat-find
   new  ba2a346   ada-mode, wisi: bump versions again; forgot to add some 
files to git
   new  9730ec3   ada-mode 5.1.3, wisi 1.0.4
   new  64afd45   release ada-mode 5.1.4
   new  1b4fb26   * packages/ada-mode/* : version 5.1.5
   new  5118a86   remove bogus execute priv
   new  45fad69   publish ada-mode 5.1.6, wisi 1.0.6, new package 
ada-ref-man
   new  89747cb   * packages/ada-mode: Miscellaneous cleanups.
   new  4e2f1e3   release ada-mode 5.1.7, wisi 1.1.0; minor format changes 
in ada-ref-man
   new  75a4c9f   release ada-mode 5.1.7, wisi 1.1.0; minor format changes 
in ada-ref-man (take 2)
   new  7bc1eb0   update ada-mode, wisi
   new  0a42145   * packages/ada-mode: Miscellaneous tweaks to fix warnings
   new  b27dd06   * ada-mode: Use lexical-binding since it requires 
Emacs-24.2 anyway
   new  cc65bfe   Update ada-mode, wisi
   new  6d77bd0   * packages/gnome-c-style/gnome-c-tests.el: Add copyright 
blurb
   new  f292e14   fix executable bits
   new  2d17566   Fix some quoting problems in doc strings
   new  7b6bcf3   Release: ada-mode: version 5.2.0. wisi: version 1.1.3
   new  35e9946   Release wisi 1.1.4, ada-mode 5.2.1
   new  ce778fa   Clear executable bit for Emacs Lisp files.
   new  7e7262b   * ada-mode/ada-mode.el (ada-case-activate-keys): Fix 
compiler warning.
   new  2db72b9   Update ada-mode to version 5.2.2, wisi to version 1.1.5
   new  a3be258   Release Ada mode 5.3.1, wisi 1.1.6
   new  e4a40ea   Warn about transfer.fsckObjects
   new  04ed297   * packages/ada-mode/ada-mode.el (ada-mode): emacs 26 vs 
hack-local-variables
   new  6d3ea76   Release ada-mode version 6.0. Release wisi version 2.0
   new  e56f179   * ada-mode/xref-ada.el: Add copyright blurb
   new  07f5c4d   Release ada-mode 6.0.1, wisi 2.0.1; fix copyright, 
packaging bugs
   new  a8cbe78   * ada-mode, wisi: Fix file access rights
   new  4c99c60   Add new files in ada-mode; package version not bumped
   new  304724f   Release ada-mode 6.1.0, wisi 2.1.0
   new  49f2753   * packages/ada-mode/ada-mode.el: Fix end of file marker
   new  acc46ef   In ada-mode, wisi; release ada-mode 6.1.1, wisi 2.1.1
   new  15ea784   In ada-mode, wisi: release Ada mode 6.2.0, wisi 1.2.0.
   new  6f2849f   In ada-mode and wisi, release ada-mode 6.2.1, wisi 2.2.1; 
fix packaging bugs
   new  376b482   Release ada-mode 7.0.1, wisi 3.0.1
   new  dc5e65e   Release ada-mode 7.1.0, wisi 3.1.0
   new  4c29ef9   * ada-mode: Fix copyright
   new  ad8a25a   In ada-mode, adapt to wisi bug fix release
   new  7d4089c   Release ada-mode bug-fix version 7.1.2
   new  dfb63bc   In ada-mode, release 7.1.3; in wisi, release 3.1.2
   new  3950c12   * ada-mode/ada-mode.el: Don't define other packages's vars
   new  31c74eb   In ada-mode, set auto-mode-alist
   new  05d6105   * .gitignore: New file




[elpa] externals/swiper 4b19cad: Split package ivy into ivy, swiper, counsel

2020-11-30 Thread Stefan Monnier
branch: externals/swiper
commit 4b19cadf6c516db7f1b31504011216c9e1a14ca7
Author: Oleh Krehel 
Commit: Stefan Monnier 

Split package ivy into ivy, swiper, counsel

Publishing them in a single package on GNU ELPA has lead to version
conflicts.
---
 .gitignore |4 +
 swiper.el  | 1768 +++-
 2 files changed, 1403 insertions(+), 369 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..74e56a1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/swiper-pkg.el
+/swiper-autoloads.el
+*.elc
+
diff --git a/swiper.el b/swiper.el
index d9bf724..10813a4 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1,11 +1,11 @@
 ;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015  Free Software Foundation, Inc.
+;; Copyright (C) 2015-2019  Free Software Foundation, Inc.
 
 ;; Author: Oleh Krehel 
 ;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.7.0
-;; Package-Requires: ((emacs "24.1"))
+;; Version: 0.13.1
+;; Package-Requires: ((emacs "24.5") (ivy "0.13.1"))
 ;; Keywords: matching
 
 ;; This file is part of GNU Emacs.
@@ -21,23 +21,19 @@
 ;; GNU General Public License for more details.
 
 ;; For a full copy of the GNU General Public License
-;; see .
+;; see .
 
 ;;; Commentary:
-;;
+
 ;; This package gives an overview of the current regex search
 ;; candidates.  The search regex can be split into groups with a
 ;; space.  Each group is highlighted with a different face.
 ;;
 ;; It can double as a quick `regex-builder', although only single
 ;; lines will be matched.
-;;
-;; It also provides `ivy-mode': a global minor mode that uses the
-;; matching back end of `swiper' for all matching on your system,
-;; including file matching. You can use it in place of `ido-mode'
-;; (can't have both on at once).
 
 ;;; Code:
+
 (require 'ivy)
 
 (defgroup swiper nil
@@ -46,47 +42,98 @@
   :prefix "swiper-")
 
 (defface swiper-match-face-1
-  '((t (:inherit isearch-lazy-highlight-face)))
-  "The background face for `swiper' matches.")
+  '((t (:inherit lazy-highlight)))
+  "The background face for `swiper' matches."
+  :group 'ivy-faces)
 
 (defface swiper-match-face-2
   '((t (:inherit isearch)))
-  "Face for `swiper' matches modulo 1.")
+  "Face for `swiper' matches modulo 1."
+  :group 'ivy-faces)
 
 (defface swiper-match-face-3
   '((t (:inherit match)))
-  "Face for `swiper' matches modulo 2.")
+  "Face for `swiper' matches modulo 2."
+  :group 'ivy-faces)
 
 (defface swiper-match-face-4
   '((t (:inherit isearch-fail)))
-  "Face for `swiper' matches modulo 3.")
+  "Face for `swiper' matches modulo 3."
+  :group 'ivy-faces)
 
-(define-obsolete-face-alias 'swiper-minibuffer-match-face-1
-'ivy-minibuffer-match-face-1 "0.6.0")
+(defface swiper-background-match-face-1
+  '((t (:inherit swiper-match-face-1)))
+  "The background face for non-current `swiper' matches."
+  :group 'ivy-faces)
 
-(define-obsolete-face-alias 'swiper-minibuffer-match-face-2
-'ivy-minibuffer-match-face-2 "0.6.0")
+(defface swiper-background-match-face-2
+  '((t (:inherit swiper-match-face-2)))
+  "Face for non-current `swiper' matches modulo 1."
+  :group 'ivy-faces)
 
-(define-obsolete-face-alias 'swiper-minibuffer-match-face-3
-'ivy-minibuffer-match-face-3 "0.6.0")
+(defface swiper-background-match-face-3
+  '((t (:inherit swiper-match-face-3)))
+  "Face for non-current `swiper' matches modulo 2."
+  :group 'ivy-faces)
 
-(define-obsolete-face-alias 'swiper-minibuffer-match-face-4
-'ivy-minibuffer-match-face-4 "0.6.0")
+(defface swiper-background-match-face-4
+  '((t (:inherit swiper-match-face-4)))
+  "Face for non-current `swiper' matches modulo 3."
+  :group 'ivy-faces)
 
 (defface swiper-line-face
   '((t (:inherit highlight)))
-  "Face for current `swiper' line.")
+  "Face for current `swiper' line."
+  :group 'ivy-faces)
 
 (defcustom swiper-faces '(swiper-match-face-1
   swiper-match-face-2
   swiper-match-face-3
   swiper-match-face-4)
-  "List of `swiper' faces for group matches.")
+  "List of `swiper' faces for group matches."
+  :group 'ivy-faces
+  :type '(repeat face))
+
+(defvar swiper-background-faces
+  '(swiper-background-match-face-1
+swiper-background-match-face-2
+swiper-background-match-face-3
+swiper-background-match-face-4)
+  "Like `swiper-faces', but used for all matches except the current one.")
+
+(defun swiper--recompute-background-faces ()
+  (let ((faces '(swiper-background-match-face-1
+ swiper-background-match-face-2
+ swiper-background-match-face-3
+ swiper-background-match-face-4))
+(colir-compose-method #'colir-compose-soft-light))
+(cl-mapc (lambda (f1 f2)
+   (let ((bg (face-background f1)))
+ (when bg
+   

[elpa] externals/relint 26639c5 16/16: Require xr 1.20

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 26639c58045189b4807c99f9097132f86cd54163
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Require xr 1.20

Not strictly necessary but will ensure that users get the updated version.
---
 relint.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/relint.el b/relint.el
index 4cb5219..3c17a57 100644
--- a/relint.el
+++ b/relint.el
@@ -4,7 +4,7 @@
 
 ;; Author: Mattias Engdegård 
 ;; Version: 1.19
-;; Package-Requires: ((xr "1.19") (emacs "26.1"))
+;; Package-Requires: ((xr "1.20") (emacs "26.1"))
 ;; URL: https://github.com/mattiase/relint
 ;; Keywords: lisp, regexps
 



[elpa] externals/relint 5720e12 07/16: Scan regexp arguments to functions in s.el

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 5720e122321715ff36c890b8612094559d4fb783
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Scan regexp arguments to functions in s.el

The following functions all take a regexp as first argument:

 s-matches?, s-matches-p, s-match-strings-all, s-matched-positions-all,
 s-match, s-slice-at, s-count-matches, s-count-matches-all,
 s-split, s-split-up-to
---
 relint.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/relint.el b/relint.el
index 7f46b46..08f61aa 100644
--- a/relint.el
+++ b/relint.el
@@ -1862,7 +1862,11 @@ directly."
'search-forward-regexp 'search-backward-regexp
'kill-matching-buffers
'keep-lines 'flush-lines 'how-many
-   'delete-matching-lines 'delete-non-matching-lines 
'count-matches)
+   'delete-matching-lines 'delete-non-matching-lines 'count-matches
+   ;; From s.el
+   's-matches? 's-matches-p 's-match-strings-all
+   's-matched-positions-all 's-match 's-slice-at
+   's-count-matches 's-count-matches-all 's-split 's-split-up-to)
   ,re-arg . ,_)
 (unless (and (symbolp re-arg)
  (memq re-arg relint--checked-variables))



[elpa] externals/relint d0fa8a8 10/16: Fix false positives in regexp provenance checks

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit d0fa8a8d13263c09962d5c8e9f5da644a1f78843
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Fix false positives in regexp provenance checks

Detect more common functions which harmlessly absorb regexps without
returning them.
---
 relint.el   | 30 +++---
 test/6.elisp|  6 +-
 test/6.expected | 33 +
 3 files changed, 49 insertions(+), 20 deletions(-)

diff --git a/relint.el b/relint.el
index 7a45323..81859ac 100644
--- a/relint.el
+++ b/relint.el
@@ -1284,12 +1284,36 @@ EXPANDED is a list of expanded functions, to prevent 
recursion."
((atom expr) nil)
((memq (car expr) relint--regexp-returning-functions)
 (list (car expr)))
-   ((memq (car expr) '(looking-at re-search-forward re-search-backward
-   string-match string-match-p looking-back looking-at-p))
+   ((memq (car expr)
+  ;; These forms never produce regexps at all, but are listed here
+  ;; to prevent false positives since their bodies often do.
+  '(while
+looking-at re-search-forward re-search-backward
+string-match string-match-p looking-back looking-at-p
+replace-regexp
+query-replace-regexp
+posix-looking-at posix-search-backward
+posix-search-forward
+posix-string-match
+search-forward-regexp search-backward-regexp
+kill-matching-buffers
+keep-lines flush-lines how-many
+delete-matching-lines delete-non-matching-lines
+count-matches
+s-matches? s-matches-p s-matched-positions-all
+s-count-matches s-count-matches-all))
 nil)
((null (cdr (last expr)))
 (let* ((head (car expr))
-   (args (if (memq head '(if when unless while))
+   (args
+(if (memq head
+  ;; These forms may generate regexps but the provenance
+  ;; of their first argument is irrelevant.
+  ;; This list, too, could be expanded vastly.
+  '(if when unless
+replace-regexp-in-string
+s-match-strings-all s-match s-slice-at
+s-split s-split-up-to))
  (cddr expr)
(cdr expr)))
(alias (assq head relint--alias-defs)))
diff --git a/test/6.elisp b/test/6.elisp
index cbbdf4b..2180df6 100644
--- a/test/6.elisp
+++ b/test/6.elisp
@@ -17,7 +17,11 @@
(format "[%s]" (regexp-quote x))
(format "[%s]" (myrefun y))
(format "[%s]" (rx ?a "b" nonl))
-   (format "[%s]" (rx-to-string z
+   (format "[%s]" (rx-to-string z))
+   (format "[%s]" (f (string-match (regexp-quote x) a))) ; ok
+   (format "[%s]" (f (replace-regexp-in-string (regexp-quote x) a b))) ; ok
+   (format "[%s]" (f (replace-regexp-in-string a b (regexp-quote x ; bad
+   ))
 
 ;; Test skip-chars
 (defun test-skip-chars (x y z)
diff --git a/test/6.expected b/test/6.expected
index 0e8728e..e8851d5 100644
--- a/test/6.expected
+++ b/test/6.expected
@@ -8,27 +8,28 @@
 6.elisp:18:19: Value from `regexp-opt' cannot be spliced into `[...]'
 6.elisp:19:19: Value from `rx' cannot be spliced into `[...]'
 6.elisp:20:19: Value from `rx-to-string' cannot be spliced into `[...]'
-6.elisp:24:24: In call to skip-chars-forward: Suspect skip set framed in 
`[...]' (pos 0)
+6.elisp:23:19: Value from `regexp-quote' cannot be spliced into `[...]'
+6.elisp:28:24: In call to skip-chars-forward: Suspect skip set framed in 
`[...]' (pos 0)
   "[a-z]"
^
-6.elisp:25:26: In call to skip-chars-backward: Duplicated character `a' (pos 1)
+6.elisp:29:26: In call to skip-chars-backward: Duplicated character `a' (pos 1)
   "aa"
.^
-6.elisp:26:23: `some-re' cannot be used for arguments to `skip-chars-forward'
-6.elisp:27:24: `regexp-quote' cannot be used for arguments to 
`skip-chars-backward'
-6.elisp:28:23: `regexp-opt' cannot be used for arguments to 
`skip-chars-forward'
-6.elisp:29:24: `rx' cannot be used for arguments to `skip-chars-backward'
-6.elisp:30:23: `rx-to-string' cannot be used for arguments to 
`skip-chars-forward'
-6.elisp:34:27: In call to skip-syntax-forward: Invalid char `s' in syntax 
string (pos 1)
+6.elisp:30:23: `some-re' cannot be used for arguments to `skip-chars-forward'
+6.elisp:31:24: `regexp-quote' cannot be used for arguments to 
`skip-chars-backward'
+6.elisp:32:23: `regexp-opt' cannot be used for arguments to 
`skip-chars-forward'
+6.elisp:33:24: `rx' cannot be used for arguments to `skip-chars-backward'
+6.elisp:34:23: `rx-to-string' cannot be used for arguments to 
`skip-chars-forward'
+6.elisp:38:27: In call to skip-syntax-forward: Invalid char `s' in syntax 
string (pos 1)
   "\\s-"
..^
-6.elisp:35:27: In call to skip-syntax-backward: Duplicated syntax code ` ' 
(pos 1)
+6.elisp:39:27: In call to skip-syntax-backward: 

[elpa] externals/relint 7690e3a 08/16: Scan font-lock-defaults correctly

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 7690e3af91ec8f9649cc5685404ffe61497b1643
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Scan font-lock-defaults correctly

Previously, font-lock-defaults was treated as font-lock-keywords which
is incorrect; the forms are different. Now assignments to variables
whose name contain 'font-lock-keywords' are scanned as such.
---
 relint.el   | 30 ++
 test/9.elisp| 22 +-
 test/9.expected | 18 --
 3 files changed, 55 insertions(+), 15 deletions(-)

diff --git a/relint.el b/relint.el
index 08f61aa..7a45323 100644
--- a/relint.el
+++ b/relint.el
@@ -1154,6 +1154,22 @@ source."
 (if literal (cons 1 elem-path) elem-path
form path))
 
+(defun relint--check-font-lock-defaults (form name pos path)
+  "Check a value for `font-lock-defaults'."
+  (let ((val (relint--eval-or-nil form)))
+(when (consp val)
+ (cond
+  ((symbolp (car val))
+   (unless (memq (car val) relint--checked-variables)
+ (relint--check-font-lock-keywords (car val) name pos path)))
+  ((consp (car val))
+   (let ((keywords (car val)))
+ (while keywords
+   (when (and (symbolp (car keywords))
+  (not (memq (car keywords) relint--checked-variables)))
+ (relint--check-font-lock-keywords (car keywords) name pos path))
+   (setq keywords (cdr keywords)
+
 (defun relint--check-font-lock-keywords (form name pos path)
   "Check a font-lock-keywords list.  A regexp can be found in an element,
 or in the car of an element."
@@ -1761,8 +1777,11 @@ directly."
(cond
 ((memq name relint--known-regexp-variables)
  (relint--check-re expr name pos (cons i path)))
-((memq name '(font-lock-defaults font-lock-keywords))
+((and (symbolp name) (string-match-p (rx "font-lock-keywords")
+ (symbol-name name)))
  (relint--check-font-lock-keywords expr name pos (cons i path)))
+((eq name 'font-lock-defaults)
+ (relint--check-font-lock-defaults expr name pos (cons i path)))
 ((eq name 'imenu-generic-expression)
  (relint--check-imenu-generic-expression
   expr name pos (cons i path)))
@@ -1969,8 +1988,8 @@ directly."
   (symbol-name name)))
   (relint--check-list re-arg name pos (cons 2 path) nil)
   (push name relint--checked-variables))
- ((string-match-p (rx "font-lock-keywords")
-  (symbol-name name))
+ ((and (symbolp name) (string-match-p (rx "font-lock-keywords")
+  (symbol-name name)))
   (relint--check-font-lock-keywords re-arg name pos (cons 2 path))
   (push name relint--checked-variables))
  ((eq name 'compilation-error-regexp-alist-alist)
@@ -2040,7 +2059,10 @@ directly."
(`(set (make-local-variable ',name) ,expr)
 (cond ((memq name relint--known-regexp-variables)
(relint--check-re expr name pos (cons 2 path)))
-  ((memq name '(font-lock-defaults font-lock-keywords))
+  ((eq name 'font-lock-defaults)
+   (relint--check-font-lock-defaults expr name pos (cons 2 path)))
+  ((and (symbolp name) (string-match-p (rx "font-lock-keywords")
+   (symbol-name name)))
(relint--check-font-lock-keywords expr name pos (cons 2 path)))
   ((eq name 'imenu-generic-expression)
(relint--check-imenu-generic-expression
diff --git a/test/9.elisp b/test/9.elisp
index 4a37174..ef6ae86 100644
--- a/test/9.elisp
+++ b/test/9.elisp
@@ -19,12 +19,24 @@
(comment-end-skip "[ll]"))
   (asdf
 
-(defun test-9-fl ()
-  (setq-local font-lock-defaults '(("[mm]" . tag)))
-  (setq font-lock-defaults '(("[nn]" . tag)))
-  (set (make-local-variable 'font-lock-defaults) '(("[oo]" . tag
-
 (defun test-9-ge ()
   (setq-local imenu-generic-expression
   '((nil "oh" 0)
 ("*more*" "+a+" 0
+
+(defun test-9-fl-kw ()
+  (setq-local font-lock-keywords '(("[mm]" . tag)))
+  (setq font-lock-keywords '(("[nn]" . tag)))
+  (set (make-local-variable 'font-lock-keywords) '(("[oo]" . tag
+
+(defconst my-fl-keyw-1
+  '(("[pp]" . alpha)))
+
+(defconst my-font-lock-keywords-2
+  '(("[qq]" . beta)))
+
+(defun test-9-fl-def ()
+  (setq font-lock-defaults
+'((my-fl-keyw-1
+   my-font-lock-keywords-2)
+  moo mooo)))
diff --git a/test/9.expected b/test/9.expected
index 7bab898..b960f81 100644
--- a/test/9.expected
+++ b/test/9.expected
@@ -34,15 +34,21 @@
 9.elisp:19:33: In comment-end-skip: Duplicated `l' inside character 
alternative (pos 2)
   

[elpa] externals/relint updated (0c35e02 -> 26639c5)

2020-11-30 Thread Mattias Engdeg�rd
mattiase pushed a change to branch externals/relint.

  from  0c35e02   Increment version to 1.18
   new  a1ea26c   Check regexp arguments to more functions
   new  b572fcd   Run automatic tests on Emacs 27.1
   new  14a5135   Minor README correction
   new  8ee9f79   Avoid descending into .git/ when looking for .el files
   new  9173a91   Add progress indicator for interactive relint-directory
   new  1c66438   Add string-search and string-replace to the list of pure 
functions
   new  5720e12   Scan regexp arguments to functions in s.el
   new  7690e3a   Scan font-lock-defaults correctly
   new  4b78e14   Add table of contents to README, and some advice
   new  d0fa8a8   Fix false positives in regexp provenance checks
   new  29e5427   Recognise a few more `featurep` arguments
   new  c8fd922   Minor looking-at optimisation
   new  f0241bc   Increment version to 1.19
   new  5572c57   Emacs 26 compatibility: `directory-files-recursively`
   new  c792bde   Perform Emacs version check at compile time
   new  26639c5   Require xr 1.20


Summary of changes:
 .github/workflows/test.yml |   1 +
 README |  15 +-
 relint.el  | 118 -
 test/2.elisp   |   9 +++-
 test/2.expected|  55 +
 test/6.elisp   |   6 ++-
 test/6.expected|  33 +++--
 test/9.elisp   |  22 +++--
 test/9.expected|  18 ---
 9 files changed, 205 insertions(+), 72 deletions(-)



[elpa] externals/relint 14a5135 03/16: Minor README correction

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 14a5135efb3582eec85efcf017ab9a1d9bd40b2d
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Minor README correction
---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 98e8a1d..0f042ad 100644
--- a/README
+++ b/README
@@ -187,7 +187,7 @@ skip-syntax-backward.
 
   - Literal '-' not first or last
 
-It is good style to put literal hyphens last in character
+It is good style to put a literal hyphen last in character
 alternatives and skip sets, to clearly indicate that it was not
 intended as part of a range.
 



[elpa] externals/relint 1c66438 06/16: Add string-search and string-replace to the list of pure functions

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 1c664381d81286bacda026d1aabf8a64c344d514
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Add string-search and string-replace to the list of pure functions

These were added in (the yet unreleased) Emacs 28.
---
 relint.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/relint.el b/relint.el
index 8fc2de3..7f46b46 100644
--- a/relint.el
+++ b/relint.el
@@ -444,6 +444,7 @@ or (NAME val VAL), for values.")
 string-join string-trim-left string-trim-right string-trim
 string-prefix-p string-suffix-p
 string-blank-p string-remove-prefix string-remove-suffix
+string-search string-replace
 vector aref elt vconcat
 char-to-string string-to-char
 number-to-string string-to-number int-to-string



[elpa] externals/relint 8ee9f79 04/16: Avoid descending into .git/ when looking for .el files

2020-11-30 Thread Mattias Engdeg�rd
branch: externals/relint
commit 8ee9f79d4b8cd5b27df1bb6342f4962db1d0930e
Author: Mattias Engdegård 
Commit: Mattias Engdegård 

Avoid descending into .git/ when looking for .el files

This saves quite some time when scanning directories containing lots
of git trees.
---
 relint.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/relint.el b/relint.el
index 3b40d12..ee670b7 100644
--- a/relint.el
+++ b/relint.el
@@ -2328,7 +2328,9 @@ TARGET is the file or directory to use for a repeated 
run."
 
 (defun relint--tree-files (dir)
   (directory-files-recursively
-   dir (rx bos (not (any ".")) (* anything) ".el" eos)))
+   dir (rx bos (not (any ".")) (* anything) ".el" eos) nil
+   ;; Save time by not pointlessly descending into huge .git directories.
+   (lambda (s) (not (string-suffix-p "/.git" s)
 
 (defun relint--scan-buffer (buffer)
   "Scan BUFFER; return (COMPLAINTS . SUPPRESSED) where



  1   2   >