[elpa] master a10ad99: Remove inconsistencies in debbugs

2019-11-20 Thread Michael Albinus
branch: master
commit a10ad997c0a7cb885ba92834bae5cfbc047f89f6
Author: Michael Albinus 
Commit: Michael Albinus 

Remove inconsistencies in debbugs

* debbugs-gnu.el (debbugs-gnu-implicit-ids)
(debbugs-gnu-jump-to-bug): Rename from `debbugs-gnus-*'.
(debbugs-gnu-apply-patch, debbugs-gnu-insert-changelog): Refuse to
work if `debbugs-gnu-mail-backend' isn't `gnus'.
---
 packages/debbugs/debbugs-gnu.el | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index 35817cc..303b625 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -1596,7 +1596,7 @@ removed instead."
   (message "Control message sent:\n%s"
(buffer-substring-no-properties (point) (1- (point-max)))
 
-(defun debbugs-gnus-implicit-ids ()
+(defun debbugs-gnu-implicit-ids ()
   "Return a list of bug IDs guessed from the current buffer."
   (delq nil (delete-dups
  (list (debbugs-gnu-current-id t)
@@ -1641,7 +1641,7 @@ removed instead."
  (list (completing-read
 "Control message: " debbugs-gnu-control-message-keywords nil t)
(let* ((implicit-ids (mapcar #'prin1-to-string
-(debbugs-gnus-implicit-ids)))
+(debbugs-gnu-implicit-ids)))
   (default-id (car implicit-ids)))
  (string-to-number
   (completing-read (if default-id
@@ -1786,7 +1786,7 @@ removed instead."
   (lambda () (remhash bugid debbugs-cache-data))
   nil t)))
 
-(defun debbugs-gnus-jump-to-bug (bugid)
+(defun debbugs-gnu-jump-to-bug (bugid)
   "Display buffer associated with BUGID with `pop-to-buffer'.
 Use `gnus-read-ephemeral-emacs-bug-group' instead if there is no such buffer."
   (let ((bug-buf nil)
@@ -1797,7 +1797,7 @@ Use `gnus-read-ephemeral-emacs-bug-group' instead if 
there is no such buffer."
for buf in (buffer-list)
while preferred-modes do
(set-buffer buf)
-   (when-let (((memql bugid (debbugs-gnus-implicit-ids)))
+   (when-let (((memql bugid (debbugs-gnu-implicit-ids)))
   (mode (cl-loop
  for mode in preferred-modes
  thereis (and (derived-mode-p mode)
@@ -2005,7 +2005,7 @@ user to call `debbugs-gnu-maybe-use-picked-commits'."
  (format "Bug # (default %s): " (car bugnum))
"Bug #: ")
  debbugs-gnu-completion-table nil t nil nil bugnum
-  (debbugs-gnus-jump-to-bug read-bugnum)
+  (debbugs-gnu-jump-to-bug read-bugnum)
   (cl-callf2 mapcar #'string-to-number bugnum)
   (unless (memql read-bugnum bugnum)
 (push read-bugnum bugnum)))
@@ -2023,7 +2023,7 @@ on an entry with a matching bug number from
 successfully sent."
   (interactive)
   (when (derived-mode-p 'message-mode)
-(cl-loop with id = (car (debbugs-gnus-implicit-ids))
+(cl-loop with id = (car (debbugs-gnu-implicit-ids))
  for pcomm-entry in debbugs-gnu-picked-commits
  for (bugnum repo-dir commit-range) = pcomm-entry
  when (memql id bugnum)
@@ -2211,6 +2211,8 @@ If given a prefix, patch in the branch directory instead.
 
 If SELECTIVELY, query the user before applying the patch."
   (interactive "P")
+  (unless (eq debbugs-gnu-mail-backend 'gnus)
+(error "This function only works with Gnus."))
   (add-hook 'diff-mode-hook #'debbugs-gnu-diff-mode)
   (debbugs-gnu-init-current-directory branch)
   (let ((rej (expand-file-name "debbugs-gnu.rej" temporary-file-directory))
@@ -2358,6 +2360,8 @@ If SELECTIVELY, query the user before applying the patch."
 (defun debbugs-gnu-insert-changelog ()
   "Add a ChangeLog from a recently applied patch from a third party."
   (interactive)
+  (unless (eq debbugs-gnu-mail-backend 'gnus)
+(error "This function only works with Gnus."))
   (let (from subject patch-subject changelog
 patch-from)
 (with-current-buffer gnus-article-buffer



[elpa] externals/phps-mode f0c18c8: Improved token-blind indentation

2019-11-20 Thread Christian Johansson
branch: externals/phps-mode
commit f0c18c8e2afac126013ec7e896644dcd31800b96
Author: Christian Johansson 
Commit: Christian Johansson 

Improved token-blind indentation
---
 phps-mode-analyzer.el  | 167 ++---
 phps-mode.el   |  17 +---
 test/phps-mode-test-functions.el   |  71 +++-
 test/phps-mode-test-integration.el |   1 -
 4 files changed, 172 insertions(+), 84 deletions(-)

diff --git a/phps-mode-analyzer.el b/phps-mode-analyzer.el
index 71f785e..e901edb 100644
--- a/phps-mode-analyzer.el
+++ b/phps-mode-analyzer.el
@@ -1828,7 +1828,8 @@
   (with-current-buffer buffer
 (let ((run-full-lexer nil)
   (old-tokens phps-mode-lexer-tokens)
-  (old-states phps-mode-lexer-states))
+  (old-states phps-mode-lexer-states)
+  (log '()))
 
   (if phps-mode-analyzer-change-min
   (progn
@@ -1924,25 +1925,29 @@
 
   (setq-local phps-mode-lexer-tokens (append 
head-tokens incremental-tokens))
 
-  (phps-mode-debug-message
-   (message "Incremental tokens: %s" 
incremental-tokens))
+  (push (list 'INCREMENTAL-LEX 
incremental-start-new-buffer) log)
 
-  )
+  (phps-mode-debug-message
+   (message "Incremental tokens: %s" 
incremental-tokens)))
+  (push (list 'FOUND-NO-HEAD-STATES 
incremental-start-new-buffer) log)
   (phps-mode-debug-message
(message "Found no head states"))
   (setq run-full-lexer t)))
+(push (list 'FOUND-NO-HEAD-TOKENS 
incremental-start-new-buffer) log)
 (phps-mode-debug-message
  (message "Found no head tokens"))
 (setq run-full-lexer t
+(push (list 'FOUND-NO-CHANGE-POINT-MINIMUM) log)
 (phps-mode-debug-message
  (message "Found no change point minimum"))
 (setq run-full-lexer t))
 
-  (if run-full-lexer
-  (progn
-(phps-mode-debug-message
- (message "Running full lexer"))
-(phps-mode-lexer-run))
+  (when run-full-lexer
+(push (list 'RUN-FULL-LEXER) log)
+(phps-mode-debug-message
+ (message "Running full lexer"))
+(phps-mode-lexer-run))
+  log)))
 
 (defun phps-mode-functions-get-processed-buffer ()
   "Get flag for whether buffer is processed or not."
@@ -3259,66 +3264,94 @@ SQUARE-BRACKET-LEVEL and ROUND-BRACKET-LEVEL."
 (phps-mode-debug-message
  (message "Using alternative indentation since buffer is not processed 
yet"
 
-(defun phps-mode-analyzer--alternative-indentation (point)
+(defun phps-mode-analyzer--alternative-indentation (&optional point)
   "Apply alternative indentation at POINT here."
-  (save-excursion
-(let ((line-number (line-number-at-pos point))
-  (move-length 1)
-  (line-is-empty t)
-  line-beginning-position
-  line-end-position
-  line-string
-  old-line-number)
-  (goto-char point)
-  (when (> line-number 1)
-(while (and
-(> (- line-number move-length) 0)
-line-is-empty)
-  (forward-line (* move-length -1))
-  (beginning-of-line)
-  (setq line-beginning-position (line-beginning-position))
-  (setq line-end-position (line-end-position))
-  (setq
-   line-string
-   (buffer-substring-no-properties line-beginning-position 
line-end-position)
-   )
-  (setq line-is-empty (string= line-string ""))
+  (unless point
+(setq point (point)))
+  (let ((new-indentation))
+(save-excursion
+  (let ((line-number (line-number-at-pos point))
+(move-length 1)
+(line-is-empty t)
+line-beginning-position
+line-end-position
+line-string
+current-line-string)
+(goto-char point)
+(setq
+ current-line-string
+ (buffer-substring-no-properties
+  (line-beginning-position)
+  (line-end-position)
   )
-
-(unless line-is-empty
-  (let* ((old-indentation (current-indentation))
- (new-indentation old-indentation)
- (bracket-level 0)
- (start 0)
- (end (- line-end-position line-beginning-position)))
-(while (and (< start end)
-(string-match 
"\\([\]{}()[]\\|<[a-zA-Z]+\\|\\)" line-string start))
-  (setq start (match-end 0))
-  (let ((bracket (substring line-string (match-beginning 0) 
(match-end 0
-(cond
- ((or
-   (string= bracket "{")
-   (string= bracket "[")
-   (string= bracket "(")
-