Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 6 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
3  lisp/evalmacs.l
@@ -250,7 +250,8 @@
(let ((doc (find-documentation body)))
`(let ()
,(if doc
- `(si:*putprop ',name ,doc 'function-documentation))
+ `(si:*putprop ',name ,doc 'function-documentation)
+ `(remprop ',name 'function-documentation))
(si:*fset ',name
(si:*set-function-name
#'(lambda ,lambda-list ,@decl ,@intr
View
7 lisp/lispmode.l
@@ -326,11 +326,14 @@
(goto-char from)
(goto-eol)
(delete-trailing-spaces)
- (while (forward-line 1)
+ (loop
(goto-eol)
(delete-trailing-spaces)
(unless (bolp)
- (funcall mode-specific-indent-command)))))
+ (funcall mode-specific-indent-command))
+ (unless (forward-line 1)
+ (return))
+ )))
t)
(defun indent-sexp ()
View
23 unittest/editor-tests.l
@@ -1047,3 +1047,26 @@
:options (format nil "-ini \"~A\" -q" ini-path1)
:environ `(("XYZZYINIFILE" . ,ini-path2)))))
=> t)
+
+
+(deftest lisp-mode-indent-region-first-line ()
+ (with-temp-buffer
+ (insert " (defvar foo 1)" #\LFD)
+ (insert " (defvar bar 2)" #\LFD)
+ (lisp-mode)
+ (indent-region (point-min) (point-max))
+ (buffer-substring (point-min) (point-max)))
+ => "(defvar foo 1)
+(defvar bar 2)
+")
+
+(deftest c-mode-indent-region-first-line ()
+ (with-temp-buffer
+ (insert " #define FOO 1" #\LFD)
+ (insert " #define BAR 2" #\LFD)
+ (c-mode)
+ (indent-region (point-min) (point-max))
+ (buffer-substring (point-min) (point-max)))
+ => "#define FOO 1
+#define BAR 2
+")
View
16 unittest/lisp-tests.l
@@ -1188,3 +1188,19 @@ lisp-indent-hook property"
'(t
(declare (special a))))
!! simple-error)
+
+(deftest redefun-docstring ()
+ (let ((sym (gensym)))
+ (eval `(values
+ (progn
+ (defun ,sym () "docstring1" 123)
+ (documentation ',sym 'function))
+ (progn
+ (defun ,sym () "docstring2" 123)
+ (documentation ',sym 'function))
+ (progn
+ (defun ,sym () 123)
+ (documentation ',sym 'function)))))
+ => "docstring1"
+ => "docstring2"
+ => nil)

No commit comments for this range

Something went wrong with that request. Please try again.