aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog50
-rw-r--r--lisp/ansi-color.el57
-rw-r--r--lisp/cedet/ChangeLog21
-rw-r--r--lisp/cedet/semantic/grammar.el4
-rw-r--r--lisp/cedet/semantic/mru-bookmark.el6
-rw-r--r--lisp/cedet/semantic/util-modes.el12
-rw-r--r--lisp/cedet/srecode/srt-mode.el4
-rw-r--r--lisp/emacs-lisp/debug.el8
-rw-r--r--lisp/emacs-lisp/gv.el5
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/ibuffer.el14
-rw-r--r--lisp/progmodes/flymake.el30
-rw-r--r--lisp/progmodes/python.el137
-rw-r--r--lisp/progmodes/ruby-mode.el12
-rw-r--r--lisp/window.el37
15 files changed, 238 insertions, 161 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f53b58b0129..6ab2880f09f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,53 @@
12012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871).
4
52012-11-13 Wolfgang Jenkner <wjenkner@inode.at>
6
7 * ansi-color.el (ansi-color-apply-sequence): Implement SGR codes
8 39 and 49 (bug#12792). Also, treat unimplemented parameters as 0,
9 thereby restoring the behavior of revisions prior to 2012-08-15T03:33:55Z!monnier@iro.umontreal.ca.
10
112012-11-13 Fabián Ezequiel Gallina <fgallina@cuca>
12
13 Fix end-of-defun misbehavior.
14 * progmodes/python.el (python-nav-beginning-of-defun): Rename from
15 python-beginning-of-defun-function. Handle nested defuns
16 correctly.
17 (python-nav-end-of-defun): Rename from
18 python-end-of-defun-function. Ensure forward movement.
19 (python-info-current-defun): Reimplement to work as intended
20 with new fixed python-nav-{end,beginning}-of-defun. Stop scanning
21 parent defuns as soon as possible.
22
232012-11-13 Glenn Morris <rgm@gnu.org>
24
25 * progmodes/flymake.el (flymake-error-bitmap)
26 (flymake-warning-bitmap, flymake-fringe-indicator-position): Doc fixes.
27 (flymake-error-bitmap, flymake-warning-bitmap): Fix :types.
28
292012-11-13 Dmitry Gutov <dgutov@yandex.ru>
30
31 * progmodes/ruby-mode.el (ruby-move-to-block): When moving
32 backward, always stop at indentation. Reverts the change from
33 2012-08-12T22:06:56Z!monnier@iro.umontreal.ca (Bug#12851).
34
352012-11-13 Glenn Morris <rgm@gnu.org>
36
37 * ibuffer.el (ibuffer-mode-map, ibuffer-mode):
38 Add ibuffer-filter-by-derived-mode.
39
40 * ibuffer.el (ibuffer-mode-map): Don't have two menu items with
41 the same name shadowing each other.
42
43 * window.el (with-temp-buffer-window): Doc tweak.
44
45 * emacs-lisp/debug.el (debugger-bury-or-kill): Doc tweak.
46
47 * help.el (temp-buffer-max-height):
48 * window.el (fit-frame-to-buffer, fit-frame-to-buffer-bottom-margin):
49 * emacs-lisp/debug.el (debugger-bury-or-kill): Fix :version.
50
12012-11-12 Stefan Monnier <monnier@iro.umontreal.ca> 512012-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 52
3 * emacs-lisp/nadvice.el: New package. 53 * emacs-lisp/nadvice.el: New package.
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index 047b4b944b9..da2880c404c 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -534,34 +534,39 @@ Returns nil only if there's no match for `ansi-color-parameter-regexp'."
534 534
535ESCAPE-SEQ is an escape sequence parsed by `ansi-color-parse-sequence'. 535ESCAPE-SEQ is an escape sequence parsed by `ansi-color-parse-sequence'.
536 536
537If the new codes resulting from ESCAPE-SEQ start with 0, then the 537For each new code, the following happens: if it is 1-7, add it to
538old codes are discarded and the remaining new codes are 538the list of codes; if it is 21-25 or 27, delete appropriate
539processed. Otherwise, for each new code: if it is 21-25 or 27-29 539parameters from the list of codes; if it is 30-37 resp. 39, the
540delete appropriate parameters from the list of codes; any other 540foreground color code is replaced or added resp. deleted; if it
541code that makes sense is added to the list of codes. Finally, 541is 40-47 resp. 49, the background color code is replaced or added
542the so changed list of codes is returned." 542resp. deleted; any other code is discarded together with the old
543codes. Finally, the so changed list of codes is returned."
543 (let ((new-codes (ansi-color-parse-sequence escape-sequence))) 544 (let ((new-codes (ansi-color-parse-sequence escape-sequence)))
544 (while new-codes 545 (while new-codes
545 (setq codes 546 (let* ((new (pop new-codes))
546 (let ((new (pop new-codes))) 547 (q (/ new 10)))
547 (cond ((zerop new) 548 (setq codes
548 nil) 549 (pcase q
549 ((or (<= new 20) 550 (0 (unless (memq new '(0 8 9))
550 (>= new 30)) 551 (cons new (remq new codes))))
551 (if (memq new codes) 552 (2 (unless (memq new '(20 26 28 29))
552 codes 553 ;; The standard says `21 doubly underlined' while
553 (cons new codes))) 554 ;; http://en.wikipedia.org/wiki/ANSI_escape_code claims
554 ;; The standard says `21 doubly underlined' while 555 ;; `21 Bright/Bold: off or Underline: Double'.
555 ;; http://en.wikipedia.org/wiki/ANSI_escape_code claims 556 (remq (- new 20) (pcase new
556 ;; `21 Bright/Bold: off or Underline: Double'. 557 (22 (remq 1 codes))
557 ((/= new 26) 558 (25 (remq 6 codes))
558 (remq (- new 20) 559 (_ codes)))))
559 (cond ((= new 22) 560 ((or 3 4) (let ((r (mod new 10)))
560 (remq 1 codes)) 561 (unless (= r 8)
561 ((= new 25) 562 (let (beg)
562 (remq 6 codes)) 563 (while (and codes (/= q (/ (car codes) 10)))
563 (t codes)))) 564 (push (pop codes) beg))
564 (t codes))))) 565 (setq codes (nconc (nreverse beg) (cdr codes)))
566 (if (= r 9)
567 codes
568 (cons new codes))))))
569 (_ nil)))))
565 codes)) 570 codes))
566 571
567(defun ansi-color-make-color-map () 572(defun ansi-color-make-color-map ()
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 6f2669e9fee..755f4c8159b 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,7 +1,20 @@
12012-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
4 * semantic/grammar.el (semantic-grammar-mode):
5 * semantic/util-modes.el (semantic-highlight-edits-mode)
6 (semantic-show-parser-state-mode): Avoid obsolete name
7 semantic-edits-new-change-hooks (bug#12869).
8
92012-11-13 Glenn Morris <rgm@gnu.org>
10
11 * srecode/srt-mode.el (srecode-template-mode):
12 Don't change global values of comment-start, comment-end. (Bug#12781)
13
12012-10-25 David Engster <deng@randomsample.de> 142012-10-25 David Engster <deng@randomsample.de>
2 15
3 * semantic/analyze.el (semantic-analyze-dereference-alias): New 16 * semantic/analyze.el (semantic-analyze-dereference-alias):
4 function to dereference aliases. 17 New function to dereference aliases.
5 (semantic-analyze-current-context-default): Use it. 18 (semantic-analyze-current-context-default): Use it.
6 19
7 * semantic/grammar.el (semantic-grammar-create-package): 20 * semantic/grammar.el (semantic-grammar-create-package):
@@ -12,8 +25,8 @@
12 25
13 * semantic.el (semantic-elapsed-time): Make it a defsubst. 26 * semantic.el (semantic-elapsed-time): Make it a defsubst.
14 27
15 * srecode/dictionary.el (srecode-adebug-dictionary): Remove 28 * srecode/dictionary.el (srecode-adebug-dictionary):
16 require for `semantic'. 29 Remove require for `semantic'.
17 30
18 * srecode/map.el: 31 * srecode/map.el:
19 * srecode/insert.el: Declare functions from `data-debug'. 32 * srecode/insert.el: Declare functions from `data-debug'.
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index c0e7b8f9038..8535c067e09 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1333,8 +1333,8 @@ the change bounds to encompass the whole nonterminal tag."
1333 (add-hook 'before-change-functions 1333 (add-hook 'before-change-functions
1334 'semantic--grammar-clear-macros-regexp-2 nil t) 1334 'semantic--grammar-clear-macros-regexp-2 nil t)
1335 ;; Handle safe re-parse of grammar rules. 1335 ;; Handle safe re-parse of grammar rules.
1336 (semantic-make-local-hook 'semantic-edits-new-change-hooks) 1336 (semantic-make-local-hook 'semantic-edits-new-change-functions)
1337 (add-hook 'semantic-edits-new-change-hooks 1337 (add-hook 'semantic-edits-new-change-functions
1338 'semantic-grammar-edits-new-change-hook-fcn 1338 'semantic-grammar-edits-new-change-hook-fcn
1339 nil t) 1339 nil t)
1340 (semantic-run-mode-hooks 'semantic-grammar-mode-hook)) 1340 (semantic-run-mode-hooks 'semantic-grammar-mode-hook))
diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el
index d042ba42582..1358fc7d062 100644
--- a/lisp/cedet/semantic/mru-bookmark.el
+++ b/lisp/cedet/semantic/mru-bookmark.el
@@ -292,13 +292,13 @@ minor mode is enabled."
292 (setq semantic-mru-bookmark-mode nil) 292 (setq semantic-mru-bookmark-mode nil)
293 (error "Buffer %s was not set up for parsing" 293 (error "Buffer %s was not set up for parsing"
294 (buffer-name))) 294 (buffer-name)))
295 (semantic-make-local-hook 'semantic-edits-new-change-hooks) 295 (semantic-make-local-hook 'semantic-edits-new-change-functions)
296 (add-hook 'semantic-edits-new-change-hooks 296 (add-hook 'semantic-edits-new-change-functions
297 'semantic-mru-bookmark-change-hook-fcn nil t) 297 'semantic-mru-bookmark-change-hook-fcn nil t)
298 (add-hook 'semantic-edits-move-change-hooks 298 (add-hook 'semantic-edits-move-change-hooks
299 'semantic-mru-bookmark-change-hook-fcn nil t)) 299 'semantic-mru-bookmark-change-hook-fcn nil t))
300 ;; Remove hooks 300 ;; Remove hooks
301 (remove-hook 'semantic-edits-new-change-hooks 301 (remove-hook 'semantic-edits-new-change-functions
302 'semantic-mru-bookmark-change-hook-fcn t) 302 'semantic-mru-bookmark-change-hook-fcn t)
303 (remove-hook 'semantic-edits-move-change-hooks 303 (remove-hook 'semantic-edits-move-change-hooks
304 'semantic-mru-bookmark-change-hook-fcn t))) 304 'semantic-mru-bookmark-change-hook-fcn t)))
diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el
index c9a0faefe6c..744d37ff189 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -221,11 +221,11 @@ minor mode is enabled."
221 (setq semantic-highlight-edits-mode nil) 221 (setq semantic-highlight-edits-mode nil)
222 (error "Buffer %s was not set up for parsing" 222 (error "Buffer %s was not set up for parsing"
223 (buffer-name))) 223 (buffer-name)))
224 (semantic-make-local-hook 'semantic-edits-new-change-hooks) 224 (semantic-make-local-hook 'semantic-edits-new-change-functions)
225 (add-hook 'semantic-edits-new-change-hooks 225 (add-hook 'semantic-edits-new-change-functions
226 'semantic-highlight-edits-new-change-hook-fcn nil t)) 226 'semantic-highlight-edits-new-change-hook-fcn nil t))
227 ;; Remove hooks 227 ;; Remove hooks
228 (remove-hook 'semantic-edits-new-change-hooks 228 (remove-hook 'semantic-edits-new-change-functions
229 'semantic-highlight-edits-new-change-hook-fcn t))) 229 'semantic-highlight-edits-new-change-hook-fcn t)))
230 230
231(semantic-add-minor-mode 'semantic-highlight-edits-mode 231(semantic-add-minor-mode 'semantic-highlight-edits-mode
@@ -460,8 +460,8 @@ minor mode is enabled."
460 (append mode-line-modified 460 (append mode-line-modified
461 '(semantic-show-parser-state-string)))) 461 '(semantic-show-parser-state-string))))
462 ;; Add hooks 462 ;; Add hooks
463 (semantic-make-local-hook 'semantic-edits-new-change-hooks) 463 (semantic-make-local-hook 'semantic-edits-new-change-functions)
464 (add-hook 'semantic-edits-new-change-hooks 464 (add-hook 'semantic-edits-new-change-functions
465 'semantic-show-parser-state-marker nil t) 465 'semantic-show-parser-state-marker nil t)
466 (semantic-make-local-hook 'semantic-edits-incremental-reparse-failed-hook) 466 (semantic-make-local-hook 'semantic-edits-incremental-reparse-failed-hook)
467 (add-hook 'semantic-edits-incremental-reparse-failed-hook 467 (add-hook 'semantic-edits-incremental-reparse-failed-hook
@@ -491,7 +491,7 @@ minor mode is enabled."
491 (setq mode-line-modified 491 (setq mode-line-modified
492 (delq 'semantic-show-parser-state-string mode-line-modified)) 492 (delq 'semantic-show-parser-state-string mode-line-modified))
493 ;; Remove hooks 493 ;; Remove hooks
494 (remove-hook 'semantic-edits-new-change-hooks 494 (remove-hook 'semantic-edits-new-change-functions
495 'semantic-show-parser-state-marker t) 495 'semantic-show-parser-state-marker t)
496 (remove-hook 'semantic-edits-incremental-reparse-failed-hook 496 (remove-hook 'semantic-edits-incremental-reparse-failed-hook
497 'semantic-show-parser-state-marker t) 497 'semantic-show-parser-state-marker t)
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 12fc08b90e4..298c8949435 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -189,8 +189,8 @@ we can tell font lock about them.")
189;;;###autoload 189;;;###autoload
190(define-derived-mode srecode-template-mode fundamental-mode "SRecorder" 190(define-derived-mode srecode-template-mode fundamental-mode "SRecorder"
191 "Major-mode for writing SRecode macros." 191 "Major-mode for writing SRecode macros."
192 (setq comment-start ";;" 192 (set (make-local-variable 'comment-start) ";;")
193 comment-end "") 193 (set (make-local-variable 'comment-end) "")
194 (set (make-local-variable 'parse-sexp-ignore-comments) t) 194 (set (make-local-variable 'parse-sexp-ignore-comments) t)
195 (set (make-local-variable 'comment-start-skip) 195 (set (make-local-variable 'comment-start-skip)
196 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") 196 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 3d4f41be8ee..a378941a5a4 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -49,9 +49,9 @@ the middle is discarded, and just the beginning and end are displayed."
49 :version "21.1") 49 :version "21.1")
50 50
51(defcustom debugger-bury-or-kill 'bury 51(defcustom debugger-bury-or-kill 'bury
52 "How to proceed with the debugger buffer when exiting `debug'. 52 "What to do with the debugger buffer when exiting `debug'.
53The value used here affects the behavior of operations on any 53The value affects the behavior of operations on any window
54window previously showing the debugger buffer. 54previously showing the debugger buffer.
55 55
56`nil' means that if its window is not deleted when exiting the 56`nil' means that if its window is not deleted when exiting the
57 debugger, invoking `switch-to-prev-buffer' will usually show 57 debugger, invoking `switch-to-prev-buffer' will usually show
@@ -79,7 +79,7 @@ The value used here is passed to `quit-restore-window'."
79 (const :tag "Bury" bury) 79 (const :tag "Bury" bury)
80 (const :tag "Kill" kill)) 80 (const :tag "Kill" kill))
81 :group 'debugger 81 :group 'debugger
82 :version "24.2") 82 :version "24.3")
83 83
84(defvar debugger-step-after-exit nil 84(defvar debugger-step-after-exit nil
85 "Non-nil means \"single-step\" after the debugger exits.") 85 "Non-nil means \"single-step\" after the debugger exits.")
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 58bfae5b503..02eec08f96b 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -220,8 +220,9 @@ so as to preserve the semantics of `setf'."
220 `(gv-define-setter ,name (val &rest args) 220 `(gv-define-setter ,name (val &rest args)
221 ,(if fix-return 221 ,(if fix-return
222 `(macroexp-let2 nil v val 222 `(macroexp-let2 nil v val
223 (cons ',setter (append args (list v))) 223 `(progn
224 v) 224 (,',setter ,@(append args (list v)))
225 ,v))
225 `(cons ',setter (append args (list val)))))) 226 `(cons ',setter (append args (list val))))))
226 227
227;;; Typical operations on generalized variables. 228;;; Typical operations on generalized variables.
diff --git a/lisp/help.el b/lisp/help.el
index 449818207b3..de2a22714f9 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -979,7 +979,7 @@ buffer, and should return a positive integer. At the time the
979function is called, the window to be resized is selected." 979function is called, the window to be resized is selected."
980 :type '(choice integer function) 980 :type '(choice integer function)
981 :group 'help 981 :group 'help
982 :version "24.2") 982 :version "24.3")
983 983
984(define-minor-mode temp-buffer-resize-mode 984(define-minor-mode temp-buffer-resize-mode
985 "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode). 985 "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode).
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index c9dcff41618..72ca189e9d5 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -632,10 +632,13 @@ directory, like `default-directory'."
632 '(menu-item "Disable all filtering" ibuffer-filter-disable 632 '(menu-item "Disable all filtering" ibuffer-filter-disable
633 :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers))) 633 :enable (and (featurep 'ibuf-ext) ibuffer-filtering-qualifiers)))
634 (define-key-after map [menu-bar view filter filter-by-mode] 634 (define-key-after map [menu-bar view filter filter-by-mode]
635 '(menu-item "Add filter by major mode..." ibuffer-filter-by-mode)) 635 '(menu-item "Add filter by any major mode..." ibuffer-filter-by-mode))
636 (define-key-after map [menu-bar view filter filter-by-mode] 636 (define-key-after map [menu-bar view filter filter-by-used-mode]
637 '(menu-item "Add filter by major mode in use..." 637 '(menu-item "Add filter by a major mode in use..."
638 ibuffer-filter-by-used-mode)) 638 ibuffer-filter-by-used-mode))
639 (define-key-after map [menu-bar view filter filter-by-derived-mode]
640 '(menu-item "Add filter by derived mode..."
641 ibuffer-filter-by-derived-mode))
639 (define-key-after map [menu-bar view filter filter-by-name] 642 (define-key-after map [menu-bar view filter filter-by-name]
640 '(menu-item "Add filter by buffer name..." ibuffer-filter-by-name)) 643 '(menu-item "Add filter by buffer name..." ibuffer-filter-by-name))
641 (define-key-after map [menu-bar view filter filter-by-filename] 644 (define-key-after map [menu-bar view filter filter-by-filename]
@@ -2438,8 +2441,9 @@ Marking commands:
2438 2441
2439Filtering commands: 2442Filtering commands:
2440 2443
2441 '\\[ibuffer-filter-by-mode]' - Add a filter by major mode. 2444 '\\[ibuffer-filter-by-mode]' - Add a filter by any major mode.
2442 '\\[ibuffer-filter-by-used-mode]' - Add a filter by major mode now in use. 2445 '\\[ibuffer-filter-by-used-mode]' - Add a filter by a major mode now in use.
2446 '\\[ibuffer-filter-by-derived-mode]' - Add a filter by derived mode.
2443 '\\[ibuffer-filter-by-name]' - Add a filter by buffer name. 2447 '\\[ibuffer-filter-by-name]' - Add a filter by buffer name.
2444 '\\[ibuffer-filter-by-content]' - Add a filter by buffer content. 2448 '\\[ibuffer-filter-by-content]' - Add a filter by buffer content.
2445 '\\[ibuffer-filter-by-filename]' - Add a filter by filename. 2449 '\\[ibuffer-filter-by-filename]' - Add a filter by filename.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 2614af9ffa4..5ba84f8991e 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -764,25 +764,39 @@ line number outside the file being compiled."
764 (and (overlayp ov) (overlay-get ov 'flymake-overlay))) 764 (and (overlayp ov) (overlay-get ov 'flymake-overlay)))
765 765
766(defcustom flymake-error-bitmap '(exclamation-mark error) 766(defcustom flymake-error-bitmap '(exclamation-mark error)
767 "Bitmap used in the fringe for indicating errors. 767 "Bitmap (a symbol) used in the fringe for indicating errors.
768The value may also be a list of two elements where the second 768The value may also be a list of two elements where the second
769element specifies the face for the bitmap." 769element specifies the face for the bitmap. For possible bitmap
770symbols, see `fringe-bitmaps'. See also `flymake-warning-bitmap'.
771
772The option `flymake-fringe-indicator-position' controls how and where
773this is used."
770 :group 'flymake 774 :group 'flymake
771 :version "24.3" 775 :version "24.3"
772 :type 'symbol) 776 :type '(choice (symbol :tag "Bitmap")
777 (list :tag "Bitmap and face"
778 (symbol :tag "Bitmap")
779 (face :tag "Face"))))
773 780
774(defcustom flymake-warning-bitmap 'question-mark 781(defcustom flymake-warning-bitmap 'question-mark
775 "Bitmap used in the fringe for indicating warnings. 782 "Bitmap (a symbol) used in the fringe for indicating warnings.
776The value may also be a list of two elements where the second 783The value may also be a list of two elements where the second
777element specifies the face for the bitmap." 784element specifies the face for the bitmap. For possible bitmap
785symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
786
787The option `flymake-fringe-indicator-position' controls how and where
788this is used."
778 :group 'flymake 789 :group 'flymake
779 :version "24.3" 790 :version "24.3"
780 :type 'symbol) 791 :type '(choice (symbol :tag "Bitmap")
792 (list :tag "Bitmap and face"
793 (symbol :tag "Bitmap")
794 (face :tag "Face"))))
781 795
782(defcustom flymake-fringe-indicator-position 'left-fringe 796(defcustom flymake-fringe-indicator-position 'left-fringe
783 "The position to put flymake fringe indicator. 797 "The position to put flymake fringe indicator.
784The value can be nil, left-fringe or right-fringe. 798The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
785Fringe indicators are disabled if nil." 799See `flymake-error-bitmap' and `flymake-warning-bitmap'."
786 :group 'flymake 800 :group 'flymake
787 :version "24.3" 801 :version "24.3"
788 :type '(choice (const left-fringe) 802 :type '(choice (const left-fringe)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ee98feaef5e..949b0252bf1 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1074,12 +1074,9 @@ automatically if needed."
1074The name of the defun should be grouped so it can be retrieved 1074The name of the defun should be grouped so it can be retrieved
1075via `match-string'.") 1075via `match-string'.")
1076 1076
1077(defun python-nav-beginning-of-defun (&optional arg) 1077(defun python-nav--beginning-of-defun (&optional arg)
1078 "Move point to `beginning-of-defun'. 1078 "Internal implementation of `python-nav-beginning-of-defun'.
1079With positive ARG move search backwards. With negative do the 1079With positive ARG search backwards, else search forwards."
1080same but forward. When ARG is nil or 0 defaults to 1. This is
1081the main part of `python-beginning-of-defun-function'. Return
1082non-nil if point is moved to `beginning-of-defun'."
1083 (when (or (null arg) (= arg 0)) (setq arg 1)) 1080 (when (or (null arg) (= arg 0)) (setq arg 1))
1084 (let* ((re-search-fn (if (> arg 0) 1081 (let* ((re-search-fn (if (> arg 0)
1085 #'re-search-backward 1082 #'re-search-backward
@@ -1087,6 +1084,15 @@ non-nil if point is moved to `beginning-of-defun'."
1087 (line-beg-pos (line-beginning-position)) 1084 (line-beg-pos (line-beginning-position))
1088 (line-content-start (+ line-beg-pos (current-indentation))) 1085 (line-content-start (+ line-beg-pos (current-indentation)))
1089 (pos (point-marker)) 1086 (pos (point-marker))
1087 (beg-indentation
1088 (and (> arg 0)
1089 (save-excursion
1090 (and (python-info-current-line-empty-p)
1091 (python-util-forward-comment -1))
1092 (python-nav-beginning-of-statement)
1093 (if (python-info-looking-at-beginning-of-defun)
1094 (+ (current-indentation) python-indent-offset)
1095 (current-indentation)))))
1090 (found 1096 (found
1091 (progn 1097 (progn
1092 (when (and (< arg 0) 1098 (when (and (< arg 0)
@@ -1094,7 +1100,12 @@ non-nil if point is moved to `beginning-of-defun'."
1094 (end-of-line 1)) 1100 (end-of-line 1))
1095 (while (and (funcall re-search-fn 1101 (while (and (funcall re-search-fn
1096 python-nav-beginning-of-defun-regexp nil t) 1102 python-nav-beginning-of-defun-regexp nil t)
1097 (python-syntax-context-type))) 1103 (or (python-syntax-context-type)
1104 ;; Handle nested defuns when moving
1105 ;; backwards by checking indentation.
1106 (and (> arg 0)
1107 (not (= (current-indentation) 0))
1108 (>= (current-indentation) beg-indentation)))))
1098 (and (python-info-looking-at-beginning-of-defun) 1109 (and (python-info-looking-at-beginning-of-defun)
1099 (or (not (= (line-number-at-pos pos) 1110 (or (not (= (line-number-at-pos pos)
1100 (line-number-at-pos))) 1111 (line-number-at-pos)))
@@ -1105,55 +1116,43 @@ non-nil if point is moved to `beginning-of-defun'."
1105 (or (beginning-of-line 1) t) 1116 (or (beginning-of-line 1) t)
1106 (and (goto-char pos) nil)))) 1117 (and (goto-char pos) nil))))
1107 1118
1108(defun python-beginning-of-defun-function (&optional arg) 1119(defun python-nav-beginning-of-defun (&optional arg)
1109 "Move point to the beginning of def or class. 1120 "Move point to `beginning-of-defun'.
1110With positive ARG move that number of functions backwards. With 1121With positive ARG search backwards else search forward. When ARG
1111negative do the same but forward. When ARG is nil or 0 defaults 1122is nil or 0 defaults to 1. When searching backwards nested
1112to 1. Return non-nil if point is moved to `beginning-of-defun'." 1123defuns are handled with care depending on current point
1124position. Return non-nil if point is moved to
1125`beginning-of-defun'."
1113 (when (or (null arg) (= arg 0)) (setq arg 1)) 1126 (when (or (null arg) (= arg 0)) (setq arg 1))
1114 (let ((found)) 1127 (let ((found))
1115 (cond ((and (eq this-command 'mark-defun) 1128 (cond ((and (eq this-command 'mark-defun)
1116 (python-info-looking-at-beginning-of-defun))) 1129 (python-info-looking-at-beginning-of-defun)))
1117 (t 1130 (t
1118 (dotimes (i (if (> arg 0) arg (- arg))) 1131 (dotimes (i (if (> arg 0) arg (- arg)))
1119 (when (and (python-nav-beginning-of-defun arg) 1132 (when (and (python-nav--beginning-of-defun arg)
1120 (not found)) 1133 (not found))
1121 (setq found t))))) 1134 (setq found t)))))
1122 found)) 1135 found))
1123 1136
1124(defun python-end-of-defun-function () 1137(defun python-nav-end-of-defun ()
1125 "Move point to the end of def or class. 1138 "Move point to the end of def or class.
1126Returns nil if point is not in a def or class." 1139Returns nil if point is not in a def or class."
1127 (interactive) 1140 (interactive)
1128 (let ((beg-defun-indent)) 1141 (let ((beg-defun-indent)
1142 (beg-pos (point)))
1129 (when (or (python-info-looking-at-beginning-of-defun) 1143 (when (or (python-info-looking-at-beginning-of-defun)
1130 (python-beginning-of-defun-function 1) 1144 (python-nav-beginning-of-defun 1)
1131 (python-beginning-of-defun-function -1)) 1145 (python-nav-beginning-of-defun -1))
1132 (setq beg-defun-indent (current-indentation)) 1146 (setq beg-defun-indent (current-indentation))
1147 (while (progn
1148 (python-nav-end-of-statement)
1149 (python-util-forward-comment 1)
1150 (and (> (current-indentation) beg-defun-indent)
1151 (not (eobp)))))
1152 (python-util-forward-comment -1)
1133 (forward-line 1) 1153 (forward-line 1)
1134 ;; Go as forward as possible 1154 ;; Ensure point moves forward.
1135 (while (and (or 1155 (and (> beg-pos (point)) (goto-char beg-pos)))))
1136 (python-nav-beginning-of-defun -1)
1137 (and (goto-char (point-max)) nil))
1138 (> (current-indentation) beg-defun-indent)))
1139 (beginning-of-line 1)
1140 ;; Go as backwards as possible
1141 (while (and (forward-line -1)
1142 (not (bobp))
1143 (or (not (current-word))
1144 (equal (char-after (+ (point) (current-indentation))) ?#)
1145 (<= (current-indentation) beg-defun-indent)
1146 (looking-at (python-rx decorator))
1147 (python-syntax-context-type))))
1148 (forward-line 1)
1149 ;; If point falls inside a paren or string context the point is
1150 ;; forwarded at the end of it (or end of buffer if its not closed)
1151 (let ((context-type (python-syntax-context-type)))
1152 (when (memq context-type '(paren string))
1153 ;; Slow but safe.
1154 (while (and (not (eobp))
1155 (python-syntax-context-type))
1156 (forward-line 1)))))))
1157 1156
1158(defun python-nav-beginning-of-statement () 1157(defun python-nav-beginning-of-statement ()
1159 "Move to start of current statement." 1158 "Move to start of current statement."
@@ -2022,7 +2021,7 @@ When argument ARG is non-nil do not include decorators."
2022 (python-shell-send-region 2021 (python-shell-send-region
2023 (progn 2022 (progn
2024 (end-of-line 1) 2023 (end-of-line 1)
2025 (while (and (or (python-beginning-of-defun-function) 2024 (while (and (or (python-nav-beginning-of-defun)
2026 (beginning-of-line 1)) 2025 (beginning-of-line 1))
2027 (> (current-indentation) 0))) 2026 (> (current-indentation) 0)))
2028 (when (not arg) 2027 (when (not arg)
@@ -2031,7 +2030,7 @@ When argument ARG is non-nil do not include decorators."
2031 (forward-line 1)) 2030 (forward-line 1))
2032 (point-marker)) 2031 (point-marker))
2033 (progn 2032 (progn
2034 (or (python-end-of-defun-function) 2033 (or (python-nav-end-of-defun)
2035 (end-of-line 1)) 2034 (end-of-line 1))
2036 (point-marker))))) 2035 (point-marker)))))
2037 2036
@@ -2879,38 +2878,40 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun.
2879This function is compatible to be used as 2878This function is compatible to be used as
2880`add-log-current-defun-function' since it returns nil if point is 2879`add-log-current-defun-function' since it returns nil if point is
2881not inside a defun." 2880not inside a defun."
2882 (let ((names '())
2883 (starting-indentation)
2884 (starting-point)
2885 (first-run t))
2886 (save-restriction 2881 (save-restriction
2887 (widen) 2882 (widen)
2888 (save-excursion 2883 (save-excursion
2889 (setq starting-point (point-marker))
2890 (setq starting-indentation (save-excursion
2891 (python-nav-beginning-of-statement)
2892 (current-indentation)))
2893 (end-of-line 1) 2884 (end-of-line 1)
2894 (while (python-beginning-of-defun-function 1) 2885 (let ((names)
2895 (when (or (< (current-indentation) starting-indentation) 2886 (starting-indentation
2896 (and first-run 2887 (save-excursion
2897 (< 2888 (and
2898 starting-point 2889 (python-nav-beginning-of-defun 1)
2899 (save-excursion 2890 ;; This extra number is just for checking code
2900 (python-end-of-defun-function) 2891 ;; against indentation to work well on first run.
2901 (point-marker))))) 2892 (+ (current-indentation) 4))))
2902 (setq first-run nil) 2893 (starting-point (point)))
2903 (setq starting-indentation (current-indentation)) 2894 ;; Check point is inside a defun.
2904 (looking-at python-nav-beginning-of-defun-regexp) 2895 (when (and starting-indentation
2905 (setq names (cons 2896 (< starting-point
2897 (save-excursion
2898 (python-nav-end-of-defun)
2899 (point))))
2900 (catch 'exit
2901 (while (python-nav-beginning-of-defun 1)
2902 (when (< (current-indentation) starting-indentation)
2903 (setq starting-indentation (current-indentation))
2904 (setq names
2905 (cons
2906 (if (not include-type) 2906 (if (not include-type)
2907 (match-string-no-properties 1) 2907 (match-string-no-properties 1)
2908 (mapconcat 'identity 2908 (mapconcat 'identity
2909 (split-string 2909 (split-string
2910 (match-string-no-properties 0)) " ")) 2910 (match-string-no-properties 0)) " "))
2911 names)))))) 2911 names)))
2912 (when names 2912 (and (= (current-indentation) 0) (throw 'exit t)))))
2913 (mapconcat (lambda (string) string) names ".")))) 2913 (and names
2914 (mapconcat (lambda (string) string) names "."))))))
2914 2915
2915(defun python-info-current-symbol (&optional replace-self) 2916(defun python-info-current-symbol (&optional replace-self)
2916 "Return current symbol using dotty syntax. 2917 "Return current symbol using dotty syntax.
@@ -3200,9 +3201,9 @@ if that value is non-nil."
3200 'python-fill-paragraph) 3201 'python-fill-paragraph)
3201 3202
3202 (set (make-local-variable 'beginning-of-defun-function) 3203 (set (make-local-variable 'beginning-of-defun-function)
3203 #'python-beginning-of-defun-function) 3204 #'python-nav-beginning-of-defun)
3204 (set (make-local-variable 'end-of-defun-function) 3205 (set (make-local-variable 'end-of-defun-function)
3205 #'python-end-of-defun-function) 3206 #'python-nav-end-of-defun)
3206 3207
3207 (add-hook 'completion-at-point-functions 3208 (add-hook 'completion-at-point-functions
3208 'python-completion-complete-at-point nil 'local) 3209 'python-completion-complete-at-point nil 'local)
@@ -3230,7 +3231,7 @@ if that value is non-nil."
3230 (add-to-list 'hs-special-modes-alist 3231 (add-to-list 'hs-special-modes-alist
3231 `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#" 3232 `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#"
3232 ,(lambda (arg) 3233 ,(lambda (arg)
3233 (python-end-of-defun-function)) nil)) 3234 (python-nav-end-of-defun)) nil))
3234 3235
3235 (set (make-local-variable 'mode-require-final-newline) t) 3236 (set (make-local-variable 'mode-require-final-newline) t)
3236 3237
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index c9bfcefb748..67f25eda288 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -898,17 +898,7 @@ or blocks containing the current block."
898 (back-to-indentation) 898 (back-to-indentation)
899 (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>")) 899 (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
900 (setq done nil))))) 900 (setq done nil)))))
901 (back-to-indentation) 901 (back-to-indentation)))
902 (when (< n 0)
903 (let ((eol (point-at-eol)) state next)
904 (if (< orig eol) (setq eol orig))
905 (setq orig (point))
906 (while (and (setq next (apply 'ruby-parse-partial eol state))
907 (< (point) eol))
908 (setq state next))
909 (when (cdaadr state)
910 (goto-char (cdaadr state)))
911 (backward-word)))))
912 902
913(defun ruby-beginning-of-block (&optional arg) 903(defun ruby-beginning-of-block (&optional arg)
914 "Move backward to the beginning of the current block. 904 "Move backward to the beginning of the current block.
diff --git a/lisp/window.el b/lisp/window.el
index be6ddf8ab9e..30ee622cfe6 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -143,37 +143,36 @@ to `display-buffer'."
143 window)))) 143 window))))
144 144
145(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) 145(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body)
146 "Evaluate BODY and display buffer specified by BUFFER-OR-NAME. 146 "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME.
147BUFFER-OR-NAME must specify either a live buffer or the name of a 147BUFFER-OR-NAME must specify either a live buffer, or the name of a
148buffer. If no buffer with such a name exists, create one. 148buffer (if it does not exist, this macro creates it).
149 149
150Make sure the specified buffer is empty before evaluating BODY. 150Make sure the specified buffer is empty before evaluating BODY.
151Do not make that buffer current for BODY. Instead, bind 151Do not make that buffer current for BODY. Instead, bind
152`standard-output' to that buffer, so that output generated with 152`standard-output' to that buffer, so that output generated with
153`prin1' and similar functions in BODY goes into that buffer. 153`prin1' and similar functions in BODY goes into that buffer.
154 154
155After evaluating BODY, mark the specified buffer unmodified and 155After evaluating BODY, this marks the specified buffer unmodified and
156read-only, and display it in a window via `display-buffer'. Pass 156read-only, and displays it in a window via `display-buffer', passing
157ACTION as action argument to `display-buffer'. Automatically 157ACTION as the action argument to `display-buffer'. It automatically
158shrink the window used if `temp-buffer-resize-mode' is enabled. 158shrinks the relevant window if `temp-buffer-resize-mode' is enabled.
159 159
160Return the value returned by BODY unless QUIT-FUNCTION specifies 160Returns the value returned by BODY, unless QUIT-FUNCTION specifies
161a function. In that case, run the function with two arguments - 161a function. In that case, runs the function with two arguments -
162the window showing the specified buffer and the value returned by 162the window showing the specified buffer and the value returned by
163BODY - and return the value returned by that function. 163BODY - and returns the value returned by that function.
164 164
165If the buffer is displayed on a new frame, the window manager may 165If the buffer is displayed on a new frame, the window manager may
166decide to select that frame. In that case, it's usually a good 166decide to select that frame. In that case, it's usually a good
167strategy if the function specified by QUIT-FUNCTION selects the 167strategy if the function specified by QUIT-FUNCTION selects the
168window showing the buffer before reading a value from the 168window showing the buffer before reading a value from the
169minibuffer, for example, when asking a `yes-or-no-p' question. 169minibuffer; for example, when asking a `yes-or-no-p' question.
170 170
171This construct is similar to `with-output-to-temp-buffer' but 171This construct is similar to `with-output-to-temp-buffer', but does
172does neither put the buffer in help mode nor does it call 172not put the buffer in help mode, or call `temp-buffer-show-function'.
173`temp-buffer-show-function'. It also runs different hooks, 173It also runs different hooks, namely `temp-buffer-window-setup-hook'
174namely `temp-buffer-window-setup-hook' (with the specified buffer 174\(with the specified buffer current) and `temp-buffer-window-show-hook'
175current) and `temp-buffer-window-show-hook' (with the specified 175\(with the specified buffer current and the window showing it selected).
176buffer current and the window showing it selected).
177 176
178Since this macro calls `display-buffer', the window displaying 177Since this macro calls `display-buffer', the window displaying
179the buffer is usually not selected and the specified buffer 178the buffer is usually not selected and the specified buffer
@@ -6065,7 +6064,7 @@ A frame can be resized if and only if its root window is a live
6065window. The height of the root window is subject to the values 6064window. The height of the root window is subject to the values
6066of `fit-frame-to-buffer-max-height' and `window-min-height'." 6065of `fit-frame-to-buffer-max-height' and `window-min-height'."
6067 :type 'boolean 6066 :type 'boolean
6068 :version "24.2" 6067 :version "24.3"
6069 :group 'help) 6068 :group 'help)
6070 6069
6071(defcustom fit-frame-to-buffer-bottom-margin 4 6070(defcustom fit-frame-to-buffer-bottom-margin 4
@@ -6073,7 +6072,7 @@ of `fit-frame-to-buffer-max-height' and `window-min-height'."
6073This is the number of lines `fit-frame-to-buffer' leaves free at the 6072This is the number of lines `fit-frame-to-buffer' leaves free at the
6074bottom of the display in order to not obscure the system task bar." 6073bottom of the display in order to not obscure the system task bar."
6075 :type 'integer 6074 :type 'integer
6076 :version "24.2" 6075 :version "24.3"
6077 :group 'windows) 6076 :group 'windows)
6078 6077
6079(defun fit-frame-to-buffer (&optional frame max-height min-height) 6078(defun fit-frame-to-buffer (&optional frame max-height min-height)