Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Emacs, how to search from beginning of file?

Tags:

emacs

org-mode

In Emacs, how I can I instruct isearch-forward to search not from the location of the point, but from the beginning of the file?

like image 894
incandescentman Avatar asked Sep 18 '25 02:09

incandescentman


1 Answers

The simplest option is to just move the point to the beginning of file with M-< before invoking isearch. Or, you can write a command that does it for you:

(defun isearch-from-buffer-start ()
  (interactive)
  (goto-char (point-min))
  (isearch-forward))
(global-set-key [(control s)] 'isearch-from-buffer-start)
like image 66
user4815162342 Avatar answered Sep 21 '25 17:09

user4815162342