diff options
author | Glenn Morris <rgm@gnu.org> | 2011-01-24 19:47:47 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2011-01-24 19:47:47 -0800 |
commit | 06d8ace51597cd41e110560a56a1abeb6cce23d6 (patch) | |
tree | e893bab169f27821637fc07e3cd2414b4b9b7b68 /lisp | |
parent | c5ecc7690d4afafb42049634d64abd781ff76642 (diff) | |
parent | 0d19d4feaa653a315853716e64bbaddb210a26ca (diff) | |
download | emacs-06d8ace51597cd41e110560a56a1abeb6cce23d6.tar.gz emacs-06d8ace51597cd41e110560a56a1abeb6cce23d6.tar.bz2 emacs-06d8ace51597cd41e110560a56a1abeb6cce23d6.zip |
Merge from emacs-23.
Note setting of CANNOT_DUMP on ia64 hpux is still to be merged manually.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 35 | ||||
-rw-r--r-- | lisp/button.el | 17 | ||||
-rw-r--r-- | lisp/comint.el | 5 | ||||
-rw-r--r-- | lisp/dired.el | 5 | ||||
-rw-r--r-- | lisp/emacs-lisp/re-builder.el | 4 | ||||
-rw-r--r-- | lisp/files.el | 27 | ||||
-rw-r--r-- | lisp/gnus/nnbabyl.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 92 | ||||
-rw-r--r-- | lisp/simple.el | 14 |
9 files changed, 125 insertions, 76 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 62aeaf7f92f..722637d9c3d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,38 @@ +2011-01-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * files.el (file-name-non-special): Only change buffer-file-name after + insert-file-contents if it's `visit'ing the file (bug#7854). + +2011-01-25 Chong Yidong <cyd@stupidchicken.com> + + * dired.el (dired-revert): Doc fix (Bug#7758). + + * simple.el (line-move-visual): Doc fix (Bug#7594). + +2011-01-25 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * progmodes/ruby-mode.el (ruby-here-doc-beg-match): Fix for + here-doc which ends with an underscore. + (ruby-mode-set-encoding): Skip shebang line always. + (ruby-mode-map): Bind C-c C-c to comment-region. + (ruby-font-lock-keywords): Highlight literal hash key labels as symbols. + (ruby-forward-sexp): Stop after literal hash key labels. + (ruby-font-lock-syntactic-keywords): Highlight regexp after open + bracket. + +2011-01-25 Keitaro Miyazaki <keitaro.miyazaki@gmail.com> (tiny change) + + * emacs-lisp/re-builder.el (reb-mode-map): Set case-fold-search in + the correct buffer (Bug#7650). + +2011-01-25 Glenn Morris <rgm@gnu.org> + + * comint.el (comint-mode): Doc fix. (Bug#7897) + + * simple.el (do-auto-fill): Give it a doc string. + + * button.el (make-text-button): Doc fix. (See bug#7881) + 2011-01-24 Stefan Monnier <monnier@iro.umontreal.ca> * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs): diff --git a/lisp/button.el b/lisp/button.el index c52e3d8e372..dbde4a3317c 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -1,7 +1,7 @@ ;;; button.el --- clickable buttons ;; -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010, 2011 Free Software Foundation, Inc. ;; ;; Author: Miles Bader <miles@gnu.org> ;; Keywords: extensions @@ -38,7 +38,9 @@ ;; the button is represented by a marker or buffer-position pointing ;; somewhere in the button. In the latter case, no markers into the ;; buffer are retained, which is important for speed if there are are -;; extremely large numbers of buttons. +;; extremely large numbers of buttons. Note however that if there is +;; an existing face text-property at the site of the button, the +;; button face may not be visible. Using overlays avoids this. ;; ;; Using `define-button-type' to define default properties for buttons ;; is not necessary, but it is is encouraged, since doing so makes the @@ -290,9 +292,12 @@ button-type from which to inherit other properties; see `define-button-type'. This function is like `make-button', except that the button is actually -part of the text instead of being a property of the buffer. Creating -large numbers of buttons can also be somewhat faster using -`make-text-button'. +part of the text instead of being a property of the buffer. That is, +this function uses text properties, the other uses overlays. +Creating large numbers of buttons can also be somewhat faster +using `make-text-button'. Note, however, that if there is an existing +face property at the site of the button, the button face may not be visible. +You may want to use `make-button' in that case. BEG can also be a string, in which case it is made into a button. diff --git a/lisp/comint.el b/lisp/comint.el index 1912cdcfc44..6b57f0a3c3f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -607,8 +607,9 @@ mode, Shell mode, etc. This can be done by setting the hooks and `comint-get-old-input' to appropriate functions, and the variable `comint-prompt-regexp' to the appropriate regular expression. -An input history is maintained of size `comint-input-ring-size', and -can be accessed with the commands \\[comint-next-input], \\[comint-previous-input], and \\[comint-dynamic-list-input-ring]. +The mode maintains an input history of size `comint-input-ring-size'. +You can access this with the commands \\[comint-next-input], +\\[comint-previous-input], and \\[comint-dynamic-list-input-ring]. Input ring history expansion can be achieved with the commands \\[comint-replace-by-expanded-history] or \\[comint-magic-space]. Input ring expansion is controlled by the variable `comint-input-autoexpand', diff --git a/lisp/dired.el b/lisp/dired.el index 36bd9f6f121..1f38b5bfb74 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1146,7 +1146,10 @@ If HDR is non-nil, insert a header line with the directory name." "Reread the dired buffer. Must also be called after `dired-actual-switches' have changed. Should not fail even on completely garbaged buffers. -Preserves old cursor, marks/flags, hidden-p." +Preserves old cursor, marks/flags, hidden-p. + +Dired sets `revert-buffer-function' to this function. The args +ARG and NOCONFIRM, passed from `revert-buffer', are ignored." (widen) ; just in case user narrowed (let ((modflag (buffer-modified-p)) (positions (dired-save-positions)) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 12a66582317..38fb826c352 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -243,7 +243,9 @@ Except for Lisp syntax this is the same as `reb-regexp'.") :help "Quit the RE Builder mode")) (define-key menu-map [rt] '(menu-item "Case sensitive" reb-toggle-case - :button (:toggle . (null case-fold-search)) + :button (:toggle . (with-current-buffer + reb-target-buffer + (null case-fold-search))) :help "Toggle case sensitivity of searches for RE Builder target buffer")) (define-key menu-map [rb] '(menu-item "Change target buffer..." reb-change-target-buffer diff --git a/lisp/files.el b/lisp/files.el index 16b43d72c3e..dcb9ac08d95 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6118,8 +6118,7 @@ only these files will be asked to be saved." (substitute-in-file-name identity) ;; `add' means add "/:" to the result. (file-truename add 0) - ;; `quote' means add "/:" to buffer-file-name. - (insert-file-contents quote 0) + (insert-file-contents insert-file-contents 0) ;; `unquote-then-quote' means set buffer-file-name ;; temporarily to unquoted filename. (verify-visited-file-modtime unquote-then-quote) @@ -6150,20 +6149,18 @@ only these files will be asked to be saved." "/" (substring (car pair) 2))))) (setq file-arg-indices (cdr file-arg-indices)))) - (cond ((eq method 'identity) - (car arguments)) - ((eq method 'add) - (concat "/:" (apply operation arguments))) - ((eq method 'quote) - (unwind-protect + (case method + (identity (car arguments)) + (add (concat "/:" (apply operation arguments))) + (insert-file-contents + (let ((visit (nth 1 arguments))) + (prog1 (apply operation arguments) - (setq buffer-file-name (concat "/:" buffer-file-name)))) - ((eq method 'unquote-then-quote) - (let (res) - (setq buffer-file-name (substring buffer-file-name 2)) - (setq res (apply operation arguments)) - (setq buffer-file-name (concat "/:" buffer-file-name)) - res)) + (when (and visit buffer-file-name) + (setq buffer-file-name (concat "/:" buffer-file-name)))))) + (unquote-then-quote + (let ((buffer-file-name (substring buffer-file-name 2))) + (apply operation arguments))) (t (apply operation arguments))))) diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index 2346c05c854..06e41d78009 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el @@ -1,6 +1,6 @@ ;;; nnbabyl.el --- rmail mbox access for Gnus -;; Copyright (C) 1995, 1996, 1997, 1998, 1099, 2000, 2001, 2002, 2003, +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 733af999cdb..b3a640a2283 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -153,6 +153,7 @@ This should only be called after matching against `ruby-here-doc-beg-re'." (define-key map (kbd "C-M-h") 'backward-kill-word) (define-key map (kbd "C-j") 'reindent-then-newline-and-indent) (define-key map (kbd "C-m") 'newline) + (define-key map (kbd "C-c C-c") 'comment-region) map) "Keymap used in Ruby mode.") @@ -319,7 +320,7 @@ Also ignores spaces after parenthesis when 'space." (cdr (assq coding-system ruby-encoding-map))) coding-system)) "ascii-8bit")) - (if (looking-at "^#![^\n]*ruby") (beginning-of-line 2)) + (if (looking-at "^#!") (beginning-of-line 2)) (cond ((looking-at "\\s *#.*-\*-\\s *\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)\\s *\\(;\\|-\*-\\)") (unless (string= (match-string 2) coding-system) (goto-char (match-beginning 2)) @@ -927,6 +928,7 @@ With ARG, do it many times. Negative ARG means move backward." (condition-case nil (while (> i 0) (skip-syntax-forward " ") + (if (looking-at ",\\s *") (goto-char (match-end 0))) (cond ((looking-at "\\?\\(\\\\[CM]-\\)*\\\\?\\S ") (goto-char (match-end 0))) ((progn @@ -1179,56 +1181,59 @@ It's useful in that it divides up the match string so that "Return a regexp to find the beginning of a heredoc. This should only be called after matching against `ruby-here-doc-end-re'." - (let ((contents (regexp-quote (match-string 2)))) + (let ((contents (concat + (regexp-quote (concat (match-string 2) (match-string 3))) + (if (string= (match-string 3) "_") "\\B" "\\b")))) (concat "<<" (let ((match (match-string 1))) (if (and match (> (length match) 0)) - (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" match "\\)" - contents "\\b\\(\\1\\|\\2\\)") - (concat "-?\\([\"']\\|\\)" contents "\\b\\1")))))) + (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" + (match-string 1) "\\)" + contents "\\(\\1\\|\\2\\)") + (concat "-?\\([\"']\\|\\)" contents "\\1")))))) (defconst ruby-font-lock-syntactic-keywords `( ;; #{ }, #$hoge, #@foo are not comments - ("\\(#\\)[{$@]" 1 (1 . nil)) - ;; the last $', $", $` in the respective string is not variable - ;; the last ?', ?", ?` in the respective string is not ascii code - ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)" - (2 (7 . nil)) - (4 (7 . nil))) - ;; $' $" $` .... are variables - ;; ?' ?" ?` are ascii codes - ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) - ;; regexps - ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" - (4 (7 . ?/)) - (6 (7 . ?/))) - ("^=en\\(d\\)\\_>" 1 "!") - ("^\\(=\\)begin\\_>" 1 (ruby-comment-beg-syntax)) - ;; Currently, the following case is highlighted incorrectly: - ;; - ;; <<FOO - ;; FOO - ;; <<BAR - ;; <<BAZ - ;; BAZ - ;; BAR - ;; - ;; This is because all here-doc beginnings are highlighted before any endings, - ;; so although <<BAR is properly marked as a beginning, when we get to <<BAZ - ;; it thinks <<BAR is part of a string so it's marked as well. - ;; - ;; This may be fixable by modifying ruby-in-here-doc-p to use - ;; ruby-in-non-here-doc-string-p rather than syntax-ppss-context, - ;; but I don't want to try that until we've got unit tests set up - ;; to make sure I don't break anything else. - (,(concat ruby-here-doc-beg-re ".*\\(\n\\)") - ,(+ 1 (regexp-opt-depth ruby-here-doc-beg-re)) - (ruby-here-doc-beg-syntax)) - (,ruby-here-doc-end-re 3 (ruby-here-doc-end-syntax))) - "Syntactic keywords for Ruby mode. See `font-lock-syntactic-keywords'.") + ("\\(#\\)[{$@]" 1 (1 . nil)) + ;; the last $', $", $` in the respective string is not variable + ;; the last ?', ?", ?` in the respective string is not ascii code + ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)" + (2 (7 . nil)) + (4 (7 . nil))) + ;; $' $" $` .... are variables + ;; ?' ?" ?` are ascii codes + ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) + ;; regexps + ("\\(^\\|[[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" + (4 (7 . ?/)) + (6 (7 . ?/))) + ("^=en\\(d\\)\\_>" 1 "!") + ("^\\(=\\)begin\\_>" 1 (ruby-comment-beg-syntax)) + ;; Currently, the following case is highlighted incorrectly: + ;; + ;; <<FOO + ;; FOO + ;; <<BAR + ;; <<BAZ + ;; BAZ + ;; BAR + ;; + ;; This is because all here-doc beginnings are highlighted before any endings, + ;; so although <<BAR is properly marked as a beginning, when we get to <<BAZ + ;; it thinks <<BAR is part of a string so it's marked as well. + ;; + ;; This may be fixable by modifying ruby-in-here-doc-p to use + ;; ruby-in-non-here-doc-string-p rather than syntax-ppss-context, + ;; but I don't want to try that until we've got unit tests set up + ;; to make sure I don't break anything else. + (,(concat ruby-here-doc-beg-re ".*\\(\n\\)") + ,(+ 1 (regexp-opt-depth ruby-here-doc-beg-re)) + (ruby-here-doc-beg-syntax)) + (,ruby-here-doc-end-re 3 (ruby-here-doc-end-syntax))) + "Syntactic keywords for Ruby mode. See `font-lock-syntactic-keywords'.") (defun ruby-comment-beg-syntax () - "Return the syntax cell for a the first character of a =begin. + "Return the syntax cell for a the first character of a =begin. See the definition of `ruby-font-lock-syntactic-keywords'. This returns a comment-delimiter cell as long as the =begin @@ -1420,6 +1425,7 @@ See `font-lock-syntax-table'.") ;; symbols '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 2 font-lock-reference-face) + '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-reference-face) ;; expression expansion '("#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)" 0 font-lock-variable-name-face t) diff --git a/lisp/simple.el b/lisp/simple.el index 476d5ab518d..612f942e6d1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4221,9 +4221,11 @@ Outline mode sets this." "When non-nil, `line-move' moves point by visual lines. This movement is based on where the cursor is displayed on the screen, instead of relying on buffer contents alone. It takes -into account variable-width characters and line continuation." +into account variable-width characters and line continuation. +If nil, `line-move' moves point by logical lines." :type 'boolean - :group 'editing-basics) + :group 'editing-basics + :version "23.1") ;; Returns non-nil if partial move was done. (defun line-move-partial (arg noerror to-end) @@ -5102,12 +5104,10 @@ If optional arg REALLY-WORD is non-nil, it finds just a word." regexp) :group 'fill) -;; This function is used as the auto-fill-function of a buffer -;; when Auto-Fill mode is enabled. -;; It returns t if it really did any work. -;; (Actually some major modes use a different auto-fill function, -;; but this one is the default one.) (defun do-auto-fill () + "The default value for `normal-auto-fill-function'. +This is the default auto-fill function, some major modes use a different one. +Returns t if it really did any work." (let (fc justify give-up (fill-prefix fill-prefix)) (if (or (not (setq justify (current-justification))) |