[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117263: * lisp/emacs-lisp/smie.el (smie--hanging
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs-24 r117263: * lisp/emacs-lisp/smie.el (smie--hanging-eolp-function): New var. |
Date: |
Fri, 20 Jun 2014 01:05:51 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117263
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17621
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-06-19 21:05:40 -0400
message:
* lisp/emacs-lisp/smie.el (smie--hanging-eolp-function): New var.
(smie-indent--hanging-p): Use it.
* lisp/progmodes/sh-script.el (sh-set-shell): Set it.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/emacs-lisp/smie.el smie.el-20100517192034-xap3ihmey43772vj-1
lisp/progmodes/sh-script.el shscript.el-20091113204419-o5vbwnq5f7feedwu-727
lisp/term/xterm.el xterm.el-20091113204419-o5vbwnq5f7feedwu-884
test/indent/shell.sh shell.sh-20110209185043-iuyrh0is1gz0s4w6-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-06-20 00:14:43 +0000
+++ b/lisp/ChangeLog 2014-06-20 01:05:40 +0000
@@ -1,3 +1,9 @@
+2014-06-20 Stefan Monnier <address@hidden>
+
+ * emacs-lisp/smie.el (smie--hanging-eolp-function): New var.
+ (smie-indent--hanging-p): Use it.
+ * progmodes/sh-script.el (sh-set-shell): Set it (bug#17621).
+
2014-06-20 Leo Liu <address@hidden>
* simple.el (read-quoted-char): Don't let help chars pop up help
=== modified file 'lisp/emacs-lisp/smie.el'
--- a/lisp/emacs-lisp/smie.el 2014-06-13 15:31:17 +0000
+++ b/lisp/emacs-lisp/smie.el 2014-06-20 01:05:40 +0000
@@ -1155,6 +1155,15 @@
The functions whose name starts with \"smie-rule-\" are helper functions
designed specifically for use in this function.")
+(defvar smie--hanging-eolp-function
+ ;; FIXME: This is a quick hack for 24.4. Don't document it and replace with
+ ;; a well-defined function with a cleaner interface instead!
+ (lambda ()
+ (skip-chars-forward " \t")
+ (or (eolp)
+ (and ;; (looking-at comment-start-skip) ;(bug#16041).
+ (forward-comment (point-max))))))
+
(defalias 'smie-rule-hanging-p 'smie-indent--hanging-p)
(defun smie-indent--hanging-p ()
"Return non-nil if the current token is \"hanging\".
@@ -1168,10 +1177,7 @@
(not (eobp))
;; Could be an open-paren.
(forward-char 1))
- (skip-chars-forward " \t")
- (or (eolp)
- (and ;; (looking-at comment-start-skip) ;(bug#16041).
- (forward-comment (point-max))))
+ (funcall smie--hanging-eolp-function)
(point))))))
(defalias 'smie-rule-bolp 'smie-indent--bolp)
=== modified file 'lisp/progmodes/sh-script.el'
--- a/lisp/progmodes/sh-script.el 2014-06-19 22:52:12 +0000
+++ b/lisp/progmodes/sh-script.el 2014-06-20 01:05:40 +0000
@@ -2279,6 +2279,11 @@
(let ((mksym (lambda (name)
(intern (format "sh-smie-%s-%s"
sh-indent-supported-here name)))))
+ (add-function :around (local 'smie--hanging-eolp-function)
+ (lambda (orig)
+ (if (looking-at "[ \t]*\\\\\n")
+ (goto-char (match-end 0))
+ (funcall orig))))
(smie-setup (symbol-value (funcall mksym "grammar"))
(funcall mksym "rules")
:forward-token (funcall mksym "forward-token")
=== modified file 'lisp/term/xterm.el'
--- a/lisp/term/xterm.el 2014-06-13 15:06:29 +0000
+++ b/lisp/term/xterm.el 2014-06-20 01:05:40 +0000
@@ -510,8 +510,8 @@
;; Gnome terminal 2.32.1 reports 1;2802;0
(setq version 200))
(when (equal (match-string 1 str) "83")
- ;; OSX's Terminal.app (version 2.3 (309), which returns 83;40003;0)
- ;; seems to also lack support for some of these (bug#17607).
+ ;; `screen' (which returns 83;40003;0) seems to also lack support for
+ ;; some of these (bug#17607).
(setq version 240))
;; If version is 242 or higher, assume the xterm supports
;; reporting the background color (TODO: maybe earlier
=== modified file 'test/indent/shell.sh'
--- a/test/indent/shell.sh 2014-06-19 22:52:12 +0000
+++ b/test/indent/shell.sh 2014-06-20 01:05:40 +0000
@@ -25,7 +25,11 @@
{ # bug#17621
foo1 &&
- foo2 &&
+ foo2 &&
+ bar
+
+ foo1 && \
+ foo2 && \
bar
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117263: * lisp/emacs-lisp/smie.el (smie--hanging-eolp-function): New var.,
Stefan Monnier <=