summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/copyright.el2
-rw-r--r--lisp/emacs-lisp/lisp-mode.el10
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index facdf9e9aae..222a903efb8 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -111,7 +111,7 @@ When this is `function', only ask when called non-interactively."
(save-match-data
(forward-line 1)
(and (looking-at comment-start-skip)
- (goto-char (match-end 1))))
+ (goto-char (match-end 0))))
(save-match-data
(looking-at copyright-years-regexp))))
(forward-line 1)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 374d3ae2327..3160af5d80d 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -932,6 +932,16 @@ is the buffer position of the start of the containing expression."
(goto-char indent-point)
(skip-chars-forward " \t")
(looking-at ":"))
+ ;; The last sexp may not be at the indentation
+ ;; where it begins, so find that one, instead.
+ (save-excursion
+ (goto-char calculate-lisp-indent-last-sexp)
+ (while (and (not (looking-back "^[ \t]*"))
+ (or (not containing-sexp)
+ (< (1+ containing-sexp) (point))))
+ (forward-sexp -1)
+ (backward-prefix-chars))
+ (setq calculate-lisp-indent-last-sexp (point)))
(> calculate-lisp-indent-last-sexp
(save-excursion
(goto-char (1+ containing-sexp))