[nongnu] elpa/org-contrib 56a3bbb 2/2: lisp/org-contrib.el: Bump version to 0.3

2021-10-13 Thread ELPA Syncer
branch: elpa/org-contrib
commit 56a3bbbd486c567234e63c95c954c5e2ed77f8e7
Author: Bastien Guerry 
Commit: Bastien Guerry 

lisp/org-contrib.el: Bump version to 0.3
---
 lisp/org-contrib.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-contrib.el b/lisp/org-contrib.el
index 0fe1088..46d5577 100644
--- a/lisp/org-contrib.el
+++ b/lisp/org-contrib.el
@@ -4,8 +4,8 @@
 
 ;; Author: Bastien Guerry 
 ;; Homepage: https://git.sr.ht/~bzg/org-contrib
-;; Package-Requires: ((emacs "25.1") (org "9.4.5"))
-;; Version: 0.2
+;; Package-Requires: ((emacs "25.1") (org "9.4.6"))
+;; Version: 0.3
 ;; Keywords: org
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 



[nongnu] elpa/org-contrib 23cd791 1/2: lisp/ol-man.el: Delete

2021-10-13 Thread ELPA Syncer
branch: elpa/org-contrib
commit 23cd791431a18437c0344ef196587c5b29d78b75
Author: Bastien Guerry 
Commit: Bastien Guerry 

lisp/ol-man.el: Delete

Moving this file to org-contrib was a mistake, fixed in upstream Org.
---
 README.md  |  1 -
 README.org |  1 -
 lisp/ol-man.el | 85 --
 3 files changed, 87 deletions(-)

diff --git a/README.md b/README.md
index 5df1622..10ff6ee 100644
--- a/README.md
+++ b/README.md
@@ -113,7 +113,6 @@ find after the "Homepage:" keyword in the files themselves:
 -   **ol-bookmark.el:** Links to bookmarks
 -   **ol-elisp-symbol.el:** Links to Emacs-lisp symbols
 -   **ol-git-link.el:** Links to specific file version
--   **ol-man.el:** Links to man pages
 -   **ol-mew.el:** Links to Mew messages
 -   **ol-notmuch.el:** Links to notmuch messages
 -   **ol-vm.el:** Support for links to VM messages
diff --git a/README.org b/README.org
index d451778..9c06ccf 100644
--- a/README.org
+++ b/README.org
@@ -105,7 +105,6 @@ find after the "Homepage:" keyword in the files themselves:
 - ol-bookmark.el :: Links to bookmarks
 - ol-elisp-symbol.el :: Links to Emacs-lisp symbols
 - ol-git-link.el :: Links to specific file version
-- ol-man.el :: Links to man pages
 - ol-mew.el :: Links to Mew messages
 - ol-notmuch.el :: Links to notmuch messages
 - ol-vm.el :: Support for links to VM messages
diff --git a/lisp/ol-man.el b/lisp/ol-man.el
deleted file mode 100644
index 2be8ec9..000
--- a/lisp/ol-man.el
+++ /dev/null
@@ -1,85 +0,0 @@
-;;; ol-man.el --- Links to man pages
-;;
-;; Author: Carsten Dominik 
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: https://orgmode.org
-;; Version: 1.0
-;;
-;; 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, 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 GNU Emacs.  If not, see .
-;
-;;
-;;; Commentary:
-
-(require 'ol)
-
-(org-link-set-parameters "man"
-:follow #'org-man-open
-:export #'org-man-export
-:store #'org-man-store-link)
-
-(defcustom org-man-command 'man
-  "The Emacs command to be used to display a man page."
-  :group 'org-link
-  :type '(choice (const man) (const woman)))
-
-(defun org-man-open (path _)
-  "Visit the manpage on PATH.
-PATH should be a topic that can be thrown at the man command.
-If PATH contains extra ::STRING which will use `occur' to search
-matched strings in man buffer."
-  (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
-  (let* ((command (match-string 1 path))
-(search (match-string 2 path)))
-(funcall org-man-command command)
-(when search
-  (with-current-buffer (concat "*Man " command "*")
-   (goto-char (point-min))
-   (search-forward search)
-
-(defun org-man-store-link ()
-  "Store a link to a README file."
-  (when (memq major-mode '(Man-mode woman-mode))
-;; This is a man page, we do make this link
-(let* ((page (org-man-get-page-name))
-   (link (concat "man:" page))
-   (description (format "Manpage for %s" page)))
-  (org-link-store-props
-   :type "man"
-   :link link
-   :description description
-
-(defun org-man-get-page-name ()
-  "Extract the page name from the buffer name."
-  ;; This works for both `Man-mode' and `woman-mode'.
-  (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
-  (match-string 1 (buffer-name))
-(error "Cannot create link to this man page")))
-
-(defun org-man-export (link description format)
-  "Export a man page link from Org files."
-  (let ((path (format "http://man.he.net/?topic=%s§ion=all"; link))
-   (desc (or description link)))
-(cond
- ((eq format 'html) (format "%s" path 
desc))
- ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
- ((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
- ((eq format 'ascii) (format "%s (%s)" desc path))
- ((eq format 'md) (format "[%s](%s)" desc path))
- (t path
-
-(provide 'ol-man)
-
-;;; ol-man.el ends here



[nongnu] elpa/org-contrib updated (b8012e7 -> 56a3bbb)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch elpa/org-contrib.

  from  b8012e7   lisp/org-contrib.el: Bump version to 0.2
   new  23cd791   lisp/ol-man.el: Delete
   new  56a3bbb   lisp/org-contrib.el: Bump version to 0.3


Summary of changes:
 README.md   |  1 -
 README.org  |  1 -
 lisp/ol-man.el  | 85 -
 lisp/org-contrib.el |  4 +--
 4 files changed, 2 insertions(+), 89 deletions(-)
 delete mode 100644 lisp/ol-man.el



[elpa] externals/nano-agenda updated (034691a -> f44fb2c)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/nano-agenda.

  from  034691a   Linting
   new  9714751   Add time if selected date is today + better handling of 
long agenda
   new  f44fb2c   Bug fix + shorter time display for today


Summary of changes:
 nano-agenda.el | 24 
 1 file changed, 16 insertions(+), 8 deletions(-)



[elpa] externals/nano-agenda f44fb2c 2/2: Bug fix + shorter time display for today

2021-10-13 Thread ELPA Syncer
branch: externals/nano-agenda
commit f44fb2c4c73300e24d3041ebfc5aa8152f627c20
Author: Nicolas P. Rougier 
Commit: Nicolas P. Rougier 

Bug fix + shorter time display for today
---
 nano-agenda.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nano-agenda.el b/nano-agenda.el
index 59ea8dc..4d4f3f3 100644
--- a/nano-agenda.el
+++ b/nano-agenda.el
@@ -365,7 +365,7 @@ for efficiency."
 (insert "\n")
 (insert (ts-format "*%A %-e %B %Y*" selected))
 (if is-today
-(insert (format-time-string " /(current time is %H:%M)/")))
+(insert (format-time-string " /(%H:%M)/")))
 (if (and (not is-today) holidays)
 (insert (format " /(%s)/" (nth 0 holidays
 (insert "\n\n")
@@ -484,7 +484,7 @@ for efficiency."
  ""))
 'keymap map))
 (if (< col 6)
-(insert (propertize (if is-today "•" " ") 'face face)
+(insert (propertize (if is-today nano-agenda-today-symbol " ") 
'face face)
   (if (< row 5) (insert "\n")
 
 (provide 'nano-agenda)



[elpa] externals/nano-agenda 9714751 1/2: Add time if selected date is today + better handling of long agenda

2021-10-13 Thread ELPA Syncer
branch: externals/nano-agenda
commit 97147517542e807df2c2b050f9d8817df3cba207
Author: Nicolas P. Rougier 
Commit: Nicolas P. Rougier 

Add time if selected date is today + better handling of long agenda
---
 nano-agenda.el | 22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/nano-agenda.el b/nano-agenda.el
index fadfef9..59ea8dc 100644
--- a/nano-agenda.el
+++ b/nano-agenda.el
@@ -73,12 +73,14 @@
"#FCC419" "#FAB005" "#F59F00" 
"#F08C00" "#E67700")
   "Background colors to be used to highlight a day in calendar
   view according to busy level."
+  :type '(repeat color)
   :group 'nano-agenda-faces)
 
 (defcustom nano-agenda-busy-foregrounds (list "#00" "#00" "#00" 
"#00" "#00"
   "#00" "#00" "#00" 
"#00" "#FF")
   "Foreground colors to be used to highlight a day in calendar
   view according to busy level."
+  :type '(repeat color)
   :group 'nano-agenda-faces)
 
 (defface nano-agenda-default
@@ -353,13 +355,18 @@ for efficiency."
  (month(ts-month selected))
  (year (ts-year  selected))
  (date (list month day year))
+ (today(ts-now))
+ (is-today (and (= (ts-year selected) (ts-year today))
+(= (ts-doy selected) (ts-doy today
  (holidays (calendar-check-holidays date))
  (entries '()))
 
 ;; Header (literal date + holidays (if any))
 (insert "\n")
 (insert (ts-format "*%A %-e %B %Y*" selected))
-(if holidays
+(if is-today
+(insert (format-time-string " /(current time is %H:%M)/")))
+(if (and (not is-today) holidays)
 (insert (format " /(%s)/" (nth 0 holidays
 (insert "\n\n")
 
@@ -378,13 +385,14 @@ for efficiency."
  (get-text-property 0 'time-of-day 
entry-2)
 
 ;; Display entries
-(dolist (entry (cl-subseq entries 0 (min 4 (length entries
-  (nano-agenda-display-entry entry))
-(if (> (length entries) 4)
-(insert (format "/+%S non-displayed event(s)/" (- (length entries) 
4)
-
+(let ((limit (if (< (length entries) 6) 6 4)))
+  (dolist (entry (cl-subseq entries 0 (min limit (length entries
+(nano-agenda-display-entry entry))
+  (if (> (length entries) limit)
+  (insert (format "/+%S non-displayed event(s)/" (- (length entries) 
limit))
   
-  (goto-char (point-min)))
+(goto-char (point-min)))
+
 
 (defun nano-agenda--populate-calendar ()
   "Populate the calendar according to the month of the current selected date."



[elpa] externals/emms f0da845: * doc/emms.texinfo: comment on emms-x-url

2021-10-13 Thread ELPA Syncer
branch: externals/emms
commit f0da8453ae94aec630ad5b3395d6bc882ef0ae57
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* doc/emms.texinfo: comment on emms-x-url

patch by Yuchen Pei
---
 doc/emms.texinfo | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/emms.texinfo b/doc/emms.texinfo
index b018d99..d3e30cf 100644
--- a/doc/emms.texinfo
+++ b/doc/emms.texinfo
@@ -545,10 +545,14 @@ A source for multiple directory trees - either @var{dir}, 
or the
 value of @var{emms-source-file-default-directory}.
 @end defun
 @defun emms-play-url url
-A source for an @var{url} - for example, for streaming.
+A source for an @var{url} - for example, for streaming over http,
+playing over sftp, or playing local files (with the ``file://''
+scheme).
 @end defun
 @defun emms-add-url url
-A source for an @var{url} - for example, for streaming.
+A source for an @var{url} - for example, for streaming over http,
+playing over sftp, or playing local files (with the ``file://''
+scheme).
 @end defun
 @defun emms-play-playlist playlist
 A source for the M3u or PLS playlist format from the file @var{playlist}.



[elpa] externals/kiwix 4e3382e: Bump version to 1.1.4

2021-10-13 Thread Philip Kaludercic
branch: externals/kiwix
commit 4e3382e2b6e40a3bd5732fd90f6e63abcabbc237
Author: stardiviner 
Commit: stardiviner 

Bump version to 1.1.4
---
 kiwix.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kiwix.el b/kiwix.el
index 7fc0232..8d7b411 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -6,7 +6,7 @@
 ;; Keywords: kiwix wikipedia
 ;; Homepage: https://github.com/stardiviner/kiwix.el
 ;; Created: 23th July 2016
-;; Version: 1.1.0
+;; Version: 1.1.4
 ;; Package-Requires: ((emacs "25.1") (request "0.3.0"))
 
 ;; Copyright (C) 2019-2020  Free Software Foundation, Inc.



[elpa] externals/transient b526b9c: transient-infix-set: Consider all incompatibility rules

2021-10-13 Thread Jonas Bernoulli
branch: externals/transient
commit b526b9c735ac7eeb95624442889cb9aabe8895a4
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

transient-infix-set: Consider all incompatibility rules

Previously all but the first set of mutually exclusive arguments
that the current argument is a member of were ignored.

Closes #155.
Closes #163.
---
 lisp/transient.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 6b4fc45..8752827 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2695,7 +2695,10 @@ prompt."
(oref obj argument-regexp
 (if-let ((sic (and value arg transient--unset-incompatible))
  (spec (oref transient--prefix incompatible))
- (incomp (remove arg (cl-find-if (lambda (elt) (member arg elt)) 
spec
+ (incomp (cl-mapcan (lambda (rule)
+  (and (member arg rule)
+   (remove arg rule)))
+spec)))
 (progn
   (cl-call-next-method obj value)
   (dolist (arg incomp)



[elpa] externals/boxy updated (f1aa854 -> bda3f52)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/boxy.

  from  f1aa854   Merge branch 'next' into 'main'
   new  6892096   Updated faces
   new  3a46efc   Reimplement (toggle-truncate-lines) to avoid message
   new  792192b   Test chinese characters
   new  e637cbf   Using string-width instead of length
   new  c93b26b   Added subr-x dep
   new  3cc4a81   Updated docstring
   new  535b186   Bump version
   new  bda3f52   Merge branch 'next' into 'main'


Summary of changes:
 boxy.el| 55 +-
 tests/boxy-test-chinese.el | 51 ++
 2 files changed, 71 insertions(+), 35 deletions(-)
 create mode 100644 tests/boxy-test-chinese.el



[elpa] externals/boxy 3a46efc 2/8: Reimplement (toggle-truncate-lines) to avoid message

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit 3a46efcdf238902afd1f5ef95cff4e520441f57f
Author: Tyler Grinn 
Commit: Tyler Grinn 

Reimplement (toggle-truncate-lines) to avoid message
---
 boxy.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/boxy.el b/boxy.el
index 192e208..8323029 100644
--- a/boxy.el
+++ b/boxy.el
@@ -412,10 +412,10 @@
 (define-derived-mode boxy-mode special-mode
   "Boxy"
   "Mode for viewing an boxy diagram."
-  (let ((inhibit-message t)) ;FIXME: Please report the message as an error.
-(setq indent-tabs-mode nil)
-(cursor-sensor-mode t)
-(toggle-truncate-lines t)))
+  (visual-line-mode -1)
+  (setq indent-tabs-mode nil)
+  (cursor-sensor-mode t)
+  (setq truncate-lines t))
 
 (cl-defun boxy-pp (box
&key



[elpa] externals/boxy 535b186 7/8: Bump version

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit 535b186f238ad1c2e957ef10ff96a464ff708771
Author: Tyler Grinn 
Commit: Tyler Grinn 

Bump version
---
 boxy.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boxy.el b/boxy.el
index 7c7c6f9..7d0cdd2 100644
--- a/boxy.el
+++ b/boxy.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Tyler Grinn 
-;; Version: 1.0.2
+;; Version: 1.0.3
 ;; File: boxy.el
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: tools



[elpa] externals/boxy c93b26b 5/8: Added subr-x dep

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit c93b26b025d1e3ad321f8907561894403aca0556
Author: Tyler Grinn 
Commit: Tyler Grinn 

Added subr-x dep
---
 boxy.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/boxy.el b/boxy.el
index 62ccfe5..2a8a013 100644
--- a/boxy.el
+++ b/boxy.el
@@ -115,6 +115,7 @@
 (require 'easy-mmode)
 (require 'eieio)
 (require 'cl-lib)
+(require 'subr-x)
 
  Options
 



[elpa] externals/boxy 3cc4a81 6/8: Updated docstring

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit 3cc4a819d78d4691949526622575a332bcad15eb
Author: Tyler Grinn 
Commit: Tyler Grinn 

Updated docstring
---
 boxy.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boxy.el b/boxy.el
index 2a8a013..7c7c6f9 100644
--- a/boxy.el
+++ b/boxy.el
@@ -120,7 +120,7 @@
  Options
 
 (defgroup boxy nil
-  "Customization options for boxy"
+  "Customization options for boxy."
   :group 'applications)
 
 (defcustom boxy-default-margin-x 2



[elpa] externals/boxy e637cbf 4/8: Using string-width instead of length

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit e637cbf04df393c2b41d9f1ea87243070fc7ddb7
Author: Tyler Grinn 
Commit: Tyler Grinn 

Using string-width instead of length
---
 boxy.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/boxy.el b/boxy.el
index 8323029..62ccfe5 100644
--- a/boxy.el
+++ b/boxy.el
@@ -915,7 +915,7 @@ Uses `boxy--offset' to determine row and column offsets."
   (let ((remaining-chars (- (save-excursion 
(end-of-line)
 
(current-column))
 (current-column
-(delete-char (min (length str) 
remaining-chars))
+(delete-char (min (string-width str) 
remaining-chars))
 (draw (cons top left)
   (concat (cond ((and double dashed) "┏")
 (double "╔")
@@ -983,7 +983,7 @@ Uses `boxy--offset' to determine row and column offsets."
 (* 2 padding)))
  (width (+ base-width
(if (slot-boundp box :name)
-   (with-slots (name) box (length name))
+   (with-slots (name) box (string-width name))
  0)))
  (children (boxy--get-children box)))
 (setq stored-width
@@ -1014,7 +1014,7 @@ Uses `boxy--offset' to determine row and column offsets."
   (mapcar #'boxy--get-width 
row)
   (* -1 margin)))
rows
-  (if (> width (+ (* 2 padding) children-width))
+  (if (> width (+ 1 (* 2 padding) children-width))
   width
 (+ base-width children-width)
 



[elpa] externals/boxy bda3f52 8/8: Merge branch 'next' into 'main'

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit bda3f524f68a962ba36265882df39eafc80b6dfd
Merge: f1aa854 535b186
Author: Tyler Grinn 
Commit: Tyler Grinn 

Merge branch 'next' into 'main'

v1.0.3

Closes #1

See merge request tygrdev/boxy!4
---
 boxy.el| 55 +-
 tests/boxy-test-chinese.el | 51 ++
 2 files changed, 71 insertions(+), 35 deletions(-)

diff --git a/boxy.el b/boxy.el
index 896e3aa..7d0cdd2 100644
--- a/boxy.el
+++ b/boxy.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Tyler Grinn 
-;; Version: 1.0.2
+;; Version: 1.0.3
 ;; File: boxy.el
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: tools
@@ -115,11 +115,12 @@
 (require 'easy-mmode)
 (require 'eieio)
 (require 'cl-lib)
+(require 'subr-x)
 
  Options
 
 (defgroup boxy nil
-  "Customization options for boxy"
+  "Customization options for boxy."
   :group 'applications)
 
 (defcustom boxy-default-margin-x 2
@@ -163,39 +164,23 @@
 (defface boxy-default nil
   "Default face used in Boxy mode.")
 
-(defface boxy-primary nil
-  "Face for highlighting the name of a box.")
+(defface boxy-primary
+   'background dark)) (:foreground "turquoise"))
+ (t (:foreground "dark cyan")))
+   "Face for highlighting the name of a box.")
 
-(face-spec-set
- 'boxy-primary
- 'background dark)) (:foreground "turquoise"))
-   (t (:foreground "dark cyan")))
- 'face-defface-spec)
-
-(defface boxy-selected nil
+(defface boxy-selected
+   '((t :foreground "light slate blue"))
   "Face for the current box border under cursor.")
 
-(face-spec-set
- 'boxy-selected
- '((t :foreground "light slate blue"))
- 'face-defface-spec)
-
-(defface boxy-rel nil
+(defface boxy-rel
+  '((t :foreground "hot pink"))
   "Face for the box which is related to the box under the cursor.")
 
-(face-spec-set
- 'boxy-rel
- '((t :foreground "hot pink"))
- 'face-defface-spec)
-
-(defface boxy-tooltip nil
-  "Face for tooltips in a boxy diagram.")
-
-(face-spec-set
- 'boxy-tooltip
+(defface boxy-tooltip
  'background dark)) (:background "gray30" :foreground "gray"))
(t (:background "gainsboro" :foreground "dim gray")))
- 'face-defface-spec)
+ "Face for tooltips in a boxy diagram.")
 
  Constants
 
@@ -428,10 +413,10 @@
 (define-derived-mode boxy-mode special-mode
   "Boxy"
   "Mode for viewing an boxy diagram."
-  (let ((inhibit-message t)) ;FIXME: Please report the message as an error.
-(setq indent-tabs-mode nil)
-(cursor-sensor-mode t)
-(toggle-truncate-lines t)))
+  (visual-line-mode -1)
+  (setq indent-tabs-mode nil)
+  (cursor-sensor-mode t)
+  (setq truncate-lines t))
 
 (cl-defun boxy-pp (box
&key
@@ -931,7 +916,7 @@ Uses `boxy--offset' to determine row and column offsets."
   (let ((remaining-chars (- (save-excursion 
(end-of-line)
 
(current-column))
 (current-column
-(delete-char (min (length str) 
remaining-chars))
+(delete-char (min (string-width str) 
remaining-chars))
 (draw (cons top left)
   (concat (cond ((and double dashed) "┏")
 (double "╔")
@@ -999,7 +984,7 @@ Uses `boxy--offset' to determine row and column offsets."
 (* 2 padding)))
  (width (+ base-width
(if (slot-boundp box :name)
-   (with-slots (name) box (length name))
+   (with-slots (name) box (string-width name))
  0)))
  (children (boxy--get-children box)))
 (setq stored-width
@@ -1030,7 +1015,7 @@ Uses `boxy--offset' to determine row and column offsets."
   (mapcar #'boxy--get-width 
row)
   (* -1 margin)))
rows
-  (if (> width (+ (* 2 padding) children-width))
+  (if (> width (+ 1 (* 2 padding) children-width))
   width
 (+ base-width children-width)
 
diff --git a/tests/boxy-test-chinese.el b/tests/boxy-test-chinese.el
new file mode 100644
index 000..0d9f30e
--- /dev/null
+++ b/tests/boxy-test-chinese.el
@@ -0,0 +1,51 @@
+;;; boxy-test-chinese.el --- Chinese test cases for boxy -*- lexical-binding: 
t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Tyler Grinn 
+
+;;; Code:
+
+ Requirements
+
+(require 'boxy-test-setup)
+
+ Tests
+
+(ert-deftest boxy-test-chinese-hello ()
+  (let* ((world (boxy-box))
+ (thing (boxy-box :name "thing" :margin-y 0))
+ (hello (boxy-box :nam

[elpa] externals/boxy 6892096 1/8: Updated faces

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit 6892096eff3d6e860c7866eaa6b07a68d8351b6d
Author: Tyler Grinn 
Commit: Tyler Grinn 

Updated faces
---
 boxy.el | 36 ++--
 1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/boxy.el b/boxy.el
index 896e3aa..192e208 100644
--- a/boxy.el
+++ b/boxy.el
@@ -163,39 +163,23 @@
 (defface boxy-default nil
   "Default face used in Boxy mode.")
 
-(defface boxy-primary nil
-  "Face for highlighting the name of a box.")
+(defface boxy-primary
+   'background dark)) (:foreground "turquoise"))
+ (t (:foreground "dark cyan")))
+   "Face for highlighting the name of a box.")
 
-(face-spec-set
- 'boxy-primary
- 'background dark)) (:foreground "turquoise"))
-   (t (:foreground "dark cyan")))
- 'face-defface-spec)
-
-(defface boxy-selected nil
+(defface boxy-selected
+   '((t :foreground "light slate blue"))
   "Face for the current box border under cursor.")
 
-(face-spec-set
- 'boxy-selected
- '((t :foreground "light slate blue"))
- 'face-defface-spec)
-
-(defface boxy-rel nil
+(defface boxy-rel
+  '((t :foreground "hot pink"))
   "Face for the box which is related to the box under the cursor.")
 
-(face-spec-set
- 'boxy-rel
- '((t :foreground "hot pink"))
- 'face-defface-spec)
-
-(defface boxy-tooltip nil
-  "Face for tooltips in a boxy diagram.")
-
-(face-spec-set
- 'boxy-tooltip
+(defface boxy-tooltip
  'background dark)) (:background "gray30" :foreground "gray"))
(t (:background "gainsboro" :foreground "dim gray")))
- 'face-defface-spec)
+ "Face for tooltips in a boxy diagram.")
 
  Constants
 



[elpa] externals/boxy 792192b 3/8: Test chinese characters

2021-10-13 Thread ELPA Syncer
branch: externals/boxy
commit 792192b56b0a022a6831a90b1f4b35c8bfed0aa3
Author: Tyler Grinn 
Commit: Tyler Grinn 

Test chinese characters
---
 tests/boxy-test-chinese.el | 51 ++
 1 file changed, 51 insertions(+)

diff --git a/tests/boxy-test-chinese.el b/tests/boxy-test-chinese.el
new file mode 100644
index 000..0d9f30e
--- /dev/null
+++ b/tests/boxy-test-chinese.el
@@ -0,0 +1,51 @@
+;;; boxy-test-chinese.el --- Chinese test cases for boxy -*- lexical-binding: 
t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Tyler Grinn 
+
+;;; Code:
+
+ Requirements
+
+(require 'boxy-test-setup)
+
+ Tests
+
+(ert-deftest boxy-test-chinese-hello ()
+  (let* ((world (boxy-box))
+ (thing (boxy-box :name "thing" :margin-y 0))
+ (hello (boxy-box :name "你好" :rel "in")))
+(boxy-add-next thing world)
+(boxy-add-next hello thing)
+(boxy-pp world)
+(with-current-buffer (get-buffer "*Boxy*")
+  (should (string= (buffer-string)
+   "
+╭──╮
+│thing │
+│╭╮│
+││你好││
+│╰╯│
+╰──╯
+")
+
+(ert-deftest boxy-test-chinese-greeting ()
+  (let* ((world (boxy-box))
+ (greeting (boxy-box :name "我叫泰勒" :margin-y 0))
+ (hello (boxy-box :name "你好" :rel "in")))
+(boxy-add-next greeting world)
+(boxy-add-next hello greeting)
+(boxy-pp world)
+(with-current-buffer (get-buffer "*Boxy*")
+  (should (string= (buffer-string)
+   "
+╭╮
+│我叫泰勒│
+│╭╮  │
+││你好│  │
+│╰╯  │
+╰╯
+")
+
+



[nongnu] elpa/proof-general 2361fe8 1/5: Fix #597; ProofGeneral cannot step over `Fail` correctly

2021-10-13 Thread ELPA Syncer
branch: elpa/proof-general
commit 2361fe8b00016e025fe5da12cea0344564364b07
Author: Pierre Courtieu 
Commit: Pierre Courtieu 

Fix #597; ProofGeneral cannot step over `Fail` correctly

The bug happened when `Set Ltac Backtrace` is enabled, which has
become the default since a few versions. The fix is to prefix the
coq-error-message variable with a negative regexp for "message:\n".

This PR should be accepted if it does not slow performances too much.
---
 coq/coq-syntax.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el
index b8b498a..a2266db 100644
--- a/coq/coq-syntax.el
+++ b/coq/coq-syntax.el
@@ -1282,7 +1282,7 @@ different."
 (defvar coq-symbols-regexp (regexp-opt coq-symbols))
 
 ;; - regular expressions
-(defvar coq-error-regexp "^\\(In nested Ltac call\\|Error:\\|Discarding 
pattern\\|Syntax error:\\|System Error:\\|User Error:\\|User 
error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
+(defvar coq-error-regexp 
"\\(?:[^:]\\|[^e]:\\|[^g]e:\\|[^a]ge:\\|[^s]age:\\|[^s]sage:\\|[^e]ssage:\\|[^m]essage:\\)\n\\(In
 nested Ltac call\\|Error:\\|Discarding pattern\\|Syntax error:\\|System 
Error:\\|User Error:\\|User error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
   "A regexp indicating that the Coq process has identified an error.")
 
 ;; april2017: coq-8.7 removes special chars definitely and puts



[nongnu] elpa/proof-general 3b765b4 3/5: Adding tests for #597.

2021-10-13 Thread ELPA Syncer
branch: elpa/proof-general
commit 3b765b48ce7920cbd5a9a8771ee2d4905a901c47
Author: Pierre Courtieu 
Commit: Pierre Courtieu 

Adding tests for #597.
---
 ci/coq-tests.el| 38 ++
 ci/test_stepwise.v | 16 
 2 files changed, 54 insertions(+)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index fb5635f..160312c 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -303,6 +303,44 @@ For example, COMMENT could be (*test-definition*)"
'show-proof-stepwise 'diffs-on))
  
 
+(ert-deftest 090_coq-test-regression-Fail()
+  "Test for Fail"
+  (coq-fixture-on-file
+   (coq-test-full-path "test_stepwise.v")
+   (lambda ()
+ (coq-test-goto-before "(*FailNoTrace*)")
+ (proof-goto-point)
+ (proof-shell-wait)
+ (proof-assert-next-command-interactive) ;; pas the comment
+ (proof-assert-next-command-interactive)
+ (proof-shell-wait)
+ (if (coq--version< (coq-version) "8.10.0")
+ (coq-should-buffer-string "The command has indeed failed with message:
+In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
+Tactic failure: Cannot solve this goal.")
+   (coq-should-buffer-string "The command has indeed failed with message:
+Tactic failure: Cannot solve this goal." "*coq*")
+
+
+;; (coq-should-buffer-regexp (regexp-quote "The command has indeed failed with 
message: Tactic failure: Cannot solve this goal.") "*response*")
+
+(ert-deftest 091_coq-test-regression-Fail()
+  "Test for Fail"
+  (coq-fixture-on-file
+   (coq-test-full-path "test_stepwise.v")
+   (lambda ()
+ (coq-test-goto-before "(*FailTrace*)")
+ (proof-goto-point)
+ (proof-shell-wait)
+ (proof-assert-next-command-interactive) ;; pas the comment
+ (proof-assert-next-command-interactive)
+ (proof-shell-wait)
+ ;; If coq--post-v811, it should be "Show Proof Diffs." otherwise "Show 
Proof."
+ (coq-should-buffer-string "The command has indeed failed with message:
+In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
+Tactic failure: Cannot solve this goal."
+ 
+
 (provide 'coq-tests)
 
 ;;; coq-tests.el ends here
diff --git a/ci/test_stepwise.v b/ci/test_stepwise.v
index 3812adb..af451ff 100644
--- a/ci/test_stepwise.v
+++ b/ci/test_stepwise.v
@@ -11,6 +11,22 @@ Proof using .
   exact proof_of_A.
 Qed. (*test-lemma*)
 
+Section failSection.
+  Local Unset Ltac Backtrace.
+  Goal False.
+  Proof. (*FailNoTrace*)
+Fail (now auto).
+auto.
+  Abort.
+
+  Local Set Ltac Backtrace.
+  Goal False. (*FailTrace*) 
+Fail (now auto).
+auto.
+  Abort.
+End failSection.
+
+
 Lemma false_proof : forall A B : bool, A = B. 
 Proof.
   intros A B.



[nongnu] elpa/proof-general updated (f6df849 -> fd04605)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch elpa/proof-general.

  from  f6df849   Merge pull request #606 from 
ProofGeneral/dont-retract-on-indent
   new  2361fe8   Fix #597; ProofGeneral cannot step over `Fail` correctly
   new  3b765b4   Adding tests for #597.
   new  8215623   Merge pull request #607 from 
Matafou/fix-#597-Fail-backtrace
   new  d2d899b   Fix #608. PG not auto adapting window width.
   new  fd04605   Merge pull request #609 from Matafou/fix-#608-width


Summary of changes:
 ci/coq-tests.el| 42 +-
 ci/test_stepwise.v | 16 
 coq/coq-syntax.el  |  2 +-
 coq/coq.el | 47 +++
 4 files changed, 73 insertions(+), 34 deletions(-)



[nongnu] elpa/proof-general 8215623 4/5: Merge pull request #607 from Matafou/fix-#597-Fail-backtrace

2021-10-13 Thread ELPA Syncer
branch: elpa/proof-general
commit 82156237e97480101225bb53a45425ea146fb6ba
Merge: f6df849 3b765b4
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #607 from Matafou/fix-#597-Fail-backtrace

Fix #597; ProofGeneral cannot step over `Fail` correctly
---
 ci/coq-tests.el| 38 ++
 ci/test_stepwise.v | 16 
 coq/coq-syntax.el  |  2 +-
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index fb5635f..160312c 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -303,6 +303,44 @@ For example, COMMENT could be (*test-definition*)"
'show-proof-stepwise 'diffs-on))
  
 
+(ert-deftest 090_coq-test-regression-Fail()
+  "Test for Fail"
+  (coq-fixture-on-file
+   (coq-test-full-path "test_stepwise.v")
+   (lambda ()
+ (coq-test-goto-before "(*FailNoTrace*)")
+ (proof-goto-point)
+ (proof-shell-wait)
+ (proof-assert-next-command-interactive) ;; pas the comment
+ (proof-assert-next-command-interactive)
+ (proof-shell-wait)
+ (if (coq--version< (coq-version) "8.10.0")
+ (coq-should-buffer-string "The command has indeed failed with message:
+In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
+Tactic failure: Cannot solve this goal.")
+   (coq-should-buffer-string "The command has indeed failed with message:
+Tactic failure: Cannot solve this goal." "*coq*")
+
+
+;; (coq-should-buffer-regexp (regexp-quote "The command has indeed failed with 
message: Tactic failure: Cannot solve this goal.") "*response*")
+
+(ert-deftest 091_coq-test-regression-Fail()
+  "Test for Fail"
+  (coq-fixture-on-file
+   (coq-test-full-path "test_stepwise.v")
+   (lambda ()
+ (coq-test-goto-before "(*FailTrace*)")
+ (proof-goto-point)
+ (proof-shell-wait)
+ (proof-assert-next-command-interactive) ;; pas the comment
+ (proof-assert-next-command-interactive)
+ (proof-shell-wait)
+ ;; If coq--post-v811, it should be "Show Proof Diffs." otherwise "Show 
Proof."
+ (coq-should-buffer-string "The command has indeed failed with message:
+In nested Ltac calls to \"now (tactic)\" and \"easy\", last call failed.
+Tactic failure: Cannot solve this goal."
+ 
+
 (provide 'coq-tests)
 
 ;;; coq-tests.el ends here
diff --git a/ci/test_stepwise.v b/ci/test_stepwise.v
index 3812adb..af451ff 100644
--- a/ci/test_stepwise.v
+++ b/ci/test_stepwise.v
@@ -11,6 +11,22 @@ Proof using .
   exact proof_of_A.
 Qed. (*test-lemma*)
 
+Section failSection.
+  Local Unset Ltac Backtrace.
+  Goal False.
+  Proof. (*FailNoTrace*)
+Fail (now auto).
+auto.
+  Abort.
+
+  Local Set Ltac Backtrace.
+  Goal False. (*FailTrace*) 
+Fail (now auto).
+auto.
+  Abort.
+End failSection.
+
+
 Lemma false_proof : forall A B : bool, A = B. 
 Proof.
   intros A B.
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el
index b8b498a..a2266db 100644
--- a/coq/coq-syntax.el
+++ b/coq/coq-syntax.el
@@ -1282,7 +1282,7 @@ different."
 (defvar coq-symbols-regexp (regexp-opt coq-symbols))
 
 ;; - regular expressions
-(defvar coq-error-regexp "^\\(In nested Ltac call\\|Error:\\|Discarding 
pattern\\|Syntax error:\\|System Error:\\|User Error:\\|User 
error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
+(defvar coq-error-regexp 
"\\(?:[^:]\\|[^e]:\\|[^g]e:\\|[^a]ge:\\|[^s]age:\\|[^s]sage:\\|[^e]ssage:\\|[^m]essage:\\)\n\\(In
 nested Ltac call\\|Error:\\|Discarding pattern\\|Syntax error:\\|System 
Error:\\|User Error:\\|User error:\\|Anomaly[:.]\\|Toplevel input[,]\\)"
   "A regexp indicating that the Coq process has identified an error.")
 
 ;; april2017: coq-8.7 removes special chars definitely and puts



[nongnu] elpa/proof-general fd04605 5/5: Merge pull request #609 from Matafou/fix-#608-width

2021-10-13 Thread ELPA Syncer
branch: elpa/proof-general
commit fd04605af1b07684da522c32d83ac346050926bb
Merge: 8215623 d2d899b
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #609 from Matafou/fix-#608-width

Fix #608. PG not auto adapting window width.
---
 ci/coq-tests.el |  4 +++-
 coq/coq.el  | 47 +++
 2 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index 160312c..3766415 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -133,7 +133,9 @@ then evaluate the BODY function and finally tear-down (exit 
Coq)."
 ;;; For info on macros: https://mullikine.github.io/posts/macro-tutorial
 ;;; (pp (macroexpand '(macro args)))
   (save-excursion
-(let* ((openfile (or file
+(let* (;; avoids bad width detection in batch mode 
+   (coq-auto-adapt-printing-width nil)
+   (openfile (or file
  (concat (make-temp-file coq-test-file-prefix) ".v")))
;; if FILE is nil, create a temporary Coq file, removed in the end
(rmfile (unless file openfile))
diff --git a/coq/coq.el b/coq/coq.el
index 84ce891..a112516 100644
--- a/coq/coq.el
+++ b/coq/coq.el
@@ -1172,9 +1172,6 @@ Printing All set."
   (interactive)
   (coq-ask-do-show-all "Show goal number" "Show" t))
 
-;; Check
-(defvar coq-auto-adapt-printing-width); defpacustom
-
 ;; Since Printing Width is a synchronized option in coq (?) it is retored
 ;; silently to a previous value when retracting. So we reset the stored width
 ;; when retracting, so that it will be auto-adapted at the next command. Not
@@ -1182,15 +1179,9 @@ Printing All set."
 
 ;; FIXME: hopefully this will eventually become a non synchronized option and
 ;; we can remove this.
-(defun coq-set-auto-adapt-printing-width (&optional _symb val); args are for 
:set compatibility
-  "Function called when setting `auto-adapt-printing-width'."
-  (setq coq-auto-adapt-printing-width val)
-  (if coq-auto-adapt-printing-width
-  (progn
-(add-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
-(add-hook 'proof-retract-command-hook #'coq-reset-printing-width))
-(remove-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
-(remove-hook 'proof-retract-command-hook #'coq-reset-printing-width)))
+;; This obeyx coq-auto-adapt-printing-width
+(add-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
+(add-hook 'proof-retract-command-hook #'coq-reset-printing-width)
 
 (defun coq--show-proof-stepwise-cmds ()
   (when coq-show-proof-stepwise
@@ -1250,7 +1241,8 @@ should match the `coq-show-proof-diffs-regexp'."
   (> (length coq-last-but-one-proofstack) 0)))
 (coq--show-proof-stepwise-cmds
 
-
+;; This does not Set Printing Width, it rather tells pg to do that before each
+;; command (if necessary)
 (defpacustom auto-adapt-printing-width t
   "If non-nil, adapt automatically printing width of goals window.
 Each time the user sends a bunch of commands to Coq, check if the
@@ -1260,17 +1252,7 @@ is chosen arbitrarily.  WARNING 2: when backtracking the 
printing
 width is synchronized by coq (?!)."
   :type 'boolean
   :safe 'booleanp
-  :group 'coq
-  :eval (coq-set-auto-adapt-printing-width))
-
-
-;; defpacustom fails to call :eval during inititialization, see trac #456
-(coq-set-auto-adapt-printing-width)
-
-;; this initiates auto adapt printing width at start, by reading the config
-;; var. Let us put this at the end of hooks to have a chance to read local
-;; variables first.
-(add-hook 'coq-mode-hook #'coq-auto-adapt-printing-width t)
+  :group 'coq)
 
 (defvar coq-shell-current-line-width nil
   "Current line width of the Coq printing width.
@@ -1333,14 +1315,15 @@ present, current pg display mode and current geometry 
otherwise."
 A Show command is also issued if SHOW is non-nil, so that the goal is
 redisplayed."
   (interactive)
-  (let ((wdth (or width (coq-guess-goal-buffer-at-next-command
-;; if no available width, or unchanged, do nothing
-(when (and wdth (not (equal wdth coq-shell-current-line-width)))
-  (proof-shell-invisible-command (format "Set Printing Width %S." (- wdth 
1)) t)
-  (setq coq-shell-current-line-width wdth)
-  ;; Show iff show non nil and some proof is under way
-  (when (and show (not (null (cl-caddr (coq-last-prompt-info-safe)
-(proof-shell-invisible-command (format "Show.") t nil 
'no-error-display)
+  (when coq-auto-adapt-printing-width
+(let ((wdth (or width (coq-guess-goal-buffer-at-next-command
+  ;; if no available width, or unchanged, do nothing
+  (when (and wdth (not (equal wdth coq-shell-current-line-width)))
+(proof-shell-invisible-command (format "Set Printing Width %S." (- 
wdth 1)) t)
+(setq coq-shell-current-line-width wdth)
+;; Show iff show non nil and some proof is under way
+(when (and show (not (null (cl-caddr (coq-last-prompt-info-safe)
+ 

[nongnu] elpa/proof-general d2d899b 2/5: Fix #608. PG not auto adapting window width.

2021-10-13 Thread ELPA Syncer
branch: elpa/proof-general
commit d2d899b742638257c6e5fbd451c0dc1d9593dacb
Author: Pierre Courtieu 
Commit: Pierre Courtieu 

Fix #608. PG not auto adapting window width.

The option setting was flawed. A recent code cleaning revealed it.
Now the hooks are set once and forall correctly and obey the setting.
---
 ci/coq-tests.el |  4 +++-
 coq/coq.el  | 47 +++
 2 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index fb5635f..acea3e7 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -133,7 +133,9 @@ then evaluate the BODY function and finally tear-down (exit 
Coq)."
 ;;; For info on macros: https://mullikine.github.io/posts/macro-tutorial
 ;;; (pp (macroexpand '(macro args)))
   (save-excursion
-(let* ((openfile (or file
+(let* (;; avoids bad width detection in batch mode 
+   (coq-auto-adapt-printing-width nil)
+   (openfile (or file
  (concat (make-temp-file coq-test-file-prefix) ".v")))
;; if FILE is nil, create a temporary Coq file, removed in the end
(rmfile (unless file openfile))
diff --git a/coq/coq.el b/coq/coq.el
index 84ce891..a112516 100644
--- a/coq/coq.el
+++ b/coq/coq.el
@@ -1172,9 +1172,6 @@ Printing All set."
   (interactive)
   (coq-ask-do-show-all "Show goal number" "Show" t))
 
-;; Check
-(defvar coq-auto-adapt-printing-width); defpacustom
-
 ;; Since Printing Width is a synchronized option in coq (?) it is retored
 ;; silently to a previous value when retracting. So we reset the stored width
 ;; when retracting, so that it will be auto-adapted at the next command. Not
@@ -1182,15 +1179,9 @@ Printing All set."
 
 ;; FIXME: hopefully this will eventually become a non synchronized option and
 ;; we can remove this.
-(defun coq-set-auto-adapt-printing-width (&optional _symb val); args are for 
:set compatibility
-  "Function called when setting `auto-adapt-printing-width'."
-  (setq coq-auto-adapt-printing-width val)
-  (if coq-auto-adapt-printing-width
-  (progn
-(add-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
-(add-hook 'proof-retract-command-hook #'coq-reset-printing-width))
-(remove-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
-(remove-hook 'proof-retract-command-hook #'coq-reset-printing-width)))
+;; This obeyx coq-auto-adapt-printing-width
+(add-hook 'proof-assert-command-hook #'coq-adapt-printing-width)
+(add-hook 'proof-retract-command-hook #'coq-reset-printing-width)
 
 (defun coq--show-proof-stepwise-cmds ()
   (when coq-show-proof-stepwise
@@ -1250,7 +1241,8 @@ should match the `coq-show-proof-diffs-regexp'."
   (> (length coq-last-but-one-proofstack) 0)))
 (coq--show-proof-stepwise-cmds
 
-
+;; This does not Set Printing Width, it rather tells pg to do that before each
+;; command (if necessary)
 (defpacustom auto-adapt-printing-width t
   "If non-nil, adapt automatically printing width of goals window.
 Each time the user sends a bunch of commands to Coq, check if the
@@ -1260,17 +1252,7 @@ is chosen arbitrarily.  WARNING 2: when backtracking the 
printing
 width is synchronized by coq (?!)."
   :type 'boolean
   :safe 'booleanp
-  :group 'coq
-  :eval (coq-set-auto-adapt-printing-width))
-
-
-;; defpacustom fails to call :eval during inititialization, see trac #456
-(coq-set-auto-adapt-printing-width)
-
-;; this initiates auto adapt printing width at start, by reading the config
-;; var. Let us put this at the end of hooks to have a chance to read local
-;; variables first.
-(add-hook 'coq-mode-hook #'coq-auto-adapt-printing-width t)
+  :group 'coq)
 
 (defvar coq-shell-current-line-width nil
   "Current line width of the Coq printing width.
@@ -1333,14 +1315,15 @@ present, current pg display mode and current geometry 
otherwise."
 A Show command is also issued if SHOW is non-nil, so that the goal is
 redisplayed."
   (interactive)
-  (let ((wdth (or width (coq-guess-goal-buffer-at-next-command
-;; if no available width, or unchanged, do nothing
-(when (and wdth (not (equal wdth coq-shell-current-line-width)))
-  (proof-shell-invisible-command (format "Set Printing Width %S." (- wdth 
1)) t)
-  (setq coq-shell-current-line-width wdth)
-  ;; Show iff show non nil and some proof is under way
-  (when (and show (not (null (cl-caddr (coq-last-prompt-info-safe)
-(proof-shell-invisible-command (format "Show.") t nil 
'no-error-display)
+  (when coq-auto-adapt-printing-width
+(let ((wdth (or width (coq-guess-goal-buffer-at-next-command
+  ;; if no available width, or unchanged, do nothing
+  (when (and wdth (not (equal wdth coq-shell-current-line-width)))
+(proof-shell-invisible-command (format "Set Printing Width %S." (- 
wdth 1)) t)
+(setq coq-shell-current-line-width wdth)
+;; Show iff show non nil and some proof is under way
+(whe

[elpa] externals/org-real 81e1867 1/5: Add ol to autoloads, added autoload plugin to eldev

2021-10-13 Thread ELPA Syncer
branch: externals/org-real
commit 81e186753c2f23fbd46135cfdc4443e6e6cf148a
Author: Tyler Grinn 
Commit: Tyler Grinn 

Add ol to autoloads, added autoload plugin to eldev
---
 .gitignore  | 2 ++
 Eldev   | 2 ++
 org-real.el | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/.gitignore b/.gitignore
index f67a22e..7c2927c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,7 @@
 /Eldev-local
 /dist
 *.elc
+*-autoloads.el
+
 
 
diff --git a/Eldev b/Eldev
index a46205d..d31ce10 100644
--- a/Eldev
+++ b/Eldev
@@ -2,6 +2,8 @@
 
 (setq eldev-standard-excludes '(".*" "/dist/" "/deps/"))
 
+(eldev-use-plugin 'autoloads)
+
 (eldev-use-local-dependency "deps/boxy" 'packaged)
 
 (eldev-defcommand
diff --git a/org-real.el b/org-real.el
index 1060618..49f139b 100644
--- a/org-real.el
+++ b/org-real.el
@@ -49,6 +49,9 @@
 
  Requirements
 
+;;;###autoload
+(require 'ol)
+
 (require 'boxy)
 (require 'eieio)
 (require 'org-element)



[elpa] externals-release/org updated (17e25c3 -> 009900d)

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

  from  17e25c3   oc-csl: Map § and §§ o section locators
   new  c83fe00   oc: Fix error message
   new  009900d   oc: Add autoload cookie for `org-cite-insert'


Summary of changes:
 lisp/oc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



[elpa] externals/org updated (2b1fc6b -> 8799422)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  2b1fc6b   Merge branch 'bugfix'
   new  c83fe00   oc: Fix error message
   new  009900d   oc: Add autoload cookie for `org-cite-insert'
   new  8799422   Merge branch 'bugfix'


Summary of changes:
 lisp/oc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



[elpa] externals-release/org c83fe00 1/2: oc: Fix error message

2021-10-13 Thread ELPA Syncer
branch: externals-release/org
commit c83fe001c7669fb55fc964a1c1a35d51ccea5adf
Author: Nicolas Goaziou 
Commit: Nicolas Goaziou 

oc: Fix error message

* lisp/oc.el (org-cite-insert): Fix copy-pasta in error message.
---
 lisp/oc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index 09884f5..071a6e3 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1608,7 +1608,7 @@ ARG is the prefix argument received when calling 
interactively the function."
   (let ((name org-cite-insert-processor))
 (cond
  ((null name)
-  (user-error "No processor set to follow citations"))
+  (user-error "No processor set to insert citations"))
  ((not (org-cite--get-processor name))
   (user-error "Unknown processor %S" name))
  ((not (org-cite-processor-has-capability-p name 'insert))



[elpa] externals/org-real 80d49f1 5/5: Merge branch 'next' into 'main'

2021-10-13 Thread ELPA Syncer
branch: externals/org-real
commit 80d49f12575d85bfe5033e16cde721e31e5badd4
Merge: c191844 3031e19
Author: Tyler Grinn 
Commit: Tyler Grinn 

Merge branch 'next' into 'main'

v1.0.3

Bug fixes

* Added org 9.3 dependency
* Added 'ol to autoloads for org-link-set-parameters
* Removed reimplementation of org-link-make-string

See merge request tygrdev/org-real!14
---
 .gitignore  |  2 ++
 Eldev   |  6 +-
 demo/garage.org | 32 
 deps/boxy   |  2 +-
 org-real.el | 38 --
 5 files changed, 36 insertions(+), 44 deletions(-)

diff --git a/.gitignore b/.gitignore
index f67a22e..7c2927c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,7 @@
 /Eldev-local
 /dist
 *.elc
+*-autoloads.el
+
 
 
diff --git a/Eldev b/Eldev
index a46205d..4d346c4 100644
--- a/Eldev
+++ b/Eldev
@@ -1,7 +1,11 @@
 ; -*- mode: emacs-lisp; lexical-binding: t -*-
 
+(eldev-use-package-archive 'gnu)
+
 (setq eldev-standard-excludes '(".*" "/dist/" "/deps/"))
 
+(eldev-use-plugin 'autoloads)
+
 (eldev-use-local-dependency "deps/boxy" 'packaged)
 
 (eldev-defcommand
@@ -37,7 +41,7 @@
  "\033[0;32mPASS\033[0m"
"\033[0;31mFAIL\033[0m")
  title)
-(if (not result)
+(if (and (not result) (fboundp 'diff-buffers))
 (let ((expected (get-expected)))
   (save-window-excursion
 (with-temp-buffer
diff --git a/demo/garage.org b/demo/garage.org
index ca2c554..abded66 100644
--- a/demo/garage.org
+++ b/demo/garage.org
@@ -1,17 +1,17 @@
 * Items in the garage
-  - [[real://garage/workbench][workbench]]
-  - [[real://garage/workbench/paintbrush?rel=in front of][paintbrush]]
-  - [[real://garage/workbench/paintbrush?rel=in front of/wrench?rel=to the 
left of][wrench]]
-  - [[real://garage/workbench/nails?rel=on top of/screwdriver?rel=on top 
of][screwdriver]]
-  - [[real://garage/workbench/ratchet?rel=on top of][ratchet]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above/shovel?rel=above][shovel]]
-  - [[real://garage/east wall/rake?rel=on][rake]]
-  - [[real://garage/workbench/hammer?rel=on][hammer]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left of][hoe]]
-  - [[real://garage/car/air freshener][air freshener]]
-  - [[real://garage/workbench/nails?rel=on top of][nails]]
-  - [[real://garage/east wall][East wall]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above][snowblower]]
-  - [[real://garage/workbench/nails?rel=on top of/screws?rel=above][screws]]
-  - [[real://garage/saw?rel=on][saw]]
-  - [[real://garage/workbench/paintbrush?rel=in front of/wrench?rel=to the 
left of/pliers?rel=below][pliers]]
+  - [[real://house/garage/workbench][workbench]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of][paintbrush]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of/wrench?rel=to 
the left of][wrench]]
+  - [[real://house/garage/workbench/nails?rel=on top of/screwdriver?rel=on top 
of][screwdriver]]
+  - [[real://house/garage/workbench/ratchet?rel=on top of][ratchet]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above/shovel?rel=above][shovel]]
+  - [[real://house/garage/east wall/rake?rel=on][rake]]
+  - [[real://house/garage/workbench/hammer?rel=on][hammer]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left of][hoe]]
+  - [[real://house/garage/car/air freshener][air freshener]]
+  - [[real://house/garage/workbench/nails?rel=on top of][nails]]
+  - [[real://house/garage/east wall][East wall]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above][snowblower]]
+  - [[real://house/garage/workbench/nails?rel=on top 
of/screws?rel=above][screws]]
+  - [[real://house/garage/saw?rel=on][saw]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of/wrench?rel=to 
the left of/pliers?rel=below][pliers]]
diff --git a/deps/boxy b/deps/boxy
index a20250a..bda3f52 16
--- a/deps/boxy
+++ b/deps/boxy
@@ -1 +1 @@
-Subproject commit a20250aea0970b1afd58ff4fea11559866326664
+Subproject commit bda3f524f68a962ba36265882df39eafc80b6dfd
diff --git a/org-real.el b/org-real.el
index 1060618..670ad09 100644
--- a/org-real.el
+++ b/org-real.el
@@ -3,9 +3,9 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Tyler Grinn 
-;; Version: 1.0.2
+;; Version: 1.0.3
 ;; File: org-real.el
-;; Package-Requires: ((emacs "26.1") (boxy "1.0"))
+;; Package-Requires: ((emacs "26.1") (boxy "1.0") (org "9.3"))
 ;; Keywords: tools
 ;; URL: https://gitlab.com/tygrdev/org-real
 
@@ -49,17 +49,21 @@
 
  Requirements
 
+;;;###autoload
+(require 'ol)
+
 (require 'bo

[elpa] externals-release/org 009900d 2/2: oc: Add autoload cookie for `org-cite-insert'

2021-10-13 Thread ELPA Syncer
branch: externals-release/org
commit 009900d7fa149f4548a726260d1a6e6ac98c8ba7
Author: Nicolas Goaziou 
Commit: Nicolas Goaziou 

oc: Add autoload cookie for `org-cite-insert'

* lisp/oc.el (org-cite-insert): Autoload function.
---
 lisp/oc.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/oc.el b/lisp/oc.el
index 071a6e3..dcda8d7 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1600,6 +1600,7 @@ The generated function inserts or edit a citation at 
point.  More specifically,
 "")
   (mapconcat (lambda (k) (concat "@" k)) keys "; "
 
+;;;###autoload
 (defun org-cite-insert (arg)
   "Insert a citation at point.
 Insertion is done according to the processor set in 
`org-cite-insert-processor'.



[elpa] externals/org-real 678ec4e 3/5: Removed reimplementation of org-link-make-string

2021-10-13 Thread ELPA Syncer
branch: externals/org-real
commit 678ec4e201dcae44d0bc8b511fe66674712350ca
Author: Tyler Grinn 
Commit: Tyler Grinn 

Removed reimplementation of org-link-make-string
---
 demo/garage.org | 32 
 org-real.el | 30 ++
 2 files changed, 22 insertions(+), 40 deletions(-)

diff --git a/demo/garage.org b/demo/garage.org
index ca2c554..abded66 100644
--- a/demo/garage.org
+++ b/demo/garage.org
@@ -1,17 +1,17 @@
 * Items in the garage
-  - [[real://garage/workbench][workbench]]
-  - [[real://garage/workbench/paintbrush?rel=in front of][paintbrush]]
-  - [[real://garage/workbench/paintbrush?rel=in front of/wrench?rel=to the 
left of][wrench]]
-  - [[real://garage/workbench/nails?rel=on top of/screwdriver?rel=on top 
of][screwdriver]]
-  - [[real://garage/workbench/ratchet?rel=on top of][ratchet]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above/shovel?rel=above][shovel]]
-  - [[real://garage/east wall/rake?rel=on][rake]]
-  - [[real://garage/workbench/hammer?rel=on][hammer]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left of][hoe]]
-  - [[real://garage/car/air freshener][air freshener]]
-  - [[real://garage/workbench/nails?rel=on top of][nails]]
-  - [[real://garage/east wall][East wall]]
-  - [[real://garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above][snowblower]]
-  - [[real://garage/workbench/nails?rel=on top of/screws?rel=above][screws]]
-  - [[real://garage/saw?rel=on][saw]]
-  - [[real://garage/workbench/paintbrush?rel=in front of/wrench?rel=to the 
left of/pliers?rel=below][pliers]]
+  - [[real://house/garage/workbench][workbench]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of][paintbrush]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of/wrench?rel=to 
the left of][wrench]]
+  - [[real://house/garage/workbench/nails?rel=on top of/screwdriver?rel=on top 
of][screwdriver]]
+  - [[real://house/garage/workbench/ratchet?rel=on top of][ratchet]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above/shovel?rel=above][shovel]]
+  - [[real://house/garage/east wall/rake?rel=on][rake]]
+  - [[real://house/garage/workbench/hammer?rel=on][hammer]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left of][hoe]]
+  - [[real://house/garage/car/air freshener][air freshener]]
+  - [[real://house/garage/workbench/nails?rel=on top of][nails]]
+  - [[real://house/garage/east wall][East wall]]
+  - [[real://house/garage/east wall/rake?rel=on/hoe?rel=to the left 
of/snowblower?rel=above][snowblower]]
+  - [[real://house/garage/workbench/nails?rel=on top 
of/screws?rel=above][screws]]
+  - [[real://house/garage/saw?rel=on][saw]]
+  - [[real://house/garage/workbench/paintbrush?rel=in front of/wrench?rel=to 
the left of/pliers?rel=below][pliers]]
diff --git a/org-real.el b/org-real.el
index d97071a..04e165c 100644
--- a/org-real.el
+++ b/org-real.el
@@ -50,7 +50,7 @@
  Requirements
 
 ;;;###autoload
-(require 'org)
+(require 'ol)
 
 (require 'boxy)
 (require 'eieio)
@@ -304,7 +304,7 @@ diagram."
   (org-in-regexp 
org-link-bracket-re 1)
   (match-end 2)
   (match-string-no-properties 2
- (new-link (org-real--link-make-string 
replace-link old-desc)))
+ (new-link (org-link-make-string replace-link 
old-desc)))
 (push
  `(lambda ()
 (save-excursion
@@ -521,7 +521,10 @@ level."
  Utility expressions
 
 (defun org-real--find-last-index (pred sequence)
-  "Return the index of the last element for which (PRED element) is non-nil in 
SEQUENCE."
+  "Return the index of the last matching element.
+
+Calls (PRED element) for each element in SEQUENCE until a match
+is found."
   (let ((i (- (length sequence) 1)))
 (catch 'match
   (mapc
@@ -531,27 +534,6 @@ level."
(reverse sequence))
   nil)))
 
-(defun org-real--link-make-string (link &optional description)
-  "Make a bracket link, consisting of LINK and DESCRIPTION.
-LINK is escaped with backslashes for inclusion in buffer."
-  (let* ((zero-width-space (string ?\x200B))
-   (description
-(and (org-string-nw-p description)
- ;; Description cannot contain two consecutive square
- ;; brackets, or end with a square bracket.  To prevent
- ;; this, insert a zero width space character between
- ;; the brackets, or at the end of the description.
- (replace-regexp-in-string
-"\\(]\\)\\(]\\)"
-(concat "\\1" zero-width-space "\\2")
-(replace-regexp-in-string "]\\'"
-(concat "\\&" zero-width-space)
-(org-trim description))
-(if (not (org-string-nw-p link)) description
-  (format "[[%s]%s]"
-  

[elpa] externals/org-real 85842f8 2/5: Added org mode 9.3, subr-x dependencies for emacs 26

2021-10-13 Thread ELPA Syncer
branch: externals/org-real
commit 85842f896e2470965756cc9cef725c299ede8e0b
Author: Tyler Grinn 
Commit: Tyler Grinn 

Added org mode 9.3, subr-x dependencies for emacs 26
---
 Eldev   | 4 +++-
 deps/boxy   | 2 +-
 org-real.el | 7 ---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Eldev b/Eldev
index d31ce10..4d346c4 100644
--- a/Eldev
+++ b/Eldev
@@ -1,5 +1,7 @@
 ; -*- mode: emacs-lisp; lexical-binding: t -*-
 
+(eldev-use-package-archive 'gnu)
+
 (setq eldev-standard-excludes '(".*" "/dist/" "/deps/"))
 
 (eldev-use-plugin 'autoloads)
@@ -39,7 +41,7 @@
  "\033[0;32mPASS\033[0m"
"\033[0;31mFAIL\033[0m")
  title)
-(if (not result)
+(if (and (not result) (fboundp 'diff-buffers))
 (let ((expected (get-expected)))
   (save-window-excursion
 (with-temp-buffer
diff --git a/deps/boxy b/deps/boxy
index a20250a..bda3f52 16
--- a/deps/boxy
+++ b/deps/boxy
@@ -1 +1 @@
-Subproject commit a20250aea0970b1afd58ff4fea11559866326664
+Subproject commit bda3f524f68a962ba36265882df39eafc80b6dfd
diff --git a/org-real.el b/org-real.el
index 49f139b..d97071a 100644
--- a/org-real.el
+++ b/org-real.el
@@ -5,7 +5,7 @@
 ;; Author: Tyler Grinn 
 ;; Version: 1.0.2
 ;; File: org-real.el
-;; Package-Requires: ((emacs "26.1") (boxy "1.0"))
+;; Package-Requires: ((emacs "26.1") (boxy "1.0") (org "9.3"))
 ;; Keywords: tools
 ;; URL: https://gitlab.com/tygrdev/org-real
 
@@ -50,7 +50,7 @@
  Requirements
 
 ;;;###autoload
-(require 'ol)
+(require 'org)
 
 (require 'boxy)
 (require 'eieio)
@@ -58,11 +58,12 @@
 (require 'cl-lib)
 (require 'ispell)
 (require 'url-parse)
+(require 'subr-x)
 
  Options
 
 (defgroup org-real nil
-  "Customization options for org-real"
+  "Customization options for org-real."
   :group 'applications)
 
 (defcustom org-real-margin-x 2



[elpa] externals/org-real updated (c191844 -> 80d49f1)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/org-real.

  from  c191844   Merge branch 'next' into 'main'
   new  81e1867   Add ol to autoloads, added autoload plugin to eldev
   new  85842f8   Added org mode 9.3, subr-x dependencies for emacs 26
   new  678ec4e   Removed reimplementation of org-link-make-string
   new  3031e19   Bump version
   new  80d49f1   Merge branch 'next' into 'main'


Summary of changes:
 .gitignore  |  2 ++
 Eldev   |  6 +-
 demo/garage.org | 32 
 deps/boxy   |  2 +-
 org-real.el | 38 --
 5 files changed, 36 insertions(+), 44 deletions(-)



[elpa] externals/org-real 3031e19 4/5: Bump version

2021-10-13 Thread ELPA Syncer
branch: externals/org-real
commit 3031e19f3384771056dc6f77157ebf621a345909
Author: Tyler Grinn 
Commit: Tyler Grinn 

Bump version
---
 org-real.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-real.el b/org-real.el
index 04e165c..670ad09 100644
--- a/org-real.el
+++ b/org-real.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Tyler Grinn 
-;; Version: 1.0.2
+;; Version: 1.0.3
 ;; File: org-real.el
 ;; Package-Requires: ((emacs "26.1") (boxy "1.0") (org "9.3"))
 ;; Keywords: tools



[elpa] externals/org 8799422: Merge branch 'bugfix'

2021-10-13 Thread ELPA Syncer
branch: externals/org
commit 8799422a32e495ca066f2fe07221056d775bb96d
Merge: 2b1fc6b 009900d
Author: Nicolas Goaziou 
Commit: Nicolas Goaziou 

Merge branch 'bugfix'
---
 lisp/oc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index 09884f5..dcda8d7 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -1600,6 +1600,7 @@ The generated function inserts or edit a citation at 
point.  More specifically,
 "")
   (mapconcat (lambda (k) (concat "@" k)) keys "; "
 
+;;;###autoload
 (defun org-cite-insert (arg)
   "Insert a citation at point.
 Insertion is done according to the processor set in 
`org-cite-insert-processor'.
@@ -1608,7 +1609,7 @@ ARG is the prefix argument received when calling 
interactively the function."
   (let ((name org-cite-insert-processor))
 (cond
  ((null name)
-  (user-error "No processor set to follow citations"))
+  (user-error "No processor set to insert citations"))
  ((not (org-cite--get-processor name))
   (user-error "Unknown processor %S" name))
  ((not (org-cite-processor-has-capability-p name 'insert))



[elpa] main 79b7c81 2/2: * gitignore: Add `packages-other`.

2021-10-13 Thread monnier--- via
branch: main
commit 79b7c81988923404c6df74894ff42b0ae6480931
Author: Stefan Monnier 
Commit: Stefan Monnier 

* gitignore: Add `packages-other`.
---
 .gitignore  | 1 +
 elpa-config | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index c9cb2b8..6ecf83c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ core
 # Generated during deployment
 /.pkg-descs.mk
 /packages/
+/other-packages
 /archive/
 /archive-devel/
 GNUmakefile
diff --git a/elpa-config b/elpa-config
index 6f8ae4b..77d516d 100644
--- a/elpa-config
+++ b/elpa-config
@@ -6,5 +6,5 @@
  (branch-prefix"externals/")
  (release-branch-prefix"externals-release/")
  ;;(specs-file "elpa-packages")
- ;;(debug  nil)
+ ;;(debug  t)
  )



[elpa] main updated (40e7269 -> 79b7c81)

2021-10-13 Thread monnier--- via
monnier pushed a change to branch main.

  from  40e7269   * elpa-packages (erc): Add some missing files
   new  5f5faca   * elpa-packages (coterm): New package
   new  79b7c81   * gitignore: Add `packages-other`.


Summary of changes:
 .gitignore| 1 +
 elpa-config   | 2 +-
 elpa-packages | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)



[elpa] main 5f5faca 1/2: * elpa-packages (coterm): New package

2021-10-13 Thread monnier--- via
branch: main
commit 5f5faca90c8c2a63775a70e21c70657493fa5970
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (coterm): New package
---
 elpa-packages | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index 8ae69ff..8145d95 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -106,6 +106,8 @@
  ("context-coloring"   :url 
"https://github.com/jacksonrayhamilton/context-coloring.git";)
  ("corfu"  :url "https://github.com/minad/corfu";
   :doc "README.org" :auto-sync t)
+ ("coterm" :url "https://repo.or.cz/emacs-coterm.git";
+  :auto-sync t)
  ("counsel":url "https://github.com/abo-abo/swiper";)
  ("cpio-mode"  :url "https://github.com/dlewan/cpio-mode";)
  ("crisp"  :url nil)



[elpa] externals/coterm 9e3e19b 05/80: Add support for \e[L

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 9e3e19b82e5514f6eb7733dad6defdb5bfa36e25
Author: m <>
Commit: m <>

Add support for \e[L
---
 coterm.el | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 42919bd..897e63e 100644
--- a/coterm.el
+++ b/coterm.el
@@ -349,7 +349,28 @@ initialize it sensibly."
 (if (eolp)
 (if (eq 1 (car ctl-params)) (dirty))
   (funcall proc-filt process
-   (make-string coterm--t-col 
?\s)
+   (make-string coterm--t-col ?\s)
+ (?L ;; \E[L - insert lines (terminfo: il, il1)
+  ;; Remove from bottom
+  (let ((coterm--t-col 0)
+end)
+(dirty)
+(let ((coterm--t-row coterm-t-height) )
+  (coterm--t-approximate-pmark pmark)
+  (setq end (marker-position pmark)))
+(let ((coterm--t-row
+   (max (- coterm-t-height
+   (car ctl-params))
+coterm--t-row)))
+  (coterm--t-approximate-pmark pmark)
+  (delete-region pmark end))
+(dirty)
+;; Insert new lines
+(coterm--t-approximate-pmark pmark)
+(unless (= pmark (point-max))
+  (funcall proc-filt process
+   (make-string (car ctl-params) ?\n
+  (dirty))
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp



[elpa] externals/coterm 7b1e001 01/80: Initial commit

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 7b1e0018654c297ff50aca18d5695ae06882db07
Author: m <>
Commit: m <>

Initial commit
---
 .gitignore |   1 +
 coterm.el  | 408 +
 2 files changed, 409 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..aee2ce5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/*.elc
diff --git a/coterm.el b/coterm.el
new file mode 100644
index 000..ad14a30
--- /dev/null
+++ b/coterm.el
@@ -0,0 +1,408 @@
+;; -*- lexical-binding: t; -*-
+
+;;; Terminal emulation
+
+;; Removed \t, \032 (\C-z), \eAnSiT
+(defconst coterm-t-control-seq-regexp
+  (concat
+   ;; A control character,
+   "\\(?:[\r\n\000\007\b\016\017]\\|"
+   ;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
+   ;; of the C1 set"),
+   "\e\\(?:[DM78c]\\|"
+   ;; or an escape sequence (section 5.4 "Control Sequences"),
+   "\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)")
+  "Regexp matching control sequences handled by term.el.")
+
+(defconst coterm-t-control-seq-prefix-regexp "\e")
+
+(defvar-local coterm-t-height t
+  "Number of lines in window.")
+(defvar-local coterm-t-width nil
+  "Number of columns in window.")
+
+(defvar-local coterm--t-home-marker nil
+  "Marks the \"home\" position for cursor addressing.
+`coterm--t-home-offset' should be taken into account as well.")
+(defvar-local coterm--t-home-offset 0
+  "How many rows lower the home position actually is.
+This usually is needed if `coterm--t-home-marker' is on the last
+line of the buffer.")
+(defvar-local coterm--t-row nil
+  "Current position from home marker.
+If nil, the current position is at process mark.")
+(defvar-local coterm--t-col nil
+  "Current position from home marker.
+If nil, the current position is at process mark.")
+
+(defvar-local coterm--t-pmark-in-sync nil
+  "If t, pmark is guaranteed to be in sync.
+In sync with variables `coterm--t-home-marker',
+`coterm--t-home-offset', `coterm--t-row' and `coterm--t-col'")
+
+(defvar-local coterm--t-saved-cursor nil)
+(defvar-local coterm-t-insert-mode nil)
+
+(defvar-local coterm--t-unhandled-fragment nil)
+
+(defun coterm--t-reset-size (height width)
+  (setq coterm-t-height height)
+  (setq coterm-t-width width))
+
+(defun coterm--t-normalize-home-offset ()
+  (save-excursion
+(goto-char coterm--t-home-marker)
+(let ((left-to-move (forward-line coterm--t-home-offset)))
+  (unless (bolp)
+(cl-incf left-to-move)
+(forward-line 0))
+  (set-marker coterm--t-home-marker (point))
+  (setq coterm--t-home-offset left-to-move
+
+(defun coterm-t-scroll-into-view ()
+  (let ((height coterm-t-height)
+(row coterm--t-row)
+(home coterm--t-home-marker))
+(cond
+ ((> row height)
+  (save-excursion
+(goto-char home)
+(let ((left-to-move (forward-line (+ coterm--t-home-offset
+ (- row height 1)
+  (unless (bolp)
+(cl-incf left-to-move)
+(forward-line 0))
+  (set-marker home (point))
+  (cl-incf coterm--t-home-offset left-to-move)
+  (setq coterm--t-row height
+ ((< row 0)
+  (save-excursion
+(goto-char home)
+(forward-line row)
+(set-marker home (point))
+(setq coterm--t-row 0))
+
+(defun coterm-t-down (n)
+  (cl-incf coterm--t-row n)
+  (setq coterm--t-pmark-in-sync nil)
+  (coterm-t-scroll-into-view))
+
+;; Moves pmark, inserts
+(defun coterm--t-adjust-pmark (proc-filt process)
+  "Set PROCESS's mark to `coterm--t-row' and `coterm--t-col'.
+If necessary, this function inserts newlines and spaces using
+PROC-FILT, so use it sparingly, usually only before inserting
+non-whitespace text."
+  (unless coterm--t-pmark-in-sync
+(let ((pmark (process-mark process)))
+  (save-excursion
+(goto-char coterm--t-home-marker)
+
+(let ((newlines (forward-line
+ (+ coterm--t-row coterm--t-home-offset
+  (unless (bolp)
+(cl-incf newlines))
+  (unless (zerop newlines)
+(set-marker pmark (point))
+(funcall proc-filt process (make-string newlines ?\n
+
+(let ((col (move-to-column coterm--t-col)))
+  (set-marker pmark (point))
+  (when (< col coterm--t-col)
+(funcall proc-filt process
+ (make-string (- coterm--t-col col) ?\s))
+(setq coterm--t-pmark-in-sync t)
+(coterm--t-normalize-home-offset)))
+
+;; Moves pmark and inserts
+(defun coterm--t-insert (proc-filt process str newlines)
+  "Insert STR using PROC-FILT and PROCESS.
+Synchronise PROCESS's mark beforehand and insert at its position.
+NEWLINES is the number of newlines STR contains. Unless it is
+zero, insertion should happen at the end of accessible portion of
+buffer."
+  (coterm--t-adjust-pmark proc-filt process)
+  (funcall proc-filt process str)
+  (save-e

[elpa] externals/coterm 044b03e 06/80: Simplify

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 044b03efd3102c8abdd99e73981b8223b8050b6a
Author: m <>
Commit: m <>

Simplify
---
 coterm.el | 111 ++
 1 file changed, 61 insertions(+), 50 deletions(-)

diff --git a/coterm.el b/coterm.el
index 897e63e..d27d8f9 100644
--- a/coterm.el
+++ b/coterm.el
@@ -49,6 +49,48 @@ In sync with variables `coterm--t-home-marker',
   (setq coterm-t-height height)
   (setq coterm-t-width width))
 
+(defun coterm--t-point (row col)
+  "Return position that approximates ROW and COL."
+  (save-excursion
+(goto-char coterm--t-home-marker)
+(and
+ (zerop (forward-line
+ (+ coterm--t-home-offset row)))
+ (not (eobp))
+ (move-to-column col))
+(point)))
+
+(defun coterm--t-delete-region (row1 col1 row2 col2)
+  (delete-region (coterm--t-point row1 col1)
+ (coterm--t-point row2 col2))
+  (setq coterm--t-pmark-in-sync nil))
+
+(defun coterm--t-clear-region (proc-filt process row1 col1 row2 col2)
+  (save-excursion
+(let ((p1 (coterm--t-point row1 col1))
+  (p2 (coterm--t-point row2 col2))
+  row col h)
+  (if (> p2 p1)
+  (setq row row1 col col1
+h (- row2 row1))
+(setq row row2 col col2
+  h (- row1 row2)))
+  (delete-region p1 p2)
+  (coterm--t-open-space proc-filt process row col h (abs (- col2 col1)))
+  (setq coterm--t-pmark-in-sync nil
+
+(defun coterm--t-open-space (proc-filt process row col height width)
+  (save-excursion
+(goto-char (coterm--t-point row col))
+(unless (eobp)
+  (set-marker (process-mark process) (point))
+  (funcall
+   proc-filt process
+   (concat (make-string height ?\n)
+   (unless (eolp)
+ (make-string (+ width (if (= row 0) 0 col)) ?\s
+  (setq coterm--t-pmark-in-sync nil
+
 (defun coterm--t-normalize-home-offset ()
   (save-excursion
 (goto-char coterm--t-home-marker)
@@ -268,9 +310,9 @@ initialize it sensibly."
(?8 (ins) ;; Restore cursor (terminfo: rc)
(when-let ((cursor coterm--t-saved-cursor))
  (setq coterm--t-row (car cursor))
- (setq cursor (cdr (cursor)))
+ (setq cursor (cdr cursor))
  (setq coterm--t-col (car cursor))
- (setq cursor (cdr (cursor)))
+ (setq cursor (cdr cursor))
  (when (car cursor)
(setq coterm--t-row (caar cursor)
(?c (ins) ;; \Ec - Reset (terminfo: rs1)
@@ -313,64 +355,33 @@ initialize it sensibly."
  ;; \E[J - clear to end of screen (terminfo: ed, clear)
  ((and ?J (guard (eq 0 (car ctl-params
   (ins)
-  (coterm--t-approximate-pmark pmark)
-  (delete-region pmark (point-max))
+  (delete-region (coterm--t-point coterm--t-row 
coterm--t-col)
+ (point-max))
   (dirty))
  ((and ?J (guard (eq 1 (car ctl-params
   (ins)
-  (coterm--t-approximate-pmark pmark)
-  (coterm--t-normalize-home-offset)
-  (delete-region coterm--t-home-marker pmark)
-  (if (= pmark (point-max))
-  (dirty)
-;; Substitute deleted region with empty lines
-(funcall proc-filt process
- (concat (make-string coterm--t-row ?\n)
- (unless (eq (char-after pmark) 
?\n)
-   (make-string coterm--t-col 
?\s))
+  (coterm--t-clear-region
+   proc-filt process 0 0 coterm--t-row coterm--t-col))
  (?J
   (ins)
-  (coterm--t-normalize-home-offset)
-  (delete-region coterm--t-home-marker (point-max))
+  (delete-region (coterm--t-point 0 0) (point-max))
   (dirty))
  (?K ;; \E[K - clear to end of line (terminfo: el, el1)
   (ins)
-  (coterm--t-approximate-pmark pmark)
-  (save-excursion
-(goto-char pmark)
-(if (eq 1 (car ctl-params))
-;; Clear left of pmark
-(forward-line 0)
-  ;; Clear right of pmark
-  (forward-line 1)
-  (un

[elpa] externals/coterm 0647615 04/80: Plug marker leak

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 064761580e976c7cf5a288a879ff3fa5d8fd2e69
Author: m <>
Commit: m <>

Plug marker leak
---
 coterm.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 87f10cd..42919bd 100644
--- a/coterm.el
+++ b/coterm.el
@@ -381,7 +381,9 @@ initialize it sensibly."
   ;; be used to handle next output.
   (ignore)))
 
-  (goto-char restore-point))
+  (goto-char restore-point)
+  (unless (eq restore-point pmark)
+(set-marker restore-point nil)))
 
 ;;; Mode functions and configuration
 



[elpa] externals/coterm a983b5e 02/80: New function for approximately moving pmark

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit a983b5efc47aea3e9df05781157c481640091162
Author: m <>
Commit: m <>

New function for approximately moving pmark
---
 coterm.el | 45 +++--
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/coterm.el b/coterm.el
index ad14a30..3437776 100644
--- a/coterm.el
+++ b/coterm.el
@@ -114,6 +114,25 @@ non-whitespace text."
 (setq coterm--t-pmark-in-sync t)
 (coterm--t-normalize-home-offset)))
 
+;; Moves pmark
+(defun coterm--t-approximate-pmark (pmark)
+  "Sets PMARK to point close to `coterm--t-row' and col.
+Don't modify buffer.  If `coterm--t-row' and `coterm--t-col'
+point to an unreachable location, locate PMARK as close to it as
+possible and return nil.  Otherwise, locate PMARK exactly and
+return t."
+  (or coterm--t-pmark-in-sync
+  (save-excursion
+(goto-char coterm--t-home-marker)
+(setq coterm--t-pmark-in-sync
+  (prog1
+  (and
+   (zerop (forward-line
+   (+ coterm--t-home-offset coterm--t-row)))
+   (bolp)
+   (<= coterm--t-col (move-to-column coterm--t-col)))
+(set-marker pmark (point)))
+
 ;; Moves pmark and inserts
 (defun coterm--t-insert (proc-filt process str newlines)
   "Insert STR using PROC-FILT and PROCESS.
@@ -293,14 +312,7 @@ initialize it sensibly."
  (dirty))
  (?J ;; \E[J - clear to end of screen (terminfo: ed, 
clear)
   (ins)
-  (save-excursion
-(goto-char coterm--t-home-marker)
-(and
- (zerop (forward-line
- (+ coterm--t-home-offset coterm--t-row)))
- (bolp)
- (move-to-column coterm--t-col))
-(set-marker pmark (point)))
+  (coterm--t-approximate-pmark pmark)
   (pcase (car ctl-params)
 (0
  (delete-region pmark (point-max)))
@@ -335,23 +347,12 @@ initialize it sensibly."
 ;; and `coterm--t-col' may point to a not yet existent location
 ;; after (point-max).  First, we move `pmark' as close to this
 ;; position as possible.
-(if (or coterm--t-pmark-in-sync
-(equal
- '(0 . t)
- (save-excursion
-   (goto-char coterm--t-home-marker)
-   (prog1
-   (cons
-(let ((newlines (forward-line
- (+ coterm--t-row 
coterm--t-home-offset
-  (if (bolp) newlines nil))
-(unless (eobp)
-  (>= coterm--t-col (move-to-column 
coterm--t-col
- (set-marker pmark (point))
+(if (coterm--t-approximate-pmark pmark)
 ;; If we succeed, clear `coterm--t-row' and col.  On next
 ;; output, we will initialize them to point to `pmark'.
 (setq coterm--t-row nil
-  coterm--t-col nil)
+  coterm--t-col nil
+  coterm--t-pmark-in-sync nil)
   ;; If we don't succeed, leave the variables unchanged.  They will
   ;; be used to handle next output.
   (ignore)))



[elpa] externals/coterm 29ef3ad 07/80: Fix scrolling

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 29ef3adf0040c5a0a2e1f447a8f3816713a31910
Author: m <>
Commit: m <>

Fix scrolling
---
 coterm.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/coterm.el b/coterm.el
index d27d8f9..96d045b 100644
--- a/coterm.el
+++ b/coterm.el
@@ -106,22 +106,23 @@ In sync with variables `coterm--t-home-marker',
 (row coterm--t-row)
 (home coterm--t-home-marker))
 (cond
- ((> row height)
+ ((>= row height)
   (save-excursion
 (goto-char home)
 (let ((left-to-move (forward-line (+ coterm--t-home-offset
- (- row height 1)
+ (- row height -1)
   (unless (bolp)
 (cl-incf left-to-move)
 (forward-line 0))
   (set-marker home (point))
-  (cl-incf coterm--t-home-offset left-to-move)
-  (setq coterm--t-row height
+  (setq coterm--t-home-offset left-to-move)
+  (setq coterm--t-row (1- height)
  ((< row 0)
   (save-excursion
 (goto-char home)
 (forward-line row)
 (set-marker home (point))
+(cl-incf coterm--t-home-offset 0)
 (setq coterm--t-row 0))
 
 (defun coterm-t-down (n)



[elpa] externals/coterm c48515c 11/80: Support \e[4h and \e[4l for insert mode

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit c48515c3ba6433a7a8a0e2b30e43480a85ef9d7d
Author: m <>
Commit: m <>

Support \e[4h and \e[4l for insert mode
---
 coterm.el | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 897d94b..25478df 100644
--- a/coterm.el
+++ b/coterm.el
@@ -405,7 +405,19 @@ initialize it sensibly."
  coterm--t-row coterm--t-col
  0 width)
 (cl-incf coterm--t-col width)
-(dirty)))
+(dirty)))
+ (?h ;; \E[?h - DEC Private Mode Set
+  (pcase (car ctl-params)
+;; (49 ;; (terminfo: smcup)
+;;  (coterm-t-switch-to-alternate-sub-buffer t))
+(4 ;; (terminfo: smir)
+ (setq coterm-t-insert-mode t
+ (?l ;; \E[?l - DEC Private Mode Reset
+  (pcase (car ctl-params)
+;; (49 ;; (terminfo: rmcup)
+;;  (coterm-t-switch-to-alternate-sub-buffer nil))
+(4 ;; (terminfo: rmir)
+ (setq coterm-t-insert-mode nil
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp



[elpa] externals/coterm cf9217d 09/80: Support \e[P and \e[@

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit cf9217d0e0b38262bd9c1dddf175ed6582e0
Author: m <>
Commit: m <>

Support \e[P and \e[@
---
 coterm.el | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index 1576873..46a5ff5 100644
--- a/coterm.el
+++ b/coterm.el
@@ -88,7 +88,11 @@ In sync with variables `coterm--t-home-marker',
proc-filt process
(concat (make-string height ?\n)
(unless (eolp)
- (make-string (+ width (if (= row 0) 0 col)) ?\s
+ (make-string (+ width (if (= height 0) 0 col)) ?\s
+  ;; Delete chars that are after the width of the terminal
+  (goto-char (process-mark process))
+  (move-to-column coterm-t-width)
+  (delete-region (point) (progn (forward-line 1) (1- (point
   (setq coterm--t-pmark-in-sync nil
 
 (defun coterm--t-normalize-home-offset ()
@@ -391,7 +395,20 @@ initialize it sensibly."
   ;; Remove at position
   (coterm--t-delete-region
coterm--t-row 0
-   (+ coterm--t-row (car ctl-params)) 0))
+   (+ coterm--t-row (car ctl-params)) 0))
+ (?P ;; \E[P - delete chars (terminfo: dch, dch1)
+  (coterm--t-delete-region
+   coterm--t-row coterm--t-col
+   coterm--t-row (+ coterm--t-col
+(max 1 (car ctl-params)
+ (?@ ;; \E[@ - insert spaces (terminfo: ich)
+  (let ((width (max 1 (car ctl-params
+(coterm--t-open-space
+ proc-filt process
+ coterm--t-row coterm--t-col
+ 0 width)
+(cl-incf coterm--t-col width)
+(dirty)))
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp



[elpa] externals/coterm 4a23ae2 23/80: Further refactor some more

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 4a23ae24616df8d998f986bf9228140e933f0c34
Author: m <>
Commit: m <>

Further refactor some more
---
 coterm.el | 113 --
 1 file changed, 43 insertions(+), 70 deletions(-)

diff --git a/coterm.el b/coterm.el
index 92694d2..263849c 100644
--- a/coterm.el
+++ b/coterm.el
@@ -73,45 +73,28 @@ Return non-nil if the position was actually reached."
(<= col (move-to-column col
 
 (defun coterm--t-delete-region (row1 col1 &optional row2 col2)
-  "Delete text betewwn two positions.
+  "Delete text between two positions.
 Deletes resulting trailing whitespace as well.  ROW1, COL1, ROW2
 and COL2 specify the two positions.  ROW2 and COL2 can be nil, in
-which case `point-max' is assumed"
-  (save-excursion
-(coterm--t-goto row1 col1)
+which case delete to `point-max'.
+
+This function moves point to the beginning of the deleted
+region."
+  (coterm--t-goto row1 col1)
+  (delete-region (point)
+ (if row2
+ (progn (coterm--t-goto row2 col2) (point))
+   (point-max)))
+  (when (eolp)
+(let ((opoint (point)))
+  (skip-chars-backward " ") (delete-region (point) opoint)))
+  (when (eobp)
 (let ((opoint (point)))
-  (delete-region opoint
- (if row2
- (progn (coterm--t-goto row2 col2) (point))
-   (point-max)))
-  (when (eolp)
-(skip-chars-backward " ")
-(delete-region opoint (setq opoint (point
-  (when (eobp)
-(skip-chars-backward "\n")
-(delete-region (point) opoint
+  (skip-chars-backward "\n") (delete-region (point) opoint)))
   (setq coterm--t-pmark-in-sync nil))
 
-(defun coterm--t-clear-region (proc-filt process row1 col1 row2 col2)
-  (save-excursion
-(let ((p1 (progn (coterm--t-goto row1 col1) (point)))
-  (p2 (progn (coterm--t-goto row2 col2) (point)))
-  row col h)
-  (if (> p2 p1)
-  (setq row row1 col col1
-h (- row2 row1))
-(setq row row2 col col2
-  h (- row1 row2)))
-  (delete-region p1 p2)
-  (coterm--t-open-space-at-point
-   proc-filt process
-   h (cond ((> row2 row1) col2)
-   ((< row2 row1) col1)
-   (t (abs (- col2 col1)
-  (setq coterm--t-pmark-in-sync nil
-
 (defun coterm--t-open-space-at-point (proc-filt process newlines spaces)
-  "Insert NEWLINES newlines and SPECES spaces at point.
+  "Insert NEWLINES newlines and SPACES spaces at point.
 Insert them using PROC-FILT and PROCESS.  Afterwards, remove
 characters that were moved after the column specified by
 `coterm--t-width'."
@@ -128,17 +111,6 @@ characters that were moved after the column specified by
 (delete-region (point) (progn (forward-line 1) (1- (point
 (setq coterm--t-pmark-in-sync nil)))
 
-(defun coterm--t-open-space (proc-filt process row col height width)
-  "Open spce at position ROW and COL, preserving point.
-Use PROC-FILT and PROCESS to insert spaces and newlines.
-Whitespace is inserted such that the character at position ROW
-and COL is moved by HEIGHT rows down and WIDTH cols to the
-right."
-  (save-excursion
-(coterm--t-goto row col)
-(coterm--t-open-space-at-point proc-filt process height
-   (+ width (if (= height 0) 0 col)
-
 (defun coterm--t-normalize-home-offset ()
   (save-excursion
 (goto-char coterm--t-home-marker)
@@ -164,8 +136,8 @@ insertion of empty lines."
  (coterm--t-scroll-by-deletion-p))
 (coterm--t-delete-region coterm--t-scroll-beg 0
  (1+ coterm--t-scroll-beg) 0)
-(coterm--t-open-space proc-filt process
-  coterm--t-row 0 1 0))
+(coterm--t-goto coterm--t-row 0)
+(coterm--t-open-space-at-point proc-filt process 1 0))
((and (= coterm--t-row (1- coterm--t-height))
  (coterm--t-scroll-by-deletion-p))
 ;; Behaviour of xterm
@@ -188,8 +160,8 @@ insertion of empty lines."
  (coterm--t-scroll-by-deletion-p))
 (coterm--t-delete-region (1- coterm--t-scroll-end) 0
  coterm--t-scroll-end 0)
-(coterm--t-open-space proc-filt process
-  coterm--t-row 0 1 0))
+(coterm--t-goto coterm--t-row 0)
+(coterm--t-open-space-at-point proc-filt process 1 0))
((and (= coterm--t-row 0)
  (coterm--t-scroll-by-deletion-p))
 ;; Behaviour of xterm
@@ -444,18 +416,20 @@ initialize it sensibly."
   (coterm--t-delete-region coterm--t-row coterm--t-col)
   (dirty))
  ((and ?J (guard (eq 1 (car ctl-params
-  (coterm--t-clear-region
-   proc-filt process 0 0 coterm--t-row coterm--t-col))
- (?J
-  ;; TODO
-  (c

[elpa] externals/coterm 586ce4e 20/80: Delete off-screen rows when scrolling up

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 586ce4effc9ae2d68f743d3b7d2b760e29297ffa
Author: m <>
Commit: m <>

Delete off-screen rows when scrolling up
---
 coterm.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coterm.el b/coterm.el
index 7cbbaeb..e734035 100644
--- a/coterm.el
+++ b/coterm.el
@@ -166,6 +166,7 @@ insertion of empty lines."
((< 0 coterm--t-row)
 (cl-decf coterm--t-row))
(t
+(coterm--t-delete-region (1- coterm--t-scroll-end) 0)
 (cl-decf coterm--t-home-offset)
 (coterm--t-normalize-home-offset)))
   (setq coterm--t-pmark-in-sync nil))



[elpa] externals/coterm f1cc63e 12/80: Support \e[6n for reporting cursor position

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit f1cc63e6665f201305c263df83719ad46c8556b5
Author: m <>
Commit: m <>

Support \e[6n for reporting cursor position
---
 coterm.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 25478df..2ebdcb8 100644
--- a/coterm.el
+++ b/coterm.el
@@ -417,7 +417,14 @@ initialize it sensibly."
 ;; (49 ;; (terminfo: rmcup)
 ;;  (coterm-t-switch-to-alternate-sub-buffer nil))
 (4 ;; (terminfo: rmir)
- (setq coterm-t-insert-mode nil
+ (setq coterm-t-insert-mode nil
+ (?n ;; \E[6n - Report cursor position (terminfo: u7)
+  (process-send-string
+   process
+   ;; (terminfo: u6)
+   (format "\e[%s;%sR"
+   (1+ coterm--t-row)
+   (1+ coterm--t-col
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp



[elpa] externals/coterm 08208f3 33/80: Handle \r\n sequence properly

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 08208f3351af530a2b05329264a1ecd639407247
Author: m <>
Commit: m <>

Handle \r\n sequence properly
---
 coterm.el | 34 +++---
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/coterm.el b/coterm.el
index 6e1b8ee..877a7eb 100644
--- a/coterm.el
+++ b/coterm.el
@@ -8,7 +8,7 @@
 (defconst coterm--t-control-seq-regexp
   (concat
;; A control character,
-   "\\(?:[\r\n\000\007\b\016\017]\\|"
+   "\\(?:[\n\000\007\b\016\017]\\|\r\n?\\|"
;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
;; of the C1 set"),
"\e\\(?:[DM78c]\\|"
@@ -342,12 +342,22 @@ initialize it sensibly."
   (setq ctl-end (match-end 0))
 
   (pcase (aref string match)
-((and ?\n
-  (guard coterm--t-pmark-in-sync)
-  (guard (= pmark (point-max)))
-  (guard (not (coterm--t-scroll-by-deletion-p
- (pass-through)
- (cl-incf will-insert-newlines))
+((and ?\r (guard (= ctl-end (+ 2 match
+ ;; A match string of length two and beginning with \r means
+ ;; that we have matched "\r\n".  In this case, and if we are
+ ;; at eob, we pass-through to avoid an unnecessary call to
+ ;; `substring' which is expensive.  In the most common when
+ ;; the process just outputs text at eob without any control
+ ;; sequences, we will end up inserting the whole string
+ ;; without a single call to `substring'.
+ (if (and coterm--t-pmark-in-sync
+  (= pmark (point-max))
+  (not (coterm--t-scroll-by-deletion-p)))
+ (progn (pass-through)
+(cl-incf will-insert-newlines))
+   (ins)
+   (setq coterm--t-col 0)
+   (coterm--t-down-line proc-filt process)))
 (?\n (ins) ;; (terminfo: cud1, ind)
  (coterm--t-down-line proc-filt process))
 (?\r (ins) ;; (terminfo: cr)
@@ -543,6 +553,15 @@ initialize it sensibly."
 (defcustom coterm-term-name term-term-name
   "Name to use for TERM.")
 
+(defun coterm--comint-strip-CR (_)
+  "Remove all \\r characters from last output."
+  (save-excursion
+(goto-char comint-last-output-start)
+(let ((pmark (process-mark (get-buffer-process (current-buffer)
+  (while (progn (skip-chars-forward "^\r")
+(< (point) pmark))
+(delete-char 1)
+
 (defun coterm--init ()
   "Initialize current buffer for coterm."
   (when-let ((process (get-buffer-process (current-buffer
@@ -552,6 +571,7 @@ initialize it sensibly."
 (setq coterm--t-scroll-end coterm--t-height)
 
 (setq-local comint-inhibit-carriage-motion t)
+(add-hook 'comint-output-filter-functions #'coterm--comint-strip-CR)
 
 (add-function :filter-return
   (local 'window-adjust-process-window-size-function)



[elpa] externals/coterm 9d532fb 22/80: Refactor some more

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 9d532fb28056687254cdb53fe353006a96daf5d0
Author: m <>
Commit: m <>

Refactor some more
---
 coterm.el | 43 ++-
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/coterm.el b/coterm.el
index d2329a0..92694d2 100644
--- a/coterm.el
+++ b/coterm.el
@@ -103,24 +103,41 @@ which case `point-max' is assumed"
 (setq row row2 col col2
   h (- row1 row2)))
   (delete-region p1 p2)
-  (coterm--t-open-space proc-filt process row col h (abs (- col2 col1)))
+  (coterm--t-open-space-at-point
+   proc-filt process
+   h (cond ((> row2 row1) col2)
+   ((< row2 row1) col1)
+   (t (abs (- col2 col1)
   (setq coterm--t-pmark-in-sync nil
 
+(defun coterm--t-open-space-at-point (proc-filt process newlines spaces)
+  "Insert NEWLINES newlines and SPECES spaces at point.
+Insert them using PROC-FILT and PROCESS.  Afterwards, remove
+characters that were moved after the column specified by
+`coterm--t-width'."
+  (unless (eobp)
+(set-marker (process-mark process) (point))
+(funcall
+ proc-filt process
+ (concat (make-string newlines ?\n)
+ (unless (eolp)
+   (make-string spaces ?\s
+;; Delete chars that are after the width of the terminal
+(goto-char (process-mark process))
+(move-to-column coterm--t-width)
+(delete-region (point) (progn (forward-line 1) (1- (point
+(setq coterm--t-pmark-in-sync nil)))
+
 (defun coterm--t-open-space (proc-filt process row col height width)
+  "Open spce at position ROW and COL, preserving point.
+Use PROC-FILT and PROCESS to insert spaces and newlines.
+Whitespace is inserted such that the character at position ROW
+and COL is moved by HEIGHT rows down and WIDTH cols to the
+right."
   (save-excursion
 (coterm--t-goto row col)
-(unless (eobp)
-  (set-marker (process-mark process) (point))
-  (funcall
-   proc-filt process
-   (concat (make-string height ?\n)
-   (unless (eolp)
- (make-string (+ width (if (= height 0) 0 col)) ?\s
-  ;; Delete chars that are after the width of the terminal
-  (goto-char (process-mark process))
-  (move-to-column coterm--t-width)
-  (delete-region (point) (progn (forward-line 1) (1- (point
-  (setq coterm--t-pmark-in-sync nil
+(coterm--t-open-space-at-point proc-filt process height
+   (+ width (if (= height 0) 0 col)
 
 (defun coterm--t-normalize-home-offset ()
   (save-excursion



[elpa] externals/coterm 9184a46 34/80: Always synchronize pmark at the end

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 9184a462b715eba0692b27065868317d6ca293e6
Author: m <>
Commit: m <>

Always synchronize pmark at the end
---
 coterm.el | 61 ++---
 1 file changed, 26 insertions(+), 35 deletions(-)

diff --git a/coterm.el b/coterm.el
index 877a7eb..5ce98eb 100644
--- a/coterm.el
+++ b/coterm.el
@@ -262,31 +262,28 @@ buffer and the scrolling region must cover the whole 
screen."
   (setq coterm--t-col (min column (1- coterm--t-width))
 
 (defun coterm--t-maybe-adjust-from-pmark (pos)
-  "If `coterm--t-row' and col are nil, point them to POS.
-`coterm--t-home-marker' may also be nil, in which case,
-initialize it sensibly."
+  "Point `coterm--t-row' and `coterm--t-col' POS.
+If `coterm--t-home-marker' is nil, initialize it sensibly."
   (unless coterm--t-home-marker
 (setq coterm--t-home-marker (point-min-marker))
 (setq coterm--t-home-offset 0))
-  (unless coterm--t-row
-(save-excursion
-  (goto-char pos)
-  (setq coterm--t-col (current-column))
-  (coterm--t-normalize-home-offset)
-  (forward-line 0)
-  (if (> (point) coterm--t-home-marker)
-  ;; Here, `coterm--t-home-offset' is guaranteed to be 0
-  (save-restriction
-(narrow-to-region coterm--t-home-marker (point))
-(let ((lines-left (forward-line (- 1 coterm--t-height
-  (when (= 0 lines-left)
-(set-marker coterm--t-home-marker (point)))
-  (setq coterm--t-row (+ -1 coterm--t-height lines-left
-(progn
-  (set-marker coterm--t-home-marker (point))
-  (setq coterm--t-home-offset 0)
-  (setq coterm--t-row 0
-(setq coterm--t-pmark-in-sync t)))
+  (save-excursion
+(goto-char pos)
+(setq coterm--t-col (current-column))
+(coterm--t-normalize-home-offset)
+(forward-line 0)
+(if (> (point) coterm--t-home-marker)
+;; Here, `coterm--t-home-offset' is guaranteed to be 0
+(save-restriction
+  (narrow-to-region coterm--t-home-marker (point))
+  (let ((lines-left (forward-line (- 1 coterm--t-height
+(when (= 0 lines-left)
+  (set-marker coterm--t-home-marker (point)))
+(setq coterm--t-row (+ -1 coterm--t-height lines-left
+  (progn
+(set-marker coterm--t-home-marker (point))
+(setq coterm--t-home-offset 0)
+(setq coterm--t-row 0)
 
 (defun coterm--t-emulate-terminal (proc-filt process string)
   (when-let ((fragment coterm--t-unhandled-fragment))
@@ -530,19 +527,13 @@ initialize it sensibly."
  (t
   (ins)))
 
-;; Here, we are at the end of process filtering. `coterm--t-row'
-;; and `coterm--t-col' may point to a not yet existent location
-;; after (point-max).  First, we move `pmark' as close to this
-;; position as possible.
-(if (coterm--t-approximate-pmark pmark)
-;; If we succeed, clear `coterm--t-row' and col.  On next
-;; output, we will initialize them to point to `pmark'.
-(setq coterm--t-row nil
-  coterm--t-col nil
-  coterm--t-pmark-in-sync nil)
-  ;; If we don't succeed, leave the variables unchanged.  They will
-  ;; be used to handle next output.
-  (ignore)))
+;; Synchronize pmark and remove all trailing whitespace after it.
+(coterm--t-adjust-pmark proc-filt process)
+(widen)
+(goto-char pmark)
+(skip-chars-forward " \n")
+(when (eobp)
+  (delete-region pmark (point
 
   (goto-char restore-point)
   (unless (eq restore-point pmark)



[elpa] externals/coterm e21bb54 18/80: Major refactor and started scroll region

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit e21bb541f010e7381a83b2e5e319b0b22815750a
Author: m <>
Commit: m <>

Major refactor and started scroll region
---
 coterm.el | 229 --
 1 file changed, 149 insertions(+), 80 deletions(-)

diff --git a/coterm.el b/coterm.el
index ffba8b0..257f654 100644
--- a/coterm.el
+++ b/coterm.el
@@ -16,10 +16,14 @@
 
 (defconst coterm--t-control-seq-prefix-regexp "\e")
 
-(defvar-local coterm--t-height t
+(defvar-local coterm--t-height nil
   "Number of lines in window.")
 (defvar-local coterm--t-width nil
   "Number of columns in window.")
+(defvar-local coterm--t-scroll-beg nil
+  "First row of the scrolling area.")
+(defvar-local coterm--t-scroll-end nil
+  "First row after the end of the scrolling area.")
 
 (defvar-local coterm--t-home-marker nil
   "Marks the \"home\" position for cursor addressing.
@@ -42,13 +46,21 @@ In sync with variables `coterm--t-home-marker',
 
 (defvar-local coterm--t-saved-cursor nil)
 (defvar-local coterm--t-insert-mode nil)
-
 (defvar-local coterm--t-unhandled-fragment nil)
 
 (defun coterm--t-reset-size (height width)
   (setq coterm--t-height height)
   (setq coterm--t-width width)
-  (setq coterm--t-col (max coterm--t-col (1- coterm--t-width
+  (setq coterm--t-scroll-beg 0)
+  (setq coterm--t-scroll-end height)
+  (setq coterm--t-pmark-in-sync nil)
+
+  (when coterm--t-row
+(setq coterm--t-col (max coterm--t-col (1- coterm--t-width)))
+(when (>= coterm--t-row coterm--t-height)
+  (cl-incf coterm--t-home-offset (- coterm--t-row coterm--t-height -1))
+  (setq coterm--t-row (1- coterm--t-height))
+  (coterm--t-normalize-home-offset
 
 (defun coterm--t-point (row col)
   "Return position that approximates ROW and COL."
@@ -104,36 +116,59 @@ In sync with variables `coterm--t-home-marker',
 (cl-incf left-to-move)
 (forward-line 0))
   (set-marker coterm--t-home-marker (point))
-  (setq coterm--t-home-offset left-to-move
-
-(defun coterm--t-scroll-into-view ()
-  (let ((height coterm--t-height)
-(row coterm--t-row)
-(home coterm--t-home-marker))
-(cond
- ((>= row height)
-  (save-excursion
-(goto-char home)
-(let ((left-to-move (forward-line (+ coterm--t-home-offset
- (- row height -1)
-  (unless (bolp)
-(cl-incf left-to-move)
-(forward-line 0))
-  (set-marker home (point))
-  (setq coterm--t-home-offset left-to-move)
-  (setq coterm--t-row (1- height)
- ((< row 0)
-  (save-excursion
-(goto-char home)
-(forward-line row)
-(set-marker home (point))
-(cl-incf coterm--t-home-offset 0)
-(setq coterm--t-row 0))
-
-(defun coterm--t-down (n)
-  (cl-incf coterm--t-row n)
-  (setq coterm--t-pmark-in-sync nil)
-  (coterm--t-scroll-into-view))
+  (setq coterm--t-home-offset (max 0 left-to-move)
+
+(defun coterm--t-scroll-by-deletion-p ()
+  (or (/= coterm--t-scroll-beg 0)
+  (/= coterm--t-scroll-end coterm--t-height)))
+
+(defun coterm--t-down-line (proc-filt process)
+  "Go down one line or scroll if at bottom.
+This takes into account the scroll region as specified by
+`coterm--t-scroll-beg' and `coterm--t-scroll-end'.  If required
+PROC-FILT and PROCESS are used to scroll with deletion and
+insertion of empty lines."
+  (cond
+   ((and (= coterm--t-row (1- coterm--t-scroll-end))
+ (coterm--t-scroll-by-deletion-p))
+(coterm--t-delete-region coterm--t-scroll-beg 0
+ (1+ coterm--t-scroll-beg) 0)
+(coterm--t-open-space proc-filt process
+  coterm--t-row 0 1 0))
+   ((and (= coterm--t-row (1- coterm--t-height))
+ (coterm--t-scroll-by-deletion-p))
+;; Behaviour of xterm
+(ignore))
+   ((< coterm--t-row (1- coterm--t-height))
+(cl-incf coterm--t-row))
+   (t
+(cl-incf coterm--t-home-offset)
+(coterm--t-normalize-home-offset)))
+  (setq coterm--t-pmark-in-sync nil))
+
+(defun coterm--t-up-line (proc-filt process)
+  "Go up one line or scroll if at top.
+This takes into account the scroll region as specified by
+`coterm--t-scroll-beg' and `coterm--t-scroll-end'.  If required
+PROC-FILT and PROCESS are used to scroll with deletion and
+insertion of empty lines."
+  (cond
+   ((and (= coterm--t-row coterm--t-scroll-beg)
+ (coterm--t-scroll-by-deletion-p))
+(coterm--t-delete-region (1- coterm--t-scroll-end) 0
+ coterm--t-scroll-end 0)
+(coterm--t-open-space proc-filt process
+  coterm--t-row 0 1 0))
+   ((and (= coterm--t-row 0)
+ (coterm--t-scroll-by-deletion-p))
+;; Behaviour of xterm
+(ignore))
+   ((< 0 coterm--t-row)
+(cl-decf coterm--t-row))
+   (t
+(cl-decf coterm--t-home-offset)
+(coterm--t-normalize-home-offset)))
+  (setq coterm--t-pmark-in-sync nil))

[elpa] externals/coterm ab1dcd4 14/80: Fix typo

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit ab1dcd47bc38286f9d6c9e73afecf3e8aebafc7b
Author: m <>
Commit: m <>

Fix typo
---
 coterm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 0a7fd87..7ce92c4 100644
--- a/coterm.el
+++ b/coterm.el
@@ -321,7 +321,7 @@ initialize it sensibly."
  (setq coterm--t-col (car cursor))
  (setq cursor (cdr cursor))
  (when (car cursor)
-   (setq coterm--t-row (caar cursor)
+   (setq ansi-color-context-region (caar cursor)
(?c (ins) ;; \Ec - Reset (terminfo: rs1)
(erase-buffer)
(when (boundp 'ansi-color-context-region)



[elpa] externals/coterm cfc9f03 13/80: Fix some escape params defaulting to 1

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit cfc9f0393f3ada187f55b851723248fc5cf0d82d
Author: m <>
Commit: m <>

Fix some escape params defaulting to 1
---
 coterm.el | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/coterm.el b/coterm.el
index 2ebdcb8..0a7fd87 100644
--- a/coterm.el
+++ b/coterm.el
@@ -258,7 +258,9 @@ initialize it sensibly."
  (dirty ()
`(setq coterm--t-pmark-in-sync nil))
  (pass-through ()
-   `(ignore)))
+   `(ignore))
+ (car-or-1 ()
+   `(max 1 (car ctl-params
 
   (if (not (and string
 (setq buf (process-buffer process))
@@ -343,19 +345,19 @@ initialize it sensibly."
 (1- (max 1 (min (or (nth 1 ctl-params) 0) 
coterm-t-width
   (dirty))
  (?A ;; cursor up (terminfo: cuu, cuu1)
-  (cl-decf coterm--t-row (car ctl-params))
+  (cl-decf coterm--t-row (car-or-1))
   (setq coterm--t-row (max coterm--t-row 0))
   (dirty))
  (?B ;; cursor down (terminfo: cud)
-  (cl-incf coterm--t-row (car ctl-params))
+  (cl-incf coterm--t-row (car-or-1))
   (setq coterm--t-row (min coterm--t-row (1- 
coterm-t-height)))
   (dirty))
  (?C ;; \E[C - cursor right (terminfo: cuf, cuf1)
-  (cl-incf coterm--t-col (car ctl-params))
+  (cl-incf coterm--t-col (car-or-1))
   (setq coterm--t-col (min coterm--t-col (1- 
coterm-t-width)))
   (dirty))
  (?D ;; \E[D - cursor left (terminfo: cub)
-  (cl-decf coterm--t-col (car ctl-params))
+  (cl-decf coterm--t-col (car-or-1))
   (setq coterm--t-col (max coterm--t-col 0))
   (dirty))
  ;; \E[J - clear to end of screen (terminfo: ed, clear)
@@ -378,28 +380,27 @@ initialize it sensibly."
  (?L ;; \E[L - insert lines (terminfo: il, il1)
   ;; Remove from bottom
   (coterm--t-delete-region
-   (- coterm-t-height (car ctl-params)) 0
+   (- coterm-t-height (car-or-1)) 0
coterm-t-height 0)
   ;; Insert at position
   (coterm--t-open-space
proc-filt process coterm--t-row 0
-   (car ctl-params) 0))
+   (car-or-1) 0))
  (?M ;; \E[M - delete lines (terminfo: dl, dl1)
   ;; Insert at bottom
   (coterm--t-open-space
proc-filt process coterm-t-height 0
-   (car ctl-params) 0)
+   (car-or-1) 0)
   ;; Remove at position
   (coterm--t-delete-region
coterm--t-row 0
-   (+ coterm--t-row (car ctl-params)) 0))
+   (+ coterm--t-row (car-or-1)) 0))
  (?P ;; \E[P - delete chars (terminfo: dch, dch1)
   (coterm--t-delete-region
coterm--t-row coterm--t-col
-   coterm--t-row (+ coterm--t-col
-(max 1 (car ctl-params)
+   coterm--t-row (+ coterm--t-col (car-or-1
  (?@ ;; \E[@ - insert spaces (terminfo: ich)
-  (let ((width (max 1 (car ctl-params
+  (let ((width (car-or-1)))
 (coterm--t-open-space
  proc-filt process
  coterm--t-row coterm--t-col



[elpa] externals/coterm 9e7720b 37/80: Use save-excursion more sparingly

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 9e7720b8cb6e6ae95d9d56e6fb34912a329be033
Author: m <>
Commit: m <>

Use save-excursion more sparingly
---
 coterm.el | 142 --
 1 file changed, 63 insertions(+), 79 deletions(-)

diff --git a/coterm.el b/coterm.el
index bf1a7a4..7006e4b 100644
--- a/coterm.el
+++ b/coterm.el
@@ -68,7 +68,8 @@ In sync with variables `coterm--t-home-marker',
 (when (>= coterm--t-row coterm--t-height)
   (cl-incf coterm--t-home-offset (- coterm--t-row coterm--t-height -1))
   (setq coterm--t-row (1- coterm--t-height))
-  (coterm--t-normalize-home-offset
+  (save-excursion
+(coterm--t-normalize-home-offset)
 
 (defun coterm--t-goto (row col)
   "Move point to a position that approximates ROW and COL.
@@ -128,14 +129,13 @@ characters that were moved after the column specified by
 (setq coterm--t-pmark-in-sync nil)))
 
 (defun coterm--t-normalize-home-offset ()
-  (save-excursion
-(goto-char coterm--t-home-marker)
-(let ((left-to-move (forward-line coterm--t-home-offset)))
-  (unless (bolp)
-(cl-incf left-to-move)
-(forward-line 0))
-  (set-marker coterm--t-home-marker (point))
-  (setq coterm--t-home-offset (max 0 left-to-move)
+  (goto-char coterm--t-home-marker)
+  (let ((left-to-move (forward-line coterm--t-home-offset)))
+(unless (bolp)
+  (cl-incf left-to-move)
+  (forward-line 0))
+(set-marker coterm--t-home-marker (point))
+(setq coterm--t-home-offset (max 0 left-to-move
 
 (defun coterm--t-scroll-by-deletion-p ()
   (or (/= coterm--t-scroll-beg 0)
@@ -197,38 +197,25 @@ PROC-FILT, so use it sparingly, usually only before 
inserting
 non-whitespace text."
   (unless coterm--t-pmark-in-sync
 (let ((pmark (process-mark process)))
-  (save-excursion
-(goto-char coterm--t-home-marker)
-
-(let ((newlines (forward-line
- (+ coterm--t-row coterm--t-home-offset
-  (unless (bolp)
-(cl-incf newlines))
-  (unless (zerop newlines)
-(set-marker pmark (point))
-(coterm--t-apply-proc-filt
- proc-filt process (make-string newlines ?\n
+  (goto-char coterm--t-home-marker)
 
-(let ((col (move-to-column coterm--t-col)))
+  (let ((newlines (forward-line
+   (+ coterm--t-row coterm--t-home-offset
+(unless (bolp)
+  (cl-incf newlines))
+(unless (zerop newlines)
   (set-marker pmark (point))
-  (when (< col coterm--t-col)
-(coterm--t-apply-proc-filt
- proc-filt process (make-string (- coterm--t-col col) ?\s))
+  (coterm--t-apply-proc-filt
+   proc-filt process (make-string newlines ?\n
+
+  (let ((col (move-to-column coterm--t-col)))
+(set-marker pmark (point))
+(when (< col coterm--t-col)
+  (coterm--t-apply-proc-filt
+   proc-filt process (make-string (- coterm--t-col col) ?\s)
 (setq coterm--t-pmark-in-sync t)
 (coterm--t-normalize-home-offset)))
 
-(defun coterm--t-approximate-pmark (pmark)
-  "Sets PMARK to point close to `coterm--t-row' and col.
-Don't modify buffer.  If `coterm--t-row' and `coterm--t-col'
-point to an unreachable location, locate PMARK as close to it as
-possible and return nil.  Otherwise, locate PMARK exactly and
-return t."
-  (or coterm--t-pmark-in-sync
-  (setq coterm--t-pmark-in-sync
-(save-excursion
-  (prog1 (coterm--t-goto coterm--t-row coterm--t-col)
-(set-marker pmark (point)))
-
 (defun coterm--t-insert (proc-filt process str newlines)
   "Insert STR using PROC-FILT and PROCESS.
 Synchronise PROCESS's mark beforehand and insert at its position.
@@ -237,33 +224,31 @@ zero, insertion must happen at the end of accessible 
portion of
 buffer and the scrolling region must cover the whole screen."
   (coterm--t-adjust-pmark proc-filt process)
   (coterm--t-apply-proc-filt proc-filt process str)
-  (save-excursion
-(goto-char (process-mark process))
-(let ((column (current-column)))
-  (if (zerop newlines)
-  (if coterm--t-insert-mode
-  ;; In insert mode, delete text outside the width of the terminal
-  (progn
-(move-to-column coterm--t-width)
-(delete-region
- (point) (progn (forward-line 1) (1- (point)
-;; If not in insert mode, replace text
-(when (> column coterm--t-col)
+  (goto-char (process-mark process))
+  (let ((column (current-column)))
+(if (zerop newlines)
+(if coterm--t-insert-mode
+;; In insert mode, delete text outside the width of the terminal
+(progn
+  (move-to-column coterm--t-width)
   (delete-region
-   (point)
-   (progn (move-to-column (- (* 2 column) coterm-

[elpa] externals/coterm ba651c6 15/80: Fix negative and too high column positions

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit ba651c6264994b19255465099148f60ba3868fb7
Author: m <>
Commit: m <>

Fix negative and too high column positions
---
 coterm.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index 7ce92c4..731b0fd 100644
--- a/coterm.el
+++ b/coterm.el
@@ -296,6 +296,7 @@ initialize it sensibly."
  (dirty))
 (?\b (ins) ;; (terminfo: cub1)
  (cl-decf coterm--t-col 1)
+ (setq coterm--t-col (max coterm--t-col 0))
  (dirty))
 (?\C-g (ins) ;; (terminfo: bel)
(beep t))
@@ -316,9 +317,9 @@ initialize it sensibly."
  (list ansi-color-context-region)
(?8 (ins) ;; Restore cursor (terminfo: rc)
(when-let ((cursor coterm--t-saved-cursor))
- (setq coterm--t-row (car cursor))
+ (setq coterm--t-row (max (car cursor) (1- 
coterm-t-height)))
  (setq cursor (cdr cursor))
- (setq coterm--t-col (car cursor))
+ (setq coterm--t-col (max (car cursor) (1- 
coterm-t-width)))
  (setq cursor (cdr cursor))
  (when (car cursor)
(setq ansi-color-context-region (caar cursor)
@@ -406,6 +407,8 @@ initialize it sensibly."
  coterm--t-row coterm--t-col
  0 width)
 (cl-incf coterm--t-col width)
+(setq coterm--t-col (min coterm--t-col
+ (1- coterm-t-width)))
 (dirty)))
  (?h ;; \E[?h - DEC Private Mode Set
   (pcase (car ctl-params)



[elpa] externals/coterm f334168 24/80: Rename function

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit f3341688947fa58a88c56ff4b42cbf3525d11554
Author: m <>
Commit: m <>

Rename function
---
 coterm.el | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/coterm.el b/coterm.el
index 263849c..ccce584 100644
--- a/coterm.el
+++ b/coterm.el
@@ -93,7 +93,7 @@ region."
   (skip-chars-backward "\n") (delete-region (point) opoint)))
   (setq coterm--t-pmark-in-sync nil))
 
-(defun coterm--t-open-space-at-point (proc-filt process newlines spaces)
+(defun coterm--t-open-space (proc-filt process newlines spaces)
   "Insert NEWLINES newlines and SPACES spaces at point.
 Insert them using PROC-FILT and PROCESS.  Afterwards, remove
 characters that were moved after the column specified by
@@ -137,7 +137,7 @@ insertion of empty lines."
 (coterm--t-delete-region coterm--t-scroll-beg 0
  (1+ coterm--t-scroll-beg) 0)
 (coterm--t-goto coterm--t-row 0)
-(coterm--t-open-space-at-point proc-filt process 1 0))
+(coterm--t-open-space proc-filt process 1 0))
((and (= coterm--t-row (1- coterm--t-height))
  (coterm--t-scroll-by-deletion-p))
 ;; Behaviour of xterm
@@ -161,7 +161,7 @@ insertion of empty lines."
 (coterm--t-delete-region (1- coterm--t-scroll-end) 0
  coterm--t-scroll-end 0)
 (coterm--t-goto coterm--t-row 0)
-(coterm--t-open-space-at-point proc-filt process 1 0))
+(coterm--t-open-space proc-filt process 1 0))
((and (= coterm--t-row 0)
  (coterm--t-scroll-by-deletion-p))
 ;; Behaviour of xterm
@@ -418,15 +418,14 @@ initialize it sensibly."
  ((and ?J (guard (eq 1 (car ctl-params
   (coterm--t-delete-region 0 0 coterm--t-row
coterm--t-col)
-  (coterm--t-open-space-at-point
+  (coterm--t-open-space
proc-filt process coterm--t-row coterm--t-col))
  (?J (coterm--t-delete-region 0 0))
  ;; \E[K - clear to end of line (terminfo: el, el1)
  ((and ?K (guard (eq 1 (car ctl-params
   (coterm--t-delete-region coterm--t-row 0
coterm--t-row coterm--t-col)
-  (coterm--t-open-space-at-point proc-filt process
- 0 coterm--t-col))
+  (coterm--t-open-space proc-filt process 0 
coterm--t-col))
  (?K (coterm--t-delete-region
   coterm--t-row coterm--t-col
   coterm--t-row coterm--t-width))
@@ -440,16 +439,14 @@ initialize it sensibly."
  coterm--t-scroll-end 0)
 ;; Insert at position
 (coterm--t-goto where 0)
-(coterm--t-open-space-at-point
- proc-filt process lines 0)))
+(coterm--t-open-space proc-filt process lines 0)))
  (?M ;; \E[M - delete lines (terminfo: dl, dl1)
   (let ((lines
  (min (car-or-1)
   (max 0 (- coterm--t-scroll-end 
coterm--t-row)
 ;; Insert at bottom
 (coterm--t-goto coterm--t-scroll-end 0)
-(coterm--t-open-space-at-point proc-filt process
-   lines 0)
+(coterm--t-open-space proc-filt process lines 0)
 ;; Remove at position
 (coterm--t-delete-region
  coterm--t-row 0
@@ -462,8 +459,7 @@ initialize it sensibly."
   (let ((width (min (car-or-1) (- coterm--t-width
   coterm--t-col -1
 (coterm--t-goto coterm--t-row coterm--t-col)
-(coterm--t-open-space-at-point proc-filt process
-   0 width)
+(coterm--t-open-space proc-filt process 0 width)
 (cl-incf coterm--t-col width)
 (setq coterm--t-col (min coterm--t-col
  (1- coterm--t-width)))



[elpa] externals/coterm e64027a 43/80: Restore 'window-point' of non-selected windows

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit e64027a440fd08903d75b6b70adc4a9c8d6d91ab
Author: m <>
Commit: m <>

Restore 'window-point' of non-selected windows
---
 coterm.el | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index 5df3688..902035b 100644
--- a/coterm.el
+++ b/coterm.el
@@ -436,6 +436,7 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
  (will-insert-newlines 0)
  restore-point
  last-match-end
+ old-pmark
  buf
  ctl-params ctl-end)
 
@@ -465,6 +466,7 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
 
 (with-current-buffer buf
   (setq restore-point (if (= (point) pmark) pmark (point-marker)))
+  (setq old-pmark (copy-marker pmark window-point-insertion-type))
   (coterm--t-maybe-adjust-from-pmark pmark)
   (save-restriction
 (widen)
@@ -543,7 +545,7 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
(?A (ins)) ;; Ignore term.el specific \eAnSiT sequences
(?\[
 (pcase (aref string (1- ctl-end))
-  (?m ; Let `comint-output-filter-functions' handle this
+  (?m ;; Let `comint-output-filter-functions' handle this
(pass-through))
   (char
(setq ctl-params (mapcar #'string-to-number
@@ -697,9 +699,25 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
   (coterm--t-goto 0 0)
   (recenter 0)))
 
+  ;; Restore point (this restores it only for the selected window)
   (goto-char restore-point)
   (unless (eq restore-point pmark)
-(set-marker restore-point nil)))
+(set-marker restore-point nil))
+
+  ;; Restore points of non-selected windows, if their `window-point'
+  ;; was on pmark
+  (let* ((sel-win (selected-window))
+ (w (next-window sel-win nil t)))
+;; Avoid infinite loop in strange case where minibuffer window
+;; is selected but not active.
+(while (window-minibuffer-p w)
+  (setq w (next-window w nil t)))
+(while (not (eq w sel-win))
+  (and (eq buf (window-buffer w))
+   (= (window-point w) old-pmark)
+   (set-window-point w pmark))
+  (setq w (next-window w nil t)))
+(set-marker old-pmark nil)))
 
 (provide 'coterm)
 ;;; coterm.el ends here



[elpa] externals/coterm 71d2dc1 30/80: Implement user-facing variables and minor mode

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 71d2dc19020cba4d8f94f52f3133ddcd12e8c73c
Author: m <>
Commit: m <>

Implement user-facing variables and minor mode
---
 coterm.el | 85 ++-
 1 file changed, 63 insertions(+), 22 deletions(-)

diff --git a/coterm.el b/coterm.el
index 6b48d19..b600d83 100644
--- a/coterm.el
+++ b/coterm.el
@@ -534,13 +534,12 @@ initialize it sensibly."
 
 ;;; Mode functions and configuration
 
-(defcustom coterm-term-name ;; term-term-name
-  "dumb"
+(defcustom coterm-term-name term-term-name
   "Name to use for TERM.")
 
-(defun coterm-comint-exec-h ()
-  (when-let (((derived-mode-p #'comint-mode))
- (process (get-buffer-process (current-buffer
+(defun coterm--init ()
+  "Initialize current buffer for coterm."
+  (when-let ((process (get-buffer-process (current-buffer
 (setq coterm--t-height (floor (window-screen-lines)))
 (setq coterm--t-width (window-max-chars-per-line))
 (setq coterm--t-scroll-beg 0)
@@ -557,30 +556,72 @@ initialize it sensibly."
   '((name . coterm-maybe-reset-size)))
 
 (add-function :around (process-filter process)
-  #'coterm--t-emulate-terminal))
+  #'coterm--t-emulate-terminal)))
 
-  ;; After `term-exec-hook', the major mode is often changed (for example into
-  ;; `shell-mode', which kills our local variables, so set them again after
-  ;; changing major modes.
-  (add-hook 'after-change-major-mode-hook #'coterm-comint-exec-h nil t))
+(defvar coterm-term-environment-function #'comint-term-environment
+  "Function to calculate environment for comint processes.
+If non-nil, it is called with zero arguments and should return a
+list of environment variable settings to apply to comint
+subprocesses.")
 
-(put #'coterm-comint-exec-h 'permanent-local-hook t)
+(defvar coterm-start-process-function #'start-file-process
+  "Function called to start a comint process.
+It is called with the same arguments as `start-process' and
+should return a process.")
 
-(defvar coterm--old-comint-terminfo-terminal nil)
+(defcustom coterm-term-name term-term-name
+  "Name to use for TERM.")
+
+(defvar coterm-termcap-format term-termcap-format
+  "Termcap capabilities supported.")
+
+(define-advice comint-exec-1 (:around (f &rest args) coterm-config)
+  "Make spawning processes for comint more configurable.
+With this advice installed on `coterm-exec-1', you use the
+settings `coterm-extra-environment-function' and
+`coterm-start-process-function' to control how comint spawns a
+process."
+  (cl-letf*
+  ((start-file-process (symbol-function #'start-file-process))
+   (comint-term-environment (symbol-function #'comint-term-environment))
+   ((symbol-function #'start-file-process)
+(lambda (&rest args)
+  (fset #'start-file-process start-file-process)
+  (apply coterm-start-process-function args)))
+   ((symbol-function #'comint-term-environment)
+(lambda (&rest args)
+  (fset #'comint-term-environment comint-term-environment)
+  (apply coterm-term-environment-function args
+(apply f args)))
 
 (define-minor-mode coterm-mode
   "Better terminal emulation in comint processes."
   :global t
   (if coterm-mode
+
   (progn
-(add-hook 'comint-exec-hook #'coterm-comint-exec-h)
-(when coterm-term-name
-  (unless coterm--old-comint-terminfo-terminal
-(setq coterm--old-comint-terminfo-terminal
-  (list comint-terminfo-terminal)))
-  (setq comint-terminfo-terminal coterm-term-name)))
+(add-hook 'comint-mode-hook #'coterm--init)
+(setq coterm-term-environment-function
+  (lambda ()
+(let (ret)
+  (when coterm-term-name
+(push (format "TERM=%s" coterm-term-name) ret))
+  (when coterm-termcap-format
+(push (format coterm-termcap-format "TERMCAP="
+  coterm-term-name
+  (floor (window-screen-lines))
+  (window-max-chars-per-line))
+  ret))
+  ret)))
+(setq coterm-start-process-function
+  (lambda (name buffer command &rest switches)
+(apply #'start-file-process name buffer
+   ;; Adapted from `term-exec-1'
+   "sh" "-c"
+   (format "stty -nl sane -echo 2>%s;\
+if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
+   ".." command switches
+
 (remove-hook 'comint-exec-hook #'coterm-comint-exec-h)
-(when coterm--old-comint-terminfo-terminal
-  (setq comint-terminfo-terminal
-(car coterm--old-comint-terminfo-terminal))
-  (setq coterm--old-comint-terminfo-terminal nil
+(setq coterm-term-environment-function #'comint-term-envi

[elpa] externals/coterm bd103f9 56/80: [auto-char] Fix searching in less

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit bd103f9f8b11db975680229df87af36ee37fcdc3
Author: m <>
Commit: m <>

[auto-char] Fix searching in less
---
 coterm.el | 68 ---
 1 file changed, 48 insertions(+), 20 deletions(-)

diff --git a/coterm.el b/coterm.el
index 376a630..afd4a86 100644
--- a/coterm.el
+++ b/coterm.el
@@ -236,26 +236,54 @@ If point is not on process mark, leave `coterm-char-mode' 
and
   (when coterm-scroll-snap-mode (coterm-scroll-snap-mode -1)
 
 (defun coterm--auto-char-less-prompt ()
-  "Enter `coterm-char-mode' if a \"less\" prompt is detected."
-  (when (eobp)
-(let ((opoint (point)))
-  (forward-line 0)
-  (prog1
-  (when (looking-at
- (concat
-  "\\(?:"
-  ":\\|"
-  "(END)\\|"
-  "byte [0-9]+\\|"
-  "100%\\|"
-  "\\(?:.* \\)?" "[0-9]?[0-9]%\\|"
-  ".*(press h for help or q to quit)\\|"
-  ".*(press RETURN)"
-  "\\)\\'"))
-(unless coterm-char-mode (coterm-char-mode 1))
-(unless coterm-scroll-snap-mode (coterm-scroll-snap-mode 1))
-t)
-(goto-char opoint)
+  "Enter `coterm-char-mode' if a \"less\" prompt is detected.
+In addition, temporarily modify `coterm-auto-char-functions' such
+that char mode is maintained even if the user presses \"/\",
+\":\", \"ESC\" or \"-\"."
+  (when (and (eobp) (coterm--auto-char-less-prompt-1))
+(unless coterm-char-mode (coterm-char-mode 1))
+(unless coterm-scroll-snap-mode (coterm-scroll-snap-mode 1))
+(cl-labels
+((hook ()
+   (if (not (eobp))
+   (rem-hook)
+ (or
+  (coterm--auto-char-less-prompt-1)
+  (progn
+(forward-line 0)
+(prog1 (looking-at (concat
+"\\(?: ESC\\| :\\|-\\)\\'\\|"
+"Examine: \\|/"))
+  (goto-char (point-max
+  (rem-hook
+ (rem-hook ()
+   (remove-hook 'coterm-auto-char-functions #'hook t)
+   (remove-hook 'coterm-auto-char-mode-hook #'rem-hook t)
+   (remove-hook 'coterm-char-mode-hook #'rem-hook t)
+   (remove-hook 'coterm-scroll-snap-mode-hook #'rem-hook t)
+   nil))
+  (add-hook 'coterm-auto-char-functions #'hook nil t)
+  (add-hook 'coterm-auto-char-mode-hook #'rem-hook nil t)
+  (add-hook 'coterm-char-mode-hook #'rem-hook nil t)
+  (add-hook 'coterm-scroll-snap-mode-hook #'rem-hook nil t))
+t))
+
+(defun coterm--auto-char-less-prompt-1 ()
+  "Return t if point is after a less prompt."
+  (let ((opoint (point)))
+(forward-line 0)
+(prog1 (looking-at
+(concat
+ "\\(?:"
+ ":\\|"
+ "(END)\\|"
+ "byte [0-9]+\\|"
+ "100%\\|"
+ "\\(?:.* \\)?" "[0-9]?[0-9]%\\|"
+ ".*(press h for help or q to quit)\\|"
+ ".*(press RETURN)"
+ "\\)\\'"))
+  (goto-char opoint
 
 (defun coterm--auto-char-mpv-prompt ()
   "Enter `coterm-char-mode' if a mpv prompt is detected.



[elpa] externals/coterm f48ef18 26/80: Fix \e[M and \e[L outside scrolling region

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit f48ef18d1c26558e185d33984004a29767953639
Author: m <>
Commit: m <>

Fix \e[M and \e[L outside scrolling region
---
 coterm.el | 44 
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/coterm.el b/coterm.el
index 75b343e..2e0029e 100644
--- a/coterm.el
+++ b/coterm.el
@@ -426,27 +426,31 @@ initialize it sensibly."
   coterm--t-row coterm--t-col
   coterm--t-row coterm--t-width))
  (?L ;; \E[L - insert lines (terminfo: il, il1)
-  (let*
-  ((where (max coterm--t-row coterm--t-scroll-beg))
-   (lines (+ (- coterm--t-row where) (car-or-1
-;; Remove from bottom
-(coterm--t-delete-region
- (- coterm--t-scroll-end lines) 0
- coterm--t-scroll-end 0)
-;; Insert at position
-(coterm--t-goto where 0)
-(coterm--t-open-space proc-filt process lines 0)))
+  (when (<= coterm--t-scroll-beg coterm--t-row
+(1- coterm--t-scroll-end))
+(let ((lines
+   (min (- coterm--t-scroll-end coterm--t-row)
+(car-or-1
+  ;; Remove from bottom
+  (coterm--t-delete-region
+   (- coterm--t-scroll-end lines) 0
+   coterm--t-scroll-end 0)
+  ;; Insert at position
+  (coterm--t-goto coterm--t-row 0)
+  (coterm--t-open-space proc-filt process lines 
0
  (?M ;; \E[M - delete lines (terminfo: dl, dl1)
-  (let ((lines
- (min (car-or-1)
-  (max 0 (- coterm--t-scroll-end 
coterm--t-row)
-;; Insert at bottom
-(coterm--t-goto coterm--t-scroll-end 0)
-(coterm--t-open-space proc-filt process lines 0)
-;; Remove at position
-(coterm--t-delete-region
- coterm--t-row 0
- (+ coterm--t-row lines) 0)))
+  (when (<= coterm--t-scroll-beg coterm--t-row
+(1- coterm--t-scroll-end))
+(let ((lines
+   (min (- coterm--t-scroll-end coterm--t-row)
+(car-or-1
+  ;; Insert at bottom
+  (coterm--t-goto coterm--t-scroll-end 0)
+  (coterm--t-open-space proc-filt process lines 0)
+  ;; Remove at position
+  (coterm--t-delete-region
+   coterm--t-row 0
+   (+ coterm--t-row lines) 0
  (?P ;; \E[P - delete chars (terminfo: dch, dch1)
   (coterm--t-delete-region
coterm--t-row coterm--t-col



[elpa] externals/coterm 73aa1f3 31/80: Properly handle OSC and Emacs specific escape sequences

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 73aa1f37a821e67ddb666fde073e103f188170cf
Author: m <>
Commit: m <>

Properly handle OSC and Emacs specific escape sequences
---
 coterm.el | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/coterm.el b/coterm.el
index b600d83..11f75a8 100644
--- a/coterm.el
+++ b/coterm.el
@@ -2,7 +2,9 @@
 
 ;;; Terminal emulation
 
-;; Differences from `term-control-seq-regexp': Removed \t, \032 (\C-z), \eAnSiT
+;; Differences from `term-control-seq-regexp':
+;; Removed: \t, \032 (\C-z)
+;; Added: OSC sequence \e] ... ; ... \e\\ (or \a)
 (defconst coterm--t-control-seq-regexp
   (concat
;; A control character,
@@ -10,6 +12,12 @@
;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
;; of the C1 set"),
"\e\\(?:[DM78c]\\|"
+   ;; Emacs specific control sequences from term.el.  In coterm, we simply
+   ;; ignore them.
+   "AnSiT[^\n]+\n\\|"
+   ;; OSC seqence.  We print them normally to let
+   ;; `comint-output-filter-functions' handle them
+   "][0-9A-Za-z]*;.*?\\(?:\a\\|\e\\)\\|"
;; or an escape sequence (section 5.4 "Control Sequences"),
"\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)")
   "Regexp matching control sequences handled by term.el.")
@@ -383,6 +391,8 @@ initialize it sensibly."
(setq coterm--t-scroll-beg 0)
(setq coterm--t-scroll-end coterm--t-height)
(setq coterm--t-insert-mode nil))
+   (?\] (pass-through)) ;; OSC sequence, handled by comint
+   (?A (ins)) ;; Ignore term.el specific \eAnSiT sequences
(?\[
 (pcase (aref string (1- ctl-end))
   (?m ; Let `comint-output-filter-functions' handle this
@@ -502,12 +512,8 @@ initialize it sensibly."
 (cond
  ((setq match (string-match coterm--t-control-seq-prefix-regexp
 string ctl-end))
-  (while (setq match (string-match 
coterm--t-control-seq-prefix-regexp
-   string (1+ match)))
-(setq ctl-end match))
-  (setq match ctl-end)
   (ins)
-  (setq coterm--t-unhandled-fragment (substring string 
last-match-end)))
+  (setq coterm--t-unhandled-fragment (substring string match)))
  ((null last-match-end)
   ;; Optimization, no substring means no string copying
   (coterm--t-insert proc-filt process string will-insert-newlines))



[elpa] externals/coterm 5aea1c8 25/80: Fixup some comments

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 5aea1c8ad5a9b8d67650ac16fee3a8cfd9036873
Author: m <>
Commit: m <>

Fixup some comments
---
 coterm.el | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index ccce584..75b343e 100644
--- a/coterm.el
+++ b/coterm.el
@@ -2,7 +2,7 @@
 
 ;;; Terminal emulation
 
-;; Removed \t, \032 (\C-z), \eAnSiT
+;; Differences from `term-control-seq-regexp': Removed \t, \032 (\C-z), \eAnSiT
 (defconst coterm--t-control-seq-regexp
   (concat
;; A control character,
@@ -174,7 +174,6 @@ insertion of empty lines."
 (coterm--t-normalize-home-offset)))
   (setq coterm--t-pmark-in-sync nil))
 
-;; Moves pmark, inserts
 (defun coterm--t-adjust-pmark (proc-filt process)
   "Set PROCESS's mark to `coterm--t-row' and `coterm--t-col'.
 If necessary, this function inserts newlines and spaces using
@@ -201,7 +200,6 @@ non-whitespace text."
 (setq coterm--t-pmark-in-sync t)
 (coterm--t-normalize-home-offset)))
 
-;; Moves pmark
 (defun coterm--t-approximate-pmark (pmark)
   "Sets PMARK to point close to `coterm--t-row' and col.
 Don't modify buffer.  If `coterm--t-row' and `coterm--t-col'
@@ -214,7 +212,6 @@ return t."
   (prog1 (coterm--t-goto coterm--t-row coterm--t-col)
 (set-marker pmark (point)))
 
-;; Moves pmark and inserts
 (defun coterm--t-insert (proc-filt process str newlines)
   "Insert STR using PROC-FILT and PROCESS.
 Synchronise PROCESS's mark beforehand and insert at its position.
@@ -247,7 +244,6 @@ buffer and the scrolling region must cover the whole 
screen."
 (setq coterm--t-row (1- coterm--t-height)
   (setq coterm--t-col (min column (1- coterm--t-width))
 
-;; Depends on pmark
 (defun coterm--t-maybe-adjust-from-pmark (pos)
   "If `coterm--t-row' and col are nil, point them to POS.
 `coterm--t-home-marker' may also be nil, in which case,



[elpa] externals/coterm 1ec97d2 29/80: \n doesn't go to column 0

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 1ec97d2c862ab91af5a64b85dc368a9ebc13dc12
Author: m <>
Commit: m <>

\n doesn't go to column 0
---
 coterm.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/coterm.el b/coterm.el
index 03e65ea..6b48d19 100644
--- a/coterm.el
+++ b/coterm.el
@@ -341,9 +341,7 @@ initialize it sensibly."
  (pass-through)
  (cl-incf will-insert-newlines))
 (?\n (ins) ;; (terminfo: cud1, ind)
- (coterm--t-down-line proc-filt process)
- (setq coterm--t-col 0)
- (dirty))
+ (coterm--t-down-line proc-filt process))
 (?\r (ins) ;; (terminfo: cr)
  (setq coterm--t-col 0)
  (dirty))



[elpa] externals/coterm 8b2836e 28/80: Fix incorrect handling of incomplete escape sequences

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 8b2836e1bcc01cf0a3d32c57027228fdda5a7b6a
Author: m <>
Commit: m <>

Fix incorrect handling of incomplete escape sequences
---
 coterm.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 7f84fec..03e65ea 100644
--- a/coterm.el
+++ b/coterm.el
@@ -506,7 +506,8 @@ initialize it sensibly."
 string ctl-end))
   (while (setq match (string-match 
coterm--t-control-seq-prefix-regexp
string (1+ match)))
-(setq ctl-end (1+ match)))
+(setq ctl-end match))
+  (setq match ctl-end)
   (ins)
   (setq coterm--t-unhandled-fragment (substring string 
last-match-end)))
  ((null last-match-end)



[elpa] externals/coterm f4f69ab 32/80: Export TERMINFO environment variable

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit f4f69ab0e005a75f1c2b2cccb05fe6356a2a98e4
Author: m <>
Commit: m <>

Export TERMINFO environment variable
---
 coterm.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/coterm.el b/coterm.el
index 11f75a8..6e1b8ee 100644
--- a/coterm.el
+++ b/coterm.el
@@ -610,6 +610,8 @@ process."
 (setq coterm-term-environment-function
   (lambda ()
 (let (ret)
+  (push (format "TERMINFO=%s" data-directory)
+ret)
   (when coterm-term-name
 (push (format "TERM=%s" coterm-term-name) ret))
   (when coterm-termcap-format



[elpa] externals/coterm c825746 27/80: Fix issue with ansi-color context marker

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit c8257464abd65e9f4b43cf5a91bbd48d6e658f39
Author: m <>
Commit: m <>

Fix issue with ansi-color context marker
---
 coterm.el | 23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/coterm.el b/coterm.el
index 2e0029e..7f84fec 100644
--- a/coterm.el
+++ b/coterm.el
@@ -72,6 +72,14 @@ Return non-nil if the position was actually reached."
(not (eobp))
(<= col (move-to-column col
 
+(defun coterm--t-apply-proc-filt (proc-filt process str)
+  "Insert STR using PROC-FILT and PROCESS.
+Basically, call PROC-FILT with the arguments PROCESS and STR, but
+adjusting `ansi-color-context-region' beforehand."
+  (when-let ((context ansi-color-context-region))
+(set-marker (cadr context) (process-mark process)))
+  (funcall proc-filt process str))
+
 (defun coterm--t-delete-region (row1 col1 &optional row2 col2)
   "Delete text between two positions.
 Deletes resulting trailing whitespace as well.  ROW1, COL1, ROW2
@@ -100,7 +108,7 @@ characters that were moved after the column specified by
 `coterm--t-width'."
   (unless (eobp)
 (set-marker (process-mark process) (point))
-(funcall
+(coterm--t-apply-proc-filt
  proc-filt process
  (concat (make-string newlines ?\n)
  (unless (eolp)
@@ -190,13 +198,14 @@ non-whitespace text."
 (cl-incf newlines))
   (unless (zerop newlines)
 (set-marker pmark (point))
-(funcall proc-filt process (make-string newlines ?\n
+(coterm--t-apply-proc-filt
+ proc-filt process (make-string newlines ?\n
 
 (let ((col (move-to-column coterm--t-col)))
   (set-marker pmark (point))
   (when (< col coterm--t-col)
-(funcall proc-filt process
- (make-string (- coterm--t-col col) ?\s))
+(coterm--t-apply-proc-filt
+ proc-filt process (make-string (- coterm--t-col col) ?\s))
 (setq coterm--t-pmark-in-sync t)
 (coterm--t-normalize-home-offset)))
 
@@ -219,7 +228,7 @@ NEWLINES is the number of newlines STR contains. Unless it 
is
 zero, insertion must happen at the end of accessible portion of
 buffer and the scrolling region must cover the whole screen."
   (coterm--t-adjust-pmark proc-filt process)
-  (funcall proc-filt process str)
+  (coterm--t-apply-proc-filt proc-filt process str)
   (save-excursion
 (goto-char (process-mark process))
 (let ((column (current-column)))
@@ -378,8 +387,8 @@ initialize it sensibly."
(setq coterm--t-insert-mode nil))
(?\[
 (pcase (aref string (1- ctl-end))
-  (?m; Let `comint-output-filter-functions' handle this
-   (ins))
+  (?m ; Let `comint-output-filter-functions' handle this
+   (pass-through))
   (char
(setq ctl-params (mapcar #'string-to-number
 (split-string ctl-params ";")))



[elpa] externals/coterm dc9466e 57/80: Implement \t (move cursor to tab stop), needed for "emacs -nw"

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit dc9466e1a21dc3729402bbb5144f4d3ba21d95e3
Author: m <>
Commit: m <>

Implement \t (move cursor to tab stop), needed for "emacs -nw"
---
 coterm.el | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index afd4a86..db5ff21 100644
--- a/coterm.el
+++ b/coterm.el
@@ -378,12 +378,16 @@ is the process mark."
 
 (defconst coterm--t-control-seq-regexp
   ;; Differences from `term-control-seq-regexp':
-  ;; Removed: \t, \032 (\C-z)
+  ;;
+  ;; For optimization, we try matching "\r\n" as whole, if possible, instead of
+  ;; \r and \n separately
+  ;;
+  ;; Removed: \032 (\C-z)
   ;; Added: OSC sequence \e] ... ; ... \e\\ (or \a)
   ;; Added: sequences \e= and \e>
   (concat
;; A control character,
-   "\\(?:[\n\000\007\b\016\017]\\|\r\n?\\|"
+   "\\(?:[\n\000\007\t\b\016\017]\\|\r\n?\\|"
;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
;; of the C1 set"),
"\e\\(?:[DM78c=>]\\|"
@@ -754,6 +758,20 @@ buffer and the scrolling region must cover the whole 
screen."
 (?\r (ins) ;; (terminfo: cr)
  (setq coterm--t-col 0)
  (dirty))
+;; TAB (terminfo: ht)
+((and ?\t
+  (guard coterm--t-pmark-in-sync)
+  (guard (= pmark (point-max)))
+  (guard (not (coterm--t-scroll-by-deletion-p
+ ;; Insert a TAB as is, if at eob
+ (pass-through))
+(?\t
+ ;; Otherwise, move point to the next tab stop
+ (ins)
+ (setq coterm--t-col
+   (min (1- coterm--t-width)
+(+ coterm--t-col 8 (- (mod coterm--t-col 8)
+ (dirty))
 (?\b (ins) ;; (terminfo: cub1)
  (setq coterm--t-col (max (1- coterm--t-col) 0))
  (dirty))



[elpa] externals/coterm 6f42ba6 45/80: Initialize home marker properly

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 6f42ba60c9ee4f08ba224721a2a28157a94239ea
Author: m <>
Commit: m <>

Initialize home marker properly
---
 coterm.el | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/coterm.el b/coterm.el
index c835605..7fd4603 100644
--- a/coterm.el
+++ b/coterm.el
@@ -224,6 +224,7 @@ In sync with variables `coterm--t-home-marker',
   (when-let ((process (get-buffer-process (current-buffer
 (setq coterm--t-height (floor (window-screen-lines)))
 (setq coterm--t-width (window-max-chars-per-line))
+(setq coterm--t-home-marker (point-min-marker))
 (setq coterm--t-scroll-beg 0)
 (setq coterm--t-scroll-end coterm--t-height)
 
@@ -253,8 +254,9 @@ In sync with variables `coterm--t-home-marker',
 (when (>= coterm--t-row coterm--t-height)
   (cl-incf coterm--t-home-offset (- coterm--t-row coterm--t-height -1))
   (setq coterm--t-row (1- coterm--t-height))
-  (save-excursion
-(coterm--t-normalize-home-offset)
+  (let ((opoint (point)))
+(coterm--t-normalize-home-offset)
+(goto-char opoint)
 
 (defun coterm--t-goto (row col)
   "Move point to a position that approximates ROW and COL.
@@ -435,12 +437,8 @@ buffer and the scrolling region must cover the whole 
screen."
 (setq coterm--t-row (1- coterm--t-height
 (setq coterm--t-col (min column (1- coterm--t-width)
 
-(defun coterm--t-maybe-adjust-from-pmark (pos)
-  "Point `coterm--t-row' and `coterm--t-col' POS.
-If `coterm--t-home-marker' is nil, initialize it sensibly."
-  (unless coterm--t-home-marker
-(setq coterm--t-home-marker (point-min-marker))
-(setq coterm--t-home-offset 0))
+(defun coterm--t-adjust-from-pmark (pos)
+  "Point `coterm--t-row' and `coterm--t-col' POS."
   (coterm--t-normalize-home-offset)
   (goto-char pos)
   (setq coterm--t-col (current-column))
@@ -499,7 +497,7 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
 (with-current-buffer buf
   (setq restore-point (if (= (point) pmark) pmark (point-marker)))
   (setq old-pmark (copy-marker pmark window-point-insertion-type))
-  (coterm--t-maybe-adjust-from-pmark pmark)
+  (coterm--t-adjust-from-pmark pmark)
   (save-restriction
 (widen)
 (unless (text-property-any



[elpa] externals/coterm 10205c8 66/80: Improve README

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 10205c8ebbd024746bc5c6aba5a93206aa6aaf23
Author: m <>
Commit: m <>

Improve README
---
 coterm.el | 29 +
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/coterm.el b/coterm.el
index 61b3c3b..07ea704 100644
--- a/coterm.el
+++ b/coterm.el
@@ -39,7 +39,7 @@
 ;; `coterm-char-mode' automatically as appropriate.  For example, if you
 ;; execute "less" in a shell buffer, coterm will detect that "less" is running
 ;; and automatically enable char mode so that you can interact with less
-;; normally.  Once you leave the "less" program, coterm will cisable char mode
+;; normally.  Once you leave the "less" program, coterm will disable char mode
 ;; so that you can interact with your shell in the normal comint way.  This
 ;; mode is enabled by default in all coterm comint buffers.
 ;;
@@ -55,21 +55,26 @@
 ;;
 ;; Add the following to your Emacs init file:
 ;;
-;;  (add-to-list 'load-path "/path/to/emacs-coterm")
-;;  (require 'coterm)
-;;  (coterm-mode)
-;;  ;; Optional: bind `coterm-char-mode-cycle' to C-; in comint
-;;  (with-eval-after-load 'comint
-;;(define-key comint-mode-map (kbd "C-;") #'coterm-char-mode-cycle))
+;;   (add-to-list 'load-path "/path/to/emacs-coterm")
+;;   (require 'coterm)
+;;   (coterm-mode)
+;;
+;;   ;; Optional: bind `coterm-char-mode-cycle' to C-; in comint
+;;   (with-eval-after-load 'comint
+;; (define-key comint-mode-map (kbd "C-;") #'coterm-char-mode-cycle))
+;;
+;;   ;; If your process repeats what you have already typed, try customizing
+;;   ;; `comint-process-echoes':
+;;   ;;   (setq-default comint-process-echoes t)
 ;;
 ;;
 ;; Differences from M-x term:
 ;;
 ;; coterm is written as an upgrade to comint.  For existing comint users, the
-;; behaviour of comint doesn't change with coterm enabled comint except for the
-;; added functionality that we can now use TUI programs.  It is therefor good
-;; for users who generally prefer comint to term.el but sometimes miss the
-;; superior terminal emulation that term.el provides.
+;; behaviour of comint doesn't change with coterm enabled except for the added
+;; functionality that we can now use TUI programs.  It is therefore good for
+;; users who generally prefer comint to term.el but sometimes miss the superior
+;; terminal emulation that term.el provides.
 
 (require 'term)
 (eval-when-compile
@@ -876,7 +881,7 @@ buffer and the scrolling region must cover the whole 
screen."
  ;; Insert a TAB as is, if at eob
  (pass-through))
 (?\t
- ;; Otherwise, move point to the next tab stop
+ ;; Otherwise, move cursor to the next tab stop
  (ins)
  (setq coterm--t-col
(min (1- coterm--t-width)



[elpa] externals/coterm 2358124 48/80: Try to enter and leave char-mode automatically

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 23581244de3f74ac1d8ed4f1236fcd1e218e8408
Author: m <>
Commit: m <>

Try to enter and leave char-mode automatically
---
 coterm.el | 233 --
 1 file changed, 195 insertions(+), 38 deletions(-)

diff --git a/coterm.el b/coterm.el
index b6c46cf..1754728 100644
--- a/coterm.el
+++ b/coterm.el
@@ -1,6 +1,8 @@
 ;;; coterm.el --- Terminal emulation for comint -*- lexical-binding: t; -*-
 
 (require 'term)
+(eval-when-compile
+  (require 'cl-lib))
 
 ;;; Mode functions and configuration
 
@@ -85,13 +87,13 @@ if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
 (setq coterm-term-environment-function #'comint-term-environment)
 (setq coterm-start-process-function #'start-file-process)))
 
-;;; Raw mode
+;;; Char mode
 
 (defvar coterm-char-mode-map
   (let ((map (make-sparse-keymap)))
 (set-keymap-parent map term-raw-map)
-(define-key map [remap term-char-mode] #'coterm-char-mode)
-(define-key map [remap term-line-mode] #'coterm-char-mode)
+(define-key map [remap term-char-mode] #'coterm-char-mode-cycle)
+(define-key map [remap term-line-mode] #'coterm-char-mode-cycle)
 map))
 
 (define-minor-mode coterm-char-mode
@@ -107,8 +109,7 @@ customize it."
 
 (define-minor-mode coterm-scroll-snap-mode
   "Keep scroll synchronized.
-Usually enabled for full-screen terminal programs to keep them on
-screen."
+Useful for full-screen terminal programs to keep them on screen."
   :keymap nil
   (if coterm-scroll-snap-mode
   (progn
@@ -117,7 +118,8 @@ screen."
 (cons scroll-margin
   (local-variable-p 'scroll-margin)))
   (setq-local scroll-margin 0))
-(add-hook 'coterm-t-after-insert-hook #'coterm--scroll-snap nil t))
+(add-hook 'coterm-t-after-insert-hook #'coterm--scroll-snap 'append t)
+(coterm--scroll-snap))
 (when-let ((margin coterm--char-old-scroll-margin))
   (setq coterm--char-old-scroll-margin nil)
   (if (cdr margin)
@@ -126,30 +128,193 @@ screen."
 (remove-hook 'coterm-t-after-insert-hook #'coterm--scroll-snap t)))
 
 (defun coterm--scroll-snap ()
-  (let* ((buf (current-buffer))
- (pmark (process-mark (get-buffer-process buf)))
- (sel-win (selected-window))
- (w sel-win))
-;; Avoid infinite loop in strange case where minibuffer window
-;; is selected but not active.
-(while (window-minibuffer-p w)
-  (setq w (next-window w nil t)))
-(while
-(progn
-  (when (and (eq buf (window-buffer w))
- ;; Only snap if point is on pmark
- (= (window-point w) pmark))
-(if (eq sel-win w)
-(progn
+  ;; We need to check for `coterm-scroll-snap-mode' because a function in
+  ;; `coterm-t-after-insert-hook' might have changed it
+  (when coterm-scroll-snap-mode
+(let* ((buf (current-buffer))
+   (pmark (process-mark (get-buffer-process buf)))
+   (sel-win (selected-window))
+   (w sel-win))
+  ;; Avoid infinite loop in strange case where minibuffer window
+  ;; is selected but not active.
+  (while (window-minibuffer-p w)
+(setq w (next-window w nil t)))
+  (while
+  (progn
+(when (and (eq buf (window-buffer w))
+   ;; Only snap if point is on pmark
+   (= (window-point w) pmark))
+  (if (eq sel-win w)
+  (progn
+(coterm--t-goto 0 0)
+(recenter 0)
+(goto-char pmark))
+(with-selected-window w
   (coterm--t-goto 0 0)
   (recenter 0)
-  (goto-char pmark))
-  (with-selected-window w
-(coterm--t-goto 0 0)
-(recenter 0)
-(goto-char pmark
-  (setq w (next-window w nil t))
-  (not (eq w sel-win))
+  (goto-char pmark
+(setq w (next-window w nil t))
+(not (eq w sel-win)))
+
+(defvar coterm-auto-char-mode)
+
+(defun coterm-char-mode-cycle ()
+  "Cycle between char mode on, off and auto.
+
+If `coterm-auto-char-mode' is enabled, disable it and enable
+both `coterm-char-mode' and `coterm-scroll-snap-mode'.
+
+If `coterm-char-mode' is enabled, disable it along with
+`coterm-scroll-snap-mode'.
+
+If it is disabled, enable `coterm-auto-char-mode'."
+  (interactive)
+  (cond
+   (coterm-auto-char-mode
+;; Interactively to show the message.
+(funcall-interactively #'coterm-auto-char-mode -1)
+(coterm-char-mode 1)
+(coterm-scroll-snap-mode 1))
+   (coterm-char-mode
+(coterm-char-mode -1)
+(coterm-scroll-snap-mode -1))
+   (t (funcall-interactively #'coterm-auto-char-mode 1
+
+ Automatic entry to char mode
+
+(define-minor-mode coterm-auto-char-mode
+  "Whether we should enter or leave char m

[elpa] externals/coterm 3599955 35/80: Fixes for documentation and compiler warnings

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 359995548f3d2033d1f1093410960994cfdb3126
Author: m <>
Commit: m <>

Fixes for documentation and compiler warnings
---
 coterm.el | 48 ++--
 1 file changed, 30 insertions(+), 18 deletions(-)

diff --git a/coterm.el b/coterm.el
index 5ce98eb..29d1ad4 100644
--- a/coterm.el
+++ b/coterm.el
@@ -2,17 +2,17 @@
 
 ;;; Terminal emulation
 
-;; Differences from `term-control-seq-regexp':
-;; Removed: \t, \032 (\C-z)
-;; Added: OSC sequence \e] ... ; ... \e\\ (or \a)
 (defconst coterm--t-control-seq-regexp
+  ;; Differences from `term-control-seq-regexp':
+  ;; Removed: \t, \032 (\C-z)
+  ;; Added: OSC sequence \e] ... ; ... \e\\ (or \a)
   (concat
;; A control character,
"\\(?:[\n\000\007\b\016\017]\\|\r\n?\\|"
;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
;; of the C1 set"),
"\e\\(?:[DM78c]\\|"
-   ;; Emacs specific control sequences from term.el.  In coterm, we simply
+   ;; Emacs specific control sequence from term.el.  In coterm, we simply
;; ignore them.
"AnSiT[^\n]+\n\\|"
;; OSC seqence.  We print them normally to let
@@ -20,7 +20,7 @@
"][0-9A-Za-z]*;.*?\\(?:\a\\|\e\\)\\|"
;; or an escape sequence (section 5.4 "Control Sequences"),
"\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)")
-  "Regexp matching control sequences handled by term.el.")
+  "Regexp matching control sequences handled by coterm.")
 
 (defconst coterm--t-control-seq-prefix-regexp "\e")
 
@@ -343,10 +343,10 @@ If `coterm--t-home-marker' is nil, initialize it 
sensibly."
  ;; A match string of length two and beginning with \r means
  ;; that we have matched "\r\n".  In this case, and if we are
  ;; at eob, we pass-through to avoid an unnecessary call to
- ;; `substring' which is expensive.  In the most common when
- ;; the process just outputs text at eob without any control
- ;; sequences, we will end up inserting the whole string
- ;; without a single call to `substring'.
+ ;; `substring' which is expensive.  In the most common case
+ ;; when the process just outputs text at eob without any
+ ;; control sequences, we will end up inserting the whole
+ ;; string without a single call to `substring'.
  (if (and coterm--t-pmark-in-sync
   (= pmark (point-max))
   (not (coterm--t-scroll-by-deletion-p)))
@@ -522,7 +522,7 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
   (ins)
   (setq coterm--t-unhandled-fragment (substring string match)))
  ((null last-match-end)
-  ;; Optimization, no substring means no string copying
+  ;; Optimization: no substring means no string copying
   (coterm--t-insert proc-filt process string will-insert-newlines))
  (t
   (ins)))
@@ -541,8 +541,10 @@ If `coterm--t-home-marker' is nil, initialize it sensibly."
 
 ;;; Mode functions and configuration
 
-(defcustom coterm-term-name term-term-name
-  "Name to use for TERM.")
+(defcustom coterm-term-name "eterm-color"
+  "Name to use for TERM."
+  :group 'comint
+  :type 'string)
 
 (defun coterm--comint-strip-CR (_)
   "Remove all \\r characters from last output."
@@ -586,11 +588,20 @@ subprocesses.")
 It is called with the same arguments as `start-process' and
 should return a process.")
 
-(defcustom coterm-term-name term-term-name
-  "Name to use for TERM.")
-
-(defvar coterm-termcap-format term-termcap-format
-  "Termcap capabilities supported.")
+(defvar coterm-termcap-format
+  "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\
+:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\
+:al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=^J\
+:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\
+:mb=\\E[5m:mh=\\E[2m:ZR=\\E[23m:ZH=\\E[3m\
+:so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\
+:UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC\
+:kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\
+:mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#256:pa#32767\
+:AB=\\E[48;5;%%dm:AF=\\E[38;5;%%dm:cr=^M\
+:bl=^G:do=^J:le=^H:ta=^I:se=\\E[27m:ue=\\E[24m\
+:kb=^?:kD=^[[3~:sc=\\E7:rc=\\E8:r1=\\Ec:"
+  "Termcap capabilities supported by coterm.")
 
 (define-advice comint-exec-1 (:around (f &rest args) coterm-config)
   "Make spawning processes for comint more configurable.
@@ -614,6 +625,7 @@ process."
 (define-minor-mode coterm-mode
   "Better terminal emulation in comint processes."
   :global t
+  :group 'comint
   (if coterm-mode
 
   (progn
@@ -641,6 +653,6 @@ process."
 if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
".." command switches
 
-(remove-hook 'comint-exec-hook #'coterm-

[elpa] externals/coterm dc5f8db 38/80: Improve doc string, add autoload cookie

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit dc5f8db2811fc63f281b15ae245af1ba56650d81
Author: m <>
Commit: m <>

Improve doc string, add autoload cookie
---
 coterm.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 7006e4b..3075077 100644
--- a/coterm.el
+++ b/coterm.el
@@ -610,8 +610,16 @@ process."
   (apply coterm-term-environment-function args
 (apply f args)))
 
+;;;###autoload
 (define-minor-mode coterm-mode
-  "Better terminal emulation in comint processes."
+  "Improved terminal emulation in comint processes.
+When this mode is enabled, terminal emulation is enabled for all
+newly spawned comint processes, allowing you to use more complex
+console programs such as \"less\" and \"mpv\" and full-screen
+programs such as \"vi\", \"top\", \"htop\" or even \"emacs -nw\".
+
+Environment variables for comint processes are set according to
+variables `coterm-term-name' and `coterm-termcap-format'."
   :global t
   :group 'comint
   (if coterm-mode



[elpa] externals/coterm b35e077 40/80: Reorganize file

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit b35e077456542db5d3171baff7864e550d5e68a1
Author: m <>
Commit: m <>

Reorganize file
---
 coterm.el | 304 +++---
 1 file changed, 151 insertions(+), 153 deletions(-)

diff --git a/coterm.el b/coterm.el
index 2b37567..0c93979 100644
--- a/coterm.el
+++ b/coterm.el
@@ -2,6 +2,126 @@
 
 (require 'term)
 
+;;; Mode functions and configuration
+
+(defcustom coterm-term-name term-term-name
+  "Name to use for TERM."
+  :group 'comint
+  :type 'string)
+
+(defvar coterm-termcap-format term-termcap-format
+  "Termcap capabilities supported by coterm.")
+
+(defvar coterm-term-environment-function #'comint-term-environment
+  "Function to calculate environment for comint processes.
+If non-nil, it is called with zero arguments and should return a
+list of environment variable settings to apply to comint
+subprocesses.")
+
+(defvar coterm-start-process-function #'start-file-process
+  "Function called to start a comint process.
+It is called with the same arguments as `start-process' and
+should return a process.")
+
+(define-advice comint-exec-1 (:around (f &rest args) coterm-config)
+  "Make spawning processes for comint more configurable.
+With this advice installed on `coterm-exec-1', you use the
+settings `coterm-extra-environment-function' and
+`coterm-start-process-function' to control how comint spawns a
+process."
+  (cl-letf*
+  ((start-file-process (symbol-function #'start-file-process))
+   (comint-term-environment (symbol-function #'comint-term-environment))
+   ((symbol-function #'start-file-process)
+(lambda (&rest args)
+  (fset #'start-file-process start-file-process)
+  (apply coterm-start-process-function args)))
+   ((symbol-function #'comint-term-environment)
+(lambda (&rest args)
+  (fset #'comint-term-environment comint-term-environment)
+  (apply coterm-term-environment-function args
+(apply f args)))
+
+;;;###autoload
+(define-minor-mode coterm-mode
+  "Improved terminal emulation in comint processes.
+When this mode is enabled, terminal emulation is enabled for all
+newly spawned comint processes, allowing you to use more complex
+console programs such as \"less\" and \"mpv\" and full-screen
+programs such as \"vi\", \"top\", \"htop\" or even \"emacs -nw\".
+
+Environment variables for comint processes are set according to
+variables `coterm-term-name' and `coterm-termcap-format'."
+  :global t
+  :group 'comint
+  (if coterm-mode
+
+  (progn
+(add-hook 'comint-mode-hook #'coterm--init)
+(setq coterm-term-environment-function
+  (lambda ()
+(let (ret)
+  (push (format "TERMINFO=%s" data-directory)
+ret)
+  (when coterm-term-name
+(push (format "TERM=%s" coterm-term-name) ret))
+  (when coterm-termcap-format
+(push (format coterm-termcap-format "TERMCAP="
+  coterm-term-name
+  (floor (window-screen-lines))
+  (window-max-chars-per-line))
+  ret))
+  ret)))
+(setq coterm-start-process-function
+  (lambda (name buffer command &rest switches)
+(apply #'start-file-process name buffer
+   ;; Adapted from `term-exec-1'
+   "sh" "-c"
+   (format "stty -nl sane -echo 2>%s;\
+if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
+   ".." command switches
+
+(remove-hook 'comint-exec-hook #'coterm--init)
+(setq coterm-term-environment-function #'comint-term-environment)
+(setq coterm-start-process-function #'start-file-process)))
+
+;;; Raw mode
+
+(defvar coterm-char-mode-map
+  (let ((map (make-sparse-keymap)))
+(set-keymap-parent map term-raw-map)
+(define-key map [remap term-char-mode] #'coterm-char-mode)
+(define-key map [remap term-line-mode] #'coterm-char-mode)
+map))
+
+(define-minor-mode coterm-char-mode
+  "Send characters you type directly to the inferior process.
+When this mode is enabled, the keymap `coterm-char-mode-map' is
+active, which inherits from `term-raw-map'.  In this map, each
+character is sent to the process, except for the escape
+character (usually C-c).  You can set `term-escape-char' to
+customize it."
+  :lighter " CHAR")
+
+(defvar coterm--char-old-scroll-margin nil)
+
+(define-minor-mode coterm-scroll-snap-mode
+  "Keep scroll synchronized.
+Usually enabled for full-screen terminal programs to keep them on
+screen."
+  :keymap nil
+  (if coterm-scroll-snap-mode
+  (unless coterm--char-old-scroll-margin
+(setq coterm--char-old-scroll-margin
+  (cons scroll-margin
+(local-variable-p 'scroll-margin)))
+(setq-local scroll

[elpa] externals/coterm dd06737 55/80: Improve regexp matching mpv prompt

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit dd0673772defc14e257760df52bad815a9222305
Author: m <>
Commit: m <>

Improve regexp matching mpv prompt
---
 coterm.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 78491cd..376a630 100644
--- a/coterm.el
+++ b/coterm.el
@@ -293,7 +293,8 @@ active if these status prompt erasures are detected."
   (forward-line -1)
   (prog1 (looking-at
   (concat "\\(?:.*\n\\)?"
-  "A?V?: "
+  "\\(?:(Paused) \\)?"
+  "\\(?:[AV]\\|AV\\): "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] / "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] "
   "([0-9]?[0-9]%).*"



[elpa] externals/coterm e268359 59/80: Account for home marker reposition when clearing screen

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit e268359ffc70d7fcbce6e55b00d15d857850ee6f
Author: m <>
Commit: m <>

Account for home marker reposition when clearing screen
---
 coterm.el | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/coterm.el b/coterm.el
index abb3c83..4e0b424 100644
--- a/coterm.el
+++ b/coterm.el
@@ -519,12 +519,22 @@ region."
  (if row2
  (progn (coterm--t-goto row2 col2) (point))
(point-max)))
-  (when (eolp)
-(let ((opoint (point)))
-  (skip-chars-backward " ") (delete-region (point) opoint)))
-  (when (eobp)
-(let ((opoint (point)))
-  (skip-chars-backward "\n") (delete-region (point) opoint)))
+  ;; Delete resulting trailing whitespace.  This may move the home marker under
+  ;; some circumstances ((coterm--t-delete-region 0 0), for example), so adjust
+  ;; it afterwards.
+  (let* ((home coterm--t-home-marker)
+ (old-home (marker-position home)))
+(when (eolp)
+  (let ((opoint (point)))
+(skip-chars-backward " ") (delete-region (point) opoint)))
+(when (eobp)
+  (let ((opoint (point)))
+(skip-chars-backward "\n") (delete-region (point) opoint)))
+(unless (= old-home home)
+  (cl-incf coterm--t-home-offset (- old-home home))
+  (goto-char home)
+  (forward-line 0)
+  (set-marker home (point
   (setq coterm--t-pmark-in-sync nil))
 
 (defun coterm--t-open-space (proc-filt process newlines spaces)



[elpa] externals/coterm 34d8808 54/80: Improve less prompt regexp

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 34d8808e556843b2ab007919c61ec8e5b256dbcb
Author: m <>
Commit: m <>

Improve less prompt regexp
---
 coterm.el | 29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/coterm.el b/coterm.el
index f91ebcd..78491cd 100644
--- a/coterm.el
+++ b/coterm.el
@@ -241,19 +241,20 @@ If point is not on process mark, leave `coterm-char-mode' 
and
 (let ((opoint (point)))
   (forward-line 0)
   (prog1
-  (and
-   (looking-at
-(concat
- ":\\|"
- "(END)\\|"
- "byte [0-9]+\\|"
- "100%\\|"
- "\\(?:[^\n]* \\)?" "[0-9]?[0-9]%\\|"
- "[^\n]*(press h for help or q to quit)"))
-   (when (= opoint (match-end 0))
- (unless coterm-char-mode (coterm-char-mode 1))
- (unless coterm-scroll-snap-mode (coterm-scroll-snap-mode 1))
- t))
+  (when (looking-at
+ (concat
+  "\\(?:"
+  ":\\|"
+  "(END)\\|"
+  "byte [0-9]+\\|"
+  "100%\\|"
+  "\\(?:.* \\)?" "[0-9]?[0-9]%\\|"
+  ".*(press h for help or q to quit)\\|"
+  ".*(press RETURN)"
+  "\\)\\'"))
+(unless coterm-char-mode (coterm-char-mode 1))
+(unless coterm-scroll-snap-mode (coterm-scroll-snap-mode 1))
+t)
 (goto-char opoint)
 
 (defun coterm--auto-char-mpv-prompt ()
@@ -291,7 +292,7 @@ active if these status prompt erasures are detected."
 (let ((opoint (point)))
   (forward-line -1)
   (prog1 (looking-at
-  (concat "\\(?:[^\n]*\n\\)?"
+  (concat "\\(?:.*\n\\)?"
   "A?V?: "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] / "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] "



[elpa] externals/coterm 654e286 49/80: Fix mistake in turning mode off

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 654e28668f930fe301dccc4fd77e989fc7b31372
Author: m <>
Commit: m <>

Fix mistake in turning mode off
---
 coterm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 1754728..3a7ac22 100644
--- a/coterm.el
+++ b/coterm.el
@@ -83,7 +83,7 @@ variables `coterm-term-name' and `coterm-termcap-format'."
 if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
".." command switches
 
-(remove-hook 'comint-exec-hook #'coterm--init)
+(remove-hook 'comint-mode-hook #'coterm--init)
 (setq coterm-term-environment-function #'comint-term-environment)
 (setq coterm-start-process-function #'start-file-process)))
 



[elpa] externals/coterm 13dd76a 51/80: Adjust mpv prompt detecting regexp

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 13dd76a69806692aab4d60fae796c5fdedda6c33
Author: m <>
Commit: m <>

Adjust mpv prompt detecting regexp
---
 coterm.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index defe9c0..36f8c79 100644
--- a/coterm.el
+++ b/coterm.el
@@ -270,10 +270,10 @@ If point is not on process mark, leave `coterm-char-mode' 
and
   (forward-line -1)
   (prog1 (looking-at
   (concat "\\(?:[^\n]*\n\\)?"
-  "AV?: "
+  "A?V?: "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] / "
   "[0-9][0-9]:[0-9][0-9]:[0-9][0-9] "
-  "([0-9]?[0-9]%)"
+  "([0-9]?[0-9]%).*"
   "\\(?:"
   "\n\\[-*\\+-*\\]"
   "\\)?"



[elpa] externals/coterm bfcd5e4 63/80: Properly indicate that pmark is synchronized

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit bfcd5e4271dea42be937365ab285a5aa2f5a4027
Author: m <>
Commit: m <>

Properly indicate that pmark is synchronized
---
 coterm.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/coterm.el b/coterm.el
index 340548b..6600acf 100644
--- a/coterm.el
+++ b/coterm.el
@@ -835,6 +835,8 @@ buffer and the scrolling region must cover the whole 
screen."
   (setq restore-point (if (= (point) pmark) pmark (point-marker)))
   (setq old-pmark (copy-marker pmark window-point-insertion-type))
   (coterm--t-adjust-from-pmark pmark)
+  (setq coterm--t-pmark-in-sync t)
+
   (save-restriction
 (coterm--narrow-to-process-output pmark)
 



[elpa] externals/coterm e534194 60/80: Fix buffer-locality of saved scroll-margin

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit e534194bcd696bfda2e91b6252d6a0cb06ebdeb5
Author: m <>
Commit: m <>

Fix buffer-locality of saved scroll-margin
---
 coterm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 4e0b424..f95ed90 100644
--- a/coterm.el
+++ b/coterm.el
@@ -105,7 +105,7 @@ character (usually C-c).  You can set `term-escape-char' to
 customize it."
   :lighter "")
 
-(defvar coterm--char-old-scroll-margin nil)
+(defvar-local coterm--char-old-scroll-margin nil)
 
 (define-minor-mode coterm-scroll-snap-mode
   "Keep scroll synchronized.



[elpa] externals/coterm 5e40af4 47/80: Prevent modification of user input harder

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 5e40af4df3c08bf37de9d57c24b4ceeb946b1c20
Author: m <>
Commit: m <>

Prevent modification of user input harder
---
 coterm.el | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index 2c61ce7..b6c46cf 100644
--- a/coterm.el
+++ b/coterm.el
@@ -500,11 +500,15 @@ buffer and the scrolling region must cover the whole 
screen."
   (coterm--t-adjust-from-pmark pmark)
   (save-restriction
 (widen)
-(unless (text-property-any
- pmark (point-max) 'field 'output)
-  ;; If pmark is at the end of buffer, not counting user input,
-  ;; prevent changing this user input by narrowing the buffer
-  (narrow-to-region (point-min) pmark))
+(goto-char (point-max))
+;; Use narrowing to prevent modification of user input at end of
+;; buffer
+(unless (eq (get-char-property (max 1 (1- (point-max))) 'field)
+'output)
+  (goto-char (point-max))
+  (text-property-search-backward 'field 'output)
+  (when (<= pmark (point))
+(narrow-to-region (point-min) (point
 
 (while (setq match (string-match coterm--t-control-seq-regexp
  string ctl-end))



[elpa] externals/coterm be23cf4 72/80: Prepare submission to ELPA

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit be23cf48776cde8b78b45f02a8771be1be7ad6dd
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Prepare submission to ELPA
---
 LICENSE.txt | 674 
 coterm.el   |   4 +-
 2 files changed, 677 insertions(+), 1 deletion(-)

diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 000..f288702
--- /dev/null
+++ b/LICENSE.txt
@@ -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 wi

[elpa] externals/coterm d5042f6 65/80: Inhibit Emacs from automatically decoding \r\n into \n

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit d5042f649983f5e08b931038f965a0af3e1979a9
Author: m <>
Commit: m <>

Inhibit Emacs from automatically decoding \r\n into \n
---
 coterm.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index d1ead36..61b3c3b 100644
--- a/coterm.el
+++ b/coterm.el
@@ -147,12 +147,13 @@ variables `coterm-term-name' and `coterm-termcap-format'."
   ret)))
 (setq coterm-start-process-function
   (lambda (name buffer command &rest switches)
-(apply #'start-file-process name buffer
-   ;; Adapted from `term-exec-1'
-   "sh" "-c"
-   (format "stty -nl sane -echo 2>%s;\
+;; Adapted from `term-exec-1'
+(let ((inhibit-eol-conversion t))
+  (apply #'start-file-process name buffer
+ "sh" "-c"
+ (format "stty -nl sane -echo 2>%s;\
 if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
-   ".." command switches
+ ".." command switches)
 
 (remove-hook 'comint-mode-hook #'coterm--init)
 (setq coterm-term-environment-function #'comint-term-environment)



[elpa] externals/coterm 952b917 52/80: Better indication of current char-mode status

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 952b91764699d740f0c1bdc7a95e3eb85dce7908
Author: m <>
Commit: m <>

Better indication of current char-mode status
---
 coterm.el | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index 36f8c79..49a54af 100644
--- a/coterm.el
+++ b/coterm.el
@@ -103,7 +103,7 @@ active, which inherits from `term-raw-map'.  In this map, 
each
 character is sent to the process, except for the escape
 character (usually C-c).  You can set `term-escape-char' to
 customize it."
-  :lighter " CHAR")
+  :lighter "")
 
 (defvar coterm--char-old-scroll-margin nil)
 
@@ -171,14 +171,13 @@ If it is disabled, enable `coterm-auto-char-mode'."
   (interactive)
   (cond
(coterm-auto-char-mode
-;; Interactively to show the message.
-(funcall-interactively #'coterm-auto-char-mode -1)
+(coterm-auto-char-mode -1)
 (coterm-char-mode 1)
 (coterm-scroll-snap-mode 1))
(coterm-char-mode
 (coterm-char-mode -1)
 (coterm-scroll-snap-mode -1))
-   (t (funcall-interactively #'coterm-auto-char-mode 1
+   (t (coterm-auto-char-mode 1
 
  Automatic entry to char mode
 
@@ -186,7 +185,7 @@ If it is disabled, enable `coterm-auto-char-mode'."
   "Whether we should enter or leave char mode automatically.
 If enabled, `coterm-auto-char-functions' are consulted to set
 `coterm-char-mode' and `coterm-scroll-snap-mode' automatically."
-  :global nil
+  :lighter ""
   (if coterm-auto-char-mode
   (progn
 (add-hook 'coterm-t-after-insert-hook #'coterm--auto-char nil t)
@@ -195,6 +194,14 @@ If enabled, `coterm-auto-char-functions' are consulted to 
set
 (remove-hook 'coterm-t-after-insert-hook #'coterm--auto-char t)
 (remove-hook 'post-command-hook #'coterm--auto-char t)))
 
+(defvar coterm-auto-char-lighter-mode-format
+  '(coterm-char-mode (coterm-auto-char-mode " AChar" " Char")
+ (coterm-auto-char-mode "" " Line")))
+
+(define-minor-mode coterm-auto-char-lighter-mode
+  "Show current char mode status in modeline."
+  :lighter coterm-auto-char-lighter-mode-format)
+
 (defvar coterm-auto-char-functions
   (list #'coterm--auto-char-less-prompt
 #'coterm--auto-char-mpv-prompt
@@ -397,6 +404,7 @@ In sync with variables `coterm--t-home-marker',
 (setq-local comint-inhibit-carriage-motion t)
 (add-hook 'comint-output-filter-functions #'coterm--comint-strip-CR nil t)
 (coterm-auto-char-mode)
+(coterm-auto-char-lighter-mode)
 
 (add-function :filter-return
   (local 'window-adjust-process-window-size-function)



[elpa] externals/coterm 8a5ffd9 68/80: Fix 'coterm--t-goto' for column zero

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 8a5ffd9f853ba4a2ae8558e42ba593d7abc64a84
Author: m <>
Commit: m <>

Fix 'coterm--t-goto' for column zero
---
 coterm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 7c0cb1b..2a5c4d1 100644
--- a/coterm.el
+++ b/coterm.el
@@ -598,7 +598,7 @@ Return non-nil if the position was actually reached."
   (and
(zerop (forward-line
(+ coterm--t-home-offset row)))
-   (not (eobp))
+   (bolp)
(<= col (move-to-column col
 
 (defun coterm--t-apply-proc-filt (proc-filt process str)



[elpa] externals/coterm bd7c681 73/80: Further document the "less" line-wrap workaround

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit bd7c681c69cf45e58c54172dfef1e556fece6505
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Further document the "less" line-wrap workaround
---
 coterm.el | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/coterm.el b/coterm.el
index cbfa060..35ff1ef 100644
--- a/coterm.el
+++ b/coterm.el
@@ -497,7 +497,8 @@ is the process mark."
 ;; will follow suit and insert long lines unchanged.  However, this means that
 ;; terminal emulation isn't fully accurate for long lines.  Up to now, "less"
 ;; was the only program I've encountered that relies on accurate line wrapping,
-;; so a workaround aimed at "less" specifically was implemented.
+;; so a workaround aimed at "less" specifically was implemented (search for the
+;; term "less" in the function `coterm--t-emulate-terminal'.
 
 (defconst coterm--t-control-seq-regexp
   ;; Differences from `term-control-seq-regexp':
@@ -914,8 +915,15 @@ buffer and the scrolling region must cover the whole 
screen."
 (coterm--t-goto coterm--t-row coterm--t-col)
 (eq (char-before) ?\s))
;; Awkward hack to make line-wrapping work in "less".
-   ;; Very specific for the way "less" performs wrapping.
-   ;; For all other cases, coterm does not support any
+   ;; Very specific for the way "less" performs wrapping:
+   ;; When reaching the end of line, instead of sending
+   ;; "\r\n" to go to the start of the next line, it sends
+   ;; " \b": a space which wraps to the next line in most
+   ;; terminals and a backspace to move to the start of the
+   ;; line.  Here we detect this and handle it like an
+   ;; ordinary "\r\n".
+   ;;
+   ;; For all other cases, coterm does not perform any
;; wrapping at all.
(delete-char -1)
(coterm--t-down-line proc-filt process)



[elpa] externals/coterm 139e8d0 79/80: Fix for Emacs 27

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 139e8d04be843143d648eded08026052741fca79
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Fix for Emacs 27
---
 coterm.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index eec0161..f570537 100644
--- a/coterm.el
+++ b/coterm.el
@@ -455,9 +455,9 @@ is the process mark."
   (unless comint-use-prompt-regexp
 (unless (eq (get-char-property (max 1 (1- (point-max))) 'field)
 'output)
-  (goto-char (point-max))
-  (text-property-search-backward 'field 'output)
-  (narrow-to-region (point-min) (max pmark (point))
+  (narrow-to-region
+   (point-min)
+   (previous-single-property-change (point-max) 'field nil pmark)
 
 ;;; Terminal emulation
 
@@ -630,8 +630,9 @@ Return non-nil if the position was actually reached."
   "Insert STR using PROC-FILT and PROCESS.
 Basically, call PROC-FILT with the arguments PROCESS and STR, but
 adjusting `ansi-color-context-region' beforehand."
-  (when-let ((context ansi-color-context-region))
-(set-marker (cadr context) (process-mark process)))
+  (when-let ((context ansi-color-context-region)
+ (marker (cadr context)))
+(set-marker marker (process-mark process)))
   (funcall proc-filt process str))
 
 (defun coterm--t-delete-region (row1 col1 &optional row2 col2)



[elpa] externals/coterm 570ae6d 74/80: Mention auto char mode as a difference from term.el

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 570ae6d495c9229e1f4ffe091a9a5e8a317127b7
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Mention auto char mode as a difference from term.el
---
 coterm.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/coterm.el b/coterm.el
index 35ff1ef..e37936c 100644
--- a/coterm.el
+++ b/coterm.el
@@ -77,6 +77,9 @@
 ;; functionality that we can now use TUI programs.  It is therefore good for
 ;; users who generally prefer comint to term.el but sometimes miss the superior
 ;; terminal emulation that term.el provides.
+;;
+;; Coterm also provides `coterm-auto-char-mode' which aims to eliminate the
+;; need to manually enable and disable char mode.
 
 ;;; Code:
 



[elpa] externals/coterm da8019b 80/80: Simplify narrowing to process output

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit da8019bac0519bd249ef1e9186a743217a7e4bd0
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Simplify narrowing to process output
---
 coterm.el | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/coterm.el b/coterm.el
index f570537..606eec2 100644
--- a/coterm.el
+++ b/coterm.el
@@ -308,12 +308,10 @@ If point is not on process mark, leave `coterm-char-mode' 
and
 `coterm-scroll-snap-mode'.  Otherwise, call functions from
 `coterm-auto-char-functions' until one returns non-nil."
   (let* ((proc (get-buffer-process (current-buffer)))
- (pmark (and proc (process-mark proc)))
- (opoint))
-(if (and pmark (= (setq opoint (point)) pmark))
+ (pmark (and proc (process-mark proc
+(if (and pmark (= (point) pmark))
 (save-restriction
   (coterm--narrow-to-process-output pmark)
-  (goto-char opoint)
   (run-hook-with-args-until-success 'coterm-auto-char-functions))
   (when coterm-char-mode (coterm-char-mode -1))
   (when coterm-scroll-snap-mode (coterm-scroll-snap-mode -1)
@@ -448,8 +446,8 @@ only leave these modes once cursor moves to the bottom 
line."
   t)
 
 (defun coterm--narrow-to-process-output (pmark)
-  "Narrow to process output and move point to the end of it.
-If there is no user input at end of buffer, simply widen.  PMARK
+  "Widen and narrow to process output.
+If there is no user input at end of buffer, simply widen. PMARK
 is the process mark."
   (widen)
   (unless comint-use-prompt-regexp



[elpa] externals/coterm 8ca9291 71/80: Minor fixes to description

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 8ca92916be63eb87504b536b275bd83ebcb795b0
Author: m <>
Commit: m <>

Minor fixes to description
---
 coterm.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/coterm.el b/coterm.el
index 8fecb3b..5eb82da 100644
--- a/coterm.el
+++ b/coterm.el
@@ -1,10 +1,10 @@
 ;;; coterm.el --- Terminal emulation for comint -*- lexical-binding: t; -*-
 
 ;; Filename: coterm.el
-;; Description: Terminal emulation for comint
 ;; Author: jakanakaevangeli 
-;; Created: 2021-10-10
 ;; Version 1.0
+;; Keywords: processes
+;; Package-Requires: ((emacs "26.1"))
 ;; URL: https://repo.or.cz/emacs-coterm.git
 
 ;; This file is not part of GNU Emacs.
@@ -22,7 +22,7 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see .
 
-;;; Commentary
+;;; Commentary:
 
 ;; If the global `coterm-mode' is enabled, proper terminal emulation will be
 ;; supported for all newly spawned comint processes.  This allows you to use
@@ -76,6 +76,8 @@
 ;; users who generally prefer comint to term.el but sometimes miss the superior
 ;; terminal emulation that term.el provides.
 
+;;; Code:
+
 (require 'term)
 (eval-when-compile
   (require 'cl-lib))



[elpa] externals/coterm ab99084 76/80: [auto-char] "less" prompt may be an empty line if it is slow

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit ab990849fe83fb894cdf74efa3f3002612fe6822
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

[auto-char] "less" prompt may be an empty line if it is slow

Try pressing d quickly on less running on a remote machine for example.
---
 coterm.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coterm.el b/coterm.el
index 96ea926..4efec91 100644
--- a/coterm.el
+++ b/coterm.el
@@ -332,6 +332,7 @@ that char mode is maintained even if the user presses \"/\",
(if (not (eobp))
(rem-hook)
  (or
+  (bolp); Empty last line if "less" is slow
   (coterm--auto-char-less-prompt-1)
   (progn
 (forward-line 0)



[elpa] externals/coterm 11a9594 78/80: [auto-char] Detect prompts from "less -M"

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 11a959487588a406189a24e838ad673474db7664
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

[auto-char] Detect prompts from "less -M"
---
 coterm.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index ed4daf9..eec0161 100644
--- a/coterm.el
+++ b/coterm.el
@@ -360,8 +360,9 @@ that char mode is maintained even if the user presses \"/\",
 (concat
  "\\(?:"
  ":\\|"
- "(END)\\|"
+ "\\(?:.* \\)?" "(END)\\|"
  "byte [0-9]+\\|"
+ "lines [0-9]+-[0-9]+\\|"
  "100%\\|"
  "\\(?:.* \\)?" "[0-9]?[0-9]%\\|"
  ".*(press h for help or q to quit)\\|"



[elpa] externals/coterm 07a2570 69/80: Work around a line wrapping issue with "less"

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 07a257077458e5121817ccdb1ee4eb61317dd662
Author: m <>
Commit: m <>

Work around a line wrapping issue with "less"
---
 coterm.el | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 2a5c4d1..2ce48e5 100644
--- a/coterm.el
+++ b/coterm.el
@@ -778,7 +778,7 @@ buffer and the scrolling region must cover the whole 
screen."
 (set-marker coterm--t-home-marker (point))
 (setq coterm--t-home-offset 0)
 (setq coterm--t-row (1- coterm--t-height
-(setq coterm--t-col (min column (1- coterm--t-width)
+(setq coterm--t-col column)))
 
 (defun coterm--t-adjust-from-pmark (pos)
   "Point `coterm--t-row' and `coterm--t-col' POS."
@@ -888,6 +888,20 @@ buffer and the scrolling region must cover the whole 
screen."
 (+ coterm--t-col 8 (- (mod coterm--t-col 8)
  (dirty))
 (?\b (ins) ;; (terminfo: cub1)
+
+ (when (and (= coterm--t-col (1+ coterm--t-width))
+(not (coterm--t-scroll-by-deletion-p))
+(coterm--t-goto coterm--t-row coterm--t-col)
+(eq (char-before) ?\s))
+   ;; Awkward hack to make line-wrapping work in "less".
+   ;; Very specific for the way "less" performs wrapping.
+   ;; For all other cases, coterm does not support any
+   ;; wrapping at all.
+   (delete-char -1)
+   (coterm--t-down-line proc-filt process)
+   (setq coterm--t-col 0)
+   (coterm--t-insert proc-filt process " " 0))
+
  (setq coterm--t-col (max (1- coterm--t-col) 0))
  (dirty))
 (?\C-g (ins) ;; (terminfo: bel)



[elpa] externals/coterm 90823af 77/80: Revert "Inhibit Emacs from automatically decoding \r\n into \n"

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 90823afecb0825db25861dfebf6a7d3ac7b02292
Author: Miha Rihtaršič 
Commit: Miha Rihtaršič 

Revert "Inhibit Emacs from automatically decoding \r\n into \n"

This reverts commit d5042f649983f5e08b931038f965a0af3e1979a9.

It seems like the variable 'inhibit-eol-conversion' does the opposite than
expected for remote processes, and for local processes it isn't needed.  
I've
only tested this on GNU/Linux systems, though.
---
 coterm.el | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/coterm.el b/coterm.el
index 4efec91..ed4daf9 100644
--- a/coterm.el
+++ b/coterm.el
@@ -159,13 +159,12 @@ variables `coterm-term-name' and `coterm-termcap-format'."
   ret)))
 (setq coterm-start-process-function
   (lambda (name buffer command &rest switches)
-;; Adapted from `term-exec-1'
-(let ((inhibit-eol-conversion t))
-  (apply #'start-file-process name buffer
- "sh" "-c"
- (format "stty -nl sane -echo 2>%s;\
+(apply #'start-file-process name buffer
+   ;; Adapted from `term-exec-1'
+   "sh" "-c"
+   (format "stty -nl sane -echo 2>%s;\
 if [ $1 = .. ]; then shift; fi; exec \"$@\"" null-device)
- ".." command switches)
+   ".." command switches
 
 (remove-hook 'comint-mode-hook #'coterm--init)
 (setq coterm-term-environment-function #'comint-term-environment)



[elpa] externals/coterm 066cd45 70/80: Explain how coterm does/doesn't do line-wrapping

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit 066cd45c2b359c7ca6439de0cfdd66782e6b3be3
Author: m <>
Commit: m <>

Explain how coterm does/doesn't do line-wrapping
---
 coterm.el | 16 
 1 file changed, 16 insertions(+)

diff --git a/coterm.el b/coterm.el
index 2ce48e5..8fecb3b 100644
--- a/coterm.el
+++ b/coterm.el
@@ -478,6 +478,22 @@ is the process mark."
 ;; position reachable, but inserting text after this whitespace means that it
 ;; isn't trailing or redundant (except if the inserted text consists of only
 ;; whitespace).
+;;
+;;
+;; Line wrapping:
+;;
+;; term.el wraps lines correctly and accurately.  When text is to be inserted
+;; at the right edge, term.el will first move the cursor to the beginning of
+;; the next line.
+;;
+;; The beauty of comint, on the other hand, is that it inserts long lines
+;; unchanged and leaves line wrapping up to Emacs.  One can easily use
+;; `toggle-truncate-lines' or even `word-wrap' to change display of long lines
+;; from compiler output for example.  That is why it was decided that coterm
+;; will follow suit and insert long lines unchanged.  However, this means that
+;; terminal emulation isn't fully accurate for long lines.  Up to now, "less"
+;; was the only program I've encountered that relies on accurate line wrapping,
+;; so a workaround aimed at "less" specifically was implemented.
 
 (defconst coterm--t-control-seq-regexp
   ;; Differences from `term-control-seq-regexp':



[elpa] branch externals/coterm created (now da8019b)

2021-10-13 Thread ELPA Syncer
elpasync pushed a change to branch externals/coterm.

at  da8019b   Simplify narrowing to process output

This branch includes the following new commits:

   new  7b1e001   Initial commit
   new  a983b5e   New function for approximately moving pmark
   new  ff83d09   Handle \e[1K
   new  0647615   Plug marker leak
   new  9e3e19b   Add support for \e[L
   new  044b03e   Simplify
   new  29ef3ad   Fix scrolling
   new  aa4a7f9   Support \e[M
   new  cf9217d   Support \e[P and \e[@
   new  ba74fb8   Simplify
   new  c48515c   Support \e[4h and \e[4l for insert mode
   new  f1cc63e   Support \e[6n for reporting cursor position
   new  cfc9f03   Fix some escape params defaulting to 1
   new  ab1dcd4   Fix typo
   new  ba651c6   Fix negative and too high column positions
   new  2403460   Make all coterm-t-* variables private
   new  e22fe83   Adjust column after resizing window
   new  e21bb54   Major refactor and started scroll region
   new  08cf379   Minor fixes
   new  586ce4e   Delete off-screen rows when scrolling up
   new  753fba8   Refactor line deletion and insertion
   new  9d532fb   Refactor some more
   new  4a23ae2   Further refactor some more
   new  f334168   Rename function
   new  5aea1c8   Fixup some comments
   new  f48ef18   Fix \e[M and \e[L outside scrolling region
   new  c825746   Fix issue with ansi-color context marker
   new  8b2836e   Fix incorrect handling of incomplete escape sequences
   new  1ec97d2   \n doesn't go to column 0
   new  71d2dc1   Implement user-facing variables and minor mode
   new  73aa1f3   Properly handle OSC and Emacs specific escape sequences
   new  f4f69ab   Export TERMINFO environment variable
   new  08208f3   Handle \r\n sequence properly
   new  9184a46   Always synchronize pmark at the end
   new  3599955   Fixes for documentation and compiler warnings
   new  c535023   Safeguard against negative values in move-to-column
   new  9e7720b   Use save-excursion more sparingly
   new  dc5f8db   Improve doc string, add autoload cookie
   new  ee37b4b   Initial support for char-mode and scroll snapping
   new  b35e077   Reorganize file
   new  4943e16   Footer and header
   new  d6912da   Support sequences \eE[E, F and G (pacman uses them)
   new  e64027a   Restore 'window-point' of non-selected windows
   new  8f0a13b   Refactor scroll snapping, snap in all windows
   new  6f42ba6   Initialize home marker properly
   new  dfebb62   Add comint output filter function buffer locally
   new  5e40af4   Prevent modification of user input harder
   new  2358124   Try to enter and leave char-mode automatically
   new  654e286   Fix mistake in turning mode off
   new  edfdbb7   Ignore sequences \e= end \e> (output by mpv)
   new  13dd76a   Adjust mpv prompt detecting regexp
   new  952b917   Better indication of current char-mode status
   new  e0a38cc   Add more documentation for auto char mode
   new  34d8808   Improve less prompt regexp
   new  dd06737   Improve regexp matching mpv prompt
   new  bd103f9   [auto-char] Fix searching in less
   new  dc9466e   Implement \t (move cursor to tab stop), needed for "emacs 
-nw"
   new  fd4041e   Remove redundant "(dirty)"
   new  e268359   Account for home marker reposition when clearing screen
   new  e534194   Fix buffer-locality of saved scroll-margin
   new  7941200   Describe package
   new  db17a99   Describe terminal emulation
   new  bfcd5e4   Properly indicate that pmark is synchronized
   new  96a636e   Protect user input at EOB more accurately
   new  d5042f6   Inhibit Emacs from automatically decoding \r\n into \n
   new  10205c8   Improve README
   new  c52f413   Keep char mode in less after pressing a digit
   new  8a5ffd9   Fix 'coterm--t-goto' for column zero
   new  07a2570   Work around a line wrapping issue with "less"
   new  066cd45   Explain how coterm does/doesn't do line-wrapping
   new  8ca9291   Minor fixes to description
   new  be23cf4   Prepare submission to ELPA
   new  bd7c681   Further document the "less" line-wrap workaround
   new  570ae6d   Mention auto char mode as a difference from term.el
   new  c717c84   Bind inhibit-read-only to t for terminal emulation
   new  ab99084   [auto-char] "less" prompt may be an empty line if it is 
slow
   new  90823af   Revert "Inhibit Emacs from automatically decoding \r\n 
into \n"
   new  11a9594   [auto-char] Detect prompts from "less -M"
   new  139e8d0   Fix for Emacs 27
   new  da8019b   Simplify narrowing to process output




[elpa] externals/coterm ff83d09 03/80: Handle \e[1K

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit ff83d09d1a89fd156906b039500d5aef2ca76cbd
Author: m <>
Commit: m <>

Handle \e[1K
---
 coterm.el | 52 ++--
 1 file changed, 38 insertions(+), 14 deletions(-)

diff --git a/coterm.el b/coterm.el
index 3437776..87f10cd 100644
--- a/coterm.el
+++ b/coterm.el
@@ -310,22 +310,46 @@ initialize it sensibly."
  (cl-decf coterm--t-col (car ctl-params))
  (setq coterm--t-col (max coterm--t-col 0))
  (dirty))
- (?J ;; \E[J - clear to end of screen (terminfo: ed, 
clear)
+ ;; \E[J - clear to end of screen (terminfo: ed, clear)
+ ((and ?J (guard (eq 0 (car ctl-params
   (ins)
   (coterm--t-approximate-pmark pmark)
-  (pcase (car ctl-params)
-(0
- (delete-region pmark (point-max)))
-(1 (coterm--t-normalize-home-offset)
-   (delete-region coterm--t-home-marker pmark)
-   (unless (= pmark (point-max))
- ;; Substitute deleted region with empty lines
- (funcall proc-filt process
-  (concat (make-string coterm--t-row 
?\n)
-  (make-string coterm--t-col 
?\s)
-(_ (coterm--t-normalize-home-offset)
-   (delete-region coterm--t-home-marker 
(point-max
-  (dirty))
+  (delete-region pmark (point-max))
+  (dirty))
+ ((and ?J (guard (eq 1 (car ctl-params
+  (ins)
+  (coterm--t-approximate-pmark pmark)
+  (coterm--t-normalize-home-offset)
+  (delete-region coterm--t-home-marker pmark)
+  (if (= pmark (point-max))
+  (dirty)
+;; Substitute deleted region with empty lines
+(funcall proc-filt process
+ (concat (make-string coterm--t-row ?\n)
+ (unless (eq (char-after pmark) 
?\n)
+   (make-string coterm--t-col 
?\s))
+ (?J
+  (ins)
+  (coterm--t-normalize-home-offset)
+  (delete-region coterm--t-home-marker (point-max))
+  (dirty))
+ (?K ;; \E[K - clear to end of line (terminfo: el, el1)
+  (ins)
+  (coterm--t-approximate-pmark pmark)
+  (save-excursion
+(goto-char pmark)
+(if (eq 1 (car ctl-params))
+;; Clear left of pmark
+(forward-line 0)
+  ;; Clear right of pmark
+  (forward-line 1)
+  (unless (eobp)
+(backward-char)))
+(delete-region (point) pmark)
+(if (eolp)
+(if (eq 1 (car ctl-params)) (dirty))
+  (funcall proc-filt process
+   (make-string coterm--t-col 
?\s)
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp



[elpa] externals/coterm aa4a7f9 08/80: Support \e[M

2021-10-13 Thread ELPA Syncer
branch: externals/coterm
commit aa4a7f929736c99c98dd7081fe139c168c520ec1
Author: m <>
Commit: m <>

Support \e[M
---
 coterm.el | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/coterm.el b/coterm.el
index 96d045b..1576873 100644
--- a/coterm.el
+++ b/coterm.el
@@ -377,12 +377,21 @@ initialize it sensibly."
  (?L ;; \E[L - insert lines (terminfo: il, il1)
   ;; Remove from bottom
   (coterm--t-delete-region
-   coterm-t-height 0
-   (- coterm-t-height (car ctl-params)))
+   (- coterm-t-height (car ctl-params)) 0
+   coterm-t-height 0)
   ;; Insert at position
   (coterm--t-open-space
proc-filt process coterm--t-row 0
-   (car ctl-params) 0))
+   (car ctl-params) 0))
+ (?M ;; \E[M - delete lines (terminfo: dl, dl1)
+  ;; Insert at bottom
+  (coterm--t-open-space
+   proc-filt process coterm-t-height 0
+   (car ctl-params) 0)
+  ;; Remove at position
+  (coterm--t-delete-region
+   coterm--t-row 0
+   (+ coterm--t-row (car ctl-params)) 0))
 
 (cond
  ((setq match (string-match coterm-t-control-seq-prefix-regexp
@@ -429,6 +438,7 @@ initialize it sensibly."
  (process (get-buffer-process (current-buffer
 (setq coterm-t-height (floor (window-screen-lines)))
 (setq coterm-t-width (window-max-chars-per-line))
+(setq-local comint-inhibit-carriage-motion t)
 
 (add-function :filter-return
   (local 'window-adjust-process-window-size-function)



  1   2   >