Commit 2578be76 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(what-line): Print narrowed linenum with full buffer num.

parent 6a99a3ea
......@@ -372,14 +372,23 @@ that uses or sets the mark."
(count-lines start end) (- end start)))
(defun what-line ()
"Print the current line number (in the buffer) of point."
"Print the current buffer line number and narrowed line number of point."
(let ((opoint (point)) start)
(message "Line %d"
(1+ (count-lines 1 (point)))))))
(goto-char (point-min))
(setq start (point))
(goto-char opoint)
(if (/= start 1)
(message "line %d (narrowed line %d)"
(1+ (count-lines 1 (point)))
(1+ (count-lines start (point))))
(message "Line %d" (1+ (count-lines 1 (point)))))))))
(defun count-lines (start end)
"Return number of lines between START and END.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment