diff options
| author | Glenn Morris | 2019-03-09 10:07:46 -0800 |
|---|---|---|
| committer | Glenn Morris | 2019-03-09 10:07:46 -0800 |
| commit | 3b63afd73b541ea559aa58edc1901c8b30e2af40 (patch) | |
| tree | a68afec4142bd100f3b6dfa3eb90aa2c0a71b34f /doc/lispref/modes.texi | |
| parent | e1819a254f28a7dcba3c395c345fe237a512e92e (diff) | |
| parent | 0589de55c465627c16314519568f22daa62ff654 (diff) | |
| download | emacs-3b63afd73b541ea559aa58edc1901c8b30e2af40.tar.gz emacs-3b63afd73b541ea559aa58edc1901c8b30e2af40.zip | |
Merge from origin/emacs-26
0589de5 (origin/emacs-26) Fix markup of fake keys in the ELisp manual
82d4b98 Avoid errors in Auto Revert mode
a3b1935 Mention empty strings in file name expansion, emacs lisp refe...
a38da0d cc-mode.texi: Work around makeinfo alignment bug. Fix proble...
464ee80 Warn against recursive invocations of 'buffer-list-update-hoo...
60b5c10 Provide more details in doc-string of 'delete-windows-on' (Bu...
f0be0f1 Improve documentation of 'delete-windows-on'
f1bddc7 * lisp/frame.el (make-frame-command): Doc fix. (Bug#34715)
2848623 Avoid undefined behavior in gdb-mi.el
dbf1837 * lisp/window.el (fit-frame-to-buffer): Make doc-string more ...
099ef44 Minor spelling and grammar fixes (bug#34756)
52fd400 Minor improvement of documentation of '(when CONDITION . SPEC)'
f872b65 Improve documentation of 'auto-coding-functions'
04cad5e Fix visiting XML files with non-Unix EOL format
a89fabe Update example major mode code in Elisp manual
# Conflicts:
# lisp/autorevert.el
# lisp/window.el
Diffstat (limited to 'doc/lispref/modes.texi')
| -rw-r--r-- | doc/lispref/modes.texi | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 22592a57b05..3f6bee9821d 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -1237,6 +1237,7 @@ the conventions listed above: | |||
| 1237 | (modify-syntax-entry ?\\ ". " st) | 1237 | (modify-syntax-entry ?\\ ". " st) |
| 1238 | ;; Add 'p' so M-c on 'hello' leads to 'Hello', not 'hello'. | 1238 | ;; Add 'p' so M-c on 'hello' leads to 'Hello', not 'hello'. |
| 1239 | (modify-syntax-entry ?' "w p" st) | 1239 | (modify-syntax-entry ?' "w p" st) |
| 1240 | @dots{} | ||
| 1240 | st) | 1241 | st) |
| 1241 | "Syntax table used while in `text-mode'.") | 1242 | "Syntax table used while in `text-mode'.") |
| 1242 | @end group | 1243 | @end group |
| @@ -1246,6 +1247,7 @@ the conventions listed above: | |||
| 1246 | (defvar text-mode-map | 1247 | (defvar text-mode-map |
| 1247 | (let ((map (make-sparse-keymap))) | 1248 | (let ((map (make-sparse-keymap))) |
| 1248 | (define-key map "\e\t" 'ispell-complete-word) | 1249 | (define-key map "\e\t" 'ispell-complete-word) |
| 1250 | @dots{} | ||
| 1249 | map) | 1251 | map) |
| 1250 | "Keymap for `text-mode'. | 1252 | "Keymap for `text-mode'. |
| 1251 | Many other modes, such as `mail-mode', `outline-mode' and | 1253 | Many other modes, such as `mail-mode', `outline-mode' and |
| @@ -1289,11 +1291,11 @@ illustrate how these modes are written. | |||
| 1289 | @smallexample | 1291 | @smallexample |
| 1290 | @group | 1292 | @group |
| 1291 | ;; @r{Create mode-specific table variables.} | 1293 | ;; @r{Create mode-specific table variables.} |
| 1292 | (defvar lisp-mode-abbrev-table nil) | 1294 | (define-abbrev-table 'lisp-mode-abbrev-table () |
| 1293 | (define-abbrev-table 'lisp-mode-abbrev-table ()) | 1295 | "Abbrev table for Lisp mode.") |
| 1294 | 1296 | ||
| 1295 | (defvar lisp-mode-syntax-table | 1297 | (defvar lisp-mode-syntax-table |
| 1296 | (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) | 1298 | (let ((table (make-syntax-table lisp--mode-syntax-table))) |
| 1297 | (modify-syntax-entry ?\[ "_ " table) | 1299 | (modify-syntax-entry ?\[ "_ " table) |
| 1298 | (modify-syntax-entry ?\] "_ " table) | 1300 | (modify-syntax-entry ?\] "_ " table) |
| 1299 | (modify-syntax-entry ?# "' 14" table) | 1301 | (modify-syntax-entry ?# "' 14" table) |
| @@ -1308,10 +1310,9 @@ each calls the following function to set various variables: | |||
| 1308 | 1310 | ||
| 1309 | @smallexample | 1311 | @smallexample |
| 1310 | @group | 1312 | @group |
| 1311 | (defun lisp-mode-variables (&optional syntax keywords-case-insensitive) | 1313 | (defun lisp-mode-variables (&optional syntax keywords-case-insensitive elisp) |
| 1312 | (when syntax | 1314 | (when syntax |
| 1313 | (set-syntax-table lisp-mode-syntax-table)) | 1315 | (set-syntax-table lisp-mode-syntax-table)) |
| 1314 | (setq local-abbrev-table lisp-mode-abbrev-table) | ||
| 1315 | @dots{} | 1316 | @dots{} |
| 1316 | @end group | 1317 | @end group |
| 1317 | @end smallexample | 1318 | @end smallexample |
| @@ -1322,8 +1323,7 @@ variable to handle Lisp comments: | |||
| 1322 | 1323 | ||
| 1323 | @smallexample | 1324 | @smallexample |
| 1324 | @group | 1325 | @group |
| 1325 | (make-local-variable 'comment-start) | 1326 | (setq-local comment-start ";") |
| 1326 | (setq comment-start ";") | ||
| 1327 | @dots{} | 1327 | @dots{} |
| 1328 | @end group | 1328 | @end group |
| 1329 | @end smallexample | 1329 | @end smallexample |
| @@ -1337,6 +1337,7 @@ common. The following code sets up the common commands: | |||
| 1337 | @group | 1337 | @group |
| 1338 | (defvar lisp-mode-shared-map | 1338 | (defvar lisp-mode-shared-map |
| 1339 | (let ((map (make-sparse-keymap))) | 1339 | (let ((map (make-sparse-keymap))) |
| 1340 | (set-keymap-parent map prog-mode-map) | ||
| 1340 | (define-key map "\e\C-q" 'indent-sexp) | 1341 | (define-key map "\e\C-q" 'indent-sexp) |
| 1341 | (define-key map "\177" 'backward-delete-char-untabify) | 1342 | (define-key map "\177" 'backward-delete-char-untabify) |
| 1342 | map) | 1343 | map) |
| @@ -1351,7 +1352,7 @@ And here is the code to set up the keymap for Lisp mode: | |||
| 1351 | @group | 1352 | @group |
| 1352 | (defvar lisp-mode-map | 1353 | (defvar lisp-mode-map |
| 1353 | (let ((map (make-sparse-keymap)) | 1354 | (let ((map (make-sparse-keymap)) |
| 1354 | (menu-map (make-sparse-keymap "Lisp"))) | 1355 | (menu-map (make-sparse-keymap "Lisp"))) |
| 1355 | (set-keymap-parent map lisp-mode-shared-map) | 1356 | (set-keymap-parent map lisp-mode-shared-map) |
| 1356 | (define-key map "\e\C-x" 'lisp-eval-defun) | 1357 | (define-key map "\e\C-x" 'lisp-eval-defun) |
| 1357 | (define-key map "\C-c\C-z" 'run-lisp) | 1358 | (define-key map "\C-c\C-z" 'run-lisp) |
| @@ -1375,17 +1376,13 @@ Blank lines separate paragraphs. Semicolons start comments. | |||
| 1375 | 1376 | ||
| 1376 | \\@{lisp-mode-map@} | 1377 | \\@{lisp-mode-map@} |
| 1377 | Note that `run-lisp' may be used either to start an inferior Lisp job | 1378 | Note that `run-lisp' may be used either to start an inferior Lisp job |
| 1378 | or to switch back to an existing one. | 1379 | or to switch back to an existing one." |
| 1379 | @end group | 1380 | @end group |
| 1380 | |||
| 1381 | @group | 1381 | @group |
| 1382 | Entry to this mode calls the value of `lisp-mode-hook' | ||
| 1383 | if that value is non-nil." | ||
| 1384 | (lisp-mode-variables nil t) | 1382 | (lisp-mode-variables nil t) |
| 1385 | (set (make-local-variable 'find-tag-default-function) | 1383 | (setq-local find-tag-default-function 'lisp-find-tag-default) |
| 1386 | 'lisp-find-tag-default) | 1384 | (setq-local comment-start-skip |
| 1387 | (set (make-local-variable 'comment-start-skip) | 1385 | "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
| 1388 | "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") | ||
| 1389 | (setq imenu-case-fold-search t)) | 1386 | (setq imenu-case-fold-search t)) |
| 1390 | @end group | 1387 | @end group |
| 1391 | @end smallexample | 1388 | @end smallexample |