From 1ecc6145d808a276cb1ce4bfc9052dc1e9515388 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 28 Apr 2006 04:06:16 +0000 Subject: [PATCH 01/83] * net/tramp.el (tramp-completion-file-name-handler): Disable Tramp's functionality while loading Tramp itself. (tramp-register-file-name-handlers): That's a defsubst now. Code from `tramp-repair-jka-compr' moved here. Apply it via `after-init-hook'. (tramp-repair-jka-compr): Removed. --- lisp/ChangeLog | 9 ++++++++ lisp/net/tramp.el | 56 ++++++++++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b384c6d8c3..ac0bbfb9700 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2006-04-28 Michael Albinus + + * net/tramp.el (tramp-completion-file-name-handler): Disable + Tramp's functionality while loading Tramp itself. + (tramp-register-file-name-handlers): That's a defsubst now. Code + from `tramp-repair-jka-compr' moved here. Apply it via + `after-init-hook'. + (tramp-repair-jka-compr): Removed. + 2006-04-27 Jay Belanger * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5f3ab41e5cb..ad4eaaa4862 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4324,24 +4324,34 @@ Fall back to normal file name handler if no Tramp handler exists." (tramp-run-real-handler operation args)))))) (setq tramp-locked tl)))) +;; Preload this DEFUN with the progn trick. This avoids cyclic +;; loading, because the `load-in-progress' check can be performed. ;;;###autoload -(defun tramp-completion-file-name-handler (operation &rest args) +(progn (defun tramp-completion-file-name-handler (operation &rest args) "Invoke tramp file name completion handler. Falls back to normal file name handler if no tramp file name handler exists." ;; (setq tramp-debug-buffer t) ;; (tramp-message 1 "%s %s" operation args) ;; (tramp-message 1 "%s %s\n%s" ;; operation args (with-output-to-string (backtrace))) - (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) - (if fn - (save-match-data (apply (cdr fn) args)) - (tramp-completion-run-real-handler operation args)))) + (if load-in-progress + ;; We are while loading Tramp. + (let (file-name-handler-alist) + (apply operation args)) + ;; If Tramp is not loaded yet, do it now. + (require 'tramp) + (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) + (if fn + (save-match-data (apply (cdr fn) args)) + (tramp-completion-run-real-handler operation args)))))) ;; Register in `file-name-handler-alist'. ;; `tramp-completion-file-name-handler' must not be active when temacs -;; dumps. And it makes no sense in batch mode anyway. +;; dumps. And it makes no sense in batch mode anyway. This must be +;; an autoloaded DEFSUBST, because Tramp would be loaded otherwise +;; applying the `after-init-hook'. ;;;###autoload -(defun tramp-register-file-name-handlers () +(defsubst tramp-register-file-name-handlers () "Add tramp file name handlers to `file-name-handler-alist'." (unless noninteractive (add-to-list 'file-name-handler-alist @@ -4349,18 +4359,20 @@ Falls back to normal file name handler if no tramp file name handler exists." (add-to-list 'file-name-handler-alist (cons tramp-completion-file-name-regexp 'tramp-completion-file-name-handler)) - (put 'tramp-completion-file-name-handler 'safe-magic t))) + (put 'tramp-completion-file-name-handler 'safe-magic t) + ;; If jka-compr is already loaded, move it to the front of + ;; `file-name-handler-alist'. + (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) + (when jka + (setq file-name-handler-alist + (cons jka (delete jka file-name-handler-alist))))))) -;; LAMBDA function used temporarily, because older/other versions of -;; Tramp don't know of `tramp-register-file-name-handlers'. Can be -;; replaced once that DEFUN is established. Relevant for Emacs 22 only. -;;;###;autoload(add-hook 'emacs-startup-hook 'tramp-register-file-name-handlers) +;; `tramp-register-file-name-handlers' cannot be autoloaded as-it-is, +;; because the `noninteractive' check would prevent functionality to +;; be dumped in temacs. ;;;###autoload(add-hook -;;;###autoload 'emacs-startup-hook -;;;###autoload '(lambda () -;;;###autoload (condition-case nil -;;;###autoload (funcall 'tramp-register-file-name-handlers) -;;;###autoload (error nil)))) +;;;###autoload 'after-init-hook +;;;###autoload '(lambda () (tramp-register-file-name-handlers))) (tramp-register-file-name-handlers) ;;;###autoload @@ -4374,16 +4386,6 @@ Falls back to normal file name handler if no tramp file name handler exists." (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) -(defun tramp-repair-jka-compr () - "If jka-compr is already loaded, move it to the front of -`file-name-handler-alist'. On Emacs 22 or so this will not be -necessary anymore." - (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) - (when jka - (setq file-name-handler-alist - (cons jka (delete jka file-name-handler-alist)))))) -(tramp-repair-jka-compr) - ;;; Interactions with other packages: From 6ed3e595681c9c76a5056c9a6b30e92cc8481780 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 28 Apr 2006 05:09:13 +0000 Subject: [PATCH 02/83] Fix a typo in a doc string. --- lisp/allout.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/allout.el b/lisp/allout.el index b6542c1a5dc..dc19c1fa15a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -301,7 +301,7 @@ alist, then use comment-start string, if any, then use default \(`.'). Set to the symbol for either of `allout-mode-leaders' or `comment-start' to use only one of them, respectively. -Value nil means to always use the default \(`.').t +Value nil means to always use the default \(`.'). comment-start strings that do not end in spaces are tripled, and an `_' underscore is tacked on the end, to distinguish them from regular From 264e9689874f73e556262656e0399c3d3a581d68 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 28 Apr 2006 22:20:57 +0000 Subject: [PATCH 03/83] *** empty log message *** --- lisp/ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac0bbfb9700..afb3b8dc165 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,34 @@ +2006-04-28 Kim F. Storm + + * progmodes/grep.el (defgroup grep): Doc fix. + (grep-auto-highlight): Remove. + (grep-template): New defcustom. + (grep-find-template): Rename from grep-tree-template. + (grep-files-aliases): Rename from grep-tree-files-aliases. + Remove "all" alias, add "l" alias. + (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove. + (grep-find-ignored-directories): New defcustom to replace + grep-tree-ignore-CVS-directories, to facilitate ignoring + subdirectories for multiple version control systems. + (grep-mode-map): Add Recursive grep item to GREP menu. + (grep-regexp-history, grep-files-history): New defvars. + (grep-probe): New helper function. + (grep-compute-defaults): Use it to simplify code. + Adapt to name changes. + Use `.' as base in grep-find-template rather than . + (grep): Remove superfluous highlight-regexp arg. Fix doc. + Call grep-compute-defaults unconditionally. + (grep-expand-keywords): New defconst. + (grep-expand-template): Rename from grep-expand-command-macros. + Simplify via grep-expand-keywords. Look at case-fold-search instead + of grep-tree-ignore-case to add -i option. + Bind case-fold-search to nil while matching keywords. + (grep-tree-last-regexp, grep-tree-last-files): Remove. + (grep-read-regexp, grep-read-files): New helper functions. + (rgrep): Rename from grep-tree. Rework to use proper histories. + Adapt to changes in defcustoms and functions above. + (lgrep): New command, as grep, but using same interactive api as rgrep. + 2006-04-28 Michael Albinus * net/tramp.el (tramp-completion-file-name-handler): Disable From 0acfb7cea6841c511cab1f30fca63b92e4fa9ce6 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 28 Apr 2006 22:22:01 +0000 Subject: [PATCH 04/83] (defgroup grep): Doc fix. (grep-auto-highlight): Remove. (grep-template): New defcustom. (grep-find-template): Rename from grep-tree-template. (grep-files-aliases): Rename from grep-tree-files-aliases. Remove "all" alias, add "l" alias. (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove. (grep-find-ignored-directories): New defcustom to replace grep-tree-ignore-CVS-directories, to facilitate ignoring subdirectories for multiple version control systems. (grep-mode-map): Add Recursive grep item to GREP menu. (grep-regexp-history, grep-files-history): New defvars. (grep-probe): New helper function. (grep-compute-defaults): Use it to simplify code. Adapt to name changes. Use `.' as base in grep-find-template rather than . (grep): Remove superfluous highlight-regexp arg. Fix doc. Call grep-compute-defaults unconditionally. (grep-expand-keywords): New defconst. (grep-expand-template): Rename from grep-expand-command-macros. Simplify via grep-expand-keywords. Look at case-fold-search instead of grep-tree-ignore-case to add -i option. Bind case-fold-search to nil while matching keywords. (grep-tree-last-regexp, grep-tree-last-files): Remove. (grep-read-regexp, grep-read-files): New helper functions. (rgrep): Rename from grep-tree. Rework to use proper histories. Adapt to changes in defcustoms and functions above. (lgrep): New command, as grep, but using same interactive api as rgrep. --- lisp/progmodes/grep.el | 489 ++++++++++++++++++++++++----------------- 1 file changed, 289 insertions(+), 200 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 6afa3f29348..e100910e8cf 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -35,7 +35,7 @@ (defgroup grep nil - "Run compiler as inferior of Emacs, parse error messages." + "Run grep as inferior of Emacs, parse error messages." :group 'tools :group 'processes) @@ -48,23 +48,6 @@ :version "22.1" :group 'grep) -(defcustom grep-auto-highlight t - "*Specify how many grep matches to highlight (and parse) initially. -\(Highlighting applies to an grep match when the mouse is over it.) -If this is a number N, all grep matches in the first N lines -are highlighted and parsed as soon as they arrive in Emacs. -If t, highlight and parse the whole grep output as soon as it arrives. -If nil, don't highlight or parse any of the grep buffer until you try to -move to the error messages. - -Those grep matches which are not parsed and highlighted initially -will be parsed and highlighted as soon as you try to move to them." - :type '(choice (const :tag "All" t) - (const :tag "None" nil) - (integer :tag "First N lines")) - :version "22.1" - :group 'grep) - (defcustom grep-highlight-matches 'auto-detect "If t, use special markers to highlight grep matches. @@ -108,6 +91,20 @@ call that function before using this variable in your program." (const :tag "Not Set" nil)) :group 'grep) +(defcustom grep-template nil + "The default command to run for \\[lgrep]. +The default value of this variable is set up by `grep-compute-defaults'; +call that function before using this variable in your program. +The following place holders should be present in the string: + - place to put -i if case insensitive grep. + - file names and wildcards to search. + - the regular expression searched for. + - place to insert null-device." + :type '(choice string + (const :tag "Not Set" nil)) + :version "22.1" + :group 'grep) + (defcustom grep-use-null-device 'auto-detect "If t, append the value of `null-device' to `grep' commands. This is done to ensure that the output of grep includes the filename of @@ -130,8 +127,8 @@ call that function before using this variable in your program." (const :tag "Not Set" nil)) :group 'grep) -(defcustom grep-tree-command nil - "The default find command for \\[grep-tree]. +(defcustom grep-find-template nil + "The default command to run for \\[rgrep]. The default value of this variable is set up by `grep-compute-defaults'; call that function before using this variable in your program. The following place holders should be present in the string: @@ -145,27 +142,22 @@ The following place holders should be present in the string: :version "22.1" :group 'grep) -(defcustom grep-tree-files-aliases '( +(defcustom grep-files-aliases '( + ("el" . "*.el") ("ch" . "*.[ch]") ("c" . "*.c") ("h" . "*.h") - ("m" . "[Mm]akefile*") ("asm" . "*.[sS]") - ("all" . "*") - ("el" . "*.el") + ("m" . "[Mm]akefile*") + ("l" . "[Cc]hange[Ll]og*") ) - "*Alist of aliases for the FILES argument to `grep-tree'." + "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'." :type 'alist :group 'grep) -(defcustom grep-tree-ignore-case t - "*If non-nil, `grep-tree' ignores case in matches." - :type 'boolean - :group 'grep) - -(defcustom grep-tree-ignore-CVS-directories t - "*If non-nil, `grep-tree' does no recurse into CVS directories." - :type 'boolean +(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}") + "*List of names of sub-directories which `rgrep' shall not recurse into." + :type '(repeat string) :group 'grep) (defcustom grep-error-screen-columns nil @@ -208,6 +200,8 @@ See `compilation-error-screen-columns'" '("Compile..." . compile)) (define-key map [menu-bar grep compilation-grep] '("Another grep..." . grep)) + (define-key map [menu-bar grep compilation-grep-find] + '("Recursive grep..." . grep-find)) (define-key map [menu-bar grep compilation-recompile] '("Repeat grep" . recompile)) (define-key map [menu-bar grep compilation-separator2] @@ -353,6 +347,11 @@ This variable's value takes effect when `grep-compute-defaults' is called.") ;;;###autoload (defvar grep-find-history nil) +;; History of lgrep and rgrep regexp and files args. +(defvar grep-regexp-history nil) +(defvar grep-files-history '("ch" "el")) + + ;;;###autoload (defun grep-process-setup () "Setup compilation variables and buffer for `grep'. @@ -378,6 +377,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (cons msg code)))) (run-hooks 'grep-setup-hook)) +(defun grep-probe (command args &optional func result) + (equal (condition-case nil + (apply (or func 'call-process) command args) + (error nil)) + (or result 0))) + ;;;###autoload (defun grep-compute-defaults () (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) @@ -385,73 +390,67 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (with-temp-buffer (let ((hello-file (expand-file-name "HELLO" data-directory))) (not - (and (equal (condition-case nil - (if grep-command - ;; `grep-command' is already set, so - ;; use that for testing. - (call-process-shell-command - grep-command nil t nil - "^English" hello-file) - ;; otherwise use `grep-program' - (call-process grep-program nil t nil - "-nH" "^English" hello-file)) - (error nil)) - 0) + (and (if grep-command + ;; `grep-command' is already set, so + ;; use that for testing. + (grep-probe grep-command + `(nil t nil "^English" ,hello-file) + #'call-process-shell-command) + ;; otherwise use `grep-program' + (grep-probe grep-program + `(nil t nil "-nH" "^English" ,hello-file))) (progn (goto-char (point-min)) (looking-at (concat (regexp-quote hello-file) ":[0-9]+:English"))))))))) - (unless grep-command - (setq grep-command - (let ((required-options (if grep-use-null-device "-n" "-nH"))) - (if (equal (condition-case nil ; in case "grep" isn't in exec-path - (call-process grep-program nil nil nil - "-e" "foo" null-device) - (error nil)) - 1) - (format "%s %s -e " grep-program required-options) - (format "%s %s " grep-program required-options))))) - (unless grep-find-use-xargs - (setq grep-find-use-xargs - (if (and - (equal (call-process "find" nil nil nil - null-device "-print0") - 0) - (equal (call-process "xargs" nil nil nil - "-0" "-e" "echo") - 0)) - 'gnu))) - (unless grep-find-command - (setq grep-find-command - (cond ((eq grep-find-use-xargs 'gnu) - (format "%s . -type f -print0 | xargs -0 -e %s" - find-program grep-command)) - (grep-find-use-xargs - (format "%s . -type f -print | xargs %s" - find-program grep-command)) - (t (cons (format "%s . -type f -exec %s {} %s \\;" - find-program grep-command null-device) - (+ 22 (length grep-command))))))) - (unless grep-tree-command - (setq grep-tree-command - (let* ((glen (length grep-program)) - (gcmd (concat grep-program " " (substring grep-command glen)))) - (cond ((eq grep-find-use-xargs 'gnu) - (format "%s -type f -print0 | xargs -0 -e %s " - find-program gcmd)) - (grep-find-use-xargs - (format "%s -type f -print | xargs %s " - find-program gcmd)) - (t (format "%s -type f -exec %s {} %s \\;" - find-program gcmd null-device)))))) + (unless (and grep-command grep-find-command + grep-template grep-find-template) + (let ((grep-options + (concat (if grep-use-null-device "-n" "-nH") + (if (grep-probe grep-program + `(nil nil nil "-e" "foo" ,null-device) + nil 1) + " -e")))) + (unless grep-command + (setq grep-command + (format "%s %s " grep-program grep-options))) + (unless grep-template + (setq grep-template + (format "%s %s " grep-program grep-options))) + (unless grep-find-use-xargs + (setq grep-find-use-xargs + (if (and + (grep-probe find-program `(nil nil nil ,null-device "-print0")) + (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo"))) + 'gnu))) + (unless grep-find-command + (setq grep-find-command + (cond ((eq grep-find-use-xargs 'gnu) + (format "%s . -type f -print0 | xargs -0 -e %s" + find-program grep-command)) + (grep-find-use-xargs + (format "%s . -type f -print | xargs %s" + find-program grep-command)) + (t (cons (format "%s . -type f -exec %s {} %s \\;" + find-program grep-command null-device) + (+ 22 (length grep-command))))))) + (unless grep-find-template + (setq grep-find-template + (let ((gcmd (format "%s %s " + grep-program grep-options))) + (cond ((eq grep-find-use-xargs 'gnu) + (format "%s . -type f -print0 | xargs -0 -e %s" + find-program gcmd)) + (grep-find-use-xargs + (format "%s . -type f -print | xargs %s" + find-program gcmd)) + (t (format "%s . -type f -exec %s {} %s \\;" + find-program gcmd null-device)))))))) (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) (setq grep-highlight-matches (with-temp-buffer - (and (equal (condition-case nil - (call-process grep-program nil t nil "--help") - (error nil)) - 0) + (and (grep-probe grep-program '(nil t nil "--help")) (progn (goto-char (point-min)) (search-forward "--color" nil t)) @@ -487,42 +486,6 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (file-name-extension buffer-file-name)))) (replace-match tag-default t t grep-default 1)))) -;;;###autoload -(defun grep (command-args &optional highlight-regexp) - "Run grep, with user-specified args, and collect output in a buffer. -While grep runs asynchronously, you can use \\[next-error] (M-x next-error), -or \\\\[compile-goto-error] in the grep \ -output buffer, to go to the lines -where grep found matches. - -This command uses a special history list for its COMMAND-ARGS, so you can -easily repeat a grep command. - -A prefix argument says to default the argument based upon the current -tag the cursor is over, substituting it into the last grep command -in the grep command history (or into `grep-command' -if that history list is empty). - -If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to -temporarily highlight in visited source lines." - (interactive - (progn - (unless (and grep-command - (or (not grep-use-null-device) (eq grep-use-null-device t))) - (grep-compute-defaults)) - (let ((default (grep-default-command))) - (list (read-from-minibuffer "Run grep (like this): " - (if current-prefix-arg - default grep-command) - nil nil 'grep-history - (if current-prefix-arg nil default)))))) - - ;; Setting process-setup-function makes exit-message-function work - ;; even when async processes aren't supported. - (compilation-start (if (and grep-use-null-device null-device) - (concat command-args " " null-device) - command-args) - 'grep-mode nil highlight-regexp)) ;;;###autoload (define-compilation-mode grep-mode "Grep" @@ -536,6 +499,40 @@ temporarily highlight in visited source lines." 'grep-process-setup) (set (make-local-variable 'compilation-disable-input) t)) + +;;;###autoload +(defun grep (command-args) + "Run grep, with user-specified args, and collect output in a buffer. +While grep runs asynchronously, you can use \\[next-error] (M-x next-error), +or \\\\[compile-goto-error] in the grep \ +output buffer, to go to the lines +where grep found matches. + +This command uses a special history list for its COMMAND-ARGS, so you can +easily repeat a grep command. + +A prefix argument says to default the argument based upon the current +tag the cursor is over, substituting it into the last grep command +in the grep command history (or into `grep-command' +if that history list is empty)." + (interactive + (progn + (grep-compute-defaults) + (let ((default (grep-default-command))) + (list (read-from-minibuffer "Run grep (like this): " + (if current-prefix-arg + default grep-command) + nil nil 'grep-history + (if current-prefix-arg nil default)))))) + + ;; Setting process-setup-function makes exit-message-function work + ;; even when async processes aren't supported. + (compilation-start (if (and grep-use-null-device null-device) + (concat command-args " " null-device) + command-args) + 'grep-mode)) + + ;;;###autoload (defun grep-find (command-args) "Run grep via find, with user-specified args COMMAND-ARGS. @@ -547,9 +544,7 @@ This command uses a special history list for its arguments, so you can easily repeat a find command." (interactive (progn - (unless (and grep-command - (or (not grep-use-null-device) (eq grep-use-null-device t))) - (grep-compute-defaults)) + (grep-compute-defaults) (if grep-find-command (list (read-from-minibuffer "Run find (like this): " grep-find-command nil nil @@ -565,84 +560,178 @@ easily repeat a find command." ;;;###autoload (defalias 'find-grep 'grep-find) -(defun grep-expand-command-macros (command &optional regexp files dir excl case-fold) - "Patch grep COMMAND replacing , etc." - (setq command - (replace-regexp-in-string "" - (or dir ".") command t t)) - (setq command - (replace-regexp-in-string "" - (or excl "") command t t)) - (setq command - (replace-regexp-in-string "" - (or files "") command t t)) - (setq command - (replace-regexp-in-string "" - (if case-fold "-i" "") command t t)) - (setq command - (replace-regexp-in-string "" - (or regexp "") command t t)) - command) -(defvar grep-tree-last-regexp "") -(defvar grep-tree-last-files (car (car grep-tree-files-aliases))) +;; User-friendly interactive API. + +(defconst grep-expand-keywords + '(("" . (and cf (isearch-no-upper-case-p regexp t) "-i")) + ("" . dir) + ("" . files) + ("" . null-device) + ("" . excl) + ("" . (shell-quote-argument (or regexp "")))) + "List of substitutions performed by `grep-expand-template'. +If car of an element matches, the cdr is evalled in to get the +substitution string. Note dynamic scoping of variables.") + +(defun grep-expand-template (template &optional regexp files dir excl) + "Patch grep COMMAND string replacing , , , , and ." + (let ((command template) + (cf case-fold-search) + (case-fold-search nil)) + (dolist (kw grep-expand-keywords command) + (if (string-match (car kw) command) + (setq command (replace-match (or (eval (cdr kw)) "") + t t command)))))) + +(defun grep-read-regexp () + "Read regexp arg for interactive grep." + (let ((default + (or (funcall (or find-tag-default-function + (get major-mode 'find-tag-default-function) + 'find-tag-default)) + ""))) + (read-string + (concat "Search for" + (if (and default (> (length default) 0)) + (format " (default %s): " default) ": ")) + nil 'grep-regexp-history default))) + +(defun grep-read-files (regexp) + "Read files arg for interactive grep." + (let* ((default + (or (and (stringp (buffer-file-name)) + (let ((fn (file-name-nondirectory (buffer-file-name))) + (aliases grep-files-aliases) + alias) + (while aliases + (setq alias (car aliases) + aliases (cdr aliases)) + (if (string-match (wildcard-to-regexp (cdr alias)) fn) + (setq aliases nil) + (setq alias nil))) + (cdr alias))) + (car grep-files-history))) + (files (read-string + (concat "Search for \"" regexp + "\" in files (default " default "): ") + nil 'grep-files-history default))) + (and files + (or (cdr (assoc files grep-files-aliases)) + files)))) ;;;###autoload -(defun grep-tree (regexp files dir &optional subdirs) - "Grep for REGEXP in FILES in directory tree rooted at DIR. -Collect output in a buffer. -Interactively, prompt separately for each search parameter. -With prefix arg, reuse previous REGEXP. +(defun lgrep (regexp &optional files) + "Run grep, searching for REGEXP in FILES in current directory. The search is limited to file names matching shell pattern FILES. -FILES may use abbreviations defined in `grep-tree-files-aliases', e.g. +FILES may use abbreviations defined in `grep-files-aliases', e.g. entering `ch' is equivalent to `*.[ch]'. -While find runs asynchronously, you can use the \\[next-error] command -to find the text that grep hits refer to. +With \\[universal-argument] prefix, allow user to edit the constructed +shell command line before it is executed. +With two \\[universal-argument] prefixes, edit and run grep shell command. -This command uses a special history list for its arguments, so you can -easily repeat a find command. +Collect output in a buffer. While grep runs asynchronously, you +can use \\[next-error] (M-x next-error), or \\\\[compile-goto-error] +in the grep output buffer, to go to the lines where grep found matches. -When used non-interactively, optional arg SUBDIRS limits the search to -those sub directories of DIR." +This command shares argument histories with \\[rgrep] and \\[grep]." (interactive - (let* ((regexp - (if current-prefix-arg - grep-tree-last-regexp - (let* ((default (current-word)) - (spec (read-string - (concat "Search for" - (if (and default (> (length default) 0)) - (format " (default %s): " default) ": "))))) - (if (equal spec "") default spec)))) - (files - (read-string (concat "Search for \"" regexp "\" in files (default " grep-tree-last-files "): "))) - (dir - (read-directory-name "Base directory: " nil default-directory t))) - (list regexp files dir))) - (unless grep-tree-command - (grep-compute-defaults)) - (unless (and (stringp files) (> (length files) 0)) - (setq files grep-tree-last-files)) - (when files - (setq grep-tree-last-files files) - (let ((mf (assoc files grep-tree-files-aliases))) - (if mf - (setq files (cdr mf))))) - (let ((command-args (grep-expand-command-macros - grep-tree-command - (setq grep-tree-last-regexp regexp) - (and files (concat "-name '" files "'")) - (if subdirs - (if (stringp subdirs) - subdirs - (mapconcat 'identity subdirs " ")) - nil) ;; we change default-directory to dir - (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") - grep-tree-ignore-case)) - (default-directory (file-name-as-directory (expand-file-name dir))) - (null-device nil)) ; see grep - (grep command-args regexp))) + (progn + (grep-compute-defaults) + (cond + ((and grep-command (equal current-prefix-arg '(16))) + (list (read-from-minibuffer "Run: " grep-command + nil nil 'grep-history) + nil)) + ((not grep-template) + (list nil + (read-string "grep.el: No `grep-template' available. Press RET."))) + (t (let* ((regexp (grep-read-regexp)) + (files (grep-read-files regexp))) + (list regexp files)))))) + (when (and (stringp regexp) (> (length regexp) 0)) + (let ((command regexp)) + (if (null files) + (if (string= command grep-command) + (setq command nil)) + (setq command (grep-expand-template + grep-template + regexp + files)) + (when command + (if (equal current-prefix-arg '(4)) + (setq command + (read-from-minibuffer "Confirm: " + command nil nil 'grep-history)) + (push command grep-history)))) + (when command + ;; Setting process-setup-function makes exit-message-function work + ;; even when async processes aren't supported. + (compilation-start (if (and grep-use-null-device null-device) + (concat command " " null-device) + command) 'grep-mode))))) + + +;;;###autoload +(defun rgrep (regexp &optional files dir) + "Recusively grep for REGEXP in FILES in directory tree rooted at DIR. +The search is limited to file names matching shell pattern FILES. +FILES may use abbreviations defined in `grep-files-aliases', e.g. +entering `ch' is equivalent to `*.[ch]'. + +With \\[universal-argument] prefix, allow user to edit the constructed +shell command line before it is executed. +With two \\[universal-argument] prefixes, edit and run grep-find shell command. + +Collect output in a buffer. While find runs asynchronously, you +can use \\[next-error] (M-x next-error), or \\\\[compile-goto-error] +in the grep output buffer, to go to the lines where grep found matches. + +This command shares argument histories with \\[lgrep] and \\[grep-find]." + (interactive + (progn + (grep-compute-defaults) + (cond + ((and grep-find-command (equal current-prefix-arg '(16))) + (list (read-from-minibuffer "Run: " grep-find-command + nil nil 'grep-find-history) + nil)) + ((not grep-find-template) + (list nil nil + (read-string "grep.el: No `grep-find-template' available. Press RET."))) + (t (let* ((regexp (grep-read-regexp)) + (files (grep-read-files regexp)) + (dir (read-directory-name "Base directory: " + nil default-directory t))) + (list regexp files dir)))))) + (when (and (stringp regexp) (> (length regexp) 0)) + (if (null files) + (if (not (string= regexp grep-find-command)) + (compilation-start regexp 'grep-mode)) + (let* ((default-directory (file-name-as-directory (expand-file-name dir))) + (command (grep-expand-template + grep-find-template + regexp + (concat "\\( -name " + (mapconcat #'shell-quote-argument + (split-string files) + " -o -name ") + " \\)") + default-directory + (and grep-find-ignored-directories + (concat "\\( -path '*/" + (mapconcat #'identity + grep-find-ignored-directories + "' -o -path '*/") + "' \\) -prune -o "))))) + (when command + (if current-prefix-arg + (setq command + (read-from-minibuffer "Confirm: " + command nil nil 'grep-find-history)) + (push command grep-find-history)) + (compilation-start command 'grep-mode)))))) (provide 'grep) From 208cc91ffb7056436702310670e338edc0426c5d Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 28 Apr 2006 23:39:02 +0000 Subject: [PATCH 05/83] (grep-read-files): Use buffer-name if no buffer-file-name. Default to *.ext if no alias matches. No default if no extension. --- lisp/progmodes/grep.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index e100910e8cf..7d8cc9d5c64 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -599,10 +599,13 @@ substitution string. Note dynamic scoping of variables.") (defun grep-read-files (regexp) "Read files arg for interactive grep." - (let* ((default - (or (and (stringp (buffer-file-name)) - (let ((fn (file-name-nondirectory (buffer-file-name))) - (aliases grep-files-aliases) + (let* ((bn (or (buffer-file-name) (buffer-name))) + (fn (and bn + (stringp bn) + (file-name-nondirectory bn))) + (default + (or (and fn + (let ((aliases grep-files-aliases) alias) (while aliases (setq alias (car aliases) @@ -611,10 +614,14 @@ substitution string. Note dynamic scoping of variables.") (setq aliases nil) (setq alias nil))) (cdr alias))) - (car grep-files-history))) + (and fn + (let ((ext (file-name-extension fn))) + (and ext (concat "*." ext)))))) (files (read-string (concat "Search for \"" regexp - "\" in files (default " default "): ") + "\" in files" + (if default (concat " (default " default ")")) + ": ") nil 'grep-files-history default))) (and files (or (cdr (assoc files grep-files-aliases)) From 6b2db6f1f60dea4f8e8b173db3c5a43423cc9fbe Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 28 Apr 2006 23:42:37 +0000 Subject: [PATCH 06/83] Add lgrep + rgrep. --- etc/NEWS | 33 ++++++++++++++++++++++++--------- man/ChangeLog | 21 ++++++++++++--------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 3c02fe82a85..4adb8313768 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1404,20 +1404,35 @@ changes. There's a new separate package grep.el, with its own submenu and customization group. ---- -*** M-x grep provides highlighting support. - -Hits are fontified in green, and hits in binary files in orange. Grep buffers -can be saved and automatically revisited. - +++ *** `grep-find' is now also available under the name `find-grep' where people knowing `find-grep-dired' would probably expect it. ++++ +*** New commands `lgrep' (local grep) and `rgrep' (recursive grep) are +more user-friendly versions of `grep' and `grep-find', which prompt +separately for the regular expression to match, the files to search, +and the base directory for the search (rgrep only). Case sensitivitivy +of the search is controlled by the current value of `case-fold-search'. + +These commands build the shell commands based on the new variables +`grep-template' (lgrep) and `grep-find-template' (rgrep). + +The files to search can use aliases defined in `grep-files-aliases'. + +Subdirectories listed in `grep-find-ignored-directories' such as those +typically used by various version control systems, like CVS and arch, +are automatically skipped by `rgrep'. + --- -*** The new variables `grep-window-height', `grep-auto-highlight', and -`grep-scroll-output' override the corresponding compilation mode -settings, for grep commands only. +*** The grep commands provide highlighting support. + +Hits are fontified in green, and hits in binary files in orange. Grep buffers +can be saved and automatically revisited. + +--- +*** The new variables `grep-window-height' and `grep-scroll-output' override +the corresponding compilation mode settings, for grep commands only. +++ *** New option `grep-highlight-matches' highlights matches in *grep* diff --git a/man/ChangeLog b/man/ChangeLog index 1f417968fa9..08db65e95e4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,16 +1,19 @@ +2006-04-29 Kim F. Storm + + * building.texi (Grep Searching): Add lgrep and rgrep. + 2006-04-26 Reiner Steib * pgg.texi (Caching passphrase): Fix markup and typos. Simplify. 2006-04-26 Sascha Wilde - * pgg.texi (Caching passphrase): Added documentation for - pgg-gpg-use-agent. + * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent. 2006-04-24 Bill Wohler - * mh-e.texi (Getting Started): Made it more explicit that you need - to install MH, and also included pointers to current MH implementations. + * mh-e.texi (Getting Started): Make it more explicit that you need + to install MH. Add pointers to current MH implementations. 2006-04-23 Richard Stallman @@ -24,14 +27,14 @@ 2006-04-21 Bill Wohler Release MH-E manual version 7.94. - + * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for release 7.94. 2006-04-21 Carsten Dominik * org.texi: Many small fixes. - (Handling links): Renamed from "Managing links". + (Handling links): Rename from "Managing links". 2006-04-21 Eli Zaretskii @@ -57,7 +60,7 @@ 2006-04-20 Carsten Dominik - * org.texi: (Time stamps): Better explanation of the purpose of + * org.texi (Time stamps): Better explanation of the purpose of different time stamps. (Structure editing, Plain lists): More details on how new items and headings are inserted. @@ -74,7 +77,7 @@ 2006-04-18 Carsten Dominik - * org.texi: (Formula syntax): Fixed link to Calc Manual. + * org.texi (Formula syntax): Fixed link to Calc Manual. 2006-04-17 Reiner Steib @@ -96,7 +99,7 @@ 2006-04-13 Carsten Dominik - * org.texi: (Updating settings): New section. + * org.texi (Updating settings): New section. (Visibility cycling): Better names for the startup folding options. (Exporting): Completely restructured. From b5eb27b30d5abce362ee4653b96df8f31ba0c1db Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 28 Apr 2006 23:42:45 +0000 Subject: [PATCH 07/83] (Grep Searching): Add lgrep and rgrep. --- man/building.texi | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/man/building.texi b/man/building.texi index cc5e667f1c3..57ecbeb2a5b 100644 --- a/man/building.texi +++ b/man/building.texi @@ -335,10 +335,12 @@ treating the matches reported by @code{grep} as if they were ``errors.'' @table @kbd @item M-x grep +@item M-x lgrep Run @code{grep} asynchronously under Emacs, with matching lines listed in the buffer named @samp{*grep*}. @item M-x grep-find @itemx M-x find-grep +@itemx M-x rgrep Run @code{grep} via @code{find}, with user-specified arguments, and collect output in the buffer named @samp{*grep*}. @item M-x kill-grep @@ -373,6 +375,27 @@ initial default for the command---one that runs both @code{find} and @code{grep}, so as to search every file in a directory tree. See also the @code{find-grep-dired} command, in @ref{Dired and Find}. +@findex lgrep +@findex rgrep + The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} +(recursive grep) are more user-friendly versions of @code{grep} and +@code{grep-find}, which prompt separately for the regular expression +to match, the files to search, and the base directory for the search +(rgrep only). Case sensitivitivy of the search is controlled by the +current value of @code{case-fold-search}. + +These commands build the shell commands based on the variables +@code{grep-template} (for @code{lgrep}) and @code{grep-find-template} +(for @code{rgrep}). + +The files to search can use aliases defined in the variable +@code{grep-files-aliases}. + +Subdirectories listed in the variable +@code{grep-find-ignored-directories} such as those typically used by +various version control systems, like CVS and arch, are automatically +skipped by @code{rgrep}. + @node Flymake @section Finding Syntax Errors On The Fly @cindex checking syntax @@ -676,7 +699,7 @@ This key is available only in the GUD interaction buffer. @kindex C-c C-f @r{(GUD)} @itemx C-x C-a C-f @findex gud-finish -Run the program until the selected stack frame returns or +Run the program until the selected stack frame returns or stops for some other reason (@code{gud-finish}). @item C-x C-a C-j From 1c9e62fec0a5b3ed35a4441d439d49f2473785a3 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Sat, 29 Apr 2006 01:25:23 +0000 Subject: [PATCH 08/83] Update for MH-E release 7.95. --- etc/ChangeLog | 6 ++++++ etc/MH-E-NEWS | 13 +++++++++++++ etc/NEWS | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 4e5030d4984..c80b23c0489 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2006-04-28 Bill Wohler + + Release MH-E version 7.95. + + * NEWS, MH-E-NEWS: Update for MH-E release 7.95. + 2006-04-21 Bill Wohler Release MH-E version 7.94. diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index 4b3074686b1..db9de4b9043 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -6,6 +6,19 @@ Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Changes in MH-E 7.95 + +Version 7.95, the second 8.0 release candidate, fixes a single bug. +It would be good to check this version ASAP since the Emacs pretest is +coming in days: if no showstopper problems are found in this version +it will be promoted to 8.0 before the pretest. Thanks for your help! + +** Bug Fixes in MH-E 7.95 + +*** Folder Completion Fails in fcc: Field + +This has been fixed (closes SF #1476270). + * Changes in MH-E 7.94 Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs, diff --git a/etc/NEWS b/etc/NEWS index 4adb8313768..22493d08549 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3040,7 +3040,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details. --- ** MH-E changes. -Upgraded to MH-E version 7.94. There have been major changes since +Upgraded to MH-E version 7.95. There have been major changes since version 5.0.2; see MH-E-NEWS for details. ** Calendar changes: From 0303217f026f6173a2a5df07cfe46c56d205778b Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Sat, 29 Apr 2006 01:26:12 +0000 Subject: [PATCH 09/83] (Version, mh-version): Update for release 7.95. --- lisp/mh-e/ChangeLog | 6 ++++++ lisp/mh-e/mh-e.el | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 2f84e2e8222..f7846394638 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,9 @@ +2006-04-28 Bill Wohler + + Release MH-E version 7.95. + + * mh-e.el (Version, mh-version): Update for release 7.95. + 2006-04-26 Eric Ding * mh-e.el (mh-invisible-header-fields-internal): Add entry diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 4b7627562f0..88b8c5bac09 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -6,7 +6,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 7.94+cvs +;; Version: 7.95 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -136,7 +136,7 @@ ;; Try to keep variables local to a single file. Provide accessors if ;; variables are shared. Use this section as a last resort. -(defconst mh-version "7.94+cvs" "Version number of MH-E.") +(defconst mh-version "7.95" "Version number of MH-E.") ;; Variants From 305452a5903e59a1de841ddf6f342918d3068462 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 29 Apr 2006 03:51:50 +0000 Subject: [PATCH 10/83] Revision: emacs@sv.gnu.org/emacs--devo--0--patch-252 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 96-97) - Update from CVS --- lisp/gnus/ChangeLog | 48 ++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus/mml1991.el | 25 +++++++++-------------- 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2976d0db3e4..c547166bfa7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,39 @@ +2006-04-27 Katsumi Yamaoka + + * lpath.el: Don't fbind string-as-multibyte for XEmacs. + + * pgg-gpg.el (pgg-string-to-multibyte): Remove. + (pgg-gpg-process-region): Revert. + + * pgg-pgp.el (pgg-pgp-process-region): Revert. + (pgg-pgp-lookup-key): Revert. + + * pgg-pgp5.el (pgg-pgp5-process-region): Revert. + (pgg-pgp5-lookup-key): Revert. + + * pgg.el (pgg-fetch-key): Revert. + +2006-04-27 Katsumi Yamaoka + + * lpath.el: Fbind make-network-process for both Emacs and XEmacs; + fbind string-as-multibyte for XEmacs. + + * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is + always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el. + (mml1991-pgg-encrypt): Ditto. + + * pgg-gpg.el (pgg-string-to-multibyte): New function. + (pgg-gpg-process-region): Make sure pgg-output-buffer is always + a multibyte buffer. + + * pgg-pgp.el (pgg-pgp-process-region): Ditto. + (pgg-pgp-lookup-key): Ditto. + + * pgg-pgp5.el (pgg-pgp5-process-region): Ditto. + (pgg-pgp5-lookup-key): Ditto. + + * pgg.el (pgg-fetch-key): Ditto. + 2006-04-26 Reiner Steib * deuglify.el (gnus-outlook-deuglify-unwrap-min) @@ -21,6 +57,18 @@ (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync DND support and use of message-in-body-p from the trunk. +2006-04-26 Katsumi Yamaoka + + * mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before + binding pgg-* variables; reimplement the section which prevents + MIME header from being signed. + (mml1991-pgg-encrypt): Make sure to load pgg.el before binding + pgg-text-mode; remove a blank line at the top of body. + + * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank + lines at the top of body; use gnus-newsgroup-charset if there's no + Charset header. + 2006-04-25 Andreas Seltenreich * nnweb.el (nnweb-google-wash-article): Sync up to new Google diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el index 23953cd6208..4db3540aec1 100644 --- a/lisp/gnus/mml1991.el +++ b/lisp/gnus/mml1991.el @@ -229,8 +229,6 @@ (defvar pgg-output-buffer)) (defun mml1991-pgg-sign (cont) - ;; Make sure to load pgg.el before binding pgg-* variables. - (require 'pgg) (let ((pgg-text-mode t) (pgg-default-user-id (or (message-options-get 'mml-sender) pgg-default-user-id)) @@ -275,19 +273,16 @@ (delete-region (point-min) (point)) (when cte (mm-decode-content-transfer-encoding (intern (downcase cte)))))) - (unless (progn - ;; Make sure to load pgg.el before binding `pgg-text-mode'. - (require 'pgg) - (let ((pgg-text-mode t)) - (pgg-encrypt-region - (point-min) (point-max) - (split-string - (or - (message-options-get 'message-recipients) - (message-options-set 'message-recipients - (read-string "Recipients: "))) - "[ \f\t\n\r\v,]+") - sign))) + (unless (let ((pgg-text-mode t)) + (pgg-encrypt-region + (point-min) (point-max) + (split-string + (or + (message-options-get 'message-recipients) + (message-options-set 'message-recipients + (read-string "Recipients: "))) + "[ \f\t\n\r\v,]+") + sign)) (pop-to-buffer pgg-errors-buffer) (error "Encrypt error")) (delete-region (point-min) (point-max)) From a55b741ef27db4b7e5c5b67acf92069cb039a0f8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:55:42 +0000 Subject: [PATCH 11/83] (reftex-guess-label-type): Tighten the safety predicate. --- lisp/textmodes/reftex-vars.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 026336c301e..f4334fbbd70 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -975,7 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for a label type. If you set this variable to nil, RefTeX will always prompt." :group 'reftex-referencing-labels :type 'boolean) -;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable 'symbolp) +;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t)))) (defcustom reftex-format-ref-function nil "Function which produces the string to insert as a reference. From 26715e1b677a9b2710542fb141a02d6023854182 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:56:19 +0000 Subject: [PATCH 12/83] (booleanp): New fun. --- lisp/subr.el | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index dc1a3d92c8e..8b8416375b1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1262,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label." ;;; Load history -;;; (defvar symbol-file-load-history-loaded nil -;;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. -;;; That file records the part of `load-history' for preloaded files, -;;; which is cleared out before dumping to make Emacs smaller.") +;; (defvar symbol-file-load-history-loaded nil +;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. +;; That file records the part of `load-history' for preloaded files, +;; which is cleared out before dumping to make Emacs smaller.") -;;; (defun load-symbol-file-load-history () -;;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done. -;;; That file records the part of `load-history' for preloaded files, -;;; which is cleared out before dumping to make Emacs smaller." -;;; (unless symbol-file-load-history-loaded -;;; (load (expand-file-name -;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. -;;; (if (eq system-type 'ms-dos) -;;; "fns.el" -;;; (format "fns-%s.el" emacs-version)) -;;; exec-directory) -;;; ;; The file name fns-%s.el already has a .el extension. -;;; nil nil t) -;;; (setq symbol-file-load-history-loaded t))) +;; (defun load-symbol-file-load-history () +;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done. +;; That file records the part of `load-history' for preloaded files, +;; which is cleared out before dumping to make Emacs smaller." +;; (unless symbol-file-load-history-loaded +;; (load (expand-file-name +;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. +;; (if (eq system-type 'ms-dos) +;; "fns.el" +;; (format "fns-%s.el" emacs-version)) +;; exec-directory) +;; ;; The file name fns-%s.el already has a .el extension. +;; nil nil t) +;; (setq symbol-file-load-history-loaded t))) (defun symbol-file (symbol &optional type) "Return the input source in which SYMBOL was defined. @@ -1927,6 +1927,10 @@ a system-dependent default device name is used." Otherwise, return nil." (or (stringp object) (null object))) +(defun booleanp (object) + "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil." + (memq object '(nil t))) + ;;;; Support for yanking and text properties. From 65f21967e400fa7e565b15df63a55ab0ee4ec876 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:56:50 +0000 Subject: [PATCH 13/83] (abbrev-mode): Tighten the safety predicate. --- lisp/abbrev.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index c0380058b53..234b8230587 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -58,7 +58,7 @@ Interactively, use the command `abbrev-mode' to enable or disable Abbrev mode in the current buffer." :type 'boolean :group 'abbrev-mode) -;;;###autoload(put 'abbrev-mode 'safe-local-variable 'symbolp) +;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp) (defvar edit-abbrevs-map From 119d72b62ca7a8c7becf59bd1a4f796810537068 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:57:38 +0000 Subject: [PATCH 14/83] (colon-double-space): Tighten the safety predicate. --- lisp/textmodes/fill.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 545e9fe14b5..9218c565c97 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -48,7 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph." "*Non-nil means put two spaces after a colon when filling." :type 'boolean :group 'fill) -;;;###autoload(put 'colon-double-space 'safe-local-variable 'symbolp) +;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp) (defvar fill-paragraph-function nil "Mode-specific function to fill a paragraph, or nil if there is none. From 85e17b4fff692ab8608efe850b25176816fee26f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:59:04 +0000 Subject: [PATCH 15/83] (sentence-end-without-space): Fix safety predicate. (sentence-end-double-space, sentence-end-without-period) (paragraph-ignore-fill-prefix): Tighten the safety predicate. --- lisp/textmodes/paragraphs.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 9e7d02182ef..aac4cee4dd7 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -81,7 +81,7 @@ to paragraphs. The fill functions insert and delete only soft newlines." (set-hard-newline-properties (point) (1+ (point))))))))))) (defcustom paragraph-start "\f\\|[ \t]*$" "\ -*Regexp for beginning of a line that starts OR separates paragraphs. +Regexp for beginning of a line that starts OR separates paragraphs. This regexp should match lines that separate paragraphs and should also match lines that start a paragraph \(and are part of that paragraph). @@ -107,7 +107,7 @@ hard newline are considered to match." ;; start a new paragraph). (defcustom paragraph-separate "[ \t\f]*$" - "*Regexp for beginning of a line that separates paragraphs. + "Regexp for beginning of a line that separates paragraphs. If you change this, you may have to change `paragraph-start' also. This is matched against the text at the left margin, which is not necessarily @@ -119,7 +119,7 @@ text indented by a margin setting." ;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp) (defcustom sentence-end-double-space t - "*Non-nil means a single space does not end a sentence. + "Non-nil means a single space does not end a sentence. This is relevant for filling. See also `sentence-end-without-period' and `colon-double-space'. @@ -128,10 +128,10 @@ regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." :type 'boolean :group 'fill) -;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'symbolp) +;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp) (defcustom sentence-end-without-period nil - "*Non-nil means a sentence will end without a period. + "Non-nil means a sentence will end without a period. For example, a sentence in Thai text ends with double space but without a period. @@ -140,21 +140,21 @@ regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." :type 'boolean :group 'fill) -;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'symbolp) +;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp) (defcustom sentence-end-without-space "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" - "*String of characters that end sentence without following spaces. + "String of characters that end sentence without following spaces. This value is used by the function `sentence-end' to construct the regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." :group 'paragraphs :type 'string) -;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'symbolp) +;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp) (defcustom sentence-end nil - "*Regexp describing the end of a sentence. + "Regexp describing the end of a sentence. The value includes the whitespace following the sentence. All paragraph boundaries also end sentences, regardless. @@ -166,7 +166,7 @@ to obtain the value of this variable." ;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p) (defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*" - "*Regexp matching the basic end of a sentence, not including following space." + "Regexp matching the basic end of a sentence, not including following space." :group 'paragraphs :type 'string :version "22.1") @@ -195,17 +195,17 @@ in between. See Info node `(elisp)Standard Regexps'." "[ \t\n]*"))) (defcustom page-delimiter "^\014" - "*Regexp describing line-beginnings that separate pages." + "Regexp describing line-beginnings that separate pages." :group 'paragraphs :type 'regexp) ;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp) (defcustom paragraph-ignore-fill-prefix nil - "*Non-nil means the paragraph commands are not affected by `fill-prefix'. + "Non-nil means the paragraph commands are not affected by `fill-prefix'. This is desirable in modes where blank lines are the paragraph delimiters." :group 'paragraphs :type 'boolean) -;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'symbolp) +;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp) (defun forward-paragraph (&optional arg) "Move forward to end of paragraph. From 80aa469540e939c8d7dcdf27021e78f12d0b957a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 13:59:52 +0000 Subject: [PATCH 16/83] (safe-local-variable-p): Remove support for the special value t. --- lisp/ChangeLog | 27 ++++++++++++++++++++++----- lisp/files.el | 6 +----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index afb3b8dc165..6048372f90b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2006-04-29 Stefan Monnier + + * files.el (safe-local-variable-p): Remove support for the special + value t. + + * textmodes/paragraphs.el (sentence-end-without-space): + Fix safety predicate. + (sentence-end-double-space, sentence-end-without-period) + (paragraph-ignore-fill-prefix): + * textmodes/fill.el (colon-double-space): + * abbrev.el (abbrev-mode): Tighten the safety predicate. + + * subr.el (booleanp): New fun. + + * textmodes/reftex-vars.el (reftex-guess-label-type): + Tighten the safety predicate. + 2006-04-28 Kim F. Storm * progmodes/grep.el (defgroup grep): Doc fix. @@ -31,12 +48,12 @@ 2006-04-28 Michael Albinus - * net/tramp.el (tramp-completion-file-name-handler): Disable - Tramp's functionality while loading Tramp itself. - (tramp-register-file-name-handlers): That's a defsubst now. Code - from `tramp-repair-jka-compr' moved here. Apply it via + * net/tramp.el (tramp-completion-file-name-handler): + Disable Tramp's functionality while loading Tramp itself. + (tramp-register-file-name-handlers): That's a defsubst now. + Code from `tramp-repair-jka-compr' moved here. Apply it via `after-init-hook'. - (tramp-repair-jka-compr): Removed. + (tramp-repair-jka-compr): Remove. 2006-04-27 Jay Belanger diff --git a/lisp/files.el b/lisp/files.el index df63e016c63..76167eb27cf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2652,15 +2652,11 @@ It is safe if any of these conditions are met: * There is a matching entry (SYM . VAL) in the `safe-local-variable-values' user option. - * The `safe-local-variable' property of SYM is t. - * The `safe-local-variable' property of SYM is a function that evaluates to a non-nil value with VAL as an argument." (or (member (cons sym val) safe-local-variable-values) (let ((safep (get sym 'safe-local-variable))) - (or (eq safep t) - (and (functionp safep) - (funcall safep val)))))) + (and (functionp safep) (funcall safep val))))) (defun risky-local-variable-p (sym &optional ignored) "Non-nil if SYM could be dangerous as a file-local variable. From 7817e3d35e77621ce12c93cb9d07820250cf31c2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 14:02:42 +0000 Subject: [PATCH 17/83] (File Local Variables): Remove the special case t for safe-local-variable. --- lispref/ChangeLog | 5 +++++ lispref/variables.texi | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index ac6bd07a175..1eed9dec592 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2006-04-29 Stefan Monnier + + * variables.texi (File Local Variables): Remove the special case t for + safe-local-variable. + 2006-04-26 Richard Stallman * syntax.texi (Parsing Expressions): Minor cleanup. diff --git a/lispref/variables.texi b/lispref/variables.texi index d97848549c0..c2abdf0563d 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi @@ -1778,13 +1778,12 @@ measures to prevent this. @cindex safe local variable You can specify safe values for a variable with a -@code{safe-local-variable} property. If the property is @code{t}, -setting that variable in a file is always considered safe, regardless -of the value used. If the property is a function of one argument, -then any value is safe if the function returns non-@code{nil} given -that value. Many commonly encountered file variables standardly have -@code{safe-local-variable} properties, including @code{fill-column}, -@code{fill-prefix}, and @code{indent-tabs-mode}. +@code{safe-local-variable} property. The property has to be +a function of one argument; any value is safe if the function +returns non-@code{nil} given that value. Many commonly encountered +file variables standardly have @code{safe-local-variable} properties, +including @code{fill-column}, @code{fill-prefix}, and +@code{indent-tabs-mode}. @defopt safe-local-variable-values This variable provides another way to mark some variable values as From 20bfe3873f561e00fd59d6d0be339dfa131e8af7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 14:14:53 +0000 Subject: [PATCH 18/83] Add `booleanp'. --- etc/NEWS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 22493d08549..a15e217cafe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3645,9 +3645,10 @@ This is useful in packages that can be preloaded. If it is non-nil, the function lists only faces matching this regexp. +++ -*** New function `string-or-null-p'. +*** New functions `string-or-null-p' and `booleanp'. -Return t if OBJECT is a string or nil. Otherwise, return nil. +`string-or-null-p' returns non-nil iff OBJECT is a string or nil. +`booleanp' returns non-nil iff OBJECT is a t or nil. ** Lisp code indentation features: From 830951b02a12688c2515de9369f8efc971371027 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Apr 2006 15:11:38 +0000 Subject: [PATCH 19/83] Improve the documentation of how to hilight multiline elements. --- lispref/modes.texi | 100 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/lispref/modes.texi b/lispref/modes.texi index 3f56179231c..e0abc221ef3 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -3029,7 +3029,51 @@ a chunk should not straddle an element matched by @code{font-lock-keywords}. The default heuristic used for this is to start and end chunks at the beginning resp. end of a line. -To work around this limitations, a few tools are provided. +In order for Font Lock to properly highlight elements that span +multiple lines, the package author has to ensure two things: correct +@emph{discovery} and correct @emph{re}highlighting. The first ensures +that Font Lock finds all multiline elements. The second ensures that +Font Lock will correctly re-highlight all the relevant text when +a multiline element is changed, e.g. causing some of the text that was +previously part of a multiline element to not be part of it any more. +The two aspects are closely related and often getting one of the two +to work will appear to make the other also work. But both aspects +have to be taken care of for the multiline elements to be +reliably highlighted. + +Correct @emph{re}highlighting of multiline elements can be done in the +following ways: +@itemize +@item +Apply the @code{font-lock-multiline} property to the element. +This will ensure that the whole element will always be immediately +rehighlighted if any part of it is changed. This can sometimes be +done automatically by setting the @code{font-lock-multiline} variable. +@item +Rely on @code{jit-lock-contextually}. This will only rehighlight the +part of the element that follows the actual change, and will do it +after a short delay. This only works if the highlighting of the +various parts of your multiline element never depends on text in +subsequent lines. Since @code{jit-lock-contextually} is activated by +default, this can be an attractive solution. +@item +Apply the @code{jit-lock-defer-multiline} property to the element. +This works only if @code{jit-lock-contextually} is used and allows it +to also work when highlighting does depend on subsequent lines. +@item +@end itemize + +Discovery of new multiline elements can be done in the following ways: +@itemize +@item +Manually placing a @code{font-lock-multiline} or +@code{jit-lock-defer-multiline} property on the element when it is +added to the buffer. +@item +Using the @code{font-lock-fontify-region-function} hook to extend the +highlighted chunks so that they never start or end in the middle of +multiline element. +@end itemize @menu * Font Lock Multiline:: Marking multiline chunks with a text property @@ -3040,24 +3084,24 @@ To work around this limitations, a few tools are provided. @node Font Lock Multiline @subsubsection Font Lock Multiline -In order to make it possible to properly highlight elements that span -multiple lines, Font Lock obeys a special text property +In order to make it possible to properly @emph{re}highlight elements that +span multiple lines, Font Lock obeys a special text property @code{font-lock-multiline} which if non-@code{nil} indicates that this -piece of text is part of a multiline construct. So when Font Lock is -asked to highlight a region, it first verifies the two boundaries and -extends them as needed so they do not fall in the middle of a piece of -text marked with the @code{font-lock-multiline} property. -Immediately after that, it also erases all @code{font-lock-multiline} -properties from the region it is about to highlight, so it is the -responsability of the highlighting specification (mostly -@code{font-lock-keywords}) to make sure that this property is re-added -where needed so as to inform the next round of Font Locking of the -presence of a multiline construct. +piece of text was highlighted as part of a multiline construct. +So when Font Lock is asked to rehighlight a region, it first verifies +the two boundaries and extends them as needed so they do not fall in +the middle of a piece of text marked with the +@code{font-lock-multiline} property. Immediately after that, it also +erases all @code{font-lock-multiline} properties from the region it is +about to highlight, so it is the responsability of the highlighting +specification (mostly @code{font-lock-keywords}) to make sure that +this property is re-added where needed so as to inform the next round +of Font Locking of the presence of a multiline construct. It is important to understand that the @code{font-lock-multiline} property should preferably only be used on Font Lock elements of -moderate size: every time that text is modified within the multiline -elements (or nearby), the whole multiline element will be completely +moderate size: every time that text is modified within a multiline +element (or nearby), the whole multiline element will be completely re-highlighted, so if its size is large, the time to font-lock may render editing painfully slow. @@ -3065,11 +3109,31 @@ render editing painfully slow. If the @code{font-lock-multiline} variable is set to @code{t}, Font Lock will try to automatically add the @code{font-lock-multiline} property on the keywords that span several lines. This is no silver -bullet however since it slows down Font Lock somewhat, and still does -not always find all multiline constructs, especially when used with -Jit Lock, which is enabled by default. +bullet however since it slows down Font Lock somewhat, and may miss +some cases or make the property larger or smaller than necessary, +especially for keywords whose @var{MATCHER} is a function, in which +case the function needs to make sure that the submatch 0 covers the +whole relevant multiline entity even if only a small subpart will +be highlighted. It is often just as easy to add the +@code{font-lock-multiline} property by hand. @end defvar +As mentioned, this property is mostly intended to ensure proper +@emph{re}fontification. It does not magically discover new +multiline elements. To discover new multiline elements, all that is +required is that font-lock operate on large enough chunks at a time. +This will happen by accident on many cases, which may give the +impression that multiline elements magically work. If you set the +@code{font-lock-multiline} variable, this impression will be even +stronger since the highlighting of those found elements will be +properly preserved from then on. But for such multiline elements to +be found reliably, you will need to either manually put the +@code{font-lock-multiline} property from some appropriate piece of +code run before Font Lock, or hook into +@code{font-lock-fontify-region-function} to manually extend the chunks +of text that Font Lock highlights so they never start or stop in the +middle of a multiline element. + @node Region to Fontify @subsubsection Region to Fontify after a Buffer Change From 41c8e348f2362ff04d14d9781b02b3f72571e4bf Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 29 Apr 2006 15:58:42 +0000 Subject: [PATCH 20/83] tramp-file-name-handler-alist): Delete expand-file-name and other operations that can cause spurious loading. --- lisp/ChangeLog | 5 +++++ lisp/net/tramp.el | 14 +++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6048372f90b..d758347a5c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-04-29 Richard Stallman + + * net/tramp.el (tramp-file-name-handler-alist): Delete + expand-file-name and other operations that can cause spurious loading. + 2006-04-29 Stefan Monnier * files.el (safe-local-variable-p): Remove support for the special diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ad4eaaa4862..b35ffeb58ff 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1822,7 +1822,7 @@ Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") ; These values conform to `file-attributes' from XEmacs 21.2. -; GNU Emacs and other tools not checked. +; Emacs and other tools not checked. (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) (1 . "p") ; fifo (2 . "c") ; character device @@ -1927,17 +1927,13 @@ on the FILENAME argument, even if VISIT was a string.") "Alist of handler functions. Operations not mentioned here will be handled by the normal Emacs functions.") -;; Handlers for partial tramp file names. For GNU Emacs just -;; `file-name-all-completions' is needed. The other ones are necessary -;; for XEmacs. + +;; Handlers for partial tramp file names. For Emacs just +;; `file-name-all-completions' is needed. (defconst tramp-completion-file-name-handler-alist '( - (file-name-directory . tramp-completion-handle-file-name-directory) - (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory) - (file-exists-p . tramp-completion-handle-file-exists-p) (file-name-all-completions . tramp-completion-handle-file-name-all-completions) - (file-name-completion . tramp-completion-handle-file-name-completion) - (expand-file-name . tramp-completion-handle-expand-file-name)) + (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. Used for file names matching `tramp-file-name-regexp'. Operations not mentioned here will be handled by `tramp-file-name-handler-alist' or the From 2ef88a94ea6a99d154bba3123bb2aba09767ef55 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 29 Apr 2006 18:52:23 +0000 Subject: [PATCH 21/83] (read_header): Give fatal error if input has no header. --- lib-src/ChangeLog | 4 ++++ lib-src/fakemail.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index a38c0cb6770..31f69a5bcd9 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2006-04-29 Richard Stallman + + * fakemail.c (read_header): Give fatal error if input has no header. + 2006-04-02 Paul Eggert * b2m.c (main): Don't include . diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 6b8634f34ab..30d39db533e 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -694,6 +694,8 @@ read_header () } while (true); + if (! the_header) + fatal ("input message has no header"); return the_header->next; } From 5e5b35c7ecd964144de14dc63dff22f410160d68 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 29 Apr 2006 18:55:19 +0000 Subject: [PATCH 22/83] (main): Check for negative value from `read'. --- lib-src/ChangeLog | 2 ++ lib-src/movemail.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 31f69a5bcd9..d2004183a83 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2006-04-29 Richard Stallman + * movemail.c (main): Check for negative value from `read'. + * fakemail.c (read_header): Give fatal error if input has no header. 2006-04-02 Paul Eggert diff --git a/lib-src/movemail.c b/lib-src/movemail.c index d3ec1fcd178..1f73ee88ba8 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -466,6 +466,8 @@ main (argc, argv) while (1) { nread = read (indesc, buf, sizeof buf); + if (nread < 0) + pfatal_with_name (inname); if (nread != write (outdesc, buf, nread)) { int saved_errno = errno; From 7c47913be1bb883737220309d93d0359a9c9d096 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 29 Apr 2006 20:15:48 +0000 Subject: [PATCH 23/83] Delete c-indentation-style local variable. --- lib-src/ChangeLog | 4 ++++ lib-src/etags.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index d2004183a83..6c3091e5906 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2006-04-29 Dan Nicolaescu + + * etags.c: Delete c-indentation-style local variable. + 2006-04-29 Richard Stallman * movemail.c (main): Check for negative value from `read'. diff --git a/lib-src/etags.c b/lib-src/etags.c index a073acb92d6..a7c98f090bb 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6887,7 +6887,6 @@ xrealloc (ptr, size) /* * Local Variables: - * c-indentation-style: gnu * indent-tabs-mode: t * tab-width: 8 * fill-column: 79 From 084a663812cac322d965fb55278bfa171092850e Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 29 Apr 2006 21:18:05 +0000 Subject: [PATCH 24/83] * help-fns.el (describe-variable): Add info about safe local variables. * custom.texi (Examining): Update C-h v output example. --- lisp/ChangeLog | 4 ++++ lisp/help-fns.el | 6 ++++++ man/ChangeLog | 4 ++++ man/custom.texi | 3 +++ 4 files changed, 17 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d758347a5c8..55893760f36 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-04-29 Dan Nicolaescu + + * help-fns.el (describe-variable): Add info about safe local variables. + 2006-04-29 Richard Stallman * net/tramp.el (tramp-file-name-handler-alist): Delete diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d30fc02c409..2b75e7fd053 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -630,6 +630,7 @@ it is displayed along with the global value." (indirect-variable variable) (error variable))) (obsolete (get variable 'byte-obsolete-variable)) + (safe-var (get variable 'safe-local-variable)) (doc (or (documentation-property variable 'variable-documentation) (documentation-property alias 'variable-documentation)))) (unless (eq alias variable) @@ -641,6 +642,11 @@ it is displayed along with the global value." (princ (if (stringp (car obsolete)) (car obsolete) (format "use `%s' instead." (car obsolete)))) (terpri)) + (when safe-var + (princ "This variable is safe to use as a file local variable") + (princ (format " only if its value\nsatisfies the predicate `%s'.\n" + safe-var)) + (terpri)) (princ "Documentation:\n") (princ (or doc "Not documented as a variable."))) ;; Make a link to customize if this variable can be customized. diff --git a/man/ChangeLog b/man/ChangeLog index 08db65e95e4..ff23fe67a18 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-04-29 Dan Nicolaescu + + * custom.texi (Examining): Update C-h v output example. + 2006-04-29 Kim F. Storm * building.texi (Grep Searching): Add lgrep and rgrep. diff --git a/man/custom.texi b/man/custom.texi index f133e890b0a..35c9222628c 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -822,6 +822,9 @@ fill-column's value is 70 Local in buffer custom.texi; global value is 70 Automatically becomes buffer-local when set in any fashion. +This variable is safe to use as a file local variable only if its value +satisfies the predicate `integerp'. + Documentation: *Column beyond which automatic line-wrapping should happen. Interactively, you can set the buffer local value using C-x f. From cdeda579513bea2a3fbf5916e0b08eb08c0b91a0 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 29 Apr 2006 21:36:04 +0000 Subject: [PATCH 25/83] (yow): Free buf. --- lib-src/ChangeLog | 2 ++ lib-src/yow.c | 1 + 2 files changed, 3 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 6c3091e5906..1118ac226e2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2006-04-29 Dan Nicolaescu + * yow.c (yow): Free buf. + * etags.c: Delete c-indentation-style local variable. 2006-04-29 Richard Stallman diff --git a/lib-src/yow.c b/lib-src/yow.c index 1356ac6db18..18f0f7b2e13 100644 --- a/lib-src/yow.c +++ b/lib-src/yow.c @@ -176,6 +176,7 @@ yow (fp) } buf[i++] = 0; printf("%s\n", buf); + free (buf); } /* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e From 7fe8b491e19c8f4a64c97c876c563506157f3868 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 29 Apr 2006 22:15:04 +0000 Subject: [PATCH 26/83] (main): Initialize docs to NULL. --- lib-src/ChangeLog | 2 ++ lib-src/sorted-doc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1118ac226e2..115e43c2d03 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2006-04-29 Dan Nicolaescu + * sorted-doc.c (main): Initialize docs to NULL. + * yow.c (yow): Free buf. * etags.c: Delete c-indentation-style local variable. diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c index a2416993a1b..0a06aa2c984 100644 --- a/lib-src/sorted-doc.c +++ b/lib-src/sorted-doc.c @@ -131,7 +131,7 @@ main () register enum state state = WAITING; /* state at start */ int cnt = 0; /* number of DOCSTRs read */ - DOCSTR *docs; /* chain of allocated DOCSTRS */ + DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */ char buf[512]; /* line buffer */ while (1) /* process one char at a time */ From af0efc3fd4041fc433d4e2d8cccf15aa35d4109a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Apr 2006 01:31:55 +0000 Subject: [PATCH 27/83] (mode-line-major-mode-keymap): Move the major mode menu to Mouse-3. (help-echo): help-echo doc fixes. --- lisp/ChangeLog | 4 ++++ lisp/bindings.el | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 55893760f36..e08a2f39efa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,10 @@ 2006-04-29 Richard Stallman + * bindings.el (mode-line-major-mode-keymap): Move the major mode menu + to Mouse-3. + (help-echo): help-echo doc fixes. + * net/tramp.el (tramp-file-name-handler-alist): Delete expand-file-name and other operations that can cause spurious loading. diff --git a/lisp/bindings.el b/lisp/bindings.el index aa3062b38e1..c2440d7f9a4 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -267,9 +267,8 @@ buffer size, the line number and the column number.") (defvar mode-line-major-mode-keymap (let ((map (make-sparse-keymap))) - (define-key map [mode-line down-mouse-1] 'mouse-major-mode-menu) (define-key map [mode-line mouse-2] 'describe-mode) - (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) + (define-key map [mode-line down-mouse-3] 'mouse-major-mode-menu) map) "\ Keymap to display on major mode.") @@ -310,13 +309,13 @@ Keymap to display on minor modes.") (list (propertize "%[(" 'help-echo help-echo) `(:propertize ("" mode-name) - help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode" + help-echo "mouse-2: help for major mode, mouse-3: major mode menu" mouse-face mode-line-highlight local-map ,mode-line-major-mode-keymap) '("" mode-line-process) `(:propertize ("" minor-mode-alist) mouse-face mode-line-highlight - help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" + help-echo "mouse-2: help for minor mode, mouse-3: toggle minor modes" local-map ,mode-line-minor-mode-keymap) (propertize "%n" 'help-echo "mouse-2: widen" 'mouse-face 'mode-line-highlight From d33c1fcea2d4ccbc45ceedc430337971ab087b9c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Apr 2006 01:36:19 +0000 Subject: [PATCH 28/83] (mode-line-major-mode-keymap): Undo last change. (mode-line-format): Further help-echo doc fixes. --- lisp/bindings.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/bindings.el b/lisp/bindings.el index c2440d7f9a4..a2449798588 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -267,8 +267,9 @@ buffer size, the line number and the column number.") (defvar mode-line-major-mode-keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] 'mouse-major-mode-menu) (define-key map [mode-line mouse-2] 'describe-mode) - (define-key map [mode-line down-mouse-3] 'mouse-major-mode-menu) + (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) map) "\ Keymap to display on major mode.") @@ -309,13 +310,13 @@ Keymap to display on minor modes.") (list (propertize "%[(" 'help-echo help-echo) `(:propertize ("" mode-name) - help-echo "mouse-2: help for major mode, mouse-3: major mode menu" + help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" mouse-face mode-line-highlight local-map ,mode-line-major-mode-keymap) '("" mode-line-process) `(:propertize ("" minor-mode-alist) mouse-face mode-line-highlight - help-echo "mouse-2: help for minor mode, mouse-3: toggle minor modes" + help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" local-map ,mode-line-minor-mode-keymap) (propertize "%n" 'help-echo "mouse-2: widen" 'mouse-face 'mode-line-highlight From 03475b051a0a5c0a0409ac6a81d30b47b94a2be9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Apr 2006 02:35:35 +0000 Subject: [PATCH 29/83] (Multiline Font Lock): Renamed from Multi line Font Lock Elements. Much clarification. (Font Lock Multiline, Region to Fontify): Much clarification. --- lispref/modes.texi | 211 ++++++++++++++++++++++----------------------- 1 file changed, 101 insertions(+), 110 deletions(-) diff --git a/lispref/modes.texi b/lispref/modes.texi index e0abc221ef3..9e55ca847fc 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -2345,8 +2345,8 @@ Search-based fontification happens second. * Syntactic Font Lock:: Fontification based on syntax tables. * Setting Syntax Properties:: Defining character syntax based on context using the Font Lock mechanism. -* Multi line Font Lock Elements:: How to coerce Font Lock into properly - highlighting multiline elements. +* Multiline Font Lock:: How to coerce Font Lock into properly + highlighting multiline constructs. @end menu @node Font Lock Basics @@ -2625,7 +2625,7 @@ Its value should have one of the forms described in this table. @strong{Warning:} Do not design an element of @code{font-lock-keywords} to match text which spans lines; this does not work reliably. -For details, see @xref{Multi line Font Lock Elements}. +For details, see @xref{Multiline Font Lock}. You can use @var{case-fold} in @code{font-lock-defaults} to specify the value of @code{font-lock-keywords-case-fold-search} which says @@ -2944,8 +2944,8 @@ value returns @code{font-lock-comment-face} for comments and This can be used to highlighting different kinds of strings or comments differently. It is also sometimes abused together with -@code{font-lock-syntactic-keywords} to highlight elements that span -multiple lines, but this is too obscure to document in this manual. +@code{font-lock-syntactic-keywords} to highlight constructs that span +multiple lines, but this is too esoteric to document here. Specify this variable using @var{other-vars} in @code{font-lock-defaults}. @@ -3015,64 +3015,60 @@ Major modes normally set this variable with @var{other-vars} in @code{font-lock-defaults}. @end defvar -@node Multi line Font Lock Elements -@subsection Multi line Font Lock Elements -@cindex multi line font lock +@node Multiline Font Lock +@subsection Multiline Font Lock Constructs +@cindex multiline font lock -Normally, Font Lock elements specified via @code{font-lock-keywords} -should not match across multiple lines. If they do, Font Lock may -fail to highlight them properly. This is fundamentally due to the -fact that Font Lock does not always look at the whole buffer at -a time, for obvious performance reasons, and instead only looks -at a small chunk at a time. In order for the highlight to be correct, -a chunk should not straddle an element matched by -@code{font-lock-keywords}. The default heuristic used for this is to -start and end chunks at the beginning resp. end of a line. + Normally, elements of @code{font-lock-keywords} should not match +across multiple lines; that doesn't work reliably, because Font Lock +usually scans just part of the buffer, and it can miss a multi-line +construct that crosses the line boundary where the scan starts. (The +scan normally starts at the beginning of a line.) -In order for Font Lock to properly highlight elements that span -multiple lines, the package author has to ensure two things: correct -@emph{discovery} and correct @emph{re}highlighting. The first ensures -that Font Lock finds all multiline elements. The second ensures that -Font Lock will correctly re-highlight all the relevant text when -a multiline element is changed, e.g. causing some of the text that was -previously part of a multiline element to not be part of it any more. -The two aspects are closely related and often getting one of the two -to work will appear to make the other also work. But both aspects -have to be taken care of for the multiline elements to be -reliably highlighted. + Making elements that match multiline constructs work properly has +two aspects: correct @emph{identification} and correct +@emph{rehighlighting}. The first means that Font Lock finds all +multiline constructs. The second means that Font Lock will correctly +rehighlight all the relevant text when a multiline construct is +changed---for example, if some of the text that was previously part of +a multiline construct ceases to be part of it. The two aspects are +closely related, and often getting one of them to work will appear to +make the other also work. However, for reliable results you must +attend explicitly to both aspects. + + There are two ways to ensure correct identification of multiline +constructs: -Correct @emph{re}highlighting of multiline elements can be done in the -following ways: @itemize @item -Apply the @code{font-lock-multiline} property to the element. -This will ensure that the whole element will always be immediately -rehighlighted if any part of it is changed. This can sometimes be -done automatically by setting the @code{font-lock-multiline} variable. -@item -Rely on @code{jit-lock-contextually}. This will only rehighlight the -part of the element that follows the actual change, and will do it -after a short delay. This only works if the highlighting of the -various parts of your multiline element never depends on text in -subsequent lines. Since @code{jit-lock-contextually} is activated by -default, this can be an attractive solution. -@item -Apply the @code{jit-lock-defer-multiline} property to the element. -This works only if @code{jit-lock-contextually} is used and allows it -to also work when highlighting does depend on subsequent lines. +Place a @code{font-lock-multiline} or @code{jit-lock-defer-multiline} +property on the construct when it is added to the buffer. @item +Use @code{font-lock-fontify-region-function} hook to extend the scan +so that the scanned text never starts or ends in the middle of a +multiline construct. @end itemize -Discovery of new multiline elements can be done in the following ways: + There are three ways to do rehighlighting of multiline constructs: + @itemize @item -Manually placing a @code{font-lock-multiline} or -@code{jit-lock-defer-multiline} property on the element when it is -added to the buffer. +Place a @code{font-lock-multiline} property on the construct. This +will rehighlight the whole construct if any part of it is changed. In +some cases you can do this automatically by setting the +@code{font-lock-multiline} variable. +@item +Use @code{jit-lock-contextually}. This will only rehighlight the part +of the construct that follows the actual change, and will do it after +a short delay. This only works if the highlighting of the various +parts of your multiline construct never depends on text in subsequent +lines. Since @code{jit-lock-contextually} is activated by default, +this can be an attractive solution. +@item +Place a @code{jit-lock-defer-multiline} property on the construct. +This works only if @code{jit-lock-contextually} is used, but it can +handle the case where highlighting depends on subsequent lines. @item -Using the @code{font-lock-fontify-region-function} hook to extend the -highlighted chunks so that they never start or end in the middle of -multiline element. @end itemize @menu @@ -3084,80 +3080,75 @@ multiline element. @node Font Lock Multiline @subsubsection Font Lock Multiline -In order to make it possible to properly @emph{re}highlight elements that -span multiple lines, Font Lock obeys a special text property -@code{font-lock-multiline} which if non-@code{nil} indicates that this -piece of text was highlighted as part of a multiline construct. -So when Font Lock is asked to rehighlight a region, it first verifies -the two boundaries and extends them as needed so they do not fall in -the middle of a piece of text marked with the -@code{font-lock-multiline} property. Immediately after that, it also -erases all @code{font-lock-multiline} properties from the region it is -about to highlight, so it is the responsability of the highlighting -specification (mostly @code{font-lock-keywords}) to make sure that -this property is re-added where needed so as to inform the next round -of Font Locking of the presence of a multiline construct. + One way to ensure reliable rehighlighting of multiline Font Lock +constructs is to put on the text property @code{font-lock-multiline}. +It should be present and non-@code{nil} for text that is part of a +multiline construct. -It is important to understand that the @code{font-lock-multiline} -property should preferably only be used on Font Lock elements of -moderate size: every time that text is modified within a multiline -element (or nearby), the whole multiline element will be completely -re-highlighted, so if its size is large, the time to font-lock may -render editing painfully slow. + When Font Lock is about to highlight a range of text, it first +extends the boundaries of the range as necessary so that they do not +fall within text marked with the @code{font-lock-multiline} property. +Then it removes any @code{font-lock-multiline} properties from the +range, and highlights it. The highlighting specification (mostly +@code{font-lock-keywords}) must reinstall this property each time, +whenever it is appropriate. + + @strong{Warning:} don't use the @code{font-lock-multiline} property +on large ranges of text, because that will make rehighlighting slow. @defvar font-lock-multiline If the @code{font-lock-multiline} variable is set to @code{t}, Font -Lock will try to automatically add the @code{font-lock-multiline} -property on the keywords that span several lines. This is no silver -bullet however since it slows down Font Lock somewhat, and may miss -some cases or make the property larger or smaller than necessary, -especially for keywords whose @var{MATCHER} is a function, in which -case the function needs to make sure that the submatch 0 covers the -whole relevant multiline entity even if only a small subpart will -be highlighted. It is often just as easy to add the -@code{font-lock-multiline} property by hand. +Lock will try to add the @code{font-lock-multiline} property +automatically on multiline constructs. This is not a universal +solution, however, since it slows down Font Lock somewhat. It can +miss some multiline constructs, or make the property larger or smaller +than necessary. + +For elements whose @var{matcher} is a function, the function should +ensure that submatch 0 covers the whole relevant multiline construct, +even if only a small subpart will be highlighted. It is often just as +easy to add the @code{font-lock-multiline} property by hand. @end defvar -As mentioned, this property is mostly intended to ensure proper -@emph{re}fontification. It does not magically discover new -multiline elements. To discover new multiline elements, all that is -required is that font-lock operate on large enough chunks at a time. -This will happen by accident on many cases, which may give the -impression that multiline elements magically work. If you set the -@code{font-lock-multiline} variable, this impression will be even -stronger since the highlighting of those found elements will be -properly preserved from then on. But for such multiline elements to -be found reliably, you will need to either manually put the -@code{font-lock-multiline} property from some appropriate piece of -code run before Font Lock, or hook into -@code{font-lock-fontify-region-function} to manually extend the chunks -of text that Font Lock highlights so they never start or stop in the -middle of a multiline element. + The @code{font-lock-multiline} property is meant to ensure proper +refontification; it does not automatically identify new multiline +constructs. Identifying the requires that Font-Lock operate on large +enough chunks at a time. This will happen by accident on many cases, +which may give the impression that multiline constructs magically work. +If you set the @code{font-lock-multiline} variable non-@code{nil}, +this impression will be even stronger, since the highlighting of those +constructs which are found will be properly updated from then on. +But that does not work reliably. + + To find multiline constructs reliably, you must either manually +place the @code{font-lock-multiline} property on the text before +Font-Lock looks at it, or use +@code{font-lock-fontify-region-function}. @node Region to Fontify @subsubsection Region to Fontify after a Buffer Change - When a buffer is changed, the region that Font Lock refontifies is by -default the smallest sequence of whole lines that spans the change. + When a buffer is changed, the region that Font Lock refontifies is +by default the smallest sequence of whole lines that spans the change. While this works well most of the time, sometimes it doesn't---for -example, when a buffer change has changed the syntactic meaning of text -on an earlier line. +example, when a change alters the syntactic meaning of text on an +earlier line. -You can enlarge (or even reduce) the region to fontify by setting @c either of -the following variables: + You can enlarge (or even reduce) the region to fontify by setting +one the following variables: @defvar font-lock-extend-region-function -This buffer-local variable is either @code{nil} or is a function that -determines the region to fontify, which Emacs then calls after each -buffer change. +This buffer-local variable is either @code{nil} or a function for +Font-Lock to call to determine the region to scan and fontify. The function is given three parameters, the standard @var{beg}, -@var{end}, and @var{old-len} from after-change-functions (@pxref{Change -Hooks}). It should return either a cons of the beginning and end buffer -positions (in that order) of the region to fontify, or @code{nil} (which -directs the caller to fontify the default region). This function needs -to preserve point, the match-data, and the current restriction. -The region it returns may start or end in the middle of a line. +@var{end}, and @var{old-len} from after-change-functions +(@pxref{Change Hooks}). It should return either a cons of the +beginning and end buffer positions (in that order) of the region to +fontify, or @code{nil} (which means choose the region in the standard +way). This function needs to preserve point, the match-data, and the +current restriction. The region it returns may start or end in the +middle of a line. Since this function is called after every buffer change, it should be reasonably fast. From eadb9d458f63db805e5bbaf5a73cc56cc8885155 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Apr 2006 02:35:46 +0000 Subject: [PATCH 30/83] *** empty log message *** --- lisp/ChangeLog | 4 +--- lispref/ChangeLog | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e08a2f39efa..7cfc9b21c1e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,9 +4,7 @@ 2006-04-29 Richard Stallman - * bindings.el (mode-line-major-mode-keymap): Move the major mode menu - to Mouse-3. - (help-echo): help-echo doc fixes. + * bindings.el (mode-line-format): help-echo doc fixes. * net/tramp.el (tramp-file-name-handler-alist): Delete expand-file-name and other operations that can cause spurious loading. diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 1eed9dec592..928790a1a9f 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2006-04-29 Richard Stallman + + * modes.texi (Multiline Font Lock): Renamed from + Multi line Font Lock Elements. Much clarification. + (Font Lock Multiline, Region to Fontify): Much clarification. + 2006-04-29 Stefan Monnier * variables.texi (File Local Variables): Remove the special case t for From 39c41ad4211ebf2ce76fc49d9621adace0439399 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 30 Apr 2006 15:35:54 +0000 Subject: [PATCH 31/83] (Fforward_comment): Don't forget to break out of the loop when we skipped backward over a generic comment. --- src/ChangeLog | 5 +++++ src/syntax.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index a4d458bee0f..99e1b6a90f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Martin Rudalics (tiny change) + + * syntax.c (Fforward_comment): Don't forget to break out of the loop + when we skipped backward over a generic comment. + 2006-04-27 Nick Roberts * .gdbinit (pp1, pv1): Only print value as expression is now diff --git a/src/syntax.c b/src/syntax.c index 3f668eac946..f56bc1181c7 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2140,6 +2140,9 @@ between them, return t; otherwise return nil. */) from_byte = ini_byte; goto leave; } + else + /* We have skipped one comment. */ + break; } else if (code == Sendcomment) { From cc1eecfd888839f6d75c0c7aa5d1e8e37f31d1c7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 30 Apr 2006 15:49:08 +0000 Subject: [PATCH 32/83] Update my email address. --- lisp/cvs-status.el | 2 +- lisp/diff-mode.el | 2 +- lisp/log-edit.el | 2 +- lisp/log-view.el | 2 +- lisp/pcvs-defs.el | 2 +- lisp/pcvs-info.el | 2 +- lisp/pcvs-parse.el | 2 +- lisp/pcvs-util.el | 2 +- lisp/reveal.el | 2 +- lisp/smerge-mode.el | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index cf0ee85db23..477914293a7 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, ;; 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs cvs status tree tools ;; This file is part of GNU Emacs. diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 7c7f7902d82..36e99888d60 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: convenience patch diff ;; This file is part of GNU Emacs. diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 0c7a655a237..611bab0a247 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, ;; 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs cvs commit log ;; This file is part of GNU Emacs. diff --git a/lisp/log-view.el b/lisp/log-view.el index 8a6f88650d2..dbee454b7d6 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: rcs sccs cvs log version-control ;; This file is part of GNU Emacs. diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el index 8f7de913261..127a550b28c 100644 --- a/lisp/pcvs-defs.el +++ b/lisp/pcvs-defs.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs ;; This file is part of GNU Emacs. diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el index 7d1a11ccb68..4aaa5add58d 100644 --- a/lisp/pcvs-info.el +++ b/lisp/pcvs-info.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs ;; This file is part of GNU Emacs. diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index 892dc962767..0193939606c 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs ;; This file is part of GNU Emacs. diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index b04f3c121a1..cb18fc83d59 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: pcl-cvs ;; This file is part of GNU Emacs. diff --git a/lisp/reveal.el b/lisp/reveal.el index 4120f9331b3..84411f98658 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: outlines ;; This file is part of GNU Emacs. diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index 9fddc4b1a05..8d9df188875 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, ;; 2004, 2005, 2006 Free Software Foundation, Inc. -;; Author: Stefan Monnier +;; Author: Stefan Monnier ;; Keywords: tools revision-control merge diff3 cvs conflict ;; This file is part of GNU Emacs. From 9abc5f4519ebcaf74a937581784fe4e73c2e8a06 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Apr 2006 22:15:21 +0000 Subject: [PATCH 33/83] (Fdefine_key): Improve error message when KEY begins with a non-prefix key. --- src/ChangeLog | 5 +++++ src/keymap.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 99e1b6a90f1..1f96b0aaaa4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Richard Stallman + + * keymap.c (Fdefine_key): Improve error message + when KEY begins with a non-prefix key. + 2006-04-30 Martin Rudalics (tiny change) * syntax.c (Fforward_comment): Don't forget to break out of the loop diff --git a/src/keymap.c b/src/keymap.c index 66f17178d5b..4f8343bf5cf 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1193,8 +1193,11 @@ binding KEY to DEF is added at the front of KEYMAP. */) if (!CONSP (keymap)) /* We must use Fkey_description rather than just passing key to error; key might be a vector, not a string. */ - error ("Key sequence %s uses invalid prefix characters", - SDATA (Fkey_description (key, Qnil))); + error ("Key sequence %s starts with non-prefix key %s", + SDATA (Fkey_description (key, Qnil)), + SDATA (Fkey_description (Fsubstring (key, make_number (0), + make_number (idx)), + Qnil))); } } From 1a2416ede302cdcf126c9876bdac5f4ae31fb223 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 30 Apr 2006 23:10:48 +0000 Subject: [PATCH 34/83] (gud-def): Add %c case. (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. (gud-format-command): Make match case sensitive. Match on %F. --- lisp/progmodes/gud.el | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 1549150dfa8..11259aa3965 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -303,13 +303,15 @@ Uses `gud--directories' to find the source files." optional doc string DOC. Certain %-escapes in the string arguments are interpreted specially if present. These are: - %f name (without directory) of current source file. - %F name (without directory or extension) of current source file. - %d directory of current source file. - %l number of current source line - %e text of the C lvalue or function-call expression surrounding point. - %a text of the hexadecimal address surrounding point - %p prefix argument to the command (if any) as a number + %f -- Name (without directory) of current source file. + %F -- Name (without directory or extension) of current source file. + %d -- Directory of current source file. + %l -- Number of current source line. + %e -- Text of the C lvalue or function-call expression surrounding point. + %a -- Text of the hexadecimal address surrounding point. + %p -- Prefix argument to the command (if any) as a number. + %c -- Fully qualified class name derived from the expression + surrounding point (jdb only). The `current' source file is the file of the current buffer (if we're in a C file) or the source file current at the last break or @@ -446,8 +448,7 @@ required by the caller." (when (or gdb-force-update (not (save-excursion (goto-char (point-min)) - (let ((case-fold-search t)) - (looking-at "Watch Expressions:"))))) + (looking-at "Watch Expressions:")))) (erase-buffer) (insert "Watch Expressions:\n") (if gdb-speedbar-auto-raise @@ -2804,7 +2805,9 @@ Obeying it means displaying in another window the specified file and line." (let ((insource (not (eq (current-buffer) gud-comint-buffer))) (frame (or gud-last-frame gud-last-last-frame)) result) - (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str)) + (while (and str + (let ((case-fold-search nil)) + (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str))) (let ((key (string-to-char (match-string 2 str))) subst) (cond From 2c3981da7c5cdaa1d52c79d348fa1b13bbde1c2e Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 30 Apr 2006 23:15:34 +0000 Subject: [PATCH 35/83] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ man/ChangeLog | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7cfc9b21c1e..6341b04d6cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-05-01 Nick Roberts + + * progmodes/gud.el (gud-def): Add %c case. + (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. + (gud-format-command): Make match case sensitive. Match on %F. + 2006-04-29 Dan Nicolaescu * help-fns.el (describe-variable): Add info about safe local variables. diff --git a/man/ChangeLog b/man/ChangeLog index ff23fe67a18..503814019b5 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-05-01 Nick Roberts + + * building.texi (GUD Customization): Describe cases %d and %c. + Update description for %e. + 2006-04-29 Dan Nicolaescu * custom.texi (Examining): Update C-h v output example. From d6802fc19c85c31f9de44064d959e7c041c68e1d Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 30 Apr 2006 23:16:47 +0000 Subject: [PATCH 36/83] (GUD Customization): Describe cases %d and %c. Update description for %e. --- man/building.texi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/man/building.texi b/man/building.texi index 57ecbeb2a5b..0cbaa5d1826 100644 --- a/man/building.texi +++ b/man/building.texi @@ -766,8 +766,6 @@ the command to @kbd{C-c @var{binding}} in the GUD buffer's mode and to The name of the current source file. If the current buffer is the GUD buffer, then the ``current source file'' is the file that the program stopped in. -@c This said, ``the name of the file the program counter was in at the last breakpoint.'' -@c But I suspect it is really the last stop file. @item %l The number of the current source line. If the current buffer is the GUD @@ -775,7 +773,9 @@ buffer, then the ``current source line'' is the line that the program stopped in. @item %e -The text of the C lvalue or function-call expression at or adjacent to point. +In transient-mark-mode the text in the region, if it is active. +Otherwise the text of the C lvalue or function-call expression at or +adjacent to point. @item %a The text of the hexadecimal address at or adjacent to point. @@ -787,6 +787,13 @@ empty string. If you don't use @samp{%p} in the command string, the command you define ignores any numeric argument. + +@item %d +The name of the directory of the current source file. + +@item %c +Fully qualified class name derived from the expression surrounding point +(jdb only). @end table @node GDB Graphical Interface From fc36394b4b5456392ca891d63842bb59d442656d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:09:40 +0000 Subject: [PATCH 37/83] (mac-ae-open-documents, mac-drag-n-drop): Use select-frame-set-input-focus instead of raise-frame. (global-map): Bind M-drag-n-drop to mac-drag-n-drop. --- lisp/term/mac-win.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 68c95d4b319..188ecdf8f27 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1480,7 +1480,7 @@ in `selection-converter-alist', which see." (re-search-forward (mapconcat 'regexp-quote (split-string search-text) "\\|") nil t))))) - (raise-frame)) + (select-frame-set-input-focus (selected-frame))) (defun mac-ae-text (ae) (or (cdr (mac-ae-parameter ae nil "TEXT")) @@ -2039,9 +2039,10 @@ Switch to a buffer editing the last file dropped." (dolist (file-name (nth 2 event)) (dnd-handle-one-url window 'private (concat "file:" file-name)))) - (raise-frame)) + (select-frame-set-input-focus (selected-frame))) (global-set-key [drag-n-drop] 'mac-drag-n-drop) +(global-set-key [M-drag-n-drop] 'mac-drag-n-drop) ;;;; Non-toolkit Scroll bars From 47915f5ffd18150b85edb6beb07f816dc950f5b5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:10:29 +0000 Subject: [PATCH 38/83] (Mac International): Now Carbon Emacs has ATSUI support. (Mac Environment Variables): Shorten example line. (Mac Font Specs): Shorten lisp lines. Add descriptions for ATSUI. --- man/macos.texi | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/man/macos.texi b/man/macos.texi index 89ce13d1d1b..272609b8392 100644 --- a/man/macos.texi +++ b/man/macos.texi @@ -104,13 +104,6 @@ character codes in the range 128-159. The coding systems @code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic} are used to represent these Mac encodings. - The fontset @code{fontset-standard} is created automatically when -Emacs is run on Mac, and used by default. It displays as many kinds -of characters as possible using 12-point Monaco as a base font. If -you see some character as a hollow box with this fontset, then it's -almost impossible to display it only by customizing font settings -(@pxref{Mac Font Specs}). - You can use input methods provided either by LEIM (@pxref{Input Methods}) or Mac OS to enter international characters. To use the former, see the International Character Set Support section of the @@ -195,7 +188,7 @@ invoked from the Finder or the @command{open} command. Command line arguments are specified like @example -/Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x25 & +/Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 & @end example @noindent @@ -295,7 +288,8 @@ you specify face attributes instead. For example, you can use 14pt Courier by customizing the default face attributes for all frames: @lisp -(set-face-attribute 'default nil :family "courier" :height 140) +(set-face-attribute 'default nil + :family "courier" :height 140) @end lisp @noindent @@ -313,21 +307,30 @@ standard X font name: @noindent @xref{Font X}. Wildcards are supported as they are on X. - Native Apple fonts in Mac Roman encoding has maker name @code{apple} -and charset @code{mac-roman}. For example 12-point Monaco can be -specified by the name @samp{-apple-monaco-*-12-*-mac-roman}. When -using a particular size of scalable fonts, it must be specified in a -format containing 14 @samp{-}s like -@samp{-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman}. + Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts +by default. Emacs on Mac OS X uses @acronym{ATSUI, Apple Type Services +for Unicode Imaging} as well as QuickDraw Text, and most of the +characters other than Chinese, Japanese, and Korean ones are drawn using +the former by default. - You can specify a @code{mac-roman} font for @acronym{ASCII} -characters like + @acronym{ATSUI}-compatible fonts have maker name @code{apple} and +charset @code{iso10646-1}. For example 12-point Monaco can be specified +by the name +@samp{-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1}. Note +that it must be specified in a format containing 14 @samp{-}s (i.e., not +by @samp{-apple-monaco-medium-r-normal-12-*-iso10646-1}) because every +@acronym{ATSUI}-compatible font is a scalable one. -@lisp + QuickDraw Text fonts have maker name @code{apple} and various charset +names other than @code{iso10646-1}. Native Apple fonts in Mac Roman +encoding has charset @code{mac-roman}. You can specify a +@code{mac-roman} font for @acronym{ASCII} characters like + +@smalllisp (add-to-list 'default-frame-alist '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman")) -@end lisp +@end smalllisp @noindent but that does not extend to ISO-8859-1: specifying a @code{mac-roman} @@ -341,16 +344,11 @@ charsets @samp{big5-0}, @samp{gb2312.1980-0}, @samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats}, respectively. - Since Emacs as of the current version uses QuickDraw Text routines -for drawing texts, only characters in the charsets listed above can be -displayed with the OS-bundled fonts, even if other applications that -use @acronym{ATSUI} or Cocoa can display variety of characters with -them. - The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining -Fontsets}) for defining fontsets often results in wrong ones -especially when using only OS-bundled fonts. The recommended way is -to create a fontset using @code{create-fontset-from-mac-roman-font}: +Fontsets}) for defining fontsets often results in wrong ones especially +when using only OS-bundled QuickDraw Text fonts. The recommended way to +use them is to create a fontset using +@code{create-fontset-from-mac-roman-font}: @lisp (create-fontset-from-mac-roman-font @@ -374,11 +372,13 @@ encoded in the names of their font suitcases. E.g., the font suitcase the name @samp{-ETL-fixed-*-iso8859-1}. @vindex mac-allow-anti-aliasing - Emacs uses the QuickDraw text rendering by default. On Mac OS X -10.2 and later, it can be changed so that it uses the Quartz 2D text -rendering (aka CG text rendering) by setting -@code{mac-allow-anti-aliasing} to @code{t}. However, it is reported -to sometimes leave some garbages. + Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D +(aka Core Graphics) and QuickDraw. By default, Emacs uses the former on +such versions. It can be changed by setting +@code{mac-allow-anti-aliasing} to @code{t} (Quartz 2D) or @code{nil} +(QuickDraw). Both @acronym{ATSUI} and QuickDraw Text drawings are +affected by the value of this variable. + @node Mac Functions @section Mac-Specific Lisp Functions From a59871e76d23e765c7bb36c4a6a06a4147a0bbff Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:01 +0000 Subject: [PATCH 39/83] (update_window): Don't set changed_p when mode/header line is updated. --- src/dispnew.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index c0acc738c78..da5e9c6e398 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4156,7 +4156,6 @@ update_window (w, force_p) update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, desired_matrix), &mouse_face_overwritten_p); - changed_p = 1; } /* Find first enabled row. Optimizations in redisplay_internal @@ -4226,7 +4225,6 @@ update_window (w, force_p) { header_line_row->y = 0; update_window_line (w, 0, &mouse_face_overwritten_p); - changed_p = 1; } /* Fix the appearance of overlapping/overlapped rows. */ From d3601bf266b918b090170efa11e32fe8ba137151 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:28 +0000 Subject: [PATCH 40/83] (mac_coerce_file_name_ptr): Try typeFSRef if coercion through typeFileURL failed. --- src/mac.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/src/mac.c b/src/mac.c index 7172301b6b0..444320322c3 100644 --- a/src/mac.c +++ b/src/mac.c @@ -448,6 +448,22 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, } else err = memFullErr; + + if (err != noErr) + { + /* Just to be paranoid ... */ + FSRef fref; + char *buf; + + buf = xmalloc (data_size + 1); + memcpy (buf, data_ptr, data_size); + buf[data_size] = '\0'; + err = FSPathMakeRef (buf, &fref, NULL); + xfree (buf); + if (err == noErr) + err = AECoercePtr (typeFSRef, &fref, sizeof (FSRef), + to_type, result); + } #else FSSpec fs; char *buf; @@ -510,6 +526,34 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, CFDataGetLength (data), result); CFRelease (data); } + + if (err != noErr) + { + /* Coercion from typeAlias to typeFileURL fails on Mac OS X + 10.2. In such cases, try typeFSRef as a target type. */ + char file_name[MAXPATHLEN]; + + if (type_code == typeFSRef && data_size == sizeof (FSRef)) + err = FSRefMakePath (data_ptr, file_name, sizeof (file_name)); + else + { + AEDesc desc; + FSRef fref; + + err = AECoercePtr (type_code, data_ptr, data_size, + typeFSRef, &desc); + if (err == noErr) + { + err = AEGetDescData (&desc, &fref, sizeof (FSRef)); + AEDisposeDesc (&desc); + } + if (err == noErr) + err = FSRefMakePath (&fref, file_name, sizeof (file_name)); + } + if (err == noErr) + err = AECreateDesc (TYPE_FILE_NAME, file_name, + strlen (file_name), result); + } #else char file_name[MAXPATHLEN]; @@ -529,11 +573,11 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size, #else fs = *(FSSpec *)(*(desc.dataHandle)); #endif - if (err == noErr) - err = fsspec_to_posix_pathname (&fs, file_name, - sizeof (file_name) - 1); AEDisposeDesc (&desc); } + if (err == noErr) + err = fsspec_to_posix_pathname (&fs, file_name, + sizeof (file_name) - 1); } if (err == noErr) err = AECreateDesc (TYPE_FILE_NAME, file_name, From caec817144f49a22d92f77ffb1ed6091ce654b21 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:11:56 +0000 Subject: [PATCH 41/83] (mac_update_title_bar): New function. [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. --- src/macfns.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/src/macfns.c b/src/macfns.c index f9a5f051eb4..dd74808d1cf 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1919,6 +1919,99 @@ mac_set_scroll_bar_width (f, arg, oldval) x_set_scroll_bar_width (f, arg, oldval); } +#if TARGET_API_MAC_CARBON +static void +mac_update_proxy_icon (f) + struct frame *f; +{ + Lisp_Object file_name = + XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename; + Window w = FRAME_MAC_WINDOW (f); + + if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name)) + return; + if (FRAME_FILE_NAME (f) && STRINGP (file_name) + && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0) + return; + + if (FRAME_FILE_NAME (f)) + { + xfree (FRAME_FILE_NAME (f)); + FRAME_FILE_NAME (f) = NULL; + } + + BLOCK_INPUT; + + if (STRINGP (file_name)) + { + OSStatus err; + AEDesc desc; + Lisp_Object encoded_file_name = ENCODE_FILE (file_name); + +#ifdef MAC_OS8 + SetPortWindowPort (w); +#endif + err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), + SBYTES (encoded_file_name), typeAlias, &desc); + if (err == noErr) + { + Size size = AEGetDescDataSize (&desc); + AliasHandle alias = (AliasHandle) NewHandle (size); + + if (alias == NULL) + err = memFullErr; + else + { + HLock ((Handle) alias); + err = AEGetDescData (&desc, *alias, size); + HUnlock ((Handle) alias); + if (err == noErr) + err = SetWindowProxyAlias (w, alias); + DisposeHandle ((Handle) alias); + } + AEDisposeDesc (&desc); + } + if (err == noErr) + { + FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1); + strcpy (FRAME_FILE_NAME (f), SDATA (file_name)); + } + } + + if (FRAME_FILE_NAME (f) == NULL) + RemoveWindowProxy (w); + + UNBLOCK_INPUT; +} +#endif + +void mac_update_title_bar (f, save_match_data) + struct frame *f; + int save_match_data; +{ +#if TARGET_API_MAC_CARBON + struct window *w; + int modified_p; + + if (!FRAME_MAC_P (f)) + return; + + w = XWINDOW (FRAME_SELECTED_WINDOW (f)); + modified_p = (BUF_SAVE_MODIFF (XBUFFER (w->buffer)) + < BUF_MODIFF (XBUFFER (w->buffer))); + if (windows_or_buffers_changed + /* Minibuffer modification status shown in the close button is + confusing. */ + || (!MINI_WINDOW_P (w) + && (modified_p != !NILP (w->last_had_star)))) + SetWindowModified (FRAME_MAC_WINDOW (f), + !MINI_WINDOW_P (w) && modified_p); + + if (windows_or_buffers_changed) + mac_update_proxy_icon (f); +#endif +} + /* Subroutines of creating a frame. */ @@ -3470,6 +3563,9 @@ show_hourglass (timer) if (FRAME_LIVE_P (f) && FRAME_MAC_P (f) && FRAME_MAC_WINDOW (f) != tip_window) { +#if USE_CG_DRAWING + mac_prepare_for_quickdraw (f); +#endif if (!f->output_data.mac->hourglass_control) { Window w = FRAME_MAC_WINDOW (f); @@ -3514,7 +3610,12 @@ hide_hourglass () if (FRAME_MAC_P (f) /* Watch out for newly created frames. */ && f->output_data.mac->hourglass_control) - HideControl (f->output_data.mac->hourglass_control); + { +#if USE_CG_DRAWING + mac_prepare_for_quickdraw (f); +#endif + HideControl (f->output_data.mac->hourglass_control); + } } hourglass_shown_p = 0; From b0635670ea3058a5ec55729c02d26ada77012304 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:12:23 +0000 Subject: [PATCH 42/83] (USE_ATSUI): Set default to 1 if MAC_OSX is defined. (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. (enum pcm_status): New enum. (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) (XCharStructRow): Remove. Now validity is represented by non-negativeness of sum of ascent and descent. (struct MacFontStruct): Change type of member `rows'. (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. --- src/macgui.h | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/macgui.h b/src/macgui.h index 7eb6c9942ab..579ae2b7663 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -79,14 +79,26 @@ typedef unsigned long Time; #include #endif /* not HAVE_CARBON */ +/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for + text drawing. */ +#ifndef USE_ATSUI +#ifdef MAC_OSX +#define USE_ATSUI 1 +#endif +#endif + +/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing + in preference to ATSUI for ASCII and Latin-1 characters. */ #ifndef USE_CG_TEXT_DRAWING #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 #define USE_CG_TEXT_DRAWING 1 #endif #endif +/* Whether to use Quartz 2D routines for drawing operations other than + texts. */ #ifndef USE_CG_DRAWING -#if USE_ATSUI && defined (MAC_OSX) +#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 #define USE_CG_DRAWING 1 #endif #endif @@ -105,6 +117,8 @@ typedef GWorldPtr Pixmap; /* Emulate XCharStruct. */ +/* If the sum of ascent and descent is negative, that means some + special status specified by enum pcm_status. */ typedef struct _XCharStruct { short lbearing; /* origin to left edge of raster */ @@ -117,6 +131,12 @@ typedef struct _XCharStruct #endif } XCharStruct; +enum pcm_status + { + PCM_VALID = 0, /* pcm data is valid */ + PCM_INVALID = -1, /* pcm data is invalid */ + }; + #define STORE_XCHARSTRUCT(xcs, w, bds) \ ((xcs).width = (w), \ (xcs).lbearing = (bds).left, \ @@ -124,18 +144,6 @@ typedef struct _XCharStruct (xcs).ascent = -(bds).top, \ (xcs).descent = (bds).bottom) -typedef struct -{ - char valid_bits[0x100 / 8]; - XCharStruct per_char[0x100]; -} XCharStructRow; - -#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \ - ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8)) - -#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \ - ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8)) - struct MacFontStruct { char *full_name; @@ -175,7 +183,7 @@ struct MacFontStruct { XCharStruct max_bounds; /* maximum bounds over all existing char */ union { XCharStruct *per_char; /* first_char to last_char information */ - XCharStructRow **rows; /* first row to last row information */ + XCharStruct **rows; /* first row to last row information */ } bounds; int ascent; /* logical extent above baseline for spacing */ int descent; /* logical decent below baseline for spacing */ @@ -229,7 +237,7 @@ typedef struct _XGC /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */ RgnHandle clip_region; -#if defined (MAC_OSX) && USE_ATSUI +#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING) /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate is in QuickDraw's. */ CGRect clip_rects[MAX_CLIP_RECTS]; From 458dbb8c7a5f3d3950529e05728b9327e50d7025 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:06 +0000 Subject: [PATCH 43/83] (mac_draw_line, mac_draw_line_to_pixmap): Adjust endpoints of strictly horizontal/vertical lines. (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. (pcm_init, pcm_get_status): New functions. (x_per_char_metric, XLoadQueryFont): Use them instead of XCharStructRow and related macros. (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag and window path pop-up menu on title bar. (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. --- src/macterm.c | 119 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 98 insertions(+), 21 deletions(-) diff --git a/src/macterm.c b/src/macterm.c index cbef67c3bee..60b5545d510 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -389,16 +389,37 @@ mac_draw_line (f, gc, x1, y1, x2, y2) { #if USE_CG_DRAWING CGContextRef context; + float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2; + + if (y1 != y2) + gx1 += 0.5f, gx2 += 0.5f; + if (x1 != x2) + gy1 += 0.5f, gy2 += 0.5f; context = mac_begin_cg_clip (f, gc); CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); CGContextBeginPath (context); - CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f); - CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f); + CGContextMoveToPoint (context, gx1, gy1); + CGContextAddLineToPoint (context, gx2, gy2); CGContextClosePath (context); CGContextStrokePath (context); mac_end_cg_clip (f); #else + if (x1 == x2) + { + if (y1 > y2) + y1--; + else if (y2 > y1) + y2--; + } + else if (y1 == y2) + { + if (x1 > x2) + x1--; + else + x2--; + } + SetPortWindowPort (FRAME_MAC_WINDOW (f)); RGBForeColor (GC_FORE_COLOR (gc)); @@ -420,6 +441,21 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) CGrafPtr old_port; GDHandle old_gdh; + if (x1 == x2) + { + if (y1 > y2) + y1--; + else if (y2 > y1) + y2--; + } + else if (y1 == y2) + { + if (x1 > x2) + x1--; + else + x2--; + } + GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); @@ -1625,7 +1661,7 @@ mac_set_clip_rectangles (display, gc, rectangles, n) DisposeRgn (region); } } -#if defined (MAC_OSX) && USE_ATSUI +#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING) for (i = 0; i < n; i++) { Rect *rect = rectangles + i; @@ -2136,6 +2172,29 @@ static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *)); +static void +pcm_init (pcm, count) + XCharStruct *pcm; + int count; +{ + bzero (pcm, sizeof (XCharStruct) * count); + while (--count >= 0) + { + pcm->descent = PCM_INVALID; + pcm++; + } +} + +static enum pcm_status +pcm_get_status (pcm) + XCharStruct *pcm; +{ + int height = pcm->ascent + pcm->descent; + + /* Negative height means some special status. */ + return height >= 0 ? PCM_VALID : height; +} + /* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B is not contained in the font. */ @@ -2152,22 +2211,21 @@ x_per_char_metric (font, char2b) #if USE_ATSUI if (font->mac_style) { - XCharStructRow **row = font->bounds.rows + char2b->byte1; + XCharStruct **row = font->bounds.rows + char2b->byte1; if (*row == NULL) { - *row = xmalloc (sizeof (XCharStructRow)); - bzero (*row, sizeof (XCharStructRow)); + *row = xmalloc (sizeof (XCharStruct) * 0x100); + pcm_init (*row, 0x100); } - pcm = (*row)->per_char + char2b->byte2; - if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2)) + pcm = *row + char2b->byte2; + if (pcm_get_status (pcm) != PCM_VALID) { BLOCK_INPUT; mac_query_char_extents (font->mac_style, (char2b->byte1 << 8) + char2b->byte2, NULL, NULL, pcm, NULL); UNBLOCK_INPUT; - XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2); } } else @@ -3122,13 +3180,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, for (i = 0; i < width; ++i) mac_draw_line (f, gc, left_x + i * left_p, top_y + i, - right_x - i * right_p, top_y + i); + right_x + 1 - i * right_p, top_y + i); /* Left. */ if (left_p) for (i = 0; i < width; ++i) mac_draw_line (f, gc, - left_x + i, top_y + i, left_x + i, bottom_y - i); + left_x + i, top_y + i, left_x + i, bottom_y - i + 1); mac_reset_clip_rectangles (dpy, gc); if (raised_p) @@ -3142,13 +3200,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, for (i = 0; i < width; ++i) mac_draw_line (f, gc, left_x + i * left_p, bottom_y - i, - right_x - i * right_p, bottom_y - i); + right_x + 1 - i * right_p, bottom_y - i); /* Right. */ if (right_p) for (i = 0; i < width; ++i) mac_draw_line (f, gc, - right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1); + right_x - i, top_y + i + 1, right_x - i, bottom_y - i); mac_reset_clip_rectangles (dpy, gc); } @@ -6300,6 +6358,11 @@ x_free_frame_resources (f) if (FRAME_SIZE_HINTS (f)) xfree (FRAME_SIZE_HINTS (f)); +#if TARGET_API_MAC_CARBON + if (FRAME_FILE_NAME (f)) + xfree (FRAME_FILE_NAME (f)); +#endif + xfree (f->output_data.mac); f->output_data.mac = NULL; @@ -7746,10 +7809,10 @@ XLoadQueryFont (Display *dpy, char *fontname) font->min_char_or_byte2 = 0; font->max_char_or_byte2 = 0xff; - font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100); - bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100); - font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow)); - bzero (font->bounds.rows[0], sizeof (XCharStructRow)); + font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100); + bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100); + font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100); + pcm_init (font->bounds.rows[0], 0x100); #if USE_CG_TEXT_DRAWING { @@ -7775,7 +7838,7 @@ XLoadQueryFont (Display *dpy, char *fontname) bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100); } #endif - space_bounds = font->bounds.rows[0]->per_char + 0x20; + space_bounds = font->bounds.rows[0] + 0x20; err = mac_query_char_extents (font->mac_style, 0x20, &font->ascent, &font->descent, space_bounds, @@ -7791,9 +7854,8 @@ XLoadQueryFont (Display *dpy, char *fontname) mac_unload_font (&one_mac_display_info, font); return NULL; } - XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20); - pcm = font->bounds.rows[0]->per_char; + pcm = font->bounds.rows[0]; for (c = 0x21; c <= 0xff; c++) { if (c == 0xad) @@ -7813,7 +7875,6 @@ XLoadQueryFont (Display *dpy, char *fontname) NULL #endif ); - XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c); #if USE_CG_TEXT_DRAWING if (font->cg_glyphs && font->cg_glyphs[c] == 0) @@ -9997,8 +10058,20 @@ XTread_socket (sd, expected, hold_quit) } break; +#if TARGET_API_MAC_CARBON + case inProxyIcon: + if (TrackWindowProxyDrag (window_ptr, er.where) + != errUserWantsToDragWindow) + break; + /* fall through */ +#endif case inDrag: #if TARGET_API_MAC_CARBON + if (IsWindowPathSelectClick (window_ptr, &er)) + { + WindowPathSelect (window_ptr, NULL, NULL); + break; + } DragWindow (window_ptr, er.where, NULL); #else /* not TARGET_API_MAC_CARBON */ DragWindow (window_ptr, er.where, &qd.screenBits.bounds); @@ -11049,7 +11122,11 @@ button will be mouse-3. */); doc: /* *If non-nil, allow anti-aliasing. The text will be rendered using Core Graphics text rendering which may anti-alias the text. */); +#if USE_CG_DRAWING + mac_use_core_graphics = 1; +#else mac_use_core_graphics = 0; +#endif /* Register an entry for `mac-roman' so that it can be used when creating the terminal frame on Mac OS 9 before loading From a019c41a5cd58fcc8b518edcdfc46e04471fbff9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:29 +0000 Subject: [PATCH 44/83] (mac_update_title_bar): Add extern. (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. (FRAME_FILE_NAME): New macro. --- src/macterm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/macterm.h b/src/macterm.h index e35f04a6ba6..f23554f01c6 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -335,6 +335,11 @@ struct mac_output { /* Hints for the size and the position of a window. */ XSizeHints *size_hints; +#if TARGET_API_MAC_CARBON + /* File name for the proxy icon of this frame. Might be NULL. */ + char *file_name; +#endif + #if USE_CG_DRAWING /* Quartz 2D graphics context. */ CGContextRef cg_context; @@ -360,6 +365,8 @@ typedef struct mac_output mac_output; #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) +#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name) + /* This gives the mac_display_info structure for the display F is on. */ #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) @@ -606,6 +613,7 @@ extern int x_char_width P_ ((struct frame *)); extern int x_char_height P_ ((struct frame *)); extern void x_sync P_ ((struct frame *)); extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); +extern void mac_update_title_bar P_ ((struct frame *, int)); /* Defined in macmenu.c */ From 6dc5c8a75b8ad0aea911c0236e4fdb35e1e0839f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:13:42 +0000 Subject: [PATCH 45/83] (unexec): Error if trying unexec from dumped executable. --- src/unexmacosx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 4ca0be829a2..f65fd9cbc22 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -1021,6 +1021,9 @@ void unexec (char *outfile, char *infile, void *start_data, void *start_bss, void *entry_address) { + if (in_dumped_exec) + unexec_error ("Unexec from a dumped executable is not supported."); + infd = open (infile, O_RDONLY, 0); if (infd < 0) { From 15ba779363ab1069b0ddba682de844246e78a72b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:14:09 +0000 Subject: [PATCH 46/83] (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't distinguish known faces from others. --- src/xdisp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 65b16da76c3..ecc097343f2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8954,6 +8954,9 @@ prepare_menu_bars () update_menu_bar (f, 0); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (f, 0); +#ifdef MAC_OS + mac_update_title_bar (f, 0); +#endif #endif UNGCPRO; } @@ -8966,6 +8969,9 @@ prepare_menu_bars () update_menu_bar (sf, 1); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (sf, 1); +#ifdef MAC_OS + mac_update_title_bar (sf, 1); +#endif #endif } @@ -18520,8 +18526,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p) sure to use a face suitable for unibyte. */ STORE_XCHAR2B (char2b, 0, glyph->u.ch); } - else if (glyph->u.ch < 128 - && glyph->face_id < BASIC_FACE_ID_SENTINEL) + else if (glyph->u.ch < 128) { /* Case of ASCII in a face known to fit ASCII. */ STORE_XCHAR2B (char2b, 0, glyph->u.ch); @@ -18923,7 +18928,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) face_id = FACE_FOR_CHAR (f, face, c); face = FACE_FROM_ID (f, face_id); } - else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL) + else if (c < 128) { /* Case of ASCII in a face known to fit ASCII. */ STORE_XCHAR2B (char2b, 0, c); From c1eb34c22c52e237a588059d93781a1bd757c8ca Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 01:14:30 +0000 Subject: [PATCH 47/83] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ man/ChangeLog | 6 ++++++ src/ChangeLog | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6341b04d6cf..869a8301c53 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-05-01 YAMAMOTO Mitsuharu + + * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use + select-frame-set-input-focus instead of raise-frame. + (global-map): Bind M-drag-n-drop to mac-drag-n-drop. + 2006-05-01 Nick Roberts * progmodes/gud.el (gud-def): Add %c case. diff --git a/man/ChangeLog b/man/ChangeLog index 503814019b5..a5797e38b28 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2006-05-01 YAMAMOTO Mitsuharu + + * macos.texi (Mac International): Now Carbon Emacs has ATSUI support. + (Mac Environment Variables): Shorten example line. + (Mac Font Specs): Shorten lisp lines. Add descriptions for ATSUI. + 2006-05-01 Nick Roberts * building.texi (GUD Customization): Describe cases %d and %c. diff --git a/src/ChangeLog b/src/ChangeLog index 1f96b0aaaa4..8b5ca9e8435 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,47 @@ +2006-05-01 YAMAMOTO Mitsuharu + + * dispnew.c (update_window): Don't set changed_p when mode/header + line is updated. + + * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. + (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't + distinguish known faces from others. + + * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion + through typeFileURL failed. + + * macfns.c (mac_update_title_bar): New function. + [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. + (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call + mac_prepare_for_quickdraw. + + * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. + (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. + (enum pcm_status): New enum. + (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID) + (XCharStructRow): Remove. Now validity is represented by + non-negativeness of sum of ascent and descent. + (struct MacFontStruct): Change type of member `rows'. + (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. + + * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): Adjust + endpoints of strictly horizontal/vertical lines. + (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. + (pcm_init, pcm_get_status): New functions. + (x_per_char_metric, XLoadQueryFont): Use them instead of + XCharStructRow and related macros. + (x_draw_relief_rect): Don't adjust arguments of mac_draw_line. + (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME. + (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag + and window path pop-up menu on title bar. + (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1. + + * macterm.h (mac_update_title_bar): Add extern. + (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'. + (FRAME_FILE_NAME): New macro. + + * unexmacosx.c (unexec): Error if trying unexec from dumped executable. + 2006-04-30 Richard Stallman * keymap.c (Fdefine_key): Improve error message From d5085af01f3c3f4ff83ca94b029959784fe29253 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 1 May 2006 02:51:38 +0000 Subject: [PATCH 48/83] (mac_update_title_bar): Minor format change. --- src/macfns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/macfns.c b/src/macfns.c index dd74808d1cf..408600c56bb 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1985,7 +1985,8 @@ mac_update_proxy_icon (f) } #endif -void mac_update_title_bar (f, save_match_data) +void +mac_update_title_bar (f, save_match_data) struct frame *f; int save_match_data; { From 1dc51c0019cd76097f7e885dedf538f0c3b4dcfb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 1 May 2006 03:28:50 +0000 Subject: [PATCH 49/83] *** empty log message *** --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 869a8301c53..f54d2b2eb31 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2006-04-30 Glenn Morris + + * calendar/cal-tex.el (cal-tex-preamble-extra): New variable. + (cal-tex-preamble): Use cal-tex-preamble-extra. + (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather + than alias `list-diary-entries'. + 2006-05-01 YAMAMOTO Mitsuharu * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use From 89aab5d47c1ee4b0851c90ef179bf5b350baa8cd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 1 May 2006 03:29:19 +0000 Subject: [PATCH 50/83] (cal-tex-preamble-extra): New variable. (cal-tex-preamble): Use cal-tex-preamble-extra. (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather than alias `list-diary-entries'. --- lisp/calendar/cal-tex.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a67d90c832e..1fd85513230 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -45,7 +45,7 @@ (require 'calendar) -(autoload 'list-diary-entries "diary-lib" nil t) +(autoload 'diary-list-entries "diary-lib" nil t) (autoload 'calendar-holiday-list "holidays" nil t) (autoload 'calendar-iso-from-absolute "cal-iso" nil t) @@ -121,6 +121,14 @@ will put the Hebrew date at the bottom of each day." :type 'integer :group 'calendar-tex) +(defcustom cal-tex-preamble-extra nil + "A string giving extra LaTeX commands to insert in the calendar preamble. +For example, to include extra packages: +\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"." + :type 'string + :group 'calendar-tex + :version "22.1") + (defcustom cal-tex-hook nil "*List of functions called after any LaTeX calendar buffer is generated. You can use this to do postprocessing on the buffer. For example, to change @@ -240,7 +248,7 @@ This definition is the heart of the calendar!") "Generate a list of all diary-entries from absolute date D1 to D2." (let ((diary-list-include-blanks nil) (diary-display-hook 'ignore)) - (list-diary-entries + (diary-list-entries (calendar-gregorian-from-absolute d1) (1+ (- d2 d1))))) @@ -253,8 +261,10 @@ Optional ARGS are included." (insert "\\documentclass") (if args (insert "[" args "]")) - (insert "{article}\n" - "\\hbadness 20000 + (insert "{article}\n") + (if (stringp cal-tex-preamble-extra) + (insert cal-tex-preamble-extra "\n")) + (insert "\\hbadness 20000 \\hfuzz=1000pt \\vbadness 20000 \\lineskip 0pt @@ -357,6 +367,8 @@ Optional parameter specifies number of years." (cal-tex-noindent) (cal-tex-nl) (let ((month-names; don't use default in case user changed it + ;; These are only used to define the command names, not + ;; the names of the months they insert. ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"])) (calendar-for-loop i from 1 to 12 do From db05690c65aac923417e522e1929525317d732a4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 1 May 2006 03:36:49 +0000 Subject: [PATCH 51/83] (LaTeX Calendar): Mention cal-tex-preamble-extra. --- man/calendar.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/calendar.texi b/man/calendar.texi index 23aeb191e86..b48b1d547de 100644 --- a/man/calendar.texi +++ b/man/calendar.texi @@ -395,7 +395,9 @@ If the variable @code{cal-tex-diary} is non-@code{nil} (the default is @code{nil}), diary entries are included also (in weekly and monthly calendars only). If the variable @code{cal-tex-rules} is non-@code{nil} (the default is @code{nil}), the calendar displays ruled pages -in styles that have sufficient room. +in styles that have sufficient room. You can use the variable +@code{cal-tex-preamble-extra} to insert extra LaTeX commands in the +preamble of the generated document if you need to. @node Holidays @section Holidays From e1cce4cfc2f5a2711fe502ab3827a9c57642a594 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 1 May 2006 03:39:17 +0000 Subject: [PATCH 52/83] *** empty log message *** --- lisp/ChangeLog | 14 +++++++------- man/ChangeLog | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f54d2b2eb31..a8f2a6fcae2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,3 @@ -2006-04-30 Glenn Morris - - * calendar/cal-tex.el (cal-tex-preamble-extra): New variable. - (cal-tex-preamble): Use cal-tex-preamble-extra. - (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather - than alias `list-diary-entries'. - 2006-05-01 YAMAMOTO Mitsuharu * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use @@ -17,6 +10,13 @@ (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. (gud-format-command): Make match case sensitive. Match on %F. +2006-04-30 Glenn Morris + + * calendar/cal-tex.el (cal-tex-preamble-extra): New variable. + (cal-tex-preamble): Use cal-tex-preamble-extra. + (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather + than alias `list-diary-entries'. + 2006-04-29 Dan Nicolaescu * help-fns.el (describe-variable): Add info about safe local variables. diff --git a/man/ChangeLog b/man/ChangeLog index a5797e38b28..45044298909 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -9,6 +9,10 @@ * building.texi (GUD Customization): Describe cases %d and %c. Update description for %e. +2006-04-30 Glenn Morris + + * calendar.texi (LaTeX Calendar): Mention cal-tex-preamble-extra. + 2006-04-29 Dan Nicolaescu * custom.texi (Examining): Update C-h v output example. From 820f5fec9786c78ec7232b9bc4758f13e9721883 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 1 May 2006 09:32:59 +0000 Subject: [PATCH 53/83] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a8f2a6fcae2..4d0cceb419e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-05-01 Kim F. Storm + + * progmodes/grep.el (grep-expand-template): Use save-match-data. + 2006-05-01 YAMAMOTO Mitsuharu * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use From d0afff349efb346e3a4339f4a831af53f1c6878b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 1 May 2006 09:33:10 +0000 Subject: [PATCH 54/83] (grep-expand-template): Use save-match-data. --- lisp/progmodes/grep.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 7d8cc9d5c64..0aba9d42b84 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -581,8 +581,13 @@ substitution string. Note dynamic scoping of variables.") (case-fold-search nil)) (dolist (kw grep-expand-keywords command) (if (string-match (car kw) command) - (setq command (replace-match (or (eval (cdr kw)) "") - t t command)))))) + (setq command + (replace-match + (or (if (symbolp (cdr kw)) + (eval (cdr kw)) + (save-match-data (eval (cdr kw)))) + "") + t t command)))))) (defun grep-read-regexp () "Read regexp arg for interactive grep." From 5fed8c15b8c8a74c5e0d0e76baa7f66be96267b6 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 1 May 2006 09:38:57 +0000 Subject: [PATCH 55/83] *** empty log message *** --- lisp/ChangeLog | 14 +++++++------- src/ChangeLog | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d0cceb419e..250b02bd01c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2689,7 +2689,7 @@ (describe-key-briefly-internal, describe-key-internal): Functions merged back into their callers. -2006-02-13 Martin Rudalics (tiny change) +2006-02-13 Martin Rudalics * info.el (info-xref-visited): Inherit from info-xref too. (Info-set-mode-line): Replace occurrences of `%' by `%%' @@ -3837,7 +3837,7 @@ * add-log.el (add-change-log-entry, change-log-merge): Conditionally use `hard-newline'. -2006-01-13 Martin Rudalics (tiny change) +2006-01-13 Martin Rudalics * wid-edit.el (widget-field-end): If the overlay is no longer associated with a buffer, behave as if the overlay didn't exist. @@ -4927,7 +4927,7 @@ * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Capture error from printing circular structures. -2005-12-17 Martin Rudalics (tiny change) +2005-12-17 Martin Rudalics * wid-edit.el (widget-checkbox-action): Clear undo info. @@ -6910,7 +6910,7 @@ scrolling the help window. Doc fix. (help-return-method): Doc fix. -2005-12-03 Martin Rudalics (tiny change) +2005-12-03 Martin Rudalics * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug whereby names of length one or names starting with a @@ -7464,7 +7464,7 @@ * custom.el (defcustom): Update link types in docstring. -2005-11-20 Martin Rudalics (tiny change) +2005-11-20 Martin Rudalics * custom.el (defgroup): Add doc-string-elt info. @@ -7737,7 +7737,7 @@ * apropos.el (apropos-calc-scores): Use apropos-pattern. -2005-11-16 Martin Rudalics (tiny change) +2005-11-16 Martin Rudalics * wid-edit.el (color): Enclose %t in %{...%}. @@ -14668,7 +14668,7 @@ * emulation/edt-mapper.el (edt-save-function-key-map) (EDT-key-name): `defvar' to silence the byte-compiler. -2005-07-02 Martin Rudalics (tiny change) +2005-07-02 Martin Rudalics * font-lock.el (font-lock-regexp-grouping-backslash): Rename from font-lock-regexp-backslash. Doc fix. diff --git a/src/ChangeLog b/src/ChangeLog index 8b5ca9e8435..b8495387311 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -47,7 +47,7 @@ * keymap.c (Fdefine_key): Improve error message when KEY begins with a non-prefix key. -2006-04-30 Martin Rudalics (tiny change) +2006-04-30 Martin Rudalics * syntax.c (Fforward_comment): Don't forget to break out of the loop when we skipped backward over a generic comment. @@ -85,7 +85,7 @@ * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. (produce_stretch_glyph): Assume that face box height and width is - already included in in stretch glyph size so caller doesn't have to + already included in stretch glyph size so caller doesn't have to consider the extra space otherwise added (fixes problem in ses.el). * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame @@ -1732,7 +1732,7 @@ * image.c [MAC_OS] (find_image_fsspec): Likewise. -2005-12-23 Martin Rudalics (tiny change) +2005-12-23 Martin Rudalics * insdel.c (insert, insert_and_inherit, insert_before_markers) (insert_before_markers_and_inherit): Make sure FROM is correct From fcdd45857005869fe14081dc783fe4ba6ac66d01 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 May 2006 13:09:24 +0000 Subject: [PATCH 56/83] (Fforward_comment): Detect generic comment at beginning of buffer when moving backwards. --- src/ChangeLog | 17 +++++++++++------ src/syntax.c | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b8495387311..3c6efb16308 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,19 +1,24 @@ +2006-05-01 Martin Rudalics + + * syntax.c (Fforward_comment): Detect generic comment at beginning of + buffer when moving backwards. + 2006-05-01 YAMAMOTO Mitsuharu * dispnew.c (update_window): Don't set changed_p when mode/header line is updated. * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar. - (get_glyph_face_and_encoding, get_char_face_and_encoding): Don't - distinguish known faces from others. + (get_glyph_face_and_encoding, get_char_face_and_encoding): + Don't distinguish known faces from others. * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion through typeFileURL failed. * macfns.c (mac_update_title_bar): New function. [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function. - (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: Call - mac_prepare_for_quickdraw. + (show_hourglass, hide_hourglass) [USE_CG_DRAWING]: + Call mac_prepare_for_quickdraw. * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined. (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1. @@ -24,8 +29,8 @@ (struct MacFontStruct): Change type of member `rows'. (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'. - * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): Adjust - endpoints of strictly horizontal/vertical lines. + * macterm.c (mac_draw_line, mac_draw_line_to_pixmap): + Adjust endpoints of strictly horizontal/vertical lines. (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects. (pcm_init, pcm_get_status): New functions. (x_per_char_metric, XLoadQueryFont): Use them instead of diff --git a/src/syntax.c b/src/syntax.c index f56bc1181c7..1c8d0debbf3 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2123,8 +2123,6 @@ between them, return t; otherwise return nil. */) while (1) { DEC_BOTH (from, from_byte); - if (from == stop) - break; UPDATE_SYNTAX_TABLE_BACKWARD (from); c = FETCH_CHAR (from_byte); if (SYNTAX (c) == Scomment_fence @@ -2133,6 +2131,8 @@ between them, return t; otherwise return nil. */) found = 1; break; } + else if (from == stop) + break; } if (found == 0) { From a01b1e220c30f882de5f0a3066730a0980929283 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 1 May 2006 13:22:15 +0000 Subject: [PATCH 57/83] =?UTF-8?q?*=20net/tramp.el=20(tramp-completion-file?= =?UTF-8?q?-name-handler-alist)=20(tramp-run-real-handler,=20tramp-complet?= =?UTF-8?q?ion-run-real-handler)=20(tramp-completion-handle-file-name-all-?= =?UTF-8?q?completions)=20(tramp-completion-handle-file-name-completion):?= =?UTF-8?q?=20Autoload=20them.=20(tramp-completion-handle-file-exists-p)?= =?UTF-8?q?=20(tramp-completion-handle-file-name-directory)=20(tramp-compl?= =?UTF-8?q?etion-handle-file-name-nondirectory)=20(tramp-completion-handle?= =?UTF-8?q?-expand-file-name):=20Remove=20them.=20(tramp-handle-file-name-?= =?UTF-8?q?directory):=20Return=20the=20real=20directory=20name.=20=20Retu?= =?UTF-8?q?rning=20"/"=20only=20doesn't=20need=20to=20be=20necessary=20any?= =?UTF-8?q?=20longer.=20(tramp-file-name-handler):=20Make=20special=20atte?= =?UTF-8?q?ntion=20when=20in=20hostname=20completion=20mode.=20(tramp-comp?= =?UTF-8?q?letion-file-name-handler):=20Revert=20patch=20from=202006-04-28?= =?UTF-8?q?.=20(tramp-register-file-name-handlers):=20Register=20`tramp-co?= =?UTF-8?q?mpletion-file-name-handler'=20only=20when=20`partial-completion?= =?UTF-8?q?-mode=EF=BF=BD=20is=20enabled.=20(tramp-completion-handle-file-?= =?UTF-8?q?name-all-completions):=20Delete=20directory=20part=20from=20res?= =?UTF-8?q?ults.=20(tramp-get-completion-methods,=20tramp-get-completion-u?= =?UTF-8?q?ser-host):=20Discard=20deleting=20"/",=20it=20doesn't=20work=20?= =?UTF-8?q?after=20the=20change=20of=20`tramp-handle-file-name-directory'?= =?UTF-8?q?=20above.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lisp/ChangeLog | 25 ++++++++ lisp/net/tramp.el | 156 ++++++++++++++++------------------------------ 2 files changed, 78 insertions(+), 103 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 250b02bd01c..d06ffdb2977 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,28 @@ +2006-05-01 Michael Albinus + + * net/tramp.el (tramp-completion-file-name-handler-alist) + (tramp-run-real-handler, tramp-completion-run-real-handler) + (tramp-completion-handle-file-name-all-completions) + (tramp-completion-handle-file-name-completion): Autoload them. + (tramp-completion-handle-file-exists-p) + (tramp-completion-handle-file-name-directory) + (tramp-completion-handle-file-name-nondirectory) + (tramp-completion-handle-expand-file-name): Remove them. + (tramp-handle-file-name-directory): Return the real directory + name. Returning "/" only doesn't need to be necessary any longer. + (tramp-file-name-handler): Make special attention when in hostname + completion mode. + (tramp-completion-file-name-handler): Revert patch from + 2006-04-28. + (tramp-register-file-name-handlers): Register + `tramp-completion-file-name-handler' only when + `partial-completion-mode´ is enabled. + (tramp-completion-handle-file-name-all-completions): Delete + directory part from results. + (tramp-get-completion-methods, tramp-get-completion-user-host): + Discard deleting "/", it doesn't work after the change of + `tramp-handle-file-name-directory' above. + 2006-05-01 Kim F. Storm * progmodes/grep.el (grep-expand-template): Use save-match-data. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b35ffeb58ff..6e166aa2393 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1821,8 +1821,6 @@ while (my $data = ) { Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") -; These values conform to `file-attributes' from XEmacs 21.2. -; Emacs and other tools not checked. (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) (1 . "p") ; fifo (2 . "c") ; character device @@ -1927,12 +1925,11 @@ on the FILENAME argument, even if VISIT was a string.") "Alist of handler functions. Operations not mentioned here will be handled by the normal Emacs functions.") - ;; Handlers for partial tramp file names. For Emacs just ;; `file-name-all-completions' is needed. +;;;###autoload (defconst tramp-completion-file-name-handler-alist - '( - (file-name-all-completions . tramp-completion-handle-file-name-all-completions) + '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. Used for file names matching `tramp-file-name-regexp'. Operations not @@ -2168,28 +2165,11 @@ target of the symlink differ." ;; Localname manipulation functions that grok TRAMP localnames... (defun tramp-handle-file-name-directory (file) "Like `file-name-directory' but aware of TRAMP files." - ;; everything except the last filename thing is the directory + ;; Everything except the last filename thing is the directory. (with-parsed-tramp-file-name file nil - ;; For the following condition, two possibilities should be tried: - ;; (1) (string= localname "") - ;; (2) (or (string= localname "") (string= localname "/")) - ;; The second variant fails when completing a "/" directory on - ;; the remote host, that is a filename which looks like - ;; "/user@host:/". But maybe wildcards fail with the first variant. - ;; We should do some investigation. - (if (string= localname "") - ;; For a filename like "/[foo]", we return "/". The `else' - ;; case would return "/[foo]" unchanged. But if we do that, - ;; then `file-expand-wildcards' ceases to work. It's not - ;; quite clear to me what's the intuition that tells that this - ;; behavior is the right behavior, but oh, well. - "/" - ;; run the command on the localname portion only - ;; CCC: This should take into account the remote machine type, no? - ;; --daniel - (tramp-make-tramp-file-name multi-method method user host - ;; This will not recurse... - (or (file-name-directory localname) ""))))) + ;; Run the command on the localname portion only. + (tramp-make-tramp-file-name + multi-method method user host (file-name-directory (or localname ""))))) (defun tramp-handle-file-name-nondirectory (file) "Like `file-name-nondirectory' but aware of TRAMP files." @@ -4140,7 +4120,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; (inhibit-file-name-operation operation)) ;; (apply operation args))) -(defun tramp-run-real-handler (operation args) +;;;###autoload +(progn (defun tramp-run-real-handler (operation args) "Invoke normal file name handler for OPERATION. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." @@ -4153,13 +4134,14 @@ pass to the OPERATION." ,(and (eq inhibit-file-name-operation operation) inhibit-file-name-handlers))) (inhibit-file-name-operation operation)) - (apply operation args))) + (apply operation args)))) ;; This function is used from `tramp-completion-file-name-handler' functions ;; only, if `tramp-completion-mode' is true. But this cannot be checked here ;; because the check is based on a full filename, not available for all ;; basic I/O operations. -(defun tramp-completion-run-real-handler (operation args) +;;;###autoload +(progn (defun tramp-completion-run-real-handler (operation args) "Invoke `tramp-file-name-handler' for OPERATION. First arg specifies the OPERATION, second arg is a list of arguments to pass to the OPERATION." @@ -4171,7 +4153,7 @@ pass to the OPERATION." ,(and (eq inhibit-file-name-operation operation) inhibit-file-name-handlers))) (inhibit-file-name-operation operation)) - (apply operation args))) + (apply operation args)))) ;; We handle here all file primitives. Most of them have the file ;; name as first parameter; nevertheless we check for them explicitly @@ -4268,12 +4250,25 @@ ARGS are the arguments OPERATION has been called with." (defun tramp-file-name-handler (operation &rest args) "Invoke Tramp file name handler. Falls back to normal file name handler if no tramp file name handler exists." +;; (setq edebug-trace t) +;; (edebug-trace "%s" (with-output-to-string (backtrace))) (save-match-data (let* ((filename (apply 'tramp-file-name-for-operation operation args)) + (completion (tramp-completion-mode filename)) (foreign (tramp-find-foreign-file-name-handler filename))) - (cond - (foreign (apply foreign operation args)) - (t (tramp-run-real-handler operation args)))))) + (with-parsed-tramp-file-name filename nil + (cond + ;; When we are in completion mode, some operations shouldn' be + ;; handled by backend. + ((and completion (memq operation '(expand-file-name))) + (tramp-run-real-handler operation args)) + ((and completion (zerop (length localname)) + (memq operation '(file-exists-p file-directory-p))) + t) + ;; Call the backend function. + (foreign (apply foreign operation args)) + ;; Nothing to do for us. + (t (tramp-run-real-handler operation args))))))) ;; In Emacs, there is some concurrency due to timers. If a timer @@ -4320,52 +4315,37 @@ Fall back to normal file name handler if no Tramp handler exists." (tramp-run-real-handler operation args)))))) (setq tramp-locked tl)))) -;; Preload this DEFUN with the progn trick. This avoids cyclic -;; loading, because the `load-in-progress' check can be performed. ;;;###autoload (progn (defun tramp-completion-file-name-handler (operation &rest args) "Invoke tramp file name completion handler. Falls back to normal file name handler if no tramp file name handler exists." -;; (setq tramp-debug-buffer t) -;; (tramp-message 1 "%s %s" operation args) -;; (tramp-message 1 "%s %s\n%s" -;; operation args (with-output-to-string (backtrace))) - (if load-in-progress - ;; We are while loading Tramp. - (let (file-name-handler-alist) - (apply operation args)) - ;; If Tramp is not loaded yet, do it now. - (require 'tramp) - (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) - (if fn - (save-match-data (apply (cdr fn) args)) - (tramp-completion-run-real-handler operation args)))))) +;; (setq edebug-trace t) +;; (edebug-trace "%s" (with-output-to-string (backtrace))) + (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) + (if fn + (save-match-data (apply (cdr fn) args)) + (tramp-completion-run-real-handler operation args))))) -;; Register in `file-name-handler-alist'. -;; `tramp-completion-file-name-handler' must not be active when temacs -;; dumps. And it makes no sense in batch mode anyway. This must be -;; an autoloaded DEFSUBST, because Tramp would be loaded otherwise -;; applying the `after-init-hook'. ;;;###autoload (defsubst tramp-register-file-name-handlers () "Add tramp file name handlers to `file-name-handler-alist'." - (unless noninteractive - (add-to-list 'file-name-handler-alist - (cons tramp-file-name-regexp 'tramp-file-name-handler)) + (add-to-list 'file-name-handler-alist + (cons tramp-file-name-regexp 'tramp-file-name-handler)) + (when partial-completion-mode (add-to-list 'file-name-handler-alist (cons tramp-completion-file-name-regexp 'tramp-completion-file-name-handler)) - (put 'tramp-completion-file-name-handler 'safe-magic t) - ;; If jka-compr is already loaded, move it to the front of - ;; `file-name-handler-alist'. - (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) - (when jka - (setq file-name-handler-alist - (cons jka (delete jka file-name-handler-alist))))))) + (put 'tramp-completion-file-name-handler 'safe-magic t)) + ;; If jka-compr is already loaded, move it to the front of + ;; `file-name-handler-alist'. + (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) + (when jka + (setq file-name-handler-alist + (cons jka (delete jka file-name-handler-alist)))))) -;; `tramp-register-file-name-handlers' cannot be autoloaded as-it-is, -;; because the `noninteractive' check would prevent functionality to -;; be dumped in temacs. +;; During autoload, it shall be checked whether +;; `partial-completion-mode' is active. Therefore registering will be +;; delayed. ;;;###autoload(add-hook ;;;###autoload 'after-init-hook ;;;###autoload '(lambda () (tramp-register-file-name-handlers))) @@ -4495,31 +4475,10 @@ Falls back to normal file name handler if no tramp file name handler exists." last-input-event) ?\ )))))) t))) -(defun tramp-completion-handle-file-exists-p (filename) - "Like `file-exists-p' for tramp files." - (if (tramp-completion-mode filename) - (tramp-run-real-handler - 'file-exists-p (list filename)) - (tramp-completion-run-real-handler - 'file-exists-p (list filename)))) - -;; Localname manipulation in case of partial TRAMP file names. -(defun tramp-completion-handle-file-name-directory (file) - "Like `file-name-directory' but aware of TRAMP files." - (if (tramp-completion-mode file) - "/" - (tramp-completion-run-real-handler - 'file-name-directory (list file)))) - -;; Localname manipulation in case of partial TRAMP file names. -(defun tramp-completion-handle-file-name-nondirectory (file) - "Like `file-name-nondirectory' but aware of TRAMP files." - (substring - file (length (tramp-completion-handle-file-name-directory file)))) - ;; Method, host name and user name completion. ;; `tramp-completion-dissect-file-name' returns a list of ;; tramp-file-name structures. For all of them we return possible completions. +;;;###autoload (defun tramp-completion-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for partial tramp files." @@ -4574,7 +4533,8 @@ Falls back to normal file name handler if no tramp file name handler exists." ;; unify list, remove nil elements (while result (let ((car (car result))) - (when car (add-to-list 'result1 car)) + (when car (add-to-list + 'result1 (substring car (length directory)))) (setq result (cdr result)))) ;; Complete local parts @@ -4593,6 +4553,7 @@ Falls back to normal file name handler if no tramp file name handler exists." (setq tramp-completion-mode nil))) ;; Method, host name and user name completion for a file. +;;;###autoload (defun tramp-completion-handle-file-name-completion (filename directory) "Like `file-name-completion' for tramp files." (try-completion filename @@ -4719,8 +4680,7 @@ remote host and localname (filename on remote host)." (lambda (method) (and method (string-match (concat "^" (regexp-quote partial-method)) method) - ;; we must remove leading "/". - (substring (tramp-make-tramp-file-name nil method nil nil nil) 1))) + (tramp-make-tramp-file-name nil method nil nil nil))) (delete "multi" (mapcar 'car tramp-methods)))) ;; Compares partial user and host names with possible completions. @@ -4753,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST." host nil))) (unless (zerop (+ (length user) (length host))) - ;; we must remove leading "/". - (substring (tramp-make-tramp-file-name nil method user host nil) 1))) + (tramp-make-tramp-file-name nil method user host nil))) (defun tramp-parse-rhosts (filename) "Return a list of (user host) tuples allowed to access. @@ -4973,15 +4932,6 @@ User may be nil." (forward-line 1) result)) -(defun tramp-completion-handle-expand-file-name (name &optional dir) - "Like `expand-file-name' for tramp files." - (let ((fullname (concat (or dir default-directory) name))) - (if (tramp-completion-mode fullname) - (tramp-run-real-handler - 'expand-file-name (list name dir)) - (tramp-completion-run-real-handler - 'expand-file-name (list name dir))))) - ;;; Internal Functions: (defun tramp-maybe-send-perl-script (multi-method method user host script name) From 0ccc83d9d3e17856aa962e7748277cafcf76d921 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 May 2006 13:30:59 +0000 Subject: [PATCH 58/83] (nil and t): Add `booleanp' predicate. --- lispref/intro.texi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lispref/intro.texi b/lispref/intro.texi index b2294be4c2d..61dfca64b97 100644 --- a/lispref/intro.texi +++ b/lispref/intro.texi @@ -212,6 +212,11 @@ to use them as constants in a program. An attempt to change their values results in a @code{setting-constant} error. @xref{Constant Variables}. +@defun booleanp object +Return non-nil iff @var{object} is one of the two canonical boolean +values: @code{t} or @code{nil}. +@end defun + @node Evaluation Notation @subsection Evaluation Notation @cindex evaluation notation From 27c5714a63cac48fd2eaa28543d206c24967f365 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 May 2006 13:31:59 +0000 Subject: [PATCH 59/83] (Type Predicates): Add links for booleanp and string-or-null-p. --- lispref/ChangeLog | 9 ++++++++- lispref/objects.texi | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 928790a1a9f..72990f9bf42 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,6 +1,13 @@ +2006-05-01 Stefan Monnier + + * intro.texi (nil and t): Add booleanp. + + * objects.texi (Type Predicates): Add links for booleanp and + string-or-null-p. + 2006-04-29 Richard Stallman - * modes.texi (Multiline Font Lock): Renamed from + * modes.texi (Multiline Font Lock): Rename from Multi line Font Lock Elements. Much clarification. (Font Lock Multiline, Region to Fontify): Much clarification. diff --git a/lispref/objects.texi b/lispref/objects.texi index 93848cffe09..0e35741a1aa 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi @@ -1779,6 +1779,12 @@ with references to further information. @item windowp @xref{Basic Windows, windowp}. + +@item booleanp +@xref{nil and t, booleanp} + +@item string-or-null-p +@xref{Predicates for Strings, string-or-null-p} @end table The most general way to check the type of an object is to call the From 23cac097756dc2fe54c3bb611c55997ecd35dd28 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 1 May 2006 15:05:48 +0000 Subject: [PATCH 60/83] (Type Predicates): Fix typos. --- lispref/objects.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lispref/objects.texi b/lispref/objects.texi index 0e35741a1aa..5665e5beee6 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi @@ -1781,10 +1781,10 @@ with references to further information. @xref{Basic Windows, windowp}. @item booleanp -@xref{nil and t, booleanp} +@xref{nil and t, booleanp}. @item string-or-null-p -@xref{Predicates for Strings, string-or-null-p} +@xref{Predicates for Strings, string-or-null-p}. @end table The most general way to check the type of an object is to call the From fc2cb77207a3532e53313342d1d3e1ab55548348 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 1 May 2006 15:12:44 +0000 Subject: [PATCH 61/83] *** empty log message *** --- lispref/ChangeLog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 72990f9bf42..1560660fc3d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2006-05-01 Juanma Barranquero + + * objects.texi (Type Predicates): Fix typos. + 2006-05-01 Stefan Monnier * intro.texi (nil and t): Add booleanp. @@ -82,7 +86,7 @@ 2006-03-25 Karl Berry - * elisp.texi: use @copyright{} instead of (C), and do not indent + * elisp.texi: Use @copyright{} instead of (C), and do not indent the year list. 2006-03-21 Nick Roberts @@ -116,7 +120,7 @@ * display.texi (Defining Images): Fix example in image-load-path-for-library by not recommending that one binds - image-load-path. Just defvar it to placate compiler and only use + image-load-path. Just defvar it to placate compiler and only use it if previously defined. 2006-03-14 Bill Wohler @@ -588,11 +592,11 @@ 2005-09-26 Chong Yidong - * errors.texi (Standard Errors): Corrected xrefs. + * errors.texi (Standard Errors): Correct xrefs. 2005-09-18 Chong Yidong - * display.texi (Defining Images): Updated documentation for + * display.texi (Defining Images): Update documentation for `image-load-path'. 2005-09-17 Richard M. Stallman From bc2fa80de71cca43fb5df49346ca09c2f4e163b7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 1 May 2006 20:15:56 +0000 Subject: [PATCH 62/83] (tool-bar-setup): Put Help and Preferences items in the default tool-bar-map. --- lisp/tool-bar.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 0a1d706a694..37d60441648 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el @@ -267,14 +267,20 @@ holds a keymap." ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") (tool-bar-add-item-from-menu 'print-buffer "print") - (tool-bar-add-item "preferences" 'customize 'customize - :help "Edit preferences (customize)") - (tool-bar-add-item "help" (lambda () - (interactive) - (popup-menu menu-bar-help-menu)) - 'help - :help "Pop up the Help menu") + ;; tool-bar-add-item-from-menu itself operates on + ;; (default-value 'tool-bar-map), but when we don't use that function, + ;; we must explicitly operate on the default value. + + (let ((tool-bar-map (default-value 'tool-bar-map))) + (tool-bar-add-item "preferences" 'customize 'customize + :help "Edit preferences (customize)") + + (tool-bar-add-item "help" (lambda () + (interactive) + (popup-menu menu-bar-help-menu)) + 'help + :help "Pop up the Help menu")) ) (provide 'tool-bar) From 78d4839b3eeaa529e26f493b1210f002b6be754a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 1 May 2006 20:16:40 +0000 Subject: [PATCH 63/83] (display-warning, lwarn): Doc fixes. --- lisp/emacs-lisp/warnings.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 133c4c42f2a..a02a8c14eba 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -209,6 +209,7 @@ only, and you can use whatever symbols you like.) LEVEL should be either :debug, :warning, :error, or :emergency \(but see `warning-minimum-level' and `warning-minimum-log-level'). +Default is :warning. :emergency -- a problem that will seriously impair Emacs operation soon if you do not attend to it promptly. @@ -292,7 +293,7 @@ See also `warning-series', `warning-prefix-function' and Aside from generating the message with `format', this is equivalent to `display-warning'. -TYPE is the warning type: either a custom group name (a symbol). +TYPE is the warning type: either a custom group name (a symbol), or a list of symbols whose first element is a custom group name. \(The rest of the symbols represent subcategories and can be whatever you like.) From d5aa078b92ac1795856e8895f5bcd52789efc95e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 1 May 2006 20:17:24 +0000 Subject: [PATCH 64/83] (undo-outer-limit-truncate): Put quotes around buffer name in messages. --- lisp/simple.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index daf297d5fe2..5da9c955eb3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1709,7 +1709,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.") ;; but we don't want to ask the question again. (setq undo-extra-outer-limit (+ size 50000)) (if (let (use-dialog-box track-mouse executing-kbd-macro ) - (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " + (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? " (buffer-name) size))) (progn (setq buffer-undo-list nil) (setq undo-extra-outer-limit nil) @@ -1717,7 +1717,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.") nil)) (display-warning '(undo discard-info) (concat - (format "Buffer %s undo info was %d bytes long.\n" + (format "Buffer `%s' undo info was %d bytes long.\n" (buffer-name) size) "The undo info was discarded because it exceeded \ `undo-outer-limit'. From 4bc1b83644d02f8bc8467f4b5547e7e3a8d9d4ff Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 1 May 2006 20:18:47 +0000 Subject: [PATCH 65/83] (help-mode): view-exit-action calls delete-window only when it is safe and possible. --- lisp/ChangeLog | 15 ++++++++++++++- lisp/help-mode.el | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d06ffdb2977..ae61defbea2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2006-05-01 Richard Stallman + + * help-mode.el (help-mode): view-exit-action calls delete-window + only when it is safe and possible. + + * simple.el (undo-outer-limit-truncate): Put quotes around buffer name + in messages. + + * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes. + + * tool-bar.el (tool-bar-setup): Put Help and Preferences items + in the default tool-bar-map. + 2006-05-01 Michael Albinus * net/tramp.el (tramp-completion-file-name-handler-alist) @@ -16,7 +29,7 @@ 2006-04-28. (tramp-register-file-name-handlers): Register `tramp-completion-file-name-handler' only when - `partial-completion-mode´ is enabled. + `partial-completion-mode is enabled. (tramp-completion-handle-file-name-all-completions): Delete directory part from results. (tramp-get-completion-methods, tramp-get-completion-user-host): diff --git a/lisp/help-mode.el b/lisp/help-mode.el index a5cdf1f4d72..0c6e0f47453 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -197,7 +197,10 @@ Commands: (view-mode) (make-local-variable 'view-no-disable-on-exit) (setq view-no-disable-on-exit t) - (setq view-exit-action (lambda (buffer) (delete-window))) + (setq view-exit-action (lambda (buffer) + (or (window-minibuffer-p (selected-window)) + (one-window-p t) + (delete-window)))) (run-mode-hooks 'help-mode-hook)) ;;;###autoload From 64ec8b2f3d60ede58b85373beb828d8db544505d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 1 May 2006 22:58:47 +0000 Subject: [PATCH 66/83] (restore_menu_items): Return a value. --- src/ChangeLog | 4 ++++ src/xmenu.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 3c6efb16308..bf52364ee66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-05-02 Andreas Schwab + + * xmenu.c (restore_menu_items): Return a value. + 2006-05-01 Martin Rudalics * syntax.c (Fforward_comment): Detect generic comment at beginning of diff --git a/src/xmenu.c b/src/xmenu.c index bb8cb19cbdf..c740062a82f 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -327,6 +327,7 @@ restore_menu_items (saved) menu_items_n_panes = XINT (XCAR (saved)); saved = XCDR (saved); menu_items_submenu_depth = XINT (XCAR (saved)); + return Qnil; } /* Push the whole state of menu_items processing onto the specpdl. From beea1ef6c5f76c289f0e42130d4221f7bde7ec4b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 00:08:17 +0000 Subject: [PATCH 67/83] (File Local Variables): Suggest using booleanp. --- lispref/variables.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lispref/variables.texi b/lispref/variables.texi index c2abdf0563d..5b4b779448e 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi @@ -1783,7 +1783,8 @@ a function of one argument; any value is safe if the function returns non-@code{nil} given that value. Many commonly encountered file variables standardly have @code{safe-local-variable} properties, including @code{fill-column}, @code{fill-prefix}, and -@code{indent-tabs-mode}. +@code{indent-tabs-mode}. For boolean-valued variables that are safe, +use @code{booleanp} as the property value. @defopt safe-local-variable-values This variable provides another way to mark some variable values as From d0789de9cd31b775d4e7933fbe99089d1a0144d2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 00:09:03 +0000 Subject: [PATCH 68/83] (nil and t): Clarify. --- lispref/ChangeLog | 6 ++++++ lispref/intro.texi | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 1560660fc3d..020e667ec16 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2006-05-01 Richard Stallman + + * intro.texi (nil and t): Clarify. + + * variables.texi (File Local Variables): Suggest using booleanp. + 2006-05-01 Juanma Barranquero * objects.texi (Type Predicates): Fix typos. diff --git a/lispref/intro.texi b/lispref/intro.texi index 61dfca64b97..7e1b6155b35 100644 --- a/lispref/intro.texi +++ b/lispref/intro.texi @@ -163,7 +163,7 @@ person reading this manual, are thought of as ``the programmer'' and are addressed as ``you''. ``The user'' is the person who uses Lisp programs, including those you write. -@cindex fonts +@cindex fonts in this manual Examples of Lisp code are formatted like this: @code{(list 1 2 3)}. Names that represent metasyntactic variables, or arguments to a function being described, are formatted like this: @var{first-number}. @@ -187,14 +187,14 @@ readers. After the Lisp reader has read either @samp{()} or @samp{nil}, there is no way to determine which representation was actually written by the programmer. - In this manual, we use @code{()} when we wish to emphasize that it -means the empty list, and we use @code{nil} when we wish to emphasize + In this manual, we write @code{()} when we wish to emphasize that it +means the empty list, and we write @code{nil} when we wish to emphasize that it means the truth value @var{false}. That is a good convention to use in Lisp programs also. @example (cons 'foo ()) ; @r{Emphasize the empty list} -(not nil) ; @r{Emphasize the truth value @var{false}} +(setq foo-flag nil) ; @r{Emphasize the truth value @var{false}} @end example @cindex @code{t}, uses of From 28408bfd27f6783900d5ed959e4269d7072092a9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 01:39:40 +0000 Subject: [PATCH 69/83] (diff-mode-shared-map): Don't bind M-W, M-U, M-C, M-r, M-R, M-A, M-SPC or M-DEL. (diff-mode-map): diff-refine-hunk now on C-c C-w (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u. --- lisp/diff-mode.el | 168 ++++++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 80 deletions(-) diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 36e99888d60..cc89aad6ca3 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -118,7 +118,8 @@ when editing big diffs)." ("\C-m" . diff-goto-source) ([mouse-2] . diff-goto-source) ;; From XEmacs' diff-mode. - ("W" . widen) +;; Standard M-w is useful, so don't change M-W. +;; ("W" . widen) ;;("." . diff-goto-source) ;display-buffer ;;("f" . diff-goto-source) ;find-file ("o" . diff-goto-source) ;other-window @@ -127,14 +128,14 @@ when editing big diffs)." ;;("h" . diff-show-header) ;;("j" . diff-show-difference) ;jump to Nth diff ;;("q" . diff-quit) - (" " . scroll-up) - ("\177" . scroll-down) - ;; Our very own bindings. - ("A" . diff-ediff-patch) - ("r" . diff-restrict-view) - ("R" . diff-reverse-direction) - ("U" . diff-context->unified) - ("C" . diff-unified->context) +;; Not useful if you have to metafy them. +;; (" " . scroll-up) +;; ("\177" . scroll-down) +;; Standard M-a is useful, so don't change M-A. +;; ("A" . diff-ediff-patch) +;; Standard M-r is useful, so don't change M-r or M-R. +;; ("r" . diff-restrict-view) +;; ("R" . diff-reverse-direction) ("q" . quit-window)) "Basic keymap for `diff-mode', bound to various prefix keys.") @@ -143,10 +144,14 @@ when editing big diffs)." ;; From compilation-minor-mode. ("\C-c\C-c" . diff-goto-source) ;; Misc operations. - ("\C-c\C-r" . diff-refine-hunk) - ("\C-c\C-s" . diff-split-hunk) ("\C-c\C-a" . diff-apply-hunk) + ("\C-c\C-e" . diff-ediff-patch) + ("\C-c\C-n" . diff-restrict-view) + ("\C-c\C-r" . diff-reverse-direction) + ("\C-c\C-s" . diff-split-hunk) ("\C-c\C-t" . diff-test-hunk) + ("\C-c\C-u" . diff-context->unified) + ("\C-c\C-w" . diff-refine-hunk) ("\C-c\C-f" . next-error-follow-minor-mode)) "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") @@ -711,77 +716,80 @@ else cover the whole bufer." (delete-region last-pt (point)) (setq delete nil))))))))))))))) -(defun diff-context->unified (start end) +(defun diff-context->unified (start end &optional to-context) "Convert context diffs to unified diffs. -START and END are either taken from the region (if a prefix arg is given) or -else cover the whole bufer." - (interactive (if current-prefix-arg - (list (mark) (point)) - (list (point-min) (point-max)))) - (unless (markerp end) (setq end (copy-marker end))) - (let (;;(diff-inhibit-after-change t) - (inhibit-read-only t)) - (save-excursion - (goto-char start) - (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) - (< (point) end)) - (combine-after-change-calls - (if (match-beginning 2) - ;; we matched a file header - (progn - ;; use reverse order to make sure the indices are kept valid - (replace-match "+++" t t nil 3) - (replace-match "---" t t nil 2)) - ;; we matched a hunk header - (let ((line1s (match-string 4)) - (line1e (match-string 5)) - (pt1 (match-beginning 0))) - (replace-match "") - (unless (re-search-forward - "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t) - (error "Can't find matching `--- n1,n2 ----' line")) - (let ((line2s (match-string 1)) - (line2e (match-string 2)) - (pt2 (progn - (delete-region (progn (beginning-of-line) (point)) - (progn (forward-line 1) (point))) - (point-marker)))) - (goto-char pt1) - (forward-line 1) - (while (< (point) pt2) - (case (char-after) - ((?! ?-) (delete-char 2) (insert "-") (forward-line 1)) - (?\s ;merge with the other half of the chunk - (let* ((endline2 - (save-excursion - (goto-char pt2) (forward-line 1) (point))) - (c (char-after pt2))) - (case c - ((?! ?+) - (insert "+" - (prog1 (buffer-substring (+ pt2 2) endline2) - (delete-region pt2 endline2)))) - (?\s ;FIXME: check consistency - (delete-region pt2 endline2) - (delete-char 1) - (forward-line 1)) - (?\\ (forward-line 1)) - (t (delete-char 1) (forward-line 1))))) - (t (forward-line 1)))) - (while (looking-at "[+! ] ") - (if (/= (char-after) ?!) (forward-char 1) - (delete-char 1) (insert "+")) - (delete-char 1) (forward-line 1)) - (save-excursion +START and END are either taken from the region +\(when it is highlighted) or else cover the whole buffer. +With a prefix argument, convert unified format to context format." + (interactive (if (and transient-mark-mode mark-active) + (list (mark) (point) current-prefix-arg) + (list (point-min) (point-max) current-prefix-arg))) + (if to-context + (diff-unified->context start end) + (unless (markerp end) (setq end (copy-marker end))) + (let ( ;;(diff-inhibit-after-change t) + (inhibit-read-only t)) + (save-excursion + (goto-char start) + (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) + (< (point) end)) + (combine-after-change-calls + (if (match-beginning 2) + ;; we matched a file header + (progn + ;; use reverse order to make sure the indices are kept valid + (replace-match "+++" t t nil 3) + (replace-match "---" t t nil 2)) + ;; we matched a hunk header + (let ((line1s (match-string 4)) + (line1e (match-string 5)) + (pt1 (match-beginning 0))) + (replace-match "") + (unless (re-search-forward + "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t) + (error "Can't find matching `--- n1,n2 ----' line")) + (let ((line2s (match-string 1)) + (line2e (match-string 2)) + (pt2 (progn + (delete-region (progn (beginning-of-line) (point)) + (progn (forward-line 1) (point))) + (point-marker)))) (goto-char pt1) - (insert "@@ -" line1s "," - (number-to-string (- (string-to-number line1e) - (string-to-number line1s) - -1)) - " +" line2s "," - (number-to-string (- (string-to-number line2e) - (string-to-number line2s) - -1)) " @@")))))))))) + (forward-line 1) + (while (< (point) pt2) + (case (char-after) + ((?! ?-) (delete-char 2) (insert "-") (forward-line 1)) + (?\s ;merge with the other half of the chunk + (let* ((endline2 + (save-excursion + (goto-char pt2) (forward-line 1) (point))) + (c (char-after pt2))) + (case c + ((?! ?+) + (insert "+" + (prog1 (buffer-substring (+ pt2 2) endline2) + (delete-region pt2 endline2)))) + (?\s ;FIXME: check consistency + (delete-region pt2 endline2) + (delete-char 1) + (forward-line 1)) + (?\\ (forward-line 1)) + (t (delete-char 1) (forward-line 1))))) + (t (forward-line 1)))) + (while (looking-at "[+! ] ") + (if (/= (char-after) ?!) (forward-char 1) + (delete-char 1) (insert "+")) + (delete-char 1) (forward-line 1)) + (save-excursion + (goto-char pt1) + (insert "@@ -" line1s "," + (number-to-string (- (string-to-number line1e) + (string-to-number line1s) + -1)) + " +" line2s "," + (number-to-string (- (string-to-number line2e) + (string-to-number line2s) + -1)) " @@"))))))))))) (defun diff-reverse-direction (start end) "Reverse the direction of the diffs. From fe5c14081eecb2392fff75bb038b3785d8455399 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 01:42:55 +0000 Subject: [PATCH 70/83] (Diff Mode): New node. --- man/ChangeLog | 4 +++ man/misc.texi | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 45044298909..7337b1de848 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-05-01 Aaron S. Hawley + + * misc.texi (Diff Mode): New node. + 2006-05-01 YAMAMOTO Mitsuharu * macos.texi (Mac International): Now Carbon Emacs has ATSUI support. diff --git a/man/misc.texi b/man/misc.texi index 0b07e04ed68..71f4aba2b49 100644 --- a/man/misc.texi +++ b/man/misc.texi @@ -1761,7 +1761,7 @@ rectangle moves along with the text inside the rectangle. Many of the sort commands ignore case differences when comparing, if @code{sort-fold-case} is non-@code{nil}. -@node Narrowing, Two-Column, Sorting, Top +@node Narrowing, Diff Mode, Sorting, Top @section Narrowing @cindex widening @cindex restriction @@ -1827,7 +1827,86 @@ this command asks for confirmation and gives you the option of enabling it; if you enable the command, confirmation will no longer be required for it. @xref{Disabling}. -@node Two-Column, Editing Binary Files, Narrowing, Top +@node Diff Mode, Two-Column, Narrowing, Top +@section Diff Mode +@cindex Diff mode + + Diff mode is useful for editing patches and comparisons produced by +the @command{diff} program. You can select Diff mode by typing +@kbd{M-x diff-mode}; Emacs commands that compare files automatically +select Diff mode. @xref{Top,, Diff, diff, Comparing and Merging Files}, +for more information about @command{diff} output formats. + + One general feature of Diff mode is that manual edits to the patch +automatically correct line numbers, including those in the hunk +header, so that you can actually apply the edited patch. Diff mode +also provides the following commands to navigate, manipulate and apply +parts of patches: + +@table @kbd +@item M-n +Move to the next hunk-start (@code{diff-hunk-next}). + +@item M-p +Move to the previous hunk-start (@code{diff-hunk-prev}). + +@item M-@} +Move to the next file-start, in a multi-file patch +(@code{diff-file-next}). + +@item M-@{ +Move to the previous file-start, in a multi-file patch +(@code{diff-file-prev}). + +@item M-k +Kill the hunk at point (@code{diff-hunk-kill}). + +@item M-K +In a multi-file patch, kill the current file part. +(@code{diff-file-kill}). + +@item C-c C-a +Apply this hunk to its target file (@code{diff-apply-hunk}). With a +prefix argument of @kbd{C-u}, revert this hunk. + +@item C-c C-c +Go to the source corresponding to this hunk (@code{diff-goto-source}). + +@item C-c C-e +Start an Ediff session with the patch (@code{diff-ediff-patch}). +@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}. + +@item C-c C-n +Restrict the view to the current hunk (@code{diff-restrict-view}). +@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the +view to the current patch of a multiple file patch. To widen again, +use @kbd{C-x n w}. + +@item C-c C-r +Reverse the direction of comparison for the entire buffer +(@code{diff-reverse-direction}). + +@item C-c C-s +Split the hunk at point (@code{diff-split-hunk}). This is for +manually editing patches, and only works with the unified diff format. + +@item C-c C-u +Convert the entire buffer to unified format +(@code{diff-context->unified}). With a prefix argument, convert +unified format to context format. In Transient Mark mode, when the +mark is active, this command operates only on the region. + +@item C-c C-w +Refine the current hunk so that it disregards changes in whitespace +(@code{diff-refine-hunk}). +@end table + + @kbd{C-x 4 a} in Diff mode operates on behalf of the target file, +but gets the function name from the patch itself. @xref{Change Log}. +This is useful for making log entries for functions that are deleted +by the patch. + +@node Two-Column, Editing Binary Files, Diff Mode, Top @section Two-Column Editing @cindex two-column editing @cindex splitting columns From 350287efea5726462a172406432b31725f259eb6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 01:43:17 +0000 Subject: [PATCH 71/83] (Top): Add Diff Mode to menu. --- man/emacs.texi | 135 +++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 71 deletions(-) diff --git a/man/emacs.texi b/man/emacs.texi index 4e01af2a27a..c058e02d8eb 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -89,9 +89,9 @@ some of how to customize it; it corresponds to GNU Emacs version @value{EMACSVER}. @ifinfo -If you never before used the Info documentation system, type @kbd{h}, -and Emacs will take you to a programmed instruction sequence for the -Info commands. +To learn more about the Info documentation system, type @kbd{h}, and +Emacs will take you to a programmed instruction sequence for the Info +commands. @end ifinfo For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The @@ -197,6 +197,7 @@ Advanced Features * Sorting:: Sorting lines, paragraphs or pages within Emacs. * Narrowing:: Restricting display and editing to a portion of the buffer. +* Diff Mode:: Editing diff output. * Two-Column:: Splitting apart columns to edit them in side-by-side windows. * Editing Binary Files::Using Hexl mode to edit binary files. @@ -286,7 +287,7 @@ Killing and Moving Text * Killing by Lines:: How to kill entire lines of text at one time. * Other Kill Commands:: Commands to kill large regions of text and syntactic units such as words and sentences. -* Graphical Kill:: The kill ring on graphical terminals: +* Graphical Kill:: The kill ring on graphical displays: yanking between applications. * CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy and paste, with enhanced rectangle support. @@ -867,47 +868,47 @@ Emacs and Microsoft Windows @unnumbered Preface This manual documents the use and simple customization of the Emacs -editor. The reader is not expected to be a programmer; simple -customizations do not require programming skill. The user who is not -interested in customizing can ignore the scattered customization hints. +editor. Simple Emacs customizations do not require you to be a +programmer, but if you are not interested in customizing, you can +ignore the customization hints. This is primarily a reference manual, but can also be used as a -primer. For complete beginners, it is a good idea to start with the -on-line, learn-by-doing tutorial, before reading the manual. To run the -tutorial, start Emacs and type @kbd{C-h t}. This way you can learn -Emacs by using Emacs on a specially designed file which describes -commands, tells you when to try them, and then explains the results you -see. +primer. If you are a complete beginner, we recommend you start with +the on-line, learn-by-doing tutorial, before reading the manual. To +run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial +describes commands, tells you when to try them, and explains the +results. On first reading, just skim chapters 1 and 2, which describe the notational conventions of the manual and the general appearance of the Emacs display screen. Note which questions are answered in these chapters, so you can refer back later. After reading chapter 4, you -should practice the commands there. The next few chapters describe -fundamental techniques and concepts that are used constantly. You need -to understand them thoroughly, experimenting with them if necessary. +should practice the commands shown there. The next few chapters +describe fundamental techniques and concepts that are used constantly. +You need to understand them thoroughly, so experiment with them +until you are fluent. Chapters 14 through 19 describe intermediate-level features that are -useful for all kinds of editing. Chapter 20 and following chapters -describe features that you may or may not want to use; read those -chapters when you need them. +useful for many kinds of editing. Chapter 20 and following chapters +describe optional but useful features; read those chapters when you +need them. Read the Trouble chapter if Emacs does not seem to be working -properly. It explains how to cope with some common problems +properly. It explains how to cope with several common problems (@pxref{Lossage}), as well as when and how to report Emacs bugs (@pxref{Bugs}). - To find the documentation on a particular command, look in the index. -Keys (character commands) and command names have separate indexes. There -is also a glossary, with a cross reference for each term. + To find the documentation of a particular command, look in the index. +Keys (character commands) and command names have separate indexes. +There is also a glossary, with a cross reference for each term. This manual is available as a printed book and also as an Info file. -The Info file is for on-line perusal with the Info program, which will -be the principal way of viewing documentation on-line in the GNU system. -Both the Info file and the Info program itself are distributed along -with GNU Emacs. The Info file and the printed book contain -substantially the same text and are generated from the same source -files, which are also distributed along with GNU Emacs. +The Info file is for on-line perusal with the Info program, which is +the principal means of accessing on-line documentation in the GNU +system. Both the Emacs Info file and an Info reader are included with +GNU Emacs. The Info file and the printed book contain substantially +the same text and are generated from the same source files, which are +also distributed with GNU Emacs. GNU Emacs is a member of the Emacs editor family. There are many Emacs editors, all sharing common principles of organization. For @@ -1058,59 +1059,51 @@ T.@: Zimmermann, Reto Zimmermann, Neal Ziring, and Detlev Zundel. @node Intro, Glossary, Distrib, Top @unnumbered Introduction - You are reading about GNU Emacs, the GNU incarnation of the advanced, -self-documenting, customizable, extensible real-time display editor Emacs. + You are reading about GNU Emacs, the GNU incarnation of the +advanced, self-documenting, customizable, extensible editor Emacs. (The `G' in `GNU' is not silent.) - We say that Emacs is a @dfn{display} editor because normally the text -being edited is visible on the screen and is updated automatically as you -type your commands. @xref{Screen,Display}. - - We call it a @dfn{real-time} editor because the display is updated very -frequently, usually after each character or pair of characters you -type. This minimizes the amount of information you must keep in your -head as you edit. @xref{Basic,Real-time,Basic Editing}. - - We call Emacs advanced because it provides facilities that go beyond -simple insertion and deletion: controlling subprocesses; automatic -indentation of programs; viewing two or more files at once; editing -formatted text; and dealing in terms of characters, words, lines, -sentences, paragraphs, and pages, as well as expressions and comments in -several different programming languages. + We call Emacs advanced because it provides much more than simple +insertion and deletion. It can control subprocesses, indent programs +automatically, show two or more files at once, and edit formatted +text. Emacs editing commands operate in terms of characters, words, +lines, sentences, paragraphs, and pages, as well as expressions and +comments in various programming languages. @dfn{Self-documenting} means that at any time you can type a special character, @kbd{Control-h}, to find out what your options are. You can also use it to find out what any command does, or to find all the commands that pertain to a topic. @xref{Help}. - @dfn{Customizable} means that you can change the definitions of Emacs -commands in little ways. For example, if you use a programming language in -which comments start with @samp{<**} and end with @samp{**>}, you can tell -the Emacs comment manipulation commands to use those strings -(@pxref{Comments}). Another sort of customization is rearrangement of the -command set. For example, if you prefer the four basic cursor motion -commands (up, down, left and right) on keys in a diamond pattern on the -keyboard, you can rebind the keys that way. @xref{Customization}. + @dfn{Customizable} means that you can alter Emacs commands' behavior +in simple ways. For example, if you use a programming language in +which comments start with @samp{<**} and end with @samp{**>}, you can +tell the Emacs comment manipulation commands to use those strings +(@pxref{Comments}). Another sort of customization is rearrangement of +the command set. For example, you can rebind the basic cursor motion +commands (up, down, left and right) to any keys on the keyboard that +you find comfortable. @xref{Customization}. - @dfn{Extensible} means that you can go beyond simple customization and -write entirely new commands, programs in the Lisp language to be run by -Emacs's own Lisp interpreter. Emacs is an ``on-line extensible'' -system, which means that it is divided into many functions that call -each other, any of which can be redefined in the middle of an editing -session. Almost any part of Emacs can be replaced without making a -separate copy of all of Emacs. Most of the editing commands of Emacs -are written in Lisp; the few exceptions could have been written -in Lisp but are written in C for efficiency. Although only a programmer -can write an extension, anybody can use it afterward. @xref{Top, -Emacs Lisp Intro, Preface, eintr, An Introduction to Programming in -Emacs Lisp}, if you want to learn Emacs Lisp programming. + @dfn{Extensible} means that you can go beyond simple customization +and write entirely new commands---programs in the Lisp language to be +run by Emacs's own Lisp interpreter. Emacs is an ``on-line +extensible'' system, which means that it is divided into many +functions that call each other, any of which can be redefined in the +middle of an editing session. Almost any part of Emacs can be +replaced without making a separate copy of all of Emacs. Most of the +editing commands of Emacs are written in Lisp; the few exceptions +could have been written in Lisp but use C instead for efficiency. +Writing an extension is programming, but non-programmers can use it +afterwards. @xref{Top, Emacs Lisp Intro, Preface, eintr, An +Introduction to Programming in Emacs Lisp}, if you want to learn Emacs +Lisp programming. When running on a graphical display, Emacs provides its own menus -and convenient handling of mouse buttons. But Emacs provides many of -the benefits of a graphical display even on a text-only terminal. For -instance, it can highlight parts of a file, display and edit several -files at once, move text between files, and edit files while running -shell commands. +and convenient handling of mouse buttons. In addition, Emacs provides +many of the benefits of a graphical display even on a text-only +terminal. For instance, it can highlight parts of a file, display and +edit several files at once, move text between files, and edit files +while running shell commands. @include screen.texi @include commands.texi From 90b571567345bf2d2cd7a7b22f27b02adc4ef168 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 2 May 2006 01:47:57 +0000 Subject: [PATCH 72/83] *** empty log message *** --- etc/NEWS | 17 +++++++++++++++++ lisp/ChangeLog | 5 +++++ man/ChangeLog | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index a15e217cafe..378f715b286 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1966,6 +1966,21 @@ run most curses applications now. +++ ** M-x diff uses Diff mode instead of Compilation mode. ++++ +** Diff mode key bindings changed. + +These are the new bindings: + +C-c C-e diff-ediff-patch (old M-A) +C-c C-n diff-restrict-view (old M-r) +C-c C-r diff-reverse-direction (old M-R) +C-c C-u diff-context->unified (old M-U) +C-c C-w diff-refine-hunk (old C-c C-r) + +To convert unified to context format, use C-u C-c C-u. +In addition, C-c C-u now operates on the region +in Transient Mark mode when the mark is active. + +++ ** You can now customize `fill-nobreak-predicate' to control where filling can break lines. The value is now normally a list of @@ -5893,6 +5908,8 @@ Currently, the following actions have been defined: - Mouse-2 on the read-only or modified status in the mode line (`%' or `*') toggles the status. +- Mouse-3 on the major mode name displays a major mode menu. + - Mouse-3 on the mode name displays a minor-mode menu. ** Hourglass pointer diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae61defbea2..e0be66f3b08 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2006-05-01 Richard Stallman + * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C, + M-r, M-R, M-A, M-SPC or M-DEL. + (diff-mode-map): diff-refine-hunk now on C-c C-w + (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u. + * help-mode.el (help-mode): view-exit-action calls delete-window only when it is safe and possible. diff --git a/man/ChangeLog b/man/ChangeLog index 7337b1de848..bd48e3f4f20 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-05-01 Richard Stallman + + * emacs.texi (Top): Add Diff Mode to menu. + 2006-05-01 Aaron S. Hawley * misc.texi (Diff Mode): New node. From 9606f1cb5cb39d78377b95271baf7dd6e3c47f94 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 2 May 2006 05:25:20 +0000 Subject: [PATCH 73/83] Revision: emacs@sv.gnu.org/emacs--devo--0--patch-257 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 98) - Update from CVS --- lisp/gnus/ChangeLog | 8 ++++++++ lisp/gnus/mm-uu.el | 17 ++++++++++++----- lisp/gnus/mml2015.el | 2 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c547166bfa7..fc1c8881b82 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,11 @@ +2006-04-28 Katsumi Yamaoka + + * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made + unibyte after clear-decrypt function runs. + + * mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg + returns as a unibyte string. + 2006-04-27 Katsumi Yamaoka * lpath.el: Don't fbind string-as-multibyte for XEmacs. diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 944e40bc964..9d9d87a3670 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -436,11 +436,18 @@ Return that buffer." "OK"))) (progn ;; Decode charset. - (when (and (or charset - (setq charset gnus-newsgroup-charset)) - (setq charset (mm-charset-to-coding-system charset)) - (not (eq charset 'ascii))) - (mm-decode-coding-region (point-min) (point-max) charset)) + (if (and (or charset + (setq charset gnus-newsgroup-charset)) + (setq charset (mm-charset-to-coding-system charset)) + (not (eq charset 'ascii))) + ;; Assume that buffer's multibyteness is turned off. + ;; See `mml2015-pgg-clear-decrypt'. + (insert (mm-decode-coding-string (prog1 + (buffer-string) + (erase-buffer) + (mm-enable-multibyte)) + charset)) + (mm-enable-multibyte)) (list (mm-make-handle buf mm-uu-text-plain-type))) (list (mm-make-handle buf '("application/pgp-encrypted"))))))) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 80dd5b26597..591ef647678 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -707,6 +707,8 @@ (buffer-string)))) (progn (erase-buffer) + ;; Treat data which pgg returns as a unibyte string. + (mm-disable-multibyte) (insert-buffer-substring pgg-output-buffer) (goto-char (point-min)) (while (search-forward "\r\n" nil t) From 6cf93749317c2e18f850cd0f47f905895e850bfc Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 2 May 2006 05:25:29 +0000 Subject: [PATCH 74/83] Revision: emacs@sv.gnu.org/emacs--devo--0--patch-258 Clean up lisp/gnus/ChangeLog a bit --- lisp/gnus/ChangeLog | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index fc1c8881b82..cecc180f522 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -8,40 +8,10 @@ 2006-04-27 Katsumi Yamaoka - * lpath.el: Don't fbind string-as-multibyte for XEmacs. - - * pgg-gpg.el (pgg-string-to-multibyte): Remove. - (pgg-gpg-process-region): Revert. - - * pgg-pgp.el (pgg-pgp-process-region): Revert. - (pgg-pgp-lookup-key): Revert. - - * pgg-pgp5.el (pgg-pgp5-process-region): Revert. - (pgg-pgp5-lookup-key): Revert. - - * pgg.el (pgg-fetch-key): Revert. - -2006-04-27 Katsumi Yamaoka - - * lpath.el: Fbind make-network-process for both Emacs and XEmacs; - fbind string-as-multibyte for XEmacs. - * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el. (mml1991-pgg-encrypt): Ditto. - * pgg-gpg.el (pgg-string-to-multibyte): New function. - (pgg-gpg-process-region): Make sure pgg-output-buffer is always - a multibyte buffer. - - * pgg-pgp.el (pgg-pgp-process-region): Ditto. - (pgg-pgp-lookup-key): Ditto. - - * pgg-pgp5.el (pgg-pgp5-process-region): Ditto. - (pgg-pgp5-lookup-key): Ditto. - - * pgg.el (pgg-fetch-key): Ditto. - 2006-04-26 Reiner Steib * deuglify.el (gnus-outlook-deuglify-unwrap-min) @@ -514,13 +484,6 @@ 2006-02-09 Daiki Ueno - * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings - in elisp. - (pgg-gpg-encrypt-symmetric-region): Ditto. - (pgg-gpg-sign-region): Ditto. - - * pgg-def.el (pgg-text-mode): New variable. - * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. (mml2015-pgg-encrypt): Ditto. From 41a2f8bab50e0ccecf410910c445bce1e281876c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 2 May 2006 08:50:59 +0000 Subject: [PATCH 75/83] (grep-expand-template): Use symbol-value instead of eval on symbols. --- lisp/ChangeLog | 16 ++++++++-------- lisp/progmodes/grep.el | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0be66f3b08..c841f83b086 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -26,24 +26,24 @@ (tramp-completion-handle-file-name-directory) (tramp-completion-handle-file-name-nondirectory) (tramp-completion-handle-expand-file-name): Remove them. - (tramp-handle-file-name-directory): Return the real directory - name. Returning "/" only doesn't need to be necessary any longer. + (tramp-handle-file-name-directory): Return the real directory name. + Returning "/" only doesn't need to be necessary any longer. (tramp-file-name-handler): Make special attention when in hostname completion mode. - (tramp-completion-file-name-handler): Revert patch from - 2006-04-28. + (tramp-completion-file-name-handler): Revert patch from 2006-04-28. (tramp-register-file-name-handlers): Register `tramp-completion-file-name-handler' only when `partial-completion-mode is enabled. - (tramp-completion-handle-file-name-all-completions): Delete - directory part from results. + (tramp-completion-handle-file-name-all-completions): + Delete directory part from results. (tramp-get-completion-methods, tramp-get-completion-user-host): Discard deleting "/", it doesn't work after the change of `tramp-handle-file-name-directory' above. 2006-05-01 Kim F. Storm - * progmodes/grep.el (grep-expand-template): Use save-match-data. + * progmodes/grep.el (grep-expand-template): Use save-match-data + and symbol-value. 2006-05-01 YAMAMOTO Mitsuharu @@ -121,7 +121,7 @@ (grep-read-regexp, grep-read-files): New helper functions. (rgrep): Rename from grep-tree. Rework to use proper histories. Adapt to changes in defcustoms and functions above. - (lgrep): New command, as grep, but using same interactive api as rgrep. + (lgrep): New command, as grep, but using same interactive UI as rgrep. 2006-04-28 Michael Albinus diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 0aba9d42b84..c695272e92b 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -584,7 +584,7 @@ substitution string. Note dynamic scoping of variables.") (setq command (replace-match (or (if (symbolp (cdr kw)) - (eval (cdr kw)) + (symbol-value (cdr kw)) (save-match-data (eval (cdr kw)))) "") t t command)))))) From 7e237d2403a7650ebbf1ded6518c850cb0225956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Potort=C3=AC?= Date: Tue, 2 May 2006 10:15:29 +0000 Subject: [PATCH 76/83] (Perl_functions): Free space allocated for var package. (Erlang_functions): Possibly free space allocated for var last. (Prolog_functions): Possibly free space allocated for var last. --- lib-src/ChangeLog | 6 ++++++ lib-src/etags.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 115e43c2d03..2e8581a6f57 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,9 @@ +2006-05-02 Francesco Potort,Al(B + + * etags.c (Perl_functions): Free space allocated for var package. + (Erlang_functions): Possibly free space allocated for var last. + (Prolog_functions): Possibly free space allocated for var last. + 2006-04-29 Dan Nicolaescu * sorted-doc.c (main): Initialize docs to NULL. diff --git a/lib-src/etags.c b/lib-src/etags.c index a7c98f090bb..e206443f39b 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -41,7 +41,7 @@ * configuration file containing regexp definitions for etags. */ -char pot_etags_version[] = "@(#) pot revision number is 17.15"; +char pot_etags_version[] = "@(#) pot revision number is 17.17"; #define TRUE 1 #define FALSE 0 @@ -4543,6 +4543,7 @@ Perl_functions (inf) lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } + free (package); } @@ -5441,6 +5442,8 @@ Prolog_functions (inf) last[len] = '\0'; } } + if (last != NULL) + free (last); } @@ -5597,7 +5600,11 @@ Erlang_functions (inf) else if (cp[0] == '-') /* attribute, e.g. "-define" */ { erlang_attribute (cp); - last = NULL; + if (last != NULL) + { + free (last); + last = NULL; + } } else if ((len = erlang_func (cp, last)) > 0) { @@ -5614,6 +5621,8 @@ Erlang_functions (inf) last[len] = '\0'; } } + if (last != NULL) + free (last); } From 31cf286fdb0a74fa05761163237ee002e1b511b8 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Tue, 2 May 2006 12:24:55 +0000 Subject: [PATCH 77/83] (byte-compile-dynamic) (byte-compile-dynamic-docstrings, byte-compile-warnings) (find-file-visit-truename, indent-tabs-mode, left-margin) (no-byte-compile no-update-autoloads, truncate-lines) (version-control): Don't use `t' for safe-local-variable declarations. --- lisp/ChangeLog | 9 +++++++++ lisp/files.el | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c841f83b086..3269c5a7266 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2006-05-02 Reiner Steib + + * files.el (byte-compile-dynamic) + (byte-compile-dynamic-docstrings, byte-compile-warnings) + (find-file-visit-truename, indent-tabs-mode, left-margin) + (no-byte-compile no-update-autoloads, truncate-lines) + (version-control): Don't use `t' for safe-local-variable + declarations. + 2006-05-01 Richard Stallman * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C, diff --git a/lisp/files.el b/lisp/files.el index 76167eb27cf..99972dc9709 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2353,27 +2353,27 @@ asking you for confirmation." (eval `(mapc (lambda (pair) (put (car pair) 'safe-local-variable (cdr pair))) - '((byte-compile-dynamic . t) - (byte-compile-dynamic-docstrings . t) - (byte-compile-warnings . t) + '((byte-compile-dynamic . booleanp) + (byte-compile-dynamic-docstrings . booleanp) + (byte-compile-warnings . booleanp) (c-basic-offset . integerp) (c-file-style . stringp) (c-indent-level . integerp) (comment-column . integerp) (compile-command . string-or-null-p) - (find-file-visit-truename . t) + (find-file-visit-truename . booleanp) (fill-column . integerp) (fill-prefix . string-or-null-p) - (indent-tabs-mode . t) + (indent-tabs-mode . booleanp) ;; C source code (kept-old-versions . integerp) (kept-new-versions . integerp) - (left-margin . t) - (no-byte-compile . t) - (no-update-autoloads . t) + (left-margin . integerp) + (no-byte-compile . booleanp) + (no-update-autoloads . booleanp) (outline-regexp . string-or-null-p) (tab-width . integerp) ;; C source code - (truncate-lines . t) ;; C source code - (version-control . t))))) + (truncate-lines . booleanp) ;; C source code + (version-control . symbolp))))) (put 'c-set-style 'safe-local-eval-function t) From 4f308f7304c763b5a4b581716515e9a6ce9cec33 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Tue, 2 May 2006 12:32:57 +0000 Subject: [PATCH 78/83] (command-line-1): Refer to Lisp manual when pure-space-overflow occurs. --- lisp/ChangeLog | 3 +++ lisp/startup.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3269c5a7266..448e319cfc4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2006-05-02 Reiner Steib + * startup.el (command-line-1): Refer to Lisp manual when + pure-space-overflow occurs. + * files.el (byte-compile-dynamic) (byte-compile-dynamic-docstrings, byte-compile-warnings) (find-file-visit-truename, indent-tabs-mode, left-margin) diff --git a/lisp/startup.el b/lisp/startup.el index 470ffd7745c..8369ecddd42 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1620,7 +1620,7 @@ normal otherwise." (not noninteractive)) (display-warning 'initialization - "Building Emacs overflowed pure space." + "Building Emacs overflowed pure space. See \"(elisp)Building Emacs\" for more information." ;; FIXME: Tell the user what kind of problems are possible and how to fix ;; the overflow. :warning)) From 72fa72acd8e9de3912fcf869cd9a09d3e63f4a2e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 2 May 2006 19:27:09 +0000 Subject: [PATCH 79/83] * msb.el (msb): If EVENT is a down event, read and discard the up event. --- lisp/ChangeLog | 5 +++++ lisp/msb.el | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 448e319cfc4..355fae2103a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-05-02 Chong Yidong + + * msb.el (msb): If EVENT is a down event, read and discard the up + event. + 2006-05-02 Reiner Steib * startup.el (command-line-1): Refer to Lisp manual when diff --git a/lisp/msb.el b/lisp/msb.el index 95cbfc85df4..61ddce5dae0 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -473,6 +473,11 @@ selects that window. See the function `mouse-select-buffer' and the variable `msb-menu-cond' for more information about how the menus are split." (interactive "e") + ;; If EVENT is a down-event, read and discard the + ;; corresponding up-event. + (and (eventp event) + (memq 'down (event-modifiers event)) + (read-event)) (let ((old-window (selected-window)) (window (posn-window (event-start event)))) (unless (framep window) (select-window window)) From 35edc8219aad7310ba1550a54bbe654f143e0b86 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 2 May 2006 20:52:52 +0000 Subject: [PATCH 80/83] calc-embed.el: (calc-override-minor-modes-map, calc-override-minor-modes): New variables. (calc-do-embedded): Make sure that Calc keystrokes aren't overwritten by minor modes. --- lisp/ChangeLog | 7 +++++++ lisp/calc/calc-embed.el | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 355fae2103a..566d66a5731 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2006-05-02 Jay Belanger + + * calc/calc-embed.el: (calc-override-minor-modes-map) + (calc-override-minor-modes): New variables. + (calc-do-embedded): Make sure that Calc keystrokes aren't + overwritten by minor modes. + 2006-05-02 Chong Yidong * msb.el (msb): If EVENT is a down event, read and discard the up diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index adb94ef7381..e54a94e4d39 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -206,6 +206,18 @@ (defvar calc-embedded-firsttime-buf) (defvar calc-embedded-firsttime-formula) +;; The following is to take care of any minor modes which override +;; a Calc command. +(defvar calc-override-minor-modes-map + (make-sparse-keymap) + "A list of keybindings that might be overwritten by minor modes.") + +;; Add any keys that might be overwritten here. +(define-key calc-override-minor-modes-map "`" 'calc-edit) + +(defvar calc-override-minor-modes + (cons t calc-override-minor-modes-map)) + (defun calc-do-embedded (calc-embed-arg end obeg oend) (if calc-embedded-info @@ -237,6 +249,8 @@ truncate-lines (nth 2 mode) buffer-read-only nil) (use-local-map (nth 1 mode)) + (setq minor-mode-overriding-map-alist + (remq calc-override-minor-modes minor-mode-overriding-map-alist)) (set-buffer-modified-p (buffer-modified-p)) (calc-embedded-restore-original-modes) (or calc-embedded-quiet @@ -297,6 +311,9 @@ buffer-read-only t) (set-buffer-modified-p (buffer-modified-p)) (use-local-map calc-mode-map) + (setq minor-mode-overriding-map-alist + (cons calc-override-minor-modes + minor-mode-overriding-map-alist)) (setq calc-no-refresh-evaltos nil) (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos))) (let (str) From bc16bf5eb3098c6a26e3355a44e910efebfe67bf Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 2 May 2006 23:14:55 +0000 Subject: [PATCH 81/83] Revision: emacs@sv.gnu.org/emacs--devo--0--patch-261 lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t --- lisp/ChangeLog | 4 ++++ lisp/replace.el | 1 + 2 files changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 566d66a5731..c1fe4d6a8a5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-05-02 Miles Bader + + * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t. + 2006-05-02 Jay Belanger * calc/calc-embed.el: (calc-override-minor-modes-map) diff --git a/lisp/replace.el b/lisp/replace.el index 3187bbbbd36..f1792b499fc 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1098,6 +1098,7 @@ See also `multi-occur'." (endpt nil) (marker nil) (curstring "") + (inhibit-field-text-motion t) (headerpt (with-current-buffer out-buf (point)))) (with-current-buffer buf (or coding From cea3f866ce0df44b5a3ff04be3cf7fe09b9e7364 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 3 May 2006 00:16:17 +0000 Subject: [PATCH 82/83] *** empty log message *** --- lisp/ChangeLog | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1fe4d6a8a5..2a402f88c01 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-05-03 Nick Roberts + + * progmodes/gdb-ui.el (gud-watch): Let user select an expression. + (menu): Fix typo. + 2006-05-02 Miles Bader * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t. @@ -82,7 +87,7 @@ 2006-05-01 Nick Roberts * progmodes/gud.el (gud-def): Add %c case. - (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily. + (gud-speedbar-buttons): Don't bind case-fold-search unnecessarily. (gud-format-command): Make match case sensitive. Match on %F. 2006-04-30 Glenn Morris From 9d6bb9e0af2671a4deca1509f4a2d5655400f67a Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 3 May 2006 00:17:35 +0000 Subject: [PATCH 83/83] (gud-watch): Let user select an expression. (menu): Fix typo. --- lisp/progmodes/gdb-ui.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index a5163319fbf..4b3202c6e41 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -690,10 +690,13 @@ With arg, enter name of variable to be watched in the minibuffer." (if event (posn-set-point (event-end event))) (require 'tooltip) (save-selected-window - (let ((expr (if arg - (completing-read "Name of variable: " - 'gud-gdb-complete-command) - (tooltip-identifier-from-point (point))))) + (let ((expr + (if arg + (completing-read "Name of variable: " + 'gud-gdb-complete-command) + (if (and transient-mark-mode mark-active) + (buffer-substring (region-beginning) (region-end)) + (tooltip-identifier-from-point (point)))))) (catch 'already-watched (dolist (var gdb-var-list) (unless (string-match "\\." (car var)) @@ -2691,7 +2694,7 @@ corresponding to the mode line clicked." '(menu-item "Inferior IO" gdb-frame-separate-io-buffer :enable gdb-use-separate-io-buffer)) (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) - (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer)) + (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer)) (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))