[elpa] master 6d0fecb: * sed-mode: New package

2016-02-25 Thread Stefan Monnier
branch: master
commit 6d0fecb89385c58cf4dd83237a4ca9e9afe9babe
Author: Stefan Monnier 
Commit: Stefan Monnier 

* sed-mode: New package
---
 packages/sed-mode/sed-mode.el |  139 +
 1 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/packages/sed-mode/sed-mode.el b/packages/sed-mode/sed-mode.el
new file mode 100644
index 000..ba29bc5
--- /dev/null
+++ b/packages/sed-mode/sed-mode.el
@@ -0,0 +1,139 @@
+;;; sed-mode.el --- Major mode to edit sed scripts  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2016  Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier 
+;; Version: 0
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; If you need this major mode, you might also want to
+;; consider spending some time with `M-x doctor'.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'smie)
+
+(defgroup sed-mode nil
+  "Major mode to edit sed code."
+  :group 'programming)
+
+
+(defvar sed-mode-syntax-table
+  (let ((st (make-syntax-table)))
+(modify-syntax-entry ?# "<" st)
+(modify-syntax-entry ?\n ">" st)
+(modify-syntax-entry ?\\ "." st)
+st))
+
+(defconst sed-commands ":=aiqQrRbcdDhHgGlnNpPstTwWxy")
+
+(eval-and-compile
+  (defconst sed-command-prefix-regexp "\\(?:^\\|[$/0-9;]\\)[ \t]*")
+  (defconst sed-address-prefix-regexp "\\(?:^\\|[,;]\\)[ \t]*"))
+
+(defconst sed-label-regexp "[[:alnum:]]+")
+
+(defun sed-syntax-propertize (beg end)
+  (goto-char beg)
+  (sed-syntax-propertize-string end)
+  (funcall
+   (syntax-propertize-rules
+("$"
+ (0 (unless (nth 8 (save-excursion (syntax-ppss (match-beginning 0
+  (put-text-property (match-beginning 0) (match-end 0)
+ 'syntax-table (string-to-syntax "|"))
+  (sed-syntax-propertize-string end)
+  nil)))
+((concat "\\(?:" sed-address-prefix-regexp
+ "\\(?:\\(?1:/\\)\\|\\(?1:.\\)\\)"
+ "\\|" sed-command-prefix-regexp "[sy]\\(?1:.\\)"
+ "\\)")
+ (0 (unless (nth 8 (save-excursion (syntax-ppss (match-beginning 0
+  (put-text-property (match-beginning 1) (match-end 1)
+ 'syntax-table (string-to-syntax "\""))
+  (sed-syntax-propertize-string end)
+  nil
+   (point) end))
+
+(defun sed-syntax-propertize-string (end)
+  (let* ((ppss (syntax-ppss))
+ (c (nth 3 ppss)))
+(when c
+  (let ((count (cond
+((or (eq c t)
+ (not (memq (char-before (nth 8 ppss)) '(?s ?y
+ 1)
+(t 2
+(goto-char (1+ (nth 8 ppss)))
+(when (re-search-forward
+   (if (eq c t) "[^\\]\n" (regexp-quote (string c)))
+   end 'move count)
+  (put-text-property (1- (match-end 0)) (match-end 0)
+ 'syntax-table
+ (if (eq c t) (string-to-syntax "|")
+   (string-to-syntax "\""
+
+(defun sed--font-lock-command (cmd)
+  (unless (nth 8 (syntax-ppss))
+(pcase cmd
+  (?: (if (looking-at (concat "[   ]*\\(" sed-label-regexp "\\)"))
+  (put-text-property (match-beginning 1) (match-end 1) 'face
+ font-lock-function-name-face)))
+  ((or ?b ?t ?T)
+   (if (looking-at (concat "[  ]*\\(" sed-label-regexp "\\)"))
+   (put-text-property (match-beginning 1) (match-end 1) 'face
+  font-lock-constant-face
+font-lock-keyword-face))
+
+(defconst sed-font-lock-keywords
+  `((,(concat sed-command-prefix-regexp "\\([" sed-commands "]\\)")
+ (1 (sed--font-lock-command (char-after (match-beginning 1)))
+
+(defconst sed-smie-grammar nil)
+
+(defun sed-smie-rules (kind token)
+  (pcase (cons kind token)
+(`(:list-intro . ,_) t)
+))
+
+;;;###autoload (add-to-list 'auto-mode-alist '("\\.sed\\'" . sed-mode))
+
+;;;###autoload
+(define-derived-mode sed-mode prog-mode "Sed"
+  "Sed editing mode."
+  ;; (setq-local font-lock-support-mode nil) ;; To help debugging.
+  (setq-local comment-start "# ")
+  (setq-local comment-end "")
+  (setq-local parse-sexp-lookup-properties t)
+  (setq-local open-paren-in-column-0-is-defun-start 

[elpa] master 1b6b981: Revert last botched commit

2016-02-25 Thread Stefan Monnier
branch: master
commit 1b6b9819a790e8a7ebe0e56507b276190e77b277
Author: Stefan Monnier 
Commit: Stefan Monnier 

Revert last botched commit
---
 packages/company/company-nxml.el|8 ++--
 packages/company/company.el |5 +
 packages/gnome-c-style/gnome-c-tests.el |2 --
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/packages/company/company-nxml.el b/packages/company/company-nxml.el
index c405d2e..70e1c09 100644
--- a/packages/company/company-nxml.el
+++ b/packages/company/company-nxml.el
@@ -1,6 +1,6 @@
 ;;; company-nxml.el --- company-mode completion back-end for nxml-mode
 
-;; Copyright (C) 2009-2011, 2013, 2016  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011, 2013  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 
@@ -123,10 +123,6 @@
 (defun company-nxml (command  arg  ignored)
   "`company-mode' completion back-end for `nxml-mode'."
   (interactive (list 'interactive))
-  (if (fboundp 'rng-completion-at-point)
-  ;; In recent Emacsen, nXML provides a good CAPF completion, so we can
-  ;; disable our own implementation.
-  nil
   (cl-case command
 (interactive (company-begin-backend 'company-nxml))
 (prefix (or (company-nxml-tag 'prefix)
@@ -140,7 +136,7 @@
  ((company-nxml-attribute-value 'prefix)
   (sort (company-nxml-attribute-value 'candidates arg)
 'string<
-(sorted t
+(sorted t)))
 
 (provide 'company-nxml)
 ;;; company-nxml.el ends here
diff --git a/packages/company/company.el b/packages/company/company.el
index 7f55625..ce0b5a4 100644
--- a/packages/company/company.el
+++ b/packages/company/company.el
@@ -1,6 +1,6 @@
 ;;; company.el --- Modular text completion framework  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2009-2016  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 ;; Maintainer: Dmitry Gutov 
@@ -318,9 +318,6 @@ This doesn't include the margins and the scroll bar."
 (defcustom company-backends `(,@(unless (version< "24.3.50" emacs-version)
   (list 'company-elisp))
   company-bbdb
-  ;; FIXME: We could use a version-test to exclude
-  ;; company-nxml, but we don't know yet if that
-  ;; version will be called 25.2 or 26.1.
   company-nxml company-css
   company-eclim company-semantic company-clang
   company-xcode company-ropemacs company-cmake
diff --git a/packages/gnome-c-style/gnome-c-tests.el 
b/packages/gnome-c-style/gnome-c-tests.el
index 2c1e220..17dbfe1 100644
--- a/packages/gnome-c-style/gnome-c-tests.el
+++ b/packages/gnome-c-style/gnome-c-tests.el
@@ -282,5 +282,3 @@ G_DECLARE_FINAL_TYPE (GGpgEngineInfo, g_gpg_engine_info, 
G_GPG, ENGINE_INFO,
   (should (equal class '("Gpg" "Engine" "Info")))
   (should (equal parent-package nil))
   (should (equal parent-class nil)
-
-;;; gnome-c-tests.el ends here



[elpa] master d9d7229: * sed-mode: New package

2016-02-25 Thread Stefan Monnier
branch: master
commit d9d7229875019ea5d97e227af18908a49a432252
Author: Stefan Monnier 
Commit: Stefan Monnier 

* sed-mode: New package
---
 packages/company/company-nxml.el|8 ++--
 packages/company/company.el |5 -
 packages/gnome-c-style/gnome-c-tests.el |2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/packages/company/company-nxml.el b/packages/company/company-nxml.el
index 70e1c09..c405d2e 100644
--- a/packages/company/company-nxml.el
+++ b/packages/company/company-nxml.el
@@ -1,6 +1,6 @@
 ;;; company-nxml.el --- company-mode completion back-end for nxml-mode
 
-;; Copyright (C) 2009-2011, 2013  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011, 2013, 2016  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 
@@ -123,6 +123,10 @@
 (defun company-nxml (command  arg  ignored)
   "`company-mode' completion back-end for `nxml-mode'."
   (interactive (list 'interactive))
+  (if (fboundp 'rng-completion-at-point)
+  ;; In recent Emacsen, nXML provides a good CAPF completion, so we can
+  ;; disable our own implementation.
+  nil
   (cl-case command
 (interactive (company-begin-backend 'company-nxml))
 (prefix (or (company-nxml-tag 'prefix)
@@ -136,7 +140,7 @@
  ((company-nxml-attribute-value 'prefix)
   (sort (company-nxml-attribute-value 'candidates arg)
 'string<
-(sorted t)))
+(sorted t
 
 (provide 'company-nxml)
 ;;; company-nxml.el ends here
diff --git a/packages/company/company.el b/packages/company/company.el
index ce0b5a4..7f55625 100644
--- a/packages/company/company.el
+++ b/packages/company/company.el
@@ -1,6 +1,6 @@
 ;;; company.el --- Modular text completion framework  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2009-2015  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2016  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 ;; Maintainer: Dmitry Gutov 
@@ -318,6 +318,9 @@ This doesn't include the margins and the scroll bar."
 (defcustom company-backends `(,@(unless (version< "24.3.50" emacs-version)
   (list 'company-elisp))
   company-bbdb
+  ;; FIXME: We could use a version-test to exclude
+  ;; company-nxml, but we don't know yet if that
+  ;; version will be called 25.2 or 26.1.
   company-nxml company-css
   company-eclim company-semantic company-clang
   company-xcode company-ropemacs company-cmake
diff --git a/packages/gnome-c-style/gnome-c-tests.el 
b/packages/gnome-c-style/gnome-c-tests.el
index 17dbfe1..2c1e220 100644
--- a/packages/gnome-c-style/gnome-c-tests.el
+++ b/packages/gnome-c-style/gnome-c-tests.el
@@ -282,3 +282,5 @@ G_DECLARE_FINAL_TYPE (GGpgEngineInfo, g_gpg_engine_info, 
G_GPG, ENGINE_INFO,
   (should (equal class '("Gpg" "Engine" "Info")))
   (should (equal parent-package nil))
   (should (equal parent-class nil)
+
+;;; gnome-c-tests.el ends here



[elpa] externals/exwm bc4aafe: Minor fixes for layout and workspace

2016-02-25 Thread Chris Feng
branch: externals/exwm
commit bc4aafec1683a27209aec33f44c3947e169860c6
Author: Chris Feng 
Commit: Chris Feng 

Minor fixes for layout and workspace

* exwm-layout.el (exwm-layout-show-mode-line): Force update mode-line.

* exwm-workspace.el (exwm-workspace--update-minibuffer): Treat nil as empty
string.
---
 exwm-layout.el|3 ++-
 exwm-workspace.el |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/exwm-layout.el b/exwm-layout.el
index c9146de..09428da 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -455,7 +455,8 @@ See also `exwm-layout-enlarge-window'."
(window-mode-line-height (frame-root-window
  exwm--floating-frame)))
 nil t)
-  (exwm-input-grab-keyboard
+  (exwm-input-grab-keyboard))
+(force-mode-line-update)))
 
 ;;;###autoload
 (defun exwm-layout-toggle-mode-line ()
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 8230bd7..283b384 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -453,7 +453,7 @@ The optional FORCE option is for internal use only."
   (setq result
 (+ result
(ceiling (1+ (length i)) width
-(split-string (current-message) "\n"))
+(split-string (or (current-message) "") "\n"))
   result)
   (count-screen-lines))
 (when (and (integerp max-mini-window-height)



[elpa] externals/exwm 84a9041: Fix exwm-workspace-switch-to-buffer

2016-02-25 Thread Chris Feng
branch: externals/exwm
commit 84a9041b20e5477fb2ce2989de9dd2583ef12773
Author: Chris Feng 
Commit: Chris Feng 

Fix exwm-workspace-switch-to-buffer

* exwm-workspace.el (exwm-workspace-switch-to-buffer): Select the floating
frame when switching to a floating X window buffer.
---
 exwm-workspace.el |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index 80767d5..8230bd7 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -399,10 +399,19 @@ The optional FORCE option is for internal use only."
(rename-buffer (concat " " (buffer-name))
   (when buffer-or-name
 (with-current-buffer buffer-or-name
-  (if (and (eq major-mode 'exwm-mode)
-   (not (eq exwm--frame exwm-workspace--current)))
-  (exwm-workspace-move-window exwm-workspace-current-index
-  exwm--id)
+  (if (eq major-mode 'exwm-mode)
+  ;; EXWM buffer.
+  (if (eq exwm--frame exwm-workspace--current)
+  ;; On the current workspace.
+  (if (not exwm--floating-frame)
+  (switch-to-buffer buffer-or-name)
+;; Select the floating frame.
+(select-frame-set-input-focus exwm--floating-frame)
+(select-window (frame-root-window exwm--floating-frame)))
+;; On another workspace.
+(exwm-workspace-move-window exwm-workspace-current-index
+exwm--id))
+;; Ordinary buffer.
 (switch-to-buffer buffer-or-name)
 
 (defun exwm-workspace-rename-buffer (newname)