[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/smalltalk-mode cd36013 26/34: smalltalk-mode fixes
From: |
Stefan Monnier |
Subject: |
[elpa] externals/smalltalk-mode cd36013 26/34: smalltalk-mode fixes |
Date: |
Tue, 9 Apr 2019 22:30:46 -0400 (EDT) |
branch: externals/smalltalk-mode
commit cd36013bd4e8050768e72f7b3060b54174ae3b56
Author: Mathieu Suen <address@hidden>
Commit: Paolo Bonzini <address@hidden>
smalltalk-mode fixes
---
smalltalk-mode.el | 65 +++++++++++++++++++++++++++++++++++--------------------
1 file changed, 41 insertions(+), 24 deletions(-)
diff --git a/smalltalk-mode.el b/smalltalk-mode.el
index dd74ee0..c09b6de 100644
--- a/smalltalk-mode.el
+++ b/smalltalk-mode.el
@@ -25,6 +25,7 @@
;;; Incorporates Frank Caggiano's changes for Emacs 19.
;;; Updates and changes for Emacs 20 and 21 by David Forster
+
;; ===[ Variables and constants ]=====================================
(defvar smalltalk-name-regexp "[A-z][A-z0-9_]*"
@@ -171,7 +172,11 @@
;; ---[ Interactive functions ]---------------------------------------
(defun smalltalk-mode ()
- "Major mode for editing Smalltalk code."
+ "Major mode for editing Smalltalk code.
+
+Commands:
+\\{smalltalk-mode-map}
+"
(interactive)
(kill-all-local-variables)
(setq major-mode 'smalltalk-mode)
@@ -299,6 +304,7 @@ one."
(defun smalltalk-forward-sexp (n)
+ "Move point left to the next smalltalk expression."
(interactive "p")
(let (i)
(cond ((< n 0)
@@ -312,6 +318,7 @@ one."
(setq n (1- n)))))))
(defun smalltalk-backward-sexp (n)
+ "Move point right to the next smalltalk expression."
(interactive "p")
(let (i)
(cond ((< n 0)
@@ -367,6 +374,7 @@ expressions."
(self-insert-command 1)))
(defun smalltalk-bang ()
+ "Go to the end of the method definition"
(interactive)
(cond ((or (smalltalk-in-string) (smalltalk-in-comment)) (insert "!"))
((smalltalk-in-bang-syntax)
@@ -1011,9 +1019,7 @@ Whitespace is defined as spaces, tabs, and comments."
(progn (setq curr-hit-point new-hit-point)
(setq curr-hit new-hit)))
(cons curr-hit curr-hit-point)))
-
-
-
+
(defun smalltalk-current-scope-point ()
(defun smalltalk-update-hit-point (current search)
(save-excursion
@@ -1134,40 +1140,50 @@ Whitespace is defined as spaces, tabs, and comments."
(defun smalltalk-find-beginning-of-keyword-send ()
(save-excursion
- (smalltalk-backward-whitespace)
- (if (or (looking-back "[.;]") (= (smalltalk-previous-keyword) (point)))
- ""
- (progn
- (smalltalk-goto-previous-keyword)
- (concat (smalltalk-find-beginning-of-keyword-send)
- (buffer-substring-no-properties (point) (progn
(smalltalk-safe-forward-sexp)(+ (point) 1))))))))
+ (let ((begin-of-defun (smalltalk-at-begin-of-defun)))
+ (smalltalk-backward-whitespace)
+ (if (or (if begin-of-defun
+ (looking-back "[].;]")
+ (looking-back "[.;]"))
+ (= (smalltalk-previous-keyword) (point)))
+ ""
+ (progn
+ (smalltalk-goto-previous-keyword)
+ (concat (smalltalk-find-beginning-of-keyword-send)
+ (buffer-substring-no-properties (point) (progn
(smalltalk-safe-forward-sexp)(+ (point) 1)))))))))
(defun smalltalk-goto-previous-keyword ()
+ "Go to the previous keyword of the current message send"
(goto-char (smalltalk-previous-keyword)))
(defun smalltalk-goto-next-keyword ()
+ "Go to the next keyword of the current message send"
(goto-char (smalltalk-next-keyword)))
(defun smalltalk-previous-keyword-1 ()
(smalltalk-backward-whitespace)
(if (looking-back "[>[({.^]") ;; not really ok when > is sent in a keyword
arg
nil
- (progn
- (smalltalk-safe-backward-sexp)
- (if (smalltalk-looking-at-keyword-send)
- (point)
- (smalltalk-previous-keyword-1)))))
+ (if (= (point) (save-excursion (smalltalk-safe-backward-sexp) (point)))
+ nil
+ (progn
+ (smalltalk-safe-backward-sexp)
+ (if (smalltalk-looking-at-keyword-send)
+ (point)
+ (smalltalk-previous-keyword-1))))))
(defun smalltalk-next-keyword-1 ()
(smalltalk-forward-whitespace)
- (if (looking-at "[])}.]")
- nil
- (progn
- (smalltalk-safe-forward-sexp)
- (skip-chars-forward ":")
- (if (smalltalk-looking-back-keyword-send)
- (point)
- (smalltalk-next-keyword-1)))))
+ (if (looking-at "[])};.]")
+ nil
+ (if (= (point) (save-excursion (smalltalk-safe-forward-sexp) (point)))
+ nil
+ (progn
+ (smalltalk-safe-forward-sexp)
+ (skip-chars-forward ":")
+ (if (smalltalk-looking-back-keyword-send)
+ (point)
+ (smalltalk-next-keyword-1))))))
(defun smalltalk-previous-keyword ()
(or (save-excursion (smalltalk-previous-keyword-1)) (point)))
@@ -1176,3 +1192,4 @@ Whitespace is defined as spaces, tabs, and comments."
(or (save-excursion (smalltalk-next-keyword-1)) (point)))
(provide 'smalltalk-mode)
+
- [elpa] externals/smalltalk-mode 7706ca9 22/34: merge smalltalk-mode bugfixes and tags support, (continued)
- [elpa] externals/smalltalk-mode 7706ca9 22/34: merge smalltalk-mode bugfixes and tags support, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 83e5fa6 03/34: more updates to the FSF address, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 81dda06 10/34: fix Emacs mode glitches reported by Jeronimo Pellegrini, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode f5a8ddb 13/34: update copyright notices for 2009, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 12cf1d9 19/34: more smalltalk mode improvements from Mathieu, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode aaa7cb0 17/34: improve smalltalk.el detection of a new method's indent, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode a5a661a 30/34: Silence byte-compiler warnings, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode f5845a2 06/34: Emacs interactor mode refinements, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 1521656 01/34: initial import, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode c81b497 21/34: Fix smalltalk-mode.el, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode cd36013 26/34: smalltalk-mode fixes,
Stefan Monnier <=
- [elpa] externals/smalltalk-mode 58ef6fd 05/34: improvements to the Emacs mode, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode a1e76a8 27/34: new smalltalk-mode navigational shortcuts, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode d3cea5f 25/34: fix typo, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 99e6910 33/34: smalltalk-mode: Fix issues spotted by Emacs' checkdoc, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode a1d6a5d 29/34: Ensure header and footer match Emacs conventions, Stefan Monnier, 2019/04/09