aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-06-29 17:53:41 +0000
committerRichard M. Stallman2001-06-29 17:53:41 +0000
commit5e6f9132de4033488b3ba5c6b556fdaca675b38c (patch)
tree483562c69bf9879e7b748848f2e202a731edb929
parent0c1baae862c3056082a3a21d9afeff704e80a4b6 (diff)
downloademacs-5e6f9132de4033488b3ba5c6b556fdaca675b38c.tar.gz
emacs-5e6f9132de4033488b3ba5c6b556fdaca675b38c.zip
Minor clarifications. Explain how to use imenu-sort-function.
Fix name of imenu-add-menubar-index.
-rw-r--r--man/programs.texi33
1 files changed, 18 insertions, 15 deletions
diff --git a/man/programs.texi b/man/programs.texi
index ec9c7a70a0e..aef2932a1eb 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -233,8 +233,9 @@ the same as @kbd{C-M-a} with a positive argument.
233@findex c-mark-function 233@findex c-mark-function
234 To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun}) 234 To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun})
235which puts point at the beginning and mark at the end of the current 235which puts point at the beginning and mark at the end of the current
236or next defun. this is the easiest way to get ready to kill the defun 236defun. This is the easiest way to get ready to kill the defun in
237in order move it to a different place in the file. 237order to move it to a different place in the file. If you use the
238command while point is between defuns, it uses the following defun.
238 239
239 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, 240 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function},
240which is almost the same as @code{mark-defun}; the difference is that 241which is almost the same as @code{mark-defun}; the difference is that
@@ -251,24 +252,25 @@ any or all of these key bindings for that purpose.
251@cindex buffer content indexes 252@cindex buffer content indexes
252@cindex tags 253@cindex tags
253 254
254 The Imenu facility offers a way to find the definitions in a file by 255 The Imenu facility offers a way to find the the major definitions in
255name. It is also useful in text formatter major modes, where it 256a file by name. It is also useful in text formatter major modes,
256treats each chapter, section, etc., as a definition. (@pxref{Tags}, 257where it treats each chapter, section, etc., as a definition.
257for a more powerful feature that handles multiple files together.) 258(@pxref{Tags}, for a more powerful feature that handles multiple files
259together.)
258 260
259@findex imenu 261@findex imenu
260@findex imenu-add-menu-bar-index 262 If you type @kbd{M-x imenu}, it reads the name of a definition using
261 If you type @kbd{M-x imenu}, it reads the name of a definition in 263the minibuffer, then goes to that definition. You can use completion
262the current buffer, then goes to that definition. You can use 264to specify the name, and a complete list of possible names is always
263completion to specify the name, and a complete list of possible names 265displayed.
264is always displayed.
265 266
267@findex imenu-add-menubar-index
266 Alternatively, you can bind the command @code{imenu} to a mouse 268 Alternatively, you can bind the command @code{imenu} to a mouse
267click. Then it displays mouse menus for you to select the definition 269click. Then it displays mouse menus for you to select the definition
268you want. You can also add the buffer's index to the menu bar by 270you want. You can also add the buffer's index to the menu bar by
269calling @code{imenu-add-menu-bar-index}. If you want to have this 271calling @code{imenu-add-menubar-index}. If you want to have this
270menu bar item available for all buffers in a certain major mode, you 272menu bar item available for all buffers in a certain major mode, you
271can do this by adding @code{imenu-add-menu-bar-index} to its mode 273can do this by adding @code{imenu-add-menubar-index} to its mode
272hook. But then you will have to wait for the buffer to be searched 274hook. But then you will have to wait for the buffer to be searched
273for definitions, each time you visit a file which uses that mode. 275for definitions, each time you visit a file which uses that mode.
274 276
@@ -283,8 +285,9 @@ in the text.
283@vindex imenu-sort-function 285@vindex imenu-sort-function
284 You can customize the way the menus are sorted by setting the 286 You can customize the way the menus are sorted by setting the
285variable @code{imenu-sort-function}. By default names are ordered as 287variable @code{imenu-sort-function}. By default names are ordered as
286they occur in the buffer; alphabetic sorting is provided as an 288they occur in the buffer; if you want alphabetic sorting, use the
287alternative. 289symbol @code{imenu--sort-by-name} as the value. You can also
290define your own comparison function by writing Lisp code.
288 291
289 Imenu provides the information to guide Which Function mode 292 Imenu provides the information to guide Which Function mode
290@ifnottex 293@ifnottex