diff options
| author | Eli Zaretskii | 2021-02-04 18:02:27 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-02-04 18:02:27 +0200 |
| commit | a304b22bc9f1396cd6958b0a6fc6092437e36d96 (patch) | |
| tree | 51ede22e8e6ea764bf124107be844d44f62e9520 | |
| parent | 914cb7a1d666a87994e0492635f262396a839d4c (diff) | |
| parent | 9bf367e18486b8f89ff1e0a4c4f4b5b4da4d9a75 (diff) | |
| download | emacs-a304b22bc9f1396cd6958b0a6fc6092437e36d96.tar.gz emacs-a304b22bc9f1396cd6958b0a6fc6092437e36d96.zip | |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 5dda3a8f8e9..f5ce107185a 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -1373,7 +1373,24 @@ and initial semicolons." | |||
| 1373 | (derived-mode-p 'emacs-lisp-mode)) | 1373 | (derived-mode-p 'emacs-lisp-mode)) |
| 1374 | emacs-lisp-docstring-fill-column | 1374 | emacs-lisp-docstring-fill-column |
| 1375 | fill-column))) | 1375 | fill-column))) |
| 1376 | (fill-paragraph justify)) | 1376 | (save-restriction |
| 1377 | (save-excursion | ||
| 1378 | (let ((ppss (syntax-ppss))) | ||
| 1379 | ;; If we're in a string, then narrow (roughly) to that | ||
| 1380 | ;; string before filling. This avoids filling Lisp | ||
| 1381 | ;; statements that follow the string. | ||
| 1382 | (when (ppss-string-terminator ppss) | ||
| 1383 | (goto-char (ppss-comment-or-string-start ppss)) | ||
| 1384 | (beginning-of-line) | ||
| 1385 | ;; The string may be unterminated -- in that case, don't | ||
| 1386 | ;; narrow. | ||
| 1387 | (when (ignore-errors | ||
| 1388 | (progn | ||
| 1389 | (forward-sexp 1) | ||
| 1390 | t)) | ||
| 1391 | (narrow-to-region (ppss-comment-or-string-start ppss) | ||
| 1392 | (point)))) | ||
| 1393 | (fill-paragraph justify))))) | ||
| 1377 | ;; Never return nil. | 1394 | ;; Never return nil. |
| 1378 | t)) | 1395 | t)) |
| 1379 | 1396 | ||