Now on revision 106586. ------------------------------------------------------------ revno: 106586 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2011-12-03 00:01:41 -0500 message: * lisp/electric.el: Streamline electric-indent's hook. (electric-indent-chars): Revert to simple list. (electric-indent-functions): New var. (electric-indent-post-self-insert-function): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-03 04:12:11 +0000 +++ lisp/ChangeLog 2011-12-03 05:01:41 +0000 @@ -1,5 +1,10 @@ 2011-12-03 Stefan Monnier + * electric.el: Streamline electric-indent's hook. + (electric-indent-chars): Revert to simple list. + (electric-indent-functions): New var. + (electric-indent-post-self-insert-function): Use it. + * progmodes/prolog.el (prolog-find-value-by-system): Avoid error when there's no inferior buffer (bug#10196). (prolog-consult-compile): Don't use toggle-read-only. === modified file 'lisp/electric.el' --- lisp/electric.el 2011-11-20 06:29:57 +0000 +++ lisp/electric.el 2011-12-03 05:01:41 +0000 @@ -197,11 +197,13 @@ ;; value, which only works well if the variable is preloaded. ;;;###autoload (defvar electric-indent-chars '(?\n) - "Characters that should cause automatic reindentation. -Each entry of the list can be either a character or a cons of the -form (CHAR . PREDICATE) which means that CHAR should cause reindentation -only if PREDICATE returns non-nil. PREDICATE is called with no arguments -and with point before the inserted char.") + "Characters that should cause automatic reindentation.") + +(defvar electric-indent-functions nil + "Special hook run to decide whether to auto-indent. +Each function is called with one argument (the inserted char), with +point right after that char, and it should return t to cause indentation, +`no-indent' to prevent indentation or nil to let other functions decide.") (defun electric-indent-post-self-insert-function () ;; FIXME: This reindents the current line, but what we really want instead is @@ -212,18 +214,21 @@ ;; There might be a way to get it working by analyzing buffer-undo-list, but ;; it looks challenging. (let (pos) - (when (and (or (memq last-command-event electric-indent-chars) - (let ((cp (assq last-command-event electric-indent-chars))) - (and cp (setq pos (electric--after-char-pos)) - (save-excursion - (goto-char (1- pos)) - (funcall (cdr cp)))))) - ;; Don't reindent while inserting spaces at beginning of line. - (or (not (memq last-command-event '(?\s ?\t))) - (save-excursion (skip-chars-backward " \t") (not (bolp)))) - (setq pos (electric--after-char-pos)) - ;; Not in a string or comment. - (not (nth 8 (save-excursion (syntax-ppss pos))))) + (when (and + ;; Don't reindent while inserting spaces at beginning of line. + (or (not (memq last-command-event '(?\s ?\t))) + (save-excursion (skip-chars-backward " \t") (not (bolp)))) + (setq pos (electric--after-char-pos)) + (save-excursion + (goto-char pos) + (let ((act (or (run-hook-with-args-until-success + 'electric-indent-functions + last-command-event) + (memq last-command-event electric-indent-chars)))) + (not + (or (memq act '(nil no-indent)) + ;; In a string or comment. + (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) ;; For newline, we want to reindent both lines and basically behave like ;; reindent-then-newline-and-indent (whose code we hence copied). (when (< (1- pos) (line-beginning-position)) @@ -231,7 +236,7 @@ (save-excursion (unless (memq indent-line-function '(indent-relative indent-to-left-margin - indent-relative-maybe)) + indent-relative-maybe)) ;; Don't reindent the previous line if the indentation function ;; is not a real one. (goto-char before) ------------------------------------------------------------ revno: 106585 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10196 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-12-02 23:12:11 -0500 message: * lisp/progmodes/prolog.el (prolog-find-value-by-system): Avoid error when there's no inferior buffer. (prolog-consult-compile): Don't use toggle-read-only. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 19:23:19 +0000 +++ lisp/ChangeLog 2011-12-03 04:12:11 +0000 @@ -1,3 +1,9 @@ +2011-12-03 Stefan Monnier + + * progmodes/prolog.el (prolog-find-value-by-system): Avoid error when + there's no inferior buffer (bug#10196). + (prolog-consult-compile): Don't use toggle-read-only. + 2011-12-02 Michael Albinus * net/tramp-sh.el (tramp-maybe-open-connection): Handle user === modified file 'lisp/progmodes/prolog.el' --- lisp/progmodes/prolog.el 2011-11-26 08:26:37 +0000 +++ lisp/progmodes/prolog.el 2011-12-03 04:12:11 +0000 @@ -868,8 +868,9 @@ (defun prolog-find-value-by-system (alist) "Get value from ALIST according to `prolog-system'." (let ((system (or prolog-system - (buffer-local-value 'prolog-system - (prolog-inferior-buffer 'dont-run))))) + (let ((infbuf (prolog-inferior-buffer 'dont-run))) + (when infbuf + (buffer-local-value 'prolog-system infbuf)))))) (if (listp alist) (let (result id) @@ -1522,7 +1523,7 @@ ;; Emacs-20). (set (make-local-variable 'compilation-parse-errors-function) 'prolog-parse-sicstus-compilation-errors)) - (toggle-read-only 0) + (setq buffer-read-only nil) (insert command-string "\n")) (save-selected-window (pop-to-buffer buffer)) ------------------------------------------------------------ revno: 106584 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-12-02 20:06:45 -0800 message: * .bzrignore: Add config.cache. diff: === modified file '.bzrignore' --- .bzrignore 2011-09-29 14:19:11 +0000 +++ .bzrignore 2011-12-03 04:06:45 +0000 @@ -1,6 +1,7 @@ ./_dir-locals.el ./bin ./BIN +./config.cache ./config.log ./config.status ./data === modified file 'ChangeLog' --- ChangeLog 2011-11-27 18:33:17 +0000 +++ ChangeLog 2011-12-03 04:06:45 +0000 @@ -1,3 +1,7 @@ +2011-12-03 Paul Eggert + + * .bzrignore: Add config.cache. + 2011-11-27 Jan Djärv * configure.in: Check for gtk_window_set_has_resize_grip. ------------------------------------------------------------ revno: 106583 fixes bug(s): http://debbugs.gnu.org/10172 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-12-03 11:04:21 +0800 message: Fix for compilation-tests.el testsuite * automated/compile-tests.el (compile-tests--test-regexps-data): Increase column numbers by one to reflect change in how compilation-message is recorded (Bug#10172). diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2011-11-22 02:55:06 +0000 +++ test/ChangeLog 2011-12-03 03:04:21 +0000 @@ -1,3 +1,9 @@ +2011-12-03 Chong Yidong + + * automated/compile-tests.el (compile-tests--test-regexps-data): + Increase column numbers by one to reflect change in how + compilation-message is recorded (Bug#10172). + 2011-11-22 Glenn Morris * rmailmm.el: New file, split from lisp/mail/rmailmm.el. === modified file 'test/automated/compile-tests.el' --- test/automated/compile-tests.el 2011-11-09 15:39:32 +0000 +++ test/automated/compile-tests.el 2011-12-03 03:04:21 +0000 @@ -41,7 +41,7 @@ 1 nil 17 "fplot.f") ;; Ada & Mpatrol ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" - 1 10 61 "foo.adb") + 1 11 61 "foo.adb") ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" 52 nil 11 "foo.ads") (" 0x8008621 main+16 at error.c:17" @@ -55,7 +55,7 @@ ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" 13 nil 49 "/src/DataBaseTestCase.java") ("[jikes] foo.java:3:5:7:9: blah blah" - 14 (4 . 9) (3 . 7) "foo.java") + 14 (5 . 10) (3 . 7) "foo.java") ;; bash ("a.sh: line 1: ls-l: command not found" 1 nil 1 "a.sh") @@ -70,9 +70,9 @@ 1 nil 68 "pong.c") ;; caml ("File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" - 1 (19 . 155) (5 . 8) "foobar.ml") + 1 (20 . 156) (5 . 8) "foobar.ml") ("File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:\nWarning 26: unused variable equ." - 1 (1 . 145) 65 "F:\\ocaml\\sorting.ml") + 1 (2 . 146) 65 "F:\\ocaml\\sorting.ml") ("File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" 1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py") ("File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" @@ -83,13 +83,13 @@ ("\"foo.f\", line 3: Error: syntax error near end of statement" 1 nil 3 "foo.f") ("\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." - 1 4 19 "vvouch.c") + 1 5 19 "vvouch.c") ("\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" - 1 0 32 "foo.c") + 1 1 32 "foo.c") ("\"foo.adb\", line 2(11): warning: file name does not match ..." - 1 10 2 "foo.adb") + 1 11 2 "foo.adb") ("\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." - 1 33 30 "src/swapping.c") + 1 34 30 "src/swapping.c") ;; cucumber ("Scenario: undefined step # features/cucumber.feature:3" 29 nil 3 "features/cucumber.feature") @@ -115,7 +115,7 @@ ("Warning near line 10 file arrayclash.f: Module contains no executable" 1 nil 10 "arrayclash.f") ("Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" - 24 8 31 "assign.f") + 24 9 31 "assign.f") ;; iar ("\"foo.c\",3 Error[32]: Error message" 1 nil 3 "foo.c") @@ -123,11 +123,11 @@ 1 nil 3 "foo.c") ;; ibm ("foo.c(2:0) : informational EDC0804: Function foo is not referenced." - 1 -1 2 "foo.c") + 1 0 2 "foo.c") ("foo.c(3:8) : warning EDC0833: Implicit return statement encountered." - 1 7 3 "foo.c") + 1 8 3 "foo.c") ("foo.c(5:5) : error EDC0350: Syntax error." - 1 4 5 "foo.c") + 1 5 5 "foo.c") ;; irix ("ccom: Error: foo.c, line 2: syntax error" 1 nil 2 "foo.c") @@ -163,7 +163,7 @@ ("In file included from /usr/include/c++/3.3/backward/warn.h:4," 1 nil 4 "/usr/include/c++/3.3/backward/warn.h") (" from /usr/include/c++/3.3/backward/iostream.h:31:0," - 1 -1 31 "/usr/include/c++/3.3/backward/iostream.h") + 1 0 31 "/usr/include/c++/3.3/backward/iostream.h") (" from test_clt.cc:1:" 1 nil 1 "test_clt.cc") ;; gnu @@ -173,15 +173,15 @@ ("foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") ("foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") ("foo.c:8:I: message" 1 nil 8 "foo.c") - ("foo.c:8.23: note: message" 1 22 8 "foo.c") - ("foo.c:8.23: info: message" 1 22 8 "foo.c") - ("foo.c:8:23:information: message" 1 22 8 "foo.c") - ("foo.c:8.23-45: Informational: message" 1 (22 . nil) (8 . 45) "foo.c") + ("foo.c:8.23: note: message" 1 23 8 "foo.c") + ("foo.c:8.23: info: message" 1 23 8 "foo.c") + ("foo.c:8:23:information: message" 1 23 8 "foo.c") + ("foo.c:8.23-45: Informational: message" 1 (23 . nil) (8 . 45) "foo.c") ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") - ("foo.c:8-45.3: message" 1 (nil . 3) (8 . 45) "foo.c") - ("foo.c:8.23-9.1: message" 1 (22 . 1) (8 . 9) "foo.c") + ("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") + ("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") ("jade:dbcommon.dsl:133:17:E: missing argument for function call" - 1 16 133 "dbcommon.dsl") + 1 17 133 "dbcommon.dsl") ("G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." 1 nil 54 "G:/cygwin/dev/build-myproj.xml") ("file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." @@ -189,8 +189,8 @@ ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" 1 nil 27041 "{standard input}") ;; lcc - ("E, file.cc(35,52) Illegal operation on pointers" 1 51 35 "file.cc") - ("W, file.cc(36,52) blah blah" 1 51 36 "file.cc") + ("E, file.cc(35,52) Illegal operation on pointers" 1 52 35 "file.cc") + ("W, file.cc(36,52) blah blah" 1 52 36 "file.cc") ;; makepp ("makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") ("makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" 27 nil nil "/foo/bar.c") @@ -198,7 +198,7 @@ ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") ;; maven ("FooBar.java:[111,53] no interface expected here" - 1 52 111 "FooBar.java") + 1 53 111 "FooBar.java") ;; mips-1 mips-2 ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" 11 nil 255 "solomon.c") @@ -220,17 +220,17 @@ 1 nil 120 "..\src\ctrl\lister.c") ;; oracle ("Semantic error at line 528, column 5, file erosacqdb.pc:" - 1 4 528 "erosacqdb.pc") + 1 5 528 "erosacqdb.pc") ("Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" - 1 9 41 "/usr/src/sb/ODBI_BHP.hpp") + 1 10 41 "/usr/src/sb/ODBI_BHP.hpp") ("PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" - 1 26 49 "/usr/src/sb/ODBI_dxfgh.pc") + 1 27 49 "/usr/src/sb/ODBI_dxfgh.pc") ("PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" 1 nil 12 "/usr/src/sb/ODBI_BHP.hpp") ("PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" 1 nil 27 "/usr/src/sb/ODBI_BHP.hpp") ("PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" - 1 39 21 "/usr/src/sb/ODBI_BHP.hpp") + 1 40 21 "/usr/src/sb/ODBI_BHP.hpp") ;; perl ("syntax error at automake line 922, near \"':'\"" 14 nil 922 "automake") @@ -262,9 +262,9 @@ 1 nil 10 "examples/test-unit.rb") ;; rxp ("Error: Mismatched end tag: expected , got \nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" - 1 7 71 "/home/reto/test/group.xml") + 1 8 71 "/home/reto/test/group.xml") ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" - 1 7 4 "/home/reto/test/group.xml") + 1 8 4 "/home/reto/test/group.xml") ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example ("Thu May 14 10:46:12 1992 mom3.p:" 1 nil nil "mom3.p") @@ -274,10 +274,10 @@ ("cc-1070 cc: WARNING File = linkl.c, Line = 38" 13 nil 38 "linkl.c") ("cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" - 18 2 16 "Hoved.f90") + 18 3 16 "Hoved.f90") ;; sun-ada ("/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" - 1 5 361 "/home3/xdhar/rcds_rc/main.a") + 1 6 361 "/home3/xdhar/rcds_rc/main.a") ;; 4bsd ("/usr/src/foo/foo.c(8): warning: w may be used before set" 1 nil 8 "/usr/src/foo/foo.c") @@ -300,7 +300,7 @@ 1 nil 46 "t/foo.t") ;; weblint ("index.html (13:1) Unknown element " - 1 0 13 "index.html")) + 1 1 13 "index.html")) "List of tests for `compilation-error-regexp-alist'. Each element has the form (STR POS COLUMN LINE FILENAME), where STR is an error string, POS is the position of the error in STR, ------------------------------------------------------------ revno: 106582 committer: Michael Albinus branch nick: trunk timestamp: Fri 2011-12-02 20:23:19 +0100 message: * net/tramp-sh.el (tramp-maybe-open-connection): Handle user interrupt. (Bug#10187) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 14:44:19 +0000 +++ lisp/ChangeLog 2011-12-02 19:23:19 +0000 @@ -1,3 +1,8 @@ +2011-12-02 Michael Albinus + + * net/tramp-sh.el (tramp-maybe-open-connection): Handle user + interrupt. (Bug#10187) + 2011-12-02 Stefan Monnier * pcmpl-gnu.el (pcomplete/tar): large-file-warn-threshold can be nil === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2011-11-20 07:30:16 +0000 +++ lisp/net/tramp-sh.el 2011-12-02 19:23:19 +0000 @@ -1042,9 +1042,9 @@ (tramp-flush-file-property l (file-name-directory l-localname)) (tramp-flush-file-property l l-localname) - ;; Right, they are on the same host, regardless of user, method, etc. - ;; We now make the link on the remote machine. This will occur as the user - ;; that FILENAME belongs to. + ;; Right, they are on the same host, regardless of user, method, + ;; etc. We now make the link on the remote machine. This will + ;; occur as the user that FILENAME belongs to. (tramp-send-command-and-check l (format @@ -4224,148 +4224,166 @@ (setq p nil))) ;; New connection must be opened. - (unless (and p (processp p) (memq (process-status p) '(run open))) - - ;; We call `tramp-get-buffer' in order to get a debug buffer for - ;; messages from the beginning. - (tramp-get-buffer vec) - (tramp-with-progress-reporter - vec 3 - (if (zerop (length (tramp-file-name-user vec))) - (format "Opening connection for %s using %s" - (tramp-file-name-host vec) - (tramp-file-name-method vec)) - (format "Opening connection for %s@%s using %s" - (tramp-file-name-user vec) - (tramp-file-name-host vec) - (tramp-file-name-method vec))) - - ;; Start new process. - (when (and p (processp p)) - (delete-process p)) - (setenv "TERM" tramp-terminal-type) - (setenv "LC_ALL" "C") - (setenv "PROMPT_COMMAND") - (setenv "PS1" tramp-initial-end-of-output) - (let* ((target-alist (tramp-compute-multi-hops vec)) - (process-connection-type tramp-process-connection-type) - (process-adaptive-read-buffering nil) - (coding-system-for-read nil) - ;; This must be done in order to avoid our file name handler. - (p (let ((default-directory - (tramp-compat-temporary-file-directory))) - (apply - 'start-process - (tramp-get-connection-name vec) - (tramp-get-connection-buffer vec) - (if tramp-encoding-command-interactive - (list tramp-encoding-shell - tramp-encoding-command-interactive) - (list tramp-encoding-shell)))))) - - ;; Set sentinel and query flag. - (tramp-set-connection-property p "vector" vec) - (set-process-sentinel p 'tramp-process-sentinel) - (tramp-compat-set-process-query-on-exit-flag p nil) - - (tramp-message - vec 6 "%s" (mapconcat 'identity (process-command p) " ")) - - ;; Check whether process is alive. - (tramp-barf-if-no-shell-prompt - p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell) - - ;; Now do all the connections as specified. - (while target-alist - (let* ((hop (car target-alist)) - (l-method (tramp-file-name-method hop)) - (l-user (tramp-file-name-user hop)) - (l-host (tramp-file-name-host hop)) - (l-port nil) - (login-program - (tramp-get-method-parameter - l-method 'tramp-login-program)) - (login-args - (tramp-get-method-parameter l-method 'tramp-login-args)) - (async-args - (tramp-get-method-parameter l-method 'tramp-async-args)) - (gw-args - (tramp-get-method-parameter l-method 'tramp-gw-args)) - (gw (tramp-get-file-property hop "" "gateway" nil)) - (g-method (and gw (tramp-file-name-method gw))) - (g-user (and gw (tramp-file-name-user gw))) - (g-host (and gw (tramp-file-name-real-host gw))) - (command login-program) - ;; We don't create the temporary file. In fact, - ;; it is just a prefix for the ControlPath option - ;; of ssh; the real temporary file has another - ;; name, and it is created and protected by ssh. - ;; It is also removed by ssh when the connection - ;; is closed. - (tmpfile - (tramp-set-connection-property - p "temp-file" - (make-temp-name - (expand-file-name - tramp-temp-name-prefix - (tramp-compat-temporary-file-directory))))) - spec) - - ;; Add arguments for asynchronous processes. - (when (and process-name async-args) - (setq login-args (append async-args login-args))) - - ;; Add gateway arguments if necessary. - (when (and gw gw-args) - (setq login-args (append gw-args login-args))) - - ;; Check for port number. Until now, there's no need - ;; for handling like method, user, host. - (when (string-match tramp-host-with-port-regexp l-host) - (setq l-port (match-string 2 l-host) - l-host (match-string 1 l-host))) - - ;; Set variables for computing the prompt for reading - ;; password. They can also be derived from a gateway. - (setq tramp-current-method (or g-method l-method) - tramp-current-user (or g-user l-user) - tramp-current-host (or g-host l-host)) - - ;; Replace login-args place holders. - (setq - l-host (or l-host "") - l-user (or l-user "") - l-port (or l-port "") - spec (format-spec-make - ?h l-host ?u l-user ?p l-port ?t tmpfile) - command - (concat - ;; We do not want to see the trailing local prompt in - ;; `start-file-process'. - (unless (memq system-type '(windows-nt)) "exec ") - command " " - (mapconcat - (lambda (x) - (setq x (mapcar (lambda (y) (format-spec y spec)) x)) - (unless (member "" x) (mapconcat 'identity x " "))) - login-args " ") - ;; Local shell could be a Windows COMSPEC. It - ;; doesn't know the ";" syntax, but we must exit - ;; always for `start-file-process'. "exec" does not - ;; work either. - (if (memq system-type '(windows-nt)) " && exit || exit"))) - - ;; Send the command. - (tramp-message vec 3 "Sending command `%s'" command) - (tramp-send-command vec command t t) - (tramp-process-actions p vec pos tramp-actions-before-shell 60) + (condition-case err + (unless (and p (processp p) (memq (process-status p) '(run open))) + + ;; We call `tramp-get-buffer' in order to get a debug + ;; buffer for messages from the beginning. + (tramp-get-buffer vec) + (tramp-with-progress-reporter + vec 3 + (if (zerop (length (tramp-file-name-user vec))) + (format "Opening connection for %s using %s" + (tramp-file-name-host vec) + (tramp-file-name-method vec)) + (format "Opening connection for %s@%s using %s" + (tramp-file-name-user vec) + (tramp-file-name-host vec) + (tramp-file-name-method vec))) + + ;; Start new process. + (when (and p (processp p)) + (delete-process p)) + (setenv "TERM" tramp-terminal-type) + (setenv "LC_ALL" "C") + (setenv "PROMPT_COMMAND") + (setenv "PS1" tramp-initial-end-of-output) + (let* ((target-alist (tramp-compute-multi-hops vec)) + (process-connection-type tramp-process-connection-type) + (process-adaptive-read-buffering nil) + (coding-system-for-read nil) + ;; This must be done in order to avoid our file + ;; name handler. + (p (let ((default-directory + (tramp-compat-temporary-file-directory))) + (apply + 'start-process + (tramp-get-connection-name vec) + (tramp-get-connection-buffer vec) + (if tramp-encoding-command-interactive + (list tramp-encoding-shell + tramp-encoding-command-interactive) + (list tramp-encoding-shell)))))) + + ;; Set sentinel and query flag. + (tramp-set-connection-property p "vector" vec) + (set-process-sentinel p 'tramp-process-sentinel) + (tramp-compat-set-process-query-on-exit-flag p nil) + (tramp-message - vec 3 "Found remote shell prompt on `%s'" l-host)) - ;; Next hop. - (setq target-alist (cdr target-alist))) - - ;; Make initial shell settings. - (tramp-open-connection-setup-interactive-shell p vec))))))) + vec 6 "%s" (mapconcat 'identity (process-command p) " ")) + + ;; Check whether process is alive. + (tramp-barf-if-no-shell-prompt + p 60 + "Couldn't find local shell prompt %s" tramp-encoding-shell) + + ;; Now do all the connections as specified. + (while target-alist + (let* ((hop (car target-alist)) + (l-method (tramp-file-name-method hop)) + (l-user (tramp-file-name-user hop)) + (l-host (tramp-file-name-host hop)) + (l-port nil) + (login-program + (tramp-get-method-parameter + l-method 'tramp-login-program)) + (login-args + (tramp-get-method-parameter + l-method 'tramp-login-args)) + (async-args + (tramp-get-method-parameter + l-method 'tramp-async-args)) + (gw-args + (tramp-get-method-parameter l-method 'tramp-gw-args)) + (gw (tramp-get-file-property hop "" "gateway" nil)) + (g-method (and gw (tramp-file-name-method gw))) + (g-user (and gw (tramp-file-name-user gw))) + (g-host (and gw (tramp-file-name-real-host gw))) + (command login-program) + ;; We don't create the temporary file. In + ;; fact, it is just a prefix for the + ;; ControlPath option of ssh; the real + ;; temporary file has another name, and it is + ;; created and protected by ssh. It is also + ;; removed by ssh when the connection is + ;; closed. + (tmpfile + (tramp-set-connection-property + p "temp-file" + (make-temp-name + (expand-file-name + tramp-temp-name-prefix + (tramp-compat-temporary-file-directory))))) + spec) + + ;; Add arguments for asynchronous processes. + (when (and process-name async-args) + (setq login-args (append async-args login-args))) + + ;; Add gateway arguments if necessary. + (when (and gw gw-args) + (setq login-args (append gw-args login-args))) + + ;; Check for port number. Until now, there's no + ;; need for handling like method, user, host. + (when (string-match tramp-host-with-port-regexp l-host) + (setq l-port (match-string 2 l-host) + l-host (match-string 1 l-host))) + + ;; Set variables for computing the prompt for + ;; reading password. They can also be derived + ;; from a gateway. + (setq tramp-current-method (or g-method l-method) + tramp-current-user (or g-user l-user) + tramp-current-host (or g-host l-host)) + + ;; Replace login-args place holders. + (setq + l-host (or l-host "") + l-user (or l-user "") + l-port (or l-port "") + spec (format-spec-make + ?h l-host ?u l-user ?p l-port ?t tmpfile) + command + (concat + ;; We do not want to see the trailing local + ;; prompt in `start-file-process'. + (unless (memq system-type '(windows-nt)) "exec ") + command " " + (mapconcat + (lambda (x) + (setq x (mapcar (lambda (y) (format-spec y spec)) x)) + (unless (member "" x) (mapconcat 'identity x " "))) + login-args " ") + ;; Local shell could be a Windows COMSPEC. It + ;; doesn't know the ";" syntax, but we must exit + ;; always for `start-file-process'. "exec" does + ;; not work either. + (if (memq system-type '(windows-nt)) " && exit || exit"))) + + ;; Send the command. + (tramp-message vec 3 "Sending command `%s'" command) + (tramp-send-command vec command t t) + (tramp-process-actions + p vec pos tramp-actions-before-shell 60) + (tramp-message + vec 3 "Found remote shell prompt on `%s'" l-host)) + ;; Next hop. + (setq target-alist (cdr target-alist))) + + ;; Make initial shell settings. + (tramp-open-connection-setup-interactive-shell p vec)))) + + ;; When the user did interrupt, we must cleanup. + (quit + (let ((p (tramp-get-connection-process vec))) + (when (and p (processp p)) + (tramp-flush-connection-property vec) + (tramp-flush-connection-property p) + (delete-process p))) + ;; Propagate the quit signal. + (signal (car err) (cdr err))))))) (defun tramp-send-command (vec command &optional neveropen nooutput) "Send the COMMAND to connection VEC. ------------------------------------------------------------ revno: 106581 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-12-03 00:50:10 +0800 message: More updates to Text chapter of Emacs manual. * text.texi (Pages): Mention how formfeed chars are displayed. (Auto Fill): Note convention for calling auto-fill-mode from Lisp. Describe adaptive filling more precisely. (Fill Commands): Note that filling removes excess whitespace. (Text Mode): Note auto-mode-alist entries for Text mode. TAB is now bound to indent-for-tab-command in Text mode. (Outline Mode): Copyedits. (Outline Visibility): Note that Reveal mode is a buffer-local minor mode. * modes.texi (Major Modes): Move note about checking major-mode in a hook function here, from Text mode. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-11-28 15:28:04 +0000 +++ doc/emacs/ChangeLog 2011-12-02 16:50:10 +0000 @@ -1,3 +1,18 @@ +2011-12-02 Chong Yidong + + * text.texi (Pages): Mention how formfeed chars are displayed. + (Auto Fill): Note convention for calling auto-fill-mode from Lisp. + Describe adaptive filling more precisely. + (Fill Commands): Note that filling removes excess whitespace. + (Text Mode): Note auto-mode-alist entries for Text mode. TAB is + now bound to indent-for-tab-command in Text mode. + (Outline Mode): Copyedits. + (Outline Visibility): Note that Reveal mode is a buffer-local + minor mode. + + * modes.texi (Major Modes): Move note about checking major-mode in + a hook function here, from Text mode. + 2011-11-28 Chong Yidong * text.texi (Words): Add xref to Position Info. === modified file 'doc/emacs/modes.texi' --- doc/emacs/modes.texi 2011-11-28 06:24:48 +0000 +++ doc/emacs/modes.texi 2011-12-02 16:50:10 +0000 @@ -115,6 +115,8 @@ mode has @code{fortran-mode-hook}. Furthermore, all text-based major modes run @code{text-mode-hook}, and all programming language modes run @code{prog-mode-hook}, prior to running their own mode hooks. +Hook functions can look at the value of the variable @code{major-mode} +to see which mode is actually being entered. Mode hooks are commonly used to enable minor modes (@pxref{Minor Modes}). For example, you can put the following lines in your init === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-11-28 15:28:04 +0000 +++ doc/emacs/text.texi 2011-12-02 16:50:10 +0000 @@ -319,15 +319,15 @@ @cindex pages @cindex formfeed character - Within some text files, text is divided into @dfn{pages}, which are -delimited by the @dfn{formfeed character} (@acronym{ASCII} code 12, -sometimes denoted as @key{control-L}). When you print hardcopy for a -file, the formfeed character forces a page break: each page of the -file goes on a separate page on paper. Most Emacs commands treat the -formfeed character just like any other character: you can insert it -with @kbd{C-q C-l}, and delete it with @key{DEL}. However, since -pages are often meaningful divisions of the file, Emacs provides -commands to move over them and operate on them. + Within some text files, text is divided into @dfn{pages} delimited +by the @dfn{formfeed character} (@acronym{ASCII} code 12, also denoted +as @key{control-L}), which is displayed in Emacs as the escape +sequence @samp{^L} (@pxref{Text Display}). Traditionally, when such +text files are printed to hardcopy, each formfeed character forces a +page break. Most Emacs commands treat it just like any other +character, so you can insert it with @kbd{C-q C-l}, delete it with +@key{DEL}, etc. In addition, Emacs provides commands to move over +pages and operate on them. @table @kbd @item M-x what-page @@ -359,9 +359,9 @@ @kindex C-x C-p @findex mark-page The @kbd{C-x C-p} command (@code{mark-page}) puts point at the -beginning of the current page and the mark at the end. The page -delimiter at the end is included (the mark follows it). The page -delimiter at the front is excluded (point follows it). +beginning of the current page (after that page delimiter at the +front), and the mark at the end of the page (after the page delimiter +at the end). @kbd{C-x C-p C-w} is a handy way to kill a page to move it elsewhere. If you move to another page delimiter with @kbd{C-x [} and @@ -403,9 +403,7 @@ specified width. Emacs does filling in two ways. In Auto Fill mode, inserting text with self-inserting characters also automatically fills it. There are also explicit fill commands that you can use when editing -text leaves it unfilled. When you edit formatted text, you can specify -a style of filling for each portion of the text (@pxref{Formatted -Text}). +text leaves it unfilled. @menu * Auto Fill:: Auto Fill mode breaks long lines automatically. @@ -419,9 +417,9 @@ @cindex Auto Fill mode @cindex mode, Auto Fill - @dfn{Auto Fill} mode is a minor mode in which lines are broken -automatically when they become too wide. Breaking happens only when -you type a @key{SPC} or @key{RET}. + @dfn{Auto Fill} mode is a buffer-local minor mode (@pxref{Minor +Modes}) in which lines are broken automatically when they become too +wide. Breaking happens only when you type a @key{SPC} or @key{RET}. @table @kbd @item M-x auto-fill-mode @@ -432,45 +430,43 @@ @end table @findex auto-fill-mode - @kbd{M-x auto-fill-mode} turns Auto Fill mode on if it was off, or off -if it was on. With a positive numeric argument it always turns Auto -Fill mode on, and with a negative argument always turns it off. You can -see when Auto Fill mode is in effect by the presence of the word -@samp{Fill} in the mode line, inside the parentheses. Auto Fill mode is -a minor mode which is enabled or disabled for each buffer individually. -@xref{Minor Modes}. - - In Auto Fill mode, lines are broken automatically at spaces when they -get longer than the desired width. Line breaking and rearrangement -takes place only when you type @key{SPC} or @key{RET}. If you wish to -insert a space or newline without permitting line-breaking, type -@kbd{C-q @key{SPC}} or @kbd{C-q C-j} (recall that a newline is really a -control-J). Also, @kbd{C-o} inserts a newline without line breaking. - - Auto Fill mode works well with programming-language modes, because it -indents new lines with @key{TAB}. If a line ending in a comment gets -too long, the text of the comment is split into two comment lines. -Optionally, new comment delimiters are inserted at the end of the first -line and the beginning of the second so that each line is a separate -comment; the variable @code{comment-multi-line} controls the choice -(@pxref{Comments}). - - Adaptive filling (@pxref{Adaptive Fill}) works for Auto Filling as -well as for explicit fill commands. It takes a fill prefix -automatically from the second or first line of a paragraph. - - Auto Fill mode does not refill entire paragraphs; it can break lines but -cannot merge lines. So editing in the middle of a paragraph can result in -a paragraph that is not correctly filled. The easiest way to make the -paragraph properly filled again is usually with the explicit fill commands. + The mode command @kbd{M-x auto-fill-mode} toggles Auto Fill mode in +the current buffer. With a positive numeric argument, it enables Auto +Fill mode, and with a negative argument it disables it. If +@code{auto-fill-mode} is called from Lisp with an omitted or +@code{nil} argument, it enables Auto Fill mode. To enable Auto Fill +mode automatically in certain major modes, add @code{auto-fill-mode} +to the mode hooks (@pxref{Major Modes}). When Auto Fill mode is +enabled, the mode indicator @samp{Fill} appears in the mode line +(@pxref{Mode Line}). + + Auto Fill mode breaks lines automatically at spaces whenever they +get longer than the desired width. This line breaking occurs only +when you type @key{SPC} or @key{RET}. If you wish to insert a space +or newline without permitting line-breaking, type @kbd{C-q @key{SPC}} +or @kbd{C-q C-j} respectively. Also, @kbd{C-o} inserts a newline +without line breaking. + + When Auto Fill mode breaks a line, it tries to obey the +@dfn{adaptive fill prefix}: if a fill prefix can be deduced from the +first and/or second line of the current paragraph, it is inserted into +the new line (@pxref{Adaptive Fill}). Otherwise the new line is +indented, as though you had typed @key{TAB} on it +(@pxref{Indentation}). In a programming language mode, if a line is +broken in the middle of a comment, the comment is split by inserting +new comment delimiters as appropriate. + + Auto Fill mode does not refill entire paragraphs; it breaks lines +but does not merge lines. Therefore, editing in the middle of a +paragraph can result in a paragraph that is not correctly filled. To +fill it, call the explicit fill commands +@iftex +described in the next section. +@end iftex @ifnottex -@xref{Fill Commands}. +(@pxref{Fill Commands}). @end ifnottex - Many users like Auto Fill mode and want to use it in all text files. -The section on init files says how to arrange this permanently for yourself. -@xref{Init File}. - @node Fill Commands @subsection Explicit Fill Commands @@ -489,21 +485,23 @@ @kindex M-q @findex fill-paragraph - To refill a paragraph, use the command @kbd{M-q} -(@code{fill-paragraph}). This operates on the paragraph that point is -inside, or the one after point if point is between paragraphs. -Refilling works by removing all the line-breaks, then inserting new -ones where necessary. When there is an active region, this command -operates on the text within the region like @code{fill-region}. + The command @kbd{M-q} (@code{fill-paragraph}) @dfn{fills} the +current paragraph. It redistributes the line breaks within the +paragraph, and deletes any excess space and tab characters occurring +within the paragraph, in such a way that the lines end up fitting +within a certain maximum width. @findex fill-region - To refill many paragraphs, use @kbd{M-x fill-region}, which -finds the paragraphs in the region and fills each of them. + Normally, @kbd{M-q} acts on the paragraph where point is, but if +point is between paragraphs, it acts on the paragraph after point. If +the region is active, it acts instead on the text in the region. You +can also call @kbd{M-x fill-region} to specifically fill the text in +the region. @findex fill-region-as-paragraph - @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h} -for finding paragraph boundaries (@pxref{Paragraphs}). For more -control, you can use @kbd{M-x fill-region-as-paragraph}, which refills + @kbd{M-q} and @code{fill-region} use the usual Emacs criteria for +finding paragraph boundaries (@pxref{Paragraphs}). For more control, +you can use @kbd{M-x fill-region-as-paragraph}, which refills everything between point and mark as a single paragraph. This command deletes any blank lines within the region, so separate blocks of text end up combined into one block. @@ -513,9 +511,18 @@ as well as filling it. This means that extra spaces are inserted to make the right margin line up exactly at the fill column. To remove the extra spaces, use @kbd{M-q} with no argument. (Likewise for -@code{fill-region}.) Another way to control justification, and choose -other styles of filling, is with the @code{justification} text -property; see @ref{Format Justification}. +@code{fill-region}.) + +@vindex fill-column +@kindex C-x f +@findex set-fill-column + The maximum line width for filling is specified by the buffer-local +variable @code{fill-column}. The default value (@pxref{Locals}) is +70. The easiest way to set @code{fill-column} in the current buffer +is to use the command @kbd{C-x f} (@code{set-fill-column}). With a +numeric argument, it uses that as the new fill column. With just +@kbd{C-u} as argument, it sets @code{fill-column} to the current +horizontal position of point. @kindex M-o M-s @r{(Text mode)} @cindex centering @@ -526,40 +533,27 @@ made by Text mode and is available only in that and related modes (@pxref{Text Mode}). -@vindex fill-column -@kindex C-x f -@findex set-fill-column - The maximum line width for filling is in the variable -@code{fill-column}. Altering the value of @code{fill-column} makes it -local to the current buffer; until that time, the default value is in -effect. The default is initially 70. @xref{Locals}. The easiest way -to set @code{fill-column} is to use the command @kbd{C-x f} -(@code{set-fill-column}). With a numeric argument, it uses that as the -new fill column. With just @kbd{C-u} as argument, it sets -@code{fill-column} to the current horizontal position of point. - - Emacs commands normally consider a period followed by two spaces or by -a newline as the end of a sentence; a period followed by just one space -indicates an abbreviation and not the end of a sentence. To preserve -the distinction between these two ways of using a period, the fill -commands do not break a line after a period followed by just one space. - - If the variable @code{sentence-end-double-space} is @code{nil}, the -fill commands expect and leave just one space at the end of a sentence. -Ordinarily this variable is @code{t}, so the fill commands insist on -two spaces for the end of a sentence, as explained above. @xref{Sentences}. + By default, Emacs considers a period followed by two spaces or by a +newline as the end of a sentence; a period followed by just one space +indicates an abbreviation, not the end of a sentence. Accordingly, +the fill commands will not break a line after a period followed by +just one space. If you change the variable +@code{sentence-end-double-space} to a non-@code{nil} value, the fill +commands will break a line after a period followed by one space, and +put just one space after each period. @xref{Sentences}, for other +effects and possible drawbacks of this. @vindex colon-double-space If the variable @code{colon-double-space} is non-@code{nil}, the fill commands put two spaces after a colon. @vindex fill-nobreak-predicate - The variable @code{fill-nobreak-predicate} is a hook (an abnormal -hook, @pxref{Hooks}) specifying additional conditions where -line-breaking is not allowed. Each function is called with no -arguments, with point at a place where Emacs is considering breaking -the line. If a function returns a non-@code{nil} value, then that's -a bad place to break the line. Two standard functions you can use are + To specify additional conditions where line-breaking is not allowed, +customize the abnormal hook variable @code{fill-nobreak-predicate} +(@pxref{Hooks}). Each function in this hook is called with no +arguments, with point positioned where Emacs is considering breaking a +line. If a function returns a non-@code{nil} value, Emacs will not +break the line there. Two functions you can use are @code{fill-single-word-nobreak-p} (don't break after the first word of a sentence or before the last) and @code{fill-french-nobreak-p} (don't break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). @@ -568,12 +562,11 @@ @subsection The Fill Prefix @cindex fill prefix - To fill a paragraph in which each line starts with a special marker -(which might be a few spaces, giving an indented paragraph), you can use -the @dfn{fill prefix} feature. The fill prefix is a string that Emacs -expects every line to start with, and which is not included in filling. -You can specify a fill prefix explicitly; Emacs can also deduce the -fill prefix automatically (@pxref{Adaptive Fill}). + The @dfn{fill prefix} feature allows paragraphs to be filled so that +each line starts with a special string of characters (such as a +sequence of spaces, giving an indented paragraph). You can specify a +fill prefix explicitly; otherwise, Emacs tries to deduce one +automatically (@pxref{Adaptive Fill}). @table @kbd @item C-x . @@ -597,15 +590,15 @@ prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line. When a fill prefix is in effect, the fill commands remove the fill -prefix from each line of the paragraph before filling and insert it on -each line after filling. (The beginning of the first line of the +prefix from each line of the paragraph before filling, and insert it +on each line after filling. (The beginning of the first line of the paragraph is left unchanged, since often that is intentionally different.) Auto Fill mode also inserts the fill prefix automatically -when it makes a new line. The @kbd{C-o} command inserts the fill -prefix on new lines it creates, when you use it at the beginning of a -line (@pxref{Blank Lines}). Conversely, the command @kbd{M-^} deletes -the prefix (if it occurs) after the newline that it deletes -(@pxref{Indentation}). +when it makes a new line (@pxref{Auto Fill}). The @kbd{C-o} command +inserts the fill prefix on new lines it creates, when you use it at +the beginning of a line (@pxref{Blank Lines}). Conversely, the +command @kbd{M-^} deletes the prefix (if it occurs) after the newline +that it deletes (@pxref{Indentation}). For example, if @code{fill-column} is 40 and you set the fill prefix to @samp{;; }, then @kbd{M-q} in the following text @@ -755,17 +748,16 @@ @findex downcase-word @findex upcase-word @findex capitalize-word - The word conversion commands are the most useful. @kbd{M-l} -(@code{downcase-word}) converts the word after point to lower case, moving -past it. Thus, repeating @kbd{M-l} converts successive words. -@kbd{M-u} (@code{upcase-word}) converts to all capitals instead, while -@kbd{M-c} (@code{capitalize-word}) puts the first letter of the word -into upper case and the rest into lower case. All these commands convert -several words at once if given an argument. They are especially convenient -for converting a large amount of text from all upper case to mixed case, -because you can move through the text using @kbd{M-l}, @kbd{M-u} or -@kbd{M-c} on each word as appropriate, occasionally using @kbd{M-f} instead -to skip a word. + @kbd{M-l} (@code{downcase-word}) converts the word after point to +lower case, moving past it. Thus, repeating @kbd{M-l} converts +successive words. @kbd{M-u} (@code{upcase-word}) converts to all +capitals instead, while @kbd{M-c} (@code{capitalize-word}) puts the +first letter of the word into upper case and the rest into lower case. +All these commands convert several words at once if given an argument. +They are especially convenient for converting a large amount of text +from all upper case to mixed case, because you can move through the +text using @kbd{M-l}, @kbd{M-u} or @kbd{M-c} on each word as +appropriate, occasionally using @kbd{M-f} instead to skip a word. When given a negative argument, the word case conversion commands apply to the appropriate number of words before point, but do not move point. @@ -799,9 +791,10 @@ @cindex mode, Text @findex text-mode - When you edit files of text in a human language, it's more convenient -to use Text mode rather than Fundamental mode. To enter Text mode, type -@kbd{M-x text-mode}. + Text mode is a major mode for editing files of text in a human +language. Files which have names ending in the extension @file{.txt} +are usually opened in Text mode (@pxref{Choosing Modes}). To +explicitly switch to Text mode, type @kbd{M-x text-mode}. In Text mode, only blank lines and page delimiters separate paragraphs. As a result, paragraphs can be indented, and adaptive @@ -809,46 +802,49 @@ @xref{Adaptive Fill}. @kindex TAB @r{(Text mode)} - Text mode defines @key{TAB} to run @code{indent-relative} -(@pxref{Indentation}), so that you can conveniently indent a line like -the previous line. + In Text mode, the @key{TAB} (@code{indent-for-tab-command}) command +usually inserts whitespace up to the next tab stop, instead of +indenting the current line. @xref{Indentation}, for details. Text mode turns off the features concerned with comments except when you explicitly invoke them. It changes the syntax table so that -single-quotes are considered part of words. However, if a word starts -with single-quotes, these are treated as a prefix for purposes such as -capitalization. That is, @kbd{M-c} will convert @samp{'hello'} into -@samp{'Hello'}, as expected. +single-quotes are considered part of words (e.g. @samp{don't} is +considered one word). However, if a word starts with a single-quote, +it is treated as a prefix for the purposes of capitalization +(e.g. @kbd{M-c} converts @samp{'hello'} into @samp{'Hello'}, as +expected). @cindex Paragraph-Indent Text mode @cindex mode, Paragraph-Indent Text @findex paragraph-indent-text-mode @findex paragraph-indent-minor-mode If you indent the first lines of paragraphs, then you should use -Paragraph-Indent Text mode rather than Text mode. In this mode, you -do not need to have blank lines between paragraphs, because the -first-line indentation is sufficient to start a paragraph; however -paragraphs in which every line is indented are not supported. Use -@kbd{M-x paragraph-indent-text-mode} to enter this mode. Use @kbd{M-x -paragraph-indent-minor-mode} to enable an equivalent minor mode in -situations where you can't change the major mode---in mail +Paragraph-Indent Text mode (@kbd{M-x paragraph-indent-text-mode}) +rather than Text mode. In that mode, you do not need to have blank +lines between paragraphs, because the first-line indentation is +sufficient to start a paragraph; however paragraphs in which every +line is indented are not supported. Use @kbd{M-x +paragraph-indent-minor-mode} to enable an equivalent minor mode for +situations where you shouldn't change the major mode---in mail composition, for instance. @kindex M-TAB @r{(Text mode)} - Text mode, and all the modes based on it, define @kbd{M-@key{TAB}} -as the command @code{ispell-complete-word}, which performs completion -of the partial word in the buffer before point, using the spelling -dictionary as the space of possible words. @xref{Spelling}. If your -window manager defines @kbd{M-@key{TAB}} to switch windows, you can -type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}. + Text mode binds @kbd{M-@key{TAB}} to @code{ispell-complete-word}. +This command performs completion of the partial word in the buffer +before point, using the spelling dictionary as the space of possible +words. @xref{Spelling}. If your window manager defines +@kbd{M-@key{TAB}} to switch windows, you can type @kbd{@key{ESC} +@key{TAB}} or @kbd{C-M-i} instead. @vindex text-mode-hook - Entering Text mode runs the hook @code{text-mode-hook}. Other major -modes related to Text mode also run this hook, followed by hooks of -their own; this includes Paragraph-Indent Text mode, Nroff mode, -@TeX{} mode, Outline mode, and Message mode. Hook functions on -@code{text-mode-hook} can look at the value of @code{major-mode} to -see which of these modes is actually being entered. @xref{Hooks}. + Entering Text mode runs the mode hook @code{text-mode-hook} +(@pxref{Major Modes}). + + The following sections describe several major modes that are +@dfn{derived} from Text mode. These derivatives share most of the +features of Text mode described above. In particular, derivatives of +Text mode run @code{text-mode-hook} prior to running their own mode +hooks. @node Outline Mode @section Outline Mode @@ -859,29 +855,34 @@ @findex outline-mode @findex outline-minor-mode @vindex outline-minor-mode-prefix - Outline mode is a major mode much like Text mode but intended for -editing outlines. It allows you to make parts of the text temporarily -invisible so that you can see the outline structure. Type @kbd{M-x -outline-mode} to switch to Outline mode as the major mode of the current -buffer. +@vindex outline-mode-hook + Outline mode is a major mode derived from Text mode, which is +specialized for editing outlines. It provides commands to navigate +between entries in the outline structure, and commands to make parts +of a buffer temporarily invisible, so that the outline structure may +be more easily viewed. Type @kbd{M-x outline-mode} to switch to +Outline mode. Entering Outline mode runs the hook +@code{text-mode-hook} followed by the hook @code{outline-mode-hook} +(@pxref{Hooks}). - When Outline mode makes a line invisible, the line does not appear -on the screen. The screen appears exactly as if the invisible line -were deleted, except that an ellipsis (three periods in a row) appears -at the end of the previous visible line. (Multiple consecutive -invisible lines produce just one ellipsis.) + When you use an Outline mode command to make a line invisible +(@pxref{Outline Visibility}), the line disappears from the screen. An +ellipsis (three periods in a row) is displayed at the end of the +previous visible line, to indicate the hidden text. Multiple +consecutive invisible lines produce just one ellipsis. Editing commands that operate on lines, such as @kbd{C-n} and -@kbd{C-p}, treat the text of the invisible line as part of the previous -visible line. Killing the ellipsis at the end of a visible line -really kills all the following invisible lines. +@kbd{C-p}, treat the text of the invisible line as part of the +previous visible line. Killing the ellipsis at the end of a visible +line really kills all the following invisible text associated with the +ellipsis. - Outline minor mode provides the same commands as the major mode, -Outline mode, but you can use it in conjunction with other major modes. -Type @kbd{M-x outline-minor-mode} to enable the Outline minor mode in -the current buffer. You can also specify this in the text of a file, -with a file local variable of the form @samp{mode: outline-minor} -(@pxref{File Variables}). + Outline minor mode is a buffer-local minor mode which provides the +same commands as the major mode, Outline mode, but can be used in +conjunction with other major modes. You can type @kbd{M-x +outline-minor-mode} to toggle Outline minor mode in the current +buffer, or use a file-local variable setting to enable it in a +specific file (@pxref{File Variables}). @kindex C-c @@ @r{(Outline minor mode)} The major mode, Outline mode, provides special key bindings on the @@ -890,17 +891,12 @@ major mode's special commands. (The variable @code{outline-minor-mode-prefix} controls the prefix used.) -@vindex outline-mode-hook - Entering Outline mode runs the hook @code{text-mode-hook} followed by -the hook @code{outline-mode-hook} (@pxref{Hooks}). - @menu -* Format: Outline Format. What the text of an outline looks like. -* Motion: Outline Motion. Special commands for moving through - outlines. -* Visibility: Outline Visibility. Commands to control what is visible. -* Views: Outline Views. Outlines and multiple views. -* Foldout:: Folding means zooming in on outlines. +* Outline Format:: What the text of an outline looks like. +* Outline Motion:: Special commands for moving through outlines. +* Outline Visibility:: Commands to control what is visible. +* Outline Views:: Outlines and multiple views. +* Foldout:: Folding means zooming in on outlines. @end menu @node Outline Format @@ -910,13 +906,13 @@ @cindex body lines (Outline mode) Outline mode assumes that the lines in the buffer are of two types: @dfn{heading lines} and @dfn{body lines}. A heading line represents a -topic in the outline. Heading lines start with one or more stars; the -number of stars determines the depth of the heading in the outline -structure. Thus, a heading line with one star is a major topic; all the -heading lines with two stars between it and the next one-star heading -are its subtopics; and so on. Any line that is not a heading line is a -body line. Body lines belong with the preceding heading line. Here is -an example: +topic in the outline. Heading lines start with one or more asterisk +(@samp{*}) characters; the number of asterisks determines the depth of +the heading in the outline structure. Thus, a heading line with one +@samp{*} is a major topic; all the heading lines with two @samp{*}s +between it and the next one-@samp{*} heading are its subtopics; and so +on. Any line that is not a heading line is a body line. Body lines +belong with the preceding heading line. Here is an example: @example * Food @@ -998,12 +994,10 @@ @findex outline-previous-visible-heading @kindex C-c C-n @r{(Outline mode)} @kindex C-c C-p @r{(Outline mode)} - @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to the next -heading line. @kbd{C-c C-p} (@code{outline-previous-visible-heading}) moves -similarly backward. Both accept numeric arguments as repeat counts. The -names emphasize that invisible headings are skipped, but this is not really -a special feature. All editing commands that look for lines ignore the -invisible lines automatically. + @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to +the next heading line. @kbd{C-c C-p} +(@code{outline-previous-visible-heading}) moves similarly backward. +Both accept numeric arguments as repeat counts. @findex outline-up-heading @findex outline-forward-same-level @@ -1011,21 +1005,19 @@ @kindex C-c C-f @r{(Outline mode)} @kindex C-c C-b @r{(Outline mode)} @kindex C-c C-u @r{(Outline mode)} - More powerful motion commands understand the level structure of headings. -@kbd{C-c C-f} (@code{outline-forward-same-level}) and + The commands @kbd{C-c C-f} (@code{outline-forward-same-level}) and @kbd{C-c C-b} (@code{outline-backward-same-level}) move from one -heading line to another visible heading at the same depth in -the outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves -backward to another heading that is less deeply nested. +heading line to another visible heading at the same depth in the +outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves backward to +another heading that is less deeply nested. @node Outline Visibility @subsection Outline Visibility Commands - The other special commands of outline mode are used to make lines visible -or invisible. Their names all start with @code{hide} or @code{show}. -Most of them fall into pairs of opposites. They are not undoable; instead, -you can undo right past them. Making lines visible or invisible is simply -not recorded by the undo mechanism. + Outline mode provides several commands for temporarily hiding or +revealing parts of the buffer, based on the outline structure. These +commands are not undoable; their effects are simply not recorded by +the undo mechanism, so you can undo right past them (@pxref{Undo}). Many of these commands act on the ``current'' heading line. If point is on a heading line, that is the current heading line; if point @@ -1069,72 +1061,64 @@ @findex show-entry @kindex C-c C-c @r{(Outline mode)} @kindex C-c C-e @r{(Outline mode)} - Two commands that are exact opposites are @kbd{C-c C-c} -(@code{hide-entry}) and @kbd{C-c C-e} (@code{show-entry}). They apply -to the body lines directly following the current heading line. -Subheadings and their bodies are not affected. + The simplest of these commands are @kbd{C-c C-c} +(@code{hide-entry}), which hides the body lines directly following the +current heading line, and @kbd{C-c C-e} (@code{show-entry}), which +reveals them. Subheadings and their bodies are not affected. @findex hide-subtree @findex show-subtree @kindex C-c C-s @r{(Outline mode)} @kindex C-c C-d @r{(Outline mode)} @cindex subtree (Outline mode) - Two more powerful opposites are @kbd{C-c C-d} (@code{hide-subtree}) -and @kbd{C-c C-s} (@code{show-subtree}). Both apply to the current -heading line's @dfn{subtree}: its body, all its subheadings, both -direct and indirect, and all of their bodies. In other words, the -subtree contains everything following the current heading line, up to -and not including the next heading of the same or higher rank. + The commands @kbd{C-c C-d} (@code{hide-subtree}) and @kbd{C-c C-s} +(@code{show-subtree}) are more powerful. They apply to the current +heading line's @dfn{subtree}: its body, all of its subheadings, both +direct and indirect, and all of their bodies. @findex hide-leaves @findex show-branches +@findex show-children @kindex C-c C-l @r{(Outline mode)} @kindex C-c C-k @r{(Outline mode)} - Intermediate between a visible subtree and an invisible one is having -all the subheadings visible but none of the body. There are two -commands for doing this, depending on whether you want to hide the -bodies or make the subheadings visible. They are @kbd{C-c C-l} -(@code{hide-leaves}) and @kbd{C-c C-k} (@code{show-branches}). - @kindex C-c C-i @r{(Outline mode)} -@findex show-children - A little weaker than @code{show-branches} is @kbd{C-c C-i} -(@code{show-children}). It makes just the direct subheadings -visible---those one level down. Deeper subheadings remain invisible, if -they were invisible. + The command @kbd{C-c C-l} (@code{hide-leaves}) hides the body of the +current heading line as well as all the bodies in its subtree; the +subheadings themselves are left visible. The command @kbd{C-c C-k} +(@code{show-branches}) reveals the subheadings, if they had previously +been hidden (e.g. by @kbd{C-c C-d}). The command @kbd{C-c C-i} +(@code{show-children}) is a weaker version of this; it reveals just +the direct subheadings, i.e. those one level down. + +@findex hide-other +@kindex C-c C-o @r{(Outline mode)} + The command @kbd{C-c C-o} (@code{hide-other}) hides everything +except the entry that point is in, plus its parents (the headers +leading up from there to top level in the outline) and the top level +headings. @findex hide-body @findex show-all @kindex C-c C-t @r{(Outline mode)} @kindex C-c C-a @r{(Outline mode)} - Two commands have a blanket effect on the whole file. @kbd{C-c C-t} -(@code{hide-body}) makes all body lines invisible, so that you see just -the outline structure (as a special exception, it will not hide lines -at the top of the file, preceding the first header line, even though -these are technically body lines). @kbd{C-c C-a} (@code{show-all}) -makes all lines visible. These commands can be thought of as a pair -of opposites even though @kbd{C-c C-a} applies to more than just body -lines. - @findex hide-sublevels @kindex C-c C-q @r{(Outline mode)} - The command @kbd{C-c C-q} (@code{hide-sublevels}) hides all but the -top level headings. With a numeric argument @var{n}, it hides everything -except the top @var{n} levels of heading lines. - -@findex hide-other -@kindex C-c C-o @r{(Outline mode)} - The command @kbd{C-c C-o} (@code{hide-other}) hides everything except -the heading and body text that point is in, plus its parents (the headers -leading up from there to top level in the outline) and the top level -headings. + The remaining commands affect the whole buffer. @kbd{C-c C-t} +(@code{hide-body}) makes all body lines invisible, so that you see +just the outline structure (as a special exception, it will not hide +lines at the top of the file, preceding the first header line, even +though these are technically body lines). @kbd{C-c C-a} +(@code{show-all}) makes all lines visible. @kbd{C-c C-q} +(@code{hide-sublevels}) hides all but the top level headings; with a +numeric argument @var{n}, it hides everything except the top @var{n} +levels of heading lines. @findex reveal-mode When incremental search finds text that is hidden by Outline mode, -it makes that part of the buffer visible. If you exit the search -at that position, the text remains visible. You can also -automatically make text visible as you navigate in it by using -@kbd{M-x reveal-mode}. +it makes that part of the buffer visible. If you exit the search at +that position, the text remains visible. You can also automatically +make text visible as you navigate in it by using Reveal mode (@kbd{M-x +reveal-mode}), a buffer-local minor mode. @node Outline Views @subsection Viewing One Outline in Multiple Views @@ -1254,7 +1238,7 @@ To use the Foldout package, you can type @kbd{M-x load-library @key{RET} foldout @key{RET}}; or you can arrange for to do that -automatically by putting this in your @file{.emacs} file: +automatically by putting this in your init file (@pxref{Init File}): @example (eval-after-load "outline" '(require 'foldout)) ------------------------------------------------------------ revno: 106580 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9160 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-12-02 09:44:19 -0500 message: * lisp/pcmpl-gnu.el (pcomplete/tar): large-file-warn-threshold can be nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 14:18:18 +0000 +++ lisp/ChangeLog 2011-12-02 14:44:19 +0000 @@ -1,5 +1,8 @@ 2011-12-02 Stefan Monnier + * pcmpl-gnu.el (pcomplete/tar): large-file-warn-threshold can be nil + (bug#9160). + * dired-aux.el (dired-query): Don't assume help-char is modifier-free (bug#10191). === modified file 'lisp/pcmpl-gnu.el' --- lisp/pcmpl-gnu.el 2011-10-02 01:04:01 +0000 +++ lisp/pcmpl-gnu.el 2011-12-02 14:44:19 +0000 @@ -309,7 +309,8 @@ (let* ((fa (file-attributes (pcomplete-arg 1))) (size (nth 7 fa))) (and (numberp size) - (< size large-file-warning-threshold)))) + (or (null large-file-warning-threshold) + (< size large-file-warning-threshold))))) (let ((file (pcomplete-arg 1))) (completion-table-dynamic (lambda (_string) ------------------------------------------------------------ revno: 106579 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10191 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-12-02 09:18:18 -0500 message: * lisp/dired-aux.el (dired-query): Don't assume help-char is modifier-free. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 10:45:44 +0000 +++ lisp/ChangeLog 2011-12-02 14:18:18 +0000 @@ -1,3 +1,8 @@ +2011-12-02 Stefan Monnier + + * dired-aux.el (dired-query): Don't assume help-char is modifier-free + (bug#10191). + 2011-12-02 Juri Linkov * info.el (Info-search): Display "end of manual" when Isearch @@ -194,8 +199,8 @@ (gdb-gud-context-command, gdb-non-stop-handler) (gdb-current-context-command, gdb-stopped): Use it. (gdb-init-1): Enable pretty printing here. - (gdb-non-stop-handler): Don't enable pretty-printing here. Check - to see if the target supports non-stop mode; if not, turn off + (gdb-non-stop-handler): Don't enable pretty-printing here. + Check to see if the target supports non-stop mode; if not, turn off non-stop mode. Use the following. (gdb-check-target-async): New defun. (gud-watch, gdb-stopped): Fix whitespace. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2011-11-17 09:09:20 +0000 +++ lisp/dired-aux.el 2011-12-02 14:18:18 +0000 @@ -927,8 +927,7 @@ (concat (apply 'format prompt args) (if help-form (format " [Type yn!q or %s] " - (key-description - (char-to-string help-char))) + (key-description (vector help-char))) " [Type y, n, q or !] "))) (set sym (setq char (read-char-choice prompt char-choices))) (if (memq char '(?y ?\s ?!)) t))))) ------------------------------------------------------------ revno: 106578 fixes bug(s): http://debbugs.gnu.org/9918 committer: Juri Linkov branch nick: trunk timestamp: Fri 2011-12-02 12:45:44 +0200 message: * lisp/info.el (Info-search): Display "end of manual" when Isearch reaches the end of single-file Info manual. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 10:35:17 +0000 +++ lisp/ChangeLog 2011-12-02 10:45:44 +0000 @@ -1,3 +1,8 @@ +2011-12-02 Juri Linkov + + * info.el (Info-search): Display "end of manual" when Isearch + reaches the end of single-file Info manual. (Bug#9918) + 2011-12-02 Eli Zaretskii * isearch.el (isearch-message-prefix): Run the input method part === modified file 'lisp/info.el' --- lisp/info.el 2011-11-23 07:03:56 +0000 +++ lisp/info.el 2011-12-02 10:45:44 +0000 @@ -1769,12 +1769,14 @@ ;; If no subfiles, give error now. (if give-up (if (null Info-current-subfile) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) - (if backward - (re-search-backward regexp) - (re-search-forward regexp))) + (if isearch-mode + (signal 'search-failed (list regexp "end of manual")) + (let ((search-spaces-regexp + (if (or (not isearch-mode) isearch-regexp) + Info-search-whitespace-regexp))) + (if backward + (re-search-backward regexp) + (re-search-forward regexp)))) (setq found nil))) (if (and bound (not found)) @@ -1845,7 +1847,7 @@ (if found (message "") (signal 'search-failed (if isearch-mode - (list regexp "end of the manual") + (list regexp "end of manual") (list regexp))))) (if (not found) (progn (Info-read-subfile osubfile) ------------------------------------------------------------ revno: 106577 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-12-02 12:37:53 +0200 message: Fix commentary for the last commit. diff: === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-12-02 10:35:17 +0000 +++ lisp/isearch.el 2011-12-02 10:37:53 +0000 @@ -2227,7 +2227,7 @@ (if current-input-method ;; Input methods for RTL languages use RTL ;; characters for their title, and that messes - ;; up the display of the prompt. + ;; up the display of search text after the prompt. (bidi-string-mark-left-to-right (concat " [" current-input-method-title "]: ")) ": ") ------------------------------------------------------------ revno: 106576 fixes bug(s): http://debbugs.gnu.org/10183 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-12-02 12:35:17 +0200 message: Fix part 3 of bug #10183 with input-method prompt in I-search. lisp/isearch.el (isearch-message-prefix): Run the input method part of the prompt through bidi-string-mark-left-to-right. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-02 10:19:49 +0000 +++ lisp/ChangeLog 2011-12-02 10:35:17 +0000 @@ -1,3 +1,8 @@ +2011-12-02 Eli Zaretskii + + * isearch.el (isearch-message-prefix): Run the input method part + of the prompt through bidi-string-mark-left-to-right. (Bug#10183) + 2011-12-02 Juri Linkov * isearch.el (isearch-occur): Use `word-search-regexp' for === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-12-02 10:19:49 +0000 +++ lisp/isearch.el 2011-12-02 10:35:17 +0000 @@ -2225,7 +2225,11 @@ (if nonincremental "search" "I-search") (if isearch-forward "" " backward") (if current-input-method - (concat " [" current-input-method-title "]: ") + ;; Input methods for RTL languages use RTL + ;; characters for their title, and that messes + ;; up the display of the prompt. + (bidi-string-mark-left-to-right + (concat " [" current-input-method-title "]: ")) ": ") ))) (propertize (concat (upcase (substring m 0 1)) (substring m 1)) ------------------------------------------------------------ revno: 106575 fixes bug(s): http://debbugs.gnu.org/10145 committer: Juri Linkov branch nick: trunk timestamp: Fri 2011-12-02 12:19:49 +0200 message: Change `wordify' to `word-search-regexp'. * lisp/isearch.el (isearch-occur): Use `word-search-regexp' for `isearch-word'. (isearch-search-and-update): Add condition for `isearch-word' and call `word-search-regexp'. * src/search.c (Fword_search_regexp): New Lisp function created from `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'. (Fword_search_backward, Fword_search_forward) (Fword_search_backward_lax, Fword_search_forward_lax): Use `Fword_search_regexp' instead of `wordify'. Doc fix. (syms_of_search): Define `Sword_search_regexp'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-01 22:34:24 +0000 +++ lisp/ChangeLog 2011-12-02 10:19:49 +0000 @@ -1,3 +1,10 @@ +2011-12-02 Juri Linkov + + * isearch.el (isearch-occur): Use `word-search-regexp' for + `isearch-word'. + (isearch-search-and-update): Add condition for `isearch-word' and + call `word-search-regexp'. (Bug#10145) + 2011-12-01 Glenn Morris * eshell/em-hist.el (eshell-hist-initialize): === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-11-29 18:39:16 +0000 +++ lisp/isearch.el 2011-12-02 10:19:49 +0000 @@ -1438,12 +1438,7 @@ (interactive (list (cond - (isearch-word (concat "\\b" (replace-regexp-in-string - "\\W+" "\\W+" - (replace-regexp-in-string - "^\\W+\\|\\W+$" "" isearch-string) - nil t) - "\\b")) + (isearch-word (word-search-regexp isearch-string)) (isearch-regexp isearch-string) (t (regexp-quote isearch-string))) (if current-prefix-arg (prefix-numeric-value current-prefix-arg)))) @@ -1642,8 +1637,10 @@ (if (and (eq case-fold-search t) search-upper-case) (setq case-fold-search (isearch-no-upper-case-p isearch-string isearch-regexp))) - (looking-at (if isearch-regexp isearch-string - (regexp-quote isearch-string)))) + (looking-at (cond + (isearch-word (word-search-regexp isearch-string t)) + (isearch-regexp isearch-string) + (t (regexp-quote isearch-string))))) (error nil)) (or isearch-yank-flag (<= (match-end 0) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-01 20:19:38 +0000 +++ src/ChangeLog 2011-12-02 10:19:49 +0000 @@ -1,3 +1,12 @@ +2011-12-02 Juri Linkov + + * search.c (Fword_search_regexp): New Lisp function created from + `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'. + (Fword_search_backward, Fword_search_forward) + (Fword_search_backward_lax, Fword_search_forward_lax): + Use `Fword_search_regexp' instead of `wordify'. Doc fix. + (syms_of_search): Define `Sword_search_regexp'. (Bug#10145) + 2011-12-01 Stefan Monnier * fileio.c (Finsert_file_contents): Move after-change-function call === modified file 'src/search.c' --- src/search.c 2011-11-27 18:17:40 +0000 +++ src/search.c 2011-12-02 10:19:49 +0000 @@ -83,11 +83,10 @@ Qnil if no searching has been done yet. */ static Lisp_Object last_thing_searched; -/* error condition signaled when regexp compile_pattern fails */ - +/* Error condition signaled when regexp compile_pattern fails. */ static Lisp_Object Qinvalid_regexp; -/* Error condition used for failing searches */ +/* Error condition used for failing searches. */ static Lisp_Object Qsearch_failed; static void set_search_regs (EMACS_INT, EMACS_INT); @@ -2078,13 +2077,16 @@ XSETBUFFER (last_thing_searched, current_buffer); } -/* Given STRING, a string of words separated by word delimiters, - compute a regexp that matches those exact words separated by - arbitrary punctuation. If LAX is nonzero, the end of the string - need not match a word boundary unless it ends in whitespace. */ +DEFUN ("word-search-regexp", Fword_search_regexp, Sword_search_regexp, 1, 2, 0, + doc: /* Return a regexp which matches words, ignoring punctuation. +Given STRING, a string of words separated by word delimiters, +compute a regexp that matches those exact words separated by +arbitrary punctuation. If LAX is non-nil, the end of the string +need not match a word boundary unless it ends in whitespace. -static Lisp_Object -wordify (Lisp_Object string, int lax) +Used in `word-search-forward', `word-search-backward', +`word-search-forward-lax', `word-search-backward-lax'. */) + (Lisp_Object string, Lisp_Object lax) { register unsigned char *o; register EMACS_INT i, i_byte, len, punct_count = 0, word_count = 0; @@ -2125,7 +2127,7 @@ } adjust = - punct_count + 5 * (word_count - 1) - + ((lax && !whitespace_at_end) ? 2 : 4); + + ((!NILP (lax) && !whitespace_at_end) ? 2 : 4); if (STRING_MULTIBYTE (string)) val = make_uninit_multibyte_string (len + adjust, SBYTES (string) @@ -2162,7 +2164,7 @@ prev_c = c; } - if (!lax || whitespace_at_end) + if (NILP (lax) || whitespace_at_end) { *o++ = '\\'; *o++ = 'b'; @@ -2217,10 +2219,14 @@ The match found must not extend before that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 0), bound, noerror, count, -1, 1, 0); + return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, -1, 1, 0); } DEFUN ("word-search-forward", Fword_search_forward, Sword_search_forward, 1, 4, @@ -2231,10 +2237,14 @@ The match found must not extend after that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 0), bound, noerror, count, 1, 1, 0); + return search_command (Fword_search_regexp (string, Qnil), bound, noerror, count, 1, 1, 0); } DEFUN ("word-search-backward-lax", Fword_search_backward_lax, Sword_search_backward_lax, 1, 4, @@ -2249,10 +2259,14 @@ The match found must not extend before that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 1), bound, noerror, count, -1, 1, 0); + return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, -1, 1, 0); } DEFUN ("word-search-forward-lax", Fword_search_forward_lax, Sword_search_forward_lax, 1, 4, @@ -2267,10 +2281,14 @@ The match found must not extend after that position. Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. */) +Optional fourth argument is repeat count--search for successive occurrences. + +Relies on the function `word-search-regexp' to convert a sequence +of words in STRING to a regexp used to search words without regard +to punctuation. */) (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { - return search_command (wordify (string, 1), bound, noerror, count, 1, 1, 0); + return search_command (Fword_search_regexp (string, Qt), bound, noerror, count, 1, 1, 0); } DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, @@ -3229,6 +3247,7 @@ defsubr (&Sposix_string_match); defsubr (&Ssearch_forward); defsubr (&Ssearch_backward); + defsubr (&Sword_search_regexp); defsubr (&Sword_search_forward); defsubr (&Sword_search_backward); defsubr (&Sword_search_forward_lax); ------------------------------------------------------------ revno: 106574 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2011-12-02 04:00:32 +0000 message: Gnus: Update the header format of icon data for the most recent icontopbm program. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-12-01 04:55:39 +0000 +++ lisp/gnus/ChangeLog 2011-12-02 04:00:32 +0000 @@ -1,3 +1,9 @@ +2011-12-02 Katsumi Yamaoka + + * compface.el (uncompface): + * gnus-art.el (gnus-article-x-face-command): Update the header format + of icon data for the most recent icontopbm program. + 2011-12-01 Katsumi Yamaoka * gnus-msg.el (gnus-inews-do-gcc): === modified file 'lisp/gnus/compface.el' --- lisp/gnus/compface.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/compface.el 2011-12-02 04:00:32 +0000 @@ -42,7 +42,8 @@ 'delete '(t nil) nil)) (progn (goto-char (point-min)) - (insert "/* Width=48, Height=48 */\n") + (insert "/* Format_version=1, Width=48, Height=48, Depth=1,\ + Valid_bits_per_item=16 */\n") ;; I just can't get "icontopbm" to work correctly on its ;; own in XEmacs. And Emacs doesn't understand un-raw pbm ;; files. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-11-30 06:05:47 +0000 +++ lisp/gnus/gnus-art.el 2011-12-02 04:00:32 +0000 @@ -268,11 +268,14 @@ (if (or (gnus-image-type-available-p 'xface) (gnus-image-type-available-p 'pbm)) 'gnus-display-x-face-in-from - "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -") + "{ echo \ +'/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\ +; uncompface; } | icontopbm | ee -") (if (gnus-image-type-available-p 'pbm) 'gnus-display-x-face-in-from - "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \ -display -")) + "{ echo \ +'/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\ +; uncompface; } | icontopbm | display -")) "*String or function to be executed to display an X-Face header. If it is a string, the command will be executed in a sub-shell asynchronously. The compressed face will be piped to this command."