[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] emacs-26 f5d0360: Escape column-zero doc parens
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] emacs-26 f5d0360: Escape column-zero doc parens |
Date: |
Wed, 13 Dec 2017 08:24:40 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> Escape column-zero doc parens. A shame bug#21871 remains unfixed.
Arguably the "open-paren in column 0" convention is not needed any more
(tho even with the patch below, "open-paren in column 0" is still used
in some places such as for the outline-regexp in elisp-mode).
Any objection to the patch below?
Stefan
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 6952ef4cf4..3211b54e2c 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -339,12 +339,17 @@ beginning-of-defun-raw
((or defun-prompt-regexp open-paren-in-column-0-is-defun-start)
(and (< arg 0) (not (eobp)) (forward-char 1))
- (and (re-search-backward (if defun-prompt-regexp
- (concat (if
open-paren-in-column-0-is-defun-start
- "^\\s(\\|" "")
- "\\(?:" defun-prompt-regexp "\\)\\s(")
- "^\\s(")
- nil 'move arg)
+ (and (let (found)
+ (while
+ (and (set found
+ (re-search-backward (if defun-prompt-regexp
+ (concat (if
open-paren-in-column-0-is-defun-start
+ "^\\s(\\|" "")
+ "\\(?:"
defun-prompt-regexp "\\)\\s(")
+ "^\\s(")
+ nil 'move arg))
+ (nth 8 (syntax-ppss))))
+ found)
(progn (goto-char (1- (match-end 0)))
t)))
- Re: [Emacs-diffs] emacs-26 f5d0360: Escape column-zero doc parens,
Stefan Monnier <=