aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/tex-mode.el15
-rw-r--r--lisp/textmodes/texinfo.el5
2 files changed, 11 insertions, 9 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 966fa60e6de..16689b1ad02 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -424,13 +424,14 @@ An alternative value is \" . \", if you use a font with a narrow period."
424 424
425(defun tex-current-defun-name () 425(defun tex-current-defun-name ()
426 "Return the name of the TeX section/paragraph/chapter at point, or nil." 426 "Return the name of the TeX section/paragraph/chapter at point, or nil."
427 (when (re-search-backward 427 (save-excursion
428 "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)" 428 (when (re-search-backward
429 nil t) 429 "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)"
430 (goto-char (match-beginning 0)) 430 nil t)
431 (buffer-substring-no-properties 431 (goto-char (match-beginning 0))
432 (1+ (point)) ; without initial backslash 432 (buffer-substring-no-properties
433 (line-end-position)))) 433 (1+ (point)) ; without initial backslash
434 (line-end-position)))))
434 435
435;;;; 436;;;;
436;;;; Font-Lock support 437;;;; Font-Lock support
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 0e45b603c1a..253b56f09b1 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -513,8 +513,9 @@ Subexpression 1 is what goes into the corresponding `@end' statement.")
513 513
514(defun texinfo-current-defun-name () 514(defun texinfo-current-defun-name ()
515 "Return the name of the Texinfo node at point, or nil." 515 "Return the name of the Texinfo node at point, or nil."
516 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t) 516 (save-excursion
517 (match-string-no-properties 1))) 517 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
518 (match-string-no-properties 1))))
518 519
519;;; Texinfo mode 520;;; Texinfo mode
520 521