Xah Talk Show 2025-04-10 Ep641 emacs lisp coding, goto-line-number-next-buffer
- emacs lisp, write a goto char of current number in next buffer
- ⛔ Warning (emacs): Nothing matches this bracket: “ at file
- c:/Users/xah/web/some/xyz.html
- position 843
(defun xah-goto-char-other-buffer ()
"move cursor to next buffer, at position that is under cursor.
Created: 2025-04-10
Version: 2025-04-10"
(interactive)
(let (xbeg xend xnum)
(skip-chars-backward "0-9")
(setq xbeg (point))
(skip-chars-forward "0-9")
(setq xend (point))
(setq xnum (buffer-substring-no-properties xbeg xend))
(other-window 1)
(goto-char (string-to-number xnum))))
(defun xah-goto-line-number-other-buffer ()
"Move cursor to next buffer, at line number that is currently under cursor.
URL `http://xahlee.info/talk_show/xah_talk_show_2025-04-10.html'
Created: 2025-04-10
Version: 2025-04-10"
(interactive)
(let (xbeg xend xnum)
(skip-chars-backward "0-9")
(setq xbeg (point))
(skip-chars-forward "0-9")
(setq xend (point))
(setq xnum (buffer-substring-no-properties xbeg xend))
(other-window 1)
(goto-char (point-min))
(forward-line (string-to-number xnum))))
(defun xah-goto-line-number-other-buffer ()
"Move cursor to next buffer, at line number that is under cursor.
Created: 2025-04-10
Version: 2025-04-10"
(interactive)
(let (xbeg xend xnum)
(skip-chars-backward "0-9")
(setq xbeg (point))
(skip-chars-forward "0-9")
(setq xend (point))
(setq xnum (buffer-substring-no-properties xbeg xend))
(other-window 1)
(goto-line (string-to-number xnum))))