aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-02-08 21:40:41 -0500
committerGlenn Morris2012-02-08 21:40:41 -0500
commita075a2c5a6e2a9807fdfb3f146d8578da70ea9ef (patch)
tree13c30d41532f7589324b693bab96fd2a9df282f7
parent1ef1990cbe59bb07e6dd46b609bb6cd7768acbda (diff)
downloademacs-a075a2c5a6e2a9807fdfb3f146d8578da70ea9ef.tar.gz
emacs-a075a2c5a6e2a9807fdfb3f146d8578da70ea9ef.zip
Doc fixes for electric.el
* lisp/electric.el (electric-indent-mode, electric-pair-mode) (electric-layout-rules, electric-layout-mode): Doc fixes. (electric-pair-pairs, electric-pair-skip-self): Add :version tags. * etc/NEWS: Related edits.
-rw-r--r--etc/NEWS11
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/electric.el21
3 files changed, 29 insertions, 9 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d99ec7bbf26..adc5ffca073 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -947,8 +947,15 @@ They are superseded by shift-select-mode, enabled by default since 23.1.
947** Occur Edit mode applies edits made in *Occur* buffers to the 947** Occur Edit mode applies edits made in *Occur* buffers to the
948original buffers. It is bound to "e" in Occur mode. 948original buffers. It is bound to "e" in Occur mode.
949 949
950** New global minor modes electric-pair-mode, electric-indent-mode, 950** New global minor mode electric-pair-mode.
951and electric-layout-mode. 951When enabled, typing an open parenthesis automatically inserts the
952matching closing one.
953
954** New global minor mode electric-indent-mode.
955When enabled, typing certain characters triggers reindentation.
956
957** New global minor mode electric-layout-mode.
958When enabled, typing certain characters automatically inserts newlines.
952 959
953** tabulated-list.el provides a generic major mode for tabulated data, 960** tabulated-list.el provides a generic major mode for tabulated data,
954from which other modes can be derived. 961from which other modes can be derived.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 06f55e23e24..0e9cf1ebd70 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-02-09 Glenn Morris <rgm@gnu.org>
2
3 * electric.el (electric-indent-mode, electric-pair-mode)
4 (electric-layout-rules, electric-layout-mode): Doc fixes.
5 (electric-pair-pairs, electric-pair-skip-self): Add :version tags.
6
12012-02-08 Martin Rudalics <rudalics@gmx.at> 72012-02-08 Martin Rudalics <rudalics@gmx.at>
2 8
3 * server.el (server-unselect-display): Don't inadvertently kill 9 * server.el (server-unselect-display): Don't inadvertently kill
diff --git a/lisp/electric.el b/lisp/electric.el
index 4ca27550f96..50c9010a74e 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -260,9 +260,9 @@ With a prefix argument ARG, enable Electric Indent mode if ARG is
260positive, and disable it otherwise. If called from Lisp, enable 260positive, and disable it otherwise. If called from Lisp, enable
261the mode if ARG is omitted or nil. 261the mode if ARG is omitted or nil.
262 262
263Electric Indent mode is a global minor mode. When enabled, 263This is a global minor mode. When enabled, it reindents whenever
264reindentation is triggered whenever you insert a character listed 264the hook `electric-indent-functions' returns non-nil, or you
265in `electric-indent-chars'." 265insert a character from `electric-indent-chars'."
266 :global t 266 :global t
267 :group 'electricity 267 :group 'electricity
268 (if (not electric-indent-mode) 268 (if (not electric-indent-mode)
@@ -288,6 +288,8 @@ in `electric-indent-chars'."
288(defcustom electric-pair-pairs 288(defcustom electric-pair-pairs
289 '((?\" . ?\")) 289 '((?\" . ?\"))
290 "Alist of pairs that should be used regardless of major mode." 290 "Alist of pairs that should be used regardless of major mode."
291 :group 'electricity
292 :version "24.1"
291 :type '(repeat (cons character character))) 293 :type '(repeat (cons character character)))
292 294
293(defcustom electric-pair-skip-self t 295(defcustom electric-pair-skip-self t
@@ -296,6 +298,8 @@ When inserting a closing paren character right before the same character,
296just skip that character instead, so that hitting ( followed by ) results 298just skip that character instead, so that hitting ( followed by ) results
297in \"()\" rather than \"())\". 299in \"()\" rather than \"())\".
298This can be convenient for people who find it easier to hit ) than C-f." 300This can be convenient for people who find it easier to hit ) than C-f."
301 :group 'electricity
302 :version "24.1"
299 :type 'boolean) 303 :type 'boolean)
300 304
301(defun electric-pair-post-self-insert-function () 305(defun electric-pair-post-self-insert-function ()
@@ -360,7 +364,9 @@ the mode if ARG is omitted or nil.
360 364
361Electric Pair mode is a global minor mode. When enabled, typing 365Electric Pair mode is a global minor mode. When enabled, typing
362an open parenthesis automatically inserts the corresponding 366an open parenthesis automatically inserts the corresponding
363closing parenthesis. \(Likewise for brackets, etc.)" 367closing parenthesis. \(Likewise for brackets, etc.)
368
369See options `electric-pair-pairs' and `electric-pair-skip-self'."
364 :global t 370 :global t
365 :group 'electricity 371 :group 'electricity
366 (if electric-pair-mode 372 (if electric-pair-mode
@@ -375,8 +381,8 @@ closing parenthesis. \(Likewise for brackets, etc.)"
375 "List of rules saying where to automatically insert newlines. 381 "List of rules saying where to automatically insert newlines.
376Each rule has the form (CHAR . WHERE) where CHAR is the char 382Each rule has the form (CHAR . WHERE) where CHAR is the char
377that was just inserted and WHERE specifies where to insert newlines 383that was just inserted and WHERE specifies where to insert newlines
378and can be: nil, `before', `after', `around', or a function that returns 384and can be: nil, `before', `after', `around', or a function of no
379one of those symbols.") 385arguments that returns one of those symbols.")
380 386
381(defun electric-layout-post-self-insert-function () 387(defun electric-layout-post-self-insert-function ()
382 (let* ((rule (cdr (assq last-command-event electric-layout-rules))) 388 (let* ((rule (cdr (assq last-command-event electric-layout-rules)))
@@ -407,7 +413,8 @@ one of those symbols.")
407 "Automatically insert newlines around some chars. 413 "Automatically insert newlines around some chars.
408With a prefix argument ARG, enable Electric Layout mode if ARG is 414With a prefix argument ARG, enable Electric Layout mode if ARG is
409positive, and disable it otherwise. If called from Lisp, enable 415positive, and disable it otherwise. If called from Lisp, enable
410the mode if ARG is omitted or nil." 416the mode if ARG is omitted or nil.
417The variable `electric-layout-rules' says when and how to insert newlines."
411 :global t 418 :global t
412 :group 'electricity 419 :group 'electricity
413 (if electric-layout-mode 420 (if electric-layout-mode