From 67410645391d8e5572c7617448f4bb94a34248ff Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 3 Aug 2007 10:49:56 +0000 Subject: (term-erase-in-display): Fix case when point is not at the beginning of the line. --- lisp/ChangeLog | 5 +++++ lisp/term.el | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5d830248269..dc80d7a6465 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-03 Dan Nicolaescu + + * term.el (term-erase-in-display): Fix case when point is not at + the beginning of the line. + 2007-08-03 Jay Belanger * calc/calc-ext.el (math-get-value,math-get-sdev) diff --git a/lisp/term.el b/lisp/term.el index c7b5ee249d1..55c5090fb2c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3715,12 +3715,12 @@ all pending output has been dealt with.")) (defun term-erase-in-display (kind) "Erases (that is blanks out) part of the window. If KIND is 0, erase from (point) to (point-max); -if KIND is 1, erase from home to point; else erase from home to point-max. -Should only be called when point is at the start of a screen line." +if KIND is 1, erase from home to point; else erase from home to point-max." (term-handle-deferred-scroll) (cond ((eq term-terminal-parameter 0) - (delete-region (point) (point-max)) - (term-unwrap-line)) + (let ((need-unwrap (bolp))) + (delete-region (point) (point-max)) + (when need-unwrap (term-unwrap-line)))) ((let ((row (term-current-row)) (col (term-horizontal-column)) (start-region term-home-marker) -- cgit v1.2.1 From bc2052ce1b6de4288e33b701b392b3bc368067d4 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Fri, 3 Aug 2007 13:52:35 +0000 Subject: Evaluate require only during compilation --- lisp/ChangeLog | 7 +++++++ lisp/printing.el | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc80d7a6465..0c5b257f859 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-03 Vinicius Jose Latorre + + * printing.el: Evaluate require only during compilation. + (pr-version): New version 6.9.1. + (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR). + (pr-global-menubar): Fix code. + 2007-08-03 Dan Nicolaescu * term.el (term-erase-in-display): Fix case when point is not at diff --git a/lisp/printing.el b/lisp/printing.el index 7b45d166aa3..98cb442ed00 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -6,11 +6,11 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 6.9 +;; Version: 6.9.1 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst pr-version "6.9" - "printing.el, v 6.9 <2007/02/11 vinicius> +(defconst pr-version "6.9.1" + "printing.el, v 6.9.1 <2007/08/02 vinicius> Please send all bug fixes and enhancements to Vinicius Jose Latorre @@ -1025,8 +1025,9 @@ Please send all bug fixes and enhancements to ;;; Code: -(require 'lpr) -(require 'ps-print) +(eval-when-compile + (require 'lpr) + (require 'ps-print)) (and (string< ps-print-version "6.6.4") @@ -1306,7 +1307,7 @@ If SUFFIX is non-nil, add that at the end of the file name." (defalias 'pr-f-read-string 'read-string) ;; GNU Emacs - (defvar deactivate-mark nil) + (defvar deactivate-mark) ;; GNU Emacs (defun pr-keep-region-active () @@ -1326,7 +1327,6 @@ If SUFFIX is non-nil, add that at the end of the file name." ;; GNU Emacs ;; Menu binding - (require 'easymenu) ;; Replace existing "print" item by "Printing" item. ;; If you're changing this file, you'll load it a second, ;; third... time, but "print" item exists only in the first load. @@ -1335,6 +1335,7 @@ If SUFFIX is non-nil, add that at the end of the file name." ;; GNU Emacs 20 ((< emacs-major-version 21) (defun pr-global-menubar (pr-menu-spec) + (require 'easymenu) (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) (when pr-menu-print-item (easy-menu-remove-item nil '("tools") pr-menu-print-item) @@ -1345,6 +1346,7 @@ If SUFFIX is non-nil, add that at the end of the file name." ;; GNU Emacs 21 & 22 (t (defun pr-global-menubar (pr-menu-spec) + (require 'easymenu) (let ((menu-file (if (= emacs-major-version 21) '("menu-bar" "files") ; GNU Emacs 21 '("menu-bar" "file")))) ; GNU Emacs 22 or higher @@ -6017,9 +6019,10 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." ;; Printing Interface (inspired on ps-print-interface.el) -(require 'widget) -(require 'wid-edit) -(require 'cus-edit) +(eval-when-compile + (require 'cus-edit) + (require 'wid-edit) + (require 'widget)) (defvar pr-i-window-configuration nil) -- cgit v1.2.1 From dcf416a7c8d3fc83127df1e8a2f6ce534761c8df Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Aug 2007 17:09:01 +0000 Subject: (telnet-mode): Fix previous change. --- lisp/net/telnet.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 28f7d1ddb46..ef01c96ec8e 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -248,7 +248,7 @@ There is a variable ``telnet-interrupt-string'' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) - (setq comint-use-prompt-regexp t)) + (set (make-local-variable 'comint-use-prompt-regexp) t)) ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") -- cgit v1.2.1 From 3d25585336617493056f7871dc591fa55cc6a90a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Aug 2007 17:09:43 +0000 Subject: (telnet-mode): Fix previous change. --- lisp/net/telnet.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 28f7d1ddb46..ef01c96ec8e 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -248,7 +248,7 @@ There is a variable ``telnet-interrupt-string'' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) - (setq comint-use-prompt-regexp t)) + (set (make-local-variable 'comint-use-prompt-regexp) t)) ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") -- cgit v1.2.1 From c192a0863e4572541693d8405a6f141c08907585 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 3 Aug 2007 22:06:36 +0000 Subject: (diff-font-lock-keywords): Fix up false positives. (diff-beginning-of-file): Adjust to the fact that diff-file-header-re may match up to 4 lines. (diff-beginning-of-file-and-junk): Rewrite. --- lisp/ChangeLog | 7 ++++++ lisp/diff-mode.el | 73 +++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 26 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c5b257f859..3ba13245336 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-03 Stefan Monnier + + * diff-mode.el (diff-font-lock-keywords): Fix up false positives. + (diff-beginning-of-file): Adjust to the fact that diff-file-header-re + may match up to 4 lines. + (diff-beginning-of-file-and-junk): Rewrite. + 2007-08-03 Vinicius Jose Latorre * printing.el: Evaluate require only during compilation. diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index cfac6517209..3c8ad2c49ff 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -349,8 +349,11 @@ when editing big diffs)." ("^--- .+ ----$" . diff-hunk-header-face) ;context ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal ("^---$" . diff-hunk-header-face) ;normal - ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+\\)\\(.*[^*-]\\)?\n" - (0 diff-header-face) (2 diff-file-header-face prepend)) + ;; For file headers, accept files with spaces, but be careful to rule + ;; out false-positives when matching hunk headers. + ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n" + (0 diff-header-face) + (2 (if (not (match-end 3)) diff-file-header-face) prepend)) ("^\\([-<]\\)\\(.*\n\\)" (1 diff-indicator-removed-face) (2 diff-removed-face)) ("^\\([+>]\\)\\(.*\n\\)" @@ -425,10 +428,20 @@ but in the file header instead, in which case move forward to the first hunk." (defun diff-beginning-of-file () (beginning-of-line) (unless (looking-at diff-file-header-re) - (forward-line 2) - (condition-case () - (re-search-backward diff-file-header-re) - (error (error "Can't find the beginning of the file"))))) + (let ((start (point)) + res) + ;; diff-file-header-re may need to match up to 4 lines, so in case + ;; we're inside the header, we need to move up to 3 lines forward. + (forward-line 3) + (if (and (setq res (re-search-backward diff-file-header-re nil t)) + ;; Maybe the 3 lines forward were too much and we matched + ;; a file header after our starting point :-( + (or (<= (point) start) + (setq res (re-search-backward diff-file-header-re nil t)))) + res + (goto-char start) + (error "Can't find the beginning of the file"))))) + (defun diff-end-of-file () (re-search-forward "^[-+#!<>0-9@* \\]" nil t) @@ -481,26 +494,34 @@ If the prefix ARG is given, restrict the view to the current file instead." "Go to the beginning of file-related diff-info. This is like `diff-beginning-of-file' except it tries to skip back over leading data such as \"Index: ...\" and such." - (let ((start (point)) - (file (condition-case err (progn (diff-beginning-of-file) (point)) - (error err))) - ;; prevhunk is one of the limits. - (prevhunk (save-excursion (ignore-errors (diff-hunk-prev) (point)))) - err) - (when (consp file) - ;; Presumably, we started before the file header, in the leading junk. - (setq err file) - (diff-file-next) - (setq file (point))) - (let ((index (save-excursion - (re-search-backward "^Index: " prevhunk t)))) - (when index (setq file index)) - (if (<= file start) - (goto-char file) - ;; File starts *after* the starting point: we really weren't in - ;; a file diff but elsewhere. - (goto-char start) - (signal (car err) (cdr err)))))) + (let* ((start (point)) + (prevfile (condition-case err + (save-excursion (diff-beginning-of-file) (point)) + (error err))) + (err (if (consp prevfile) prevfile)) + (nextfile (ignore-errors + (save-excursion + (goto-char start) (diff-file-next) (point)))) + ;; prevhunk is one of the limits. + (prevhunk (save-excursion + (ignore-errors + (if (numberp prevfile) (goto-char prevfile)) + (diff-hunk-prev) (point)))) + (previndex (save-excursion + (re-search-backward "^Index: " prevhunk t)))) + ;; If we're in the junk, we should use nextfile instead of prevfile. + (if (and (numberp nextfile) + (or (not (numberp prevfile)) + (and previndex (> previndex prevfile)))) + (setq prevfile nextfile)) + (if (and previndex (numberp prevfile) (< previndex prevfile)) + (setq prevfile previndex)) + (if (and (numberp prevfile) (<= prevfile start)) + (goto-char prevfile) + ;; File starts *after* the starting point: we really weren't in + ;; a file diff but elsewhere. + (goto-char start) + (signal (car err) (cdr err))))) (defun diff-file-kill () "Kill current file's hunks." -- cgit v1.2.1 From b0fcd35819b267bfe305b084060f0b00fbaedd37 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:31:05 +0000 Subject: (cperl-compilation-error-regexp-alist): Remove duplicate defvar preventing initialization. (cperl-mode): Fix compilation-error-regexp-alist-alist setting. --- lisp/progmodes/cperl-mode.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d1dc0e875c4..3badfed5d4f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1497,9 +1497,16 @@ the last)." (defvar cperl-use-major-mode 'cperl-mode) (defvar cperl-font-lock-multiline-start nil) (defvar cperl-font-lock-multiline nil) -(defvar cperl-compilation-error-regexp-alist nil) (defvar cperl-font-locking nil) +;; NB as it stands the code in cperl-mode assumes this only has one +;; element. If Xemacs 19 support were dropped, this could all be simplified. +(defvar cperl-compilation-error-regexp-alist + ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). + '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" + 2 3)) + "Alist that specifies how to match errors in perl output.") + ;;;###autoload (defun cperl-mode () "Major mode for editing Perl code. @@ -1786,7 +1793,7 @@ or as help on variables `cperl-tips', `cperl-problems', (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x (make-local-variable 'compilation-error-regexp-alist-alist) (set 'compilation-error-regexp-alist-alist - (cons (cons 'cperl cperl-compilation-error-regexp-alist) + (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) (symbol-value 'compilation-error-regexp-alist-alist))) (if (fboundp 'compilation-build-compilation-error-regexp-alist) (let ((f 'compilation-build-compilation-error-regexp-alist)) @@ -5702,13 +5709,6 @@ indentation and initial hashes. Behaves usually outside of comment." (t 5))) ; should not happen -(defvar cperl-compilation-error-regexp-alist - ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). - '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" - 2 3)) - "Alist that specifies how to match errors in perl output.") - - (defun cperl-windowed-init () "Initialization under windowed version." (cond ((featurep 'ps-print) -- cgit v1.2.1 From f6208d7976932f2df71d2ef8624068d18593ade1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:31:36 +0000 Subject: (auto-revert-tail-mode): auto-revert-tail-pos is zero, not nil, when the library is first loaded. Check for a file that has been modified on disk. --- lisp/autorevert.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 473e8e1976b..6c6dbd963d5 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -276,9 +276,9 @@ the list of old buffers.") "Position of last known end of file.") (add-hook 'find-file-hook - (lambda () - (set (make-local-variable 'auto-revert-tail-pos) - (nth 7 (file-attributes buffer-file-name))))) + (lambda () + (set (make-local-variable 'auto-revert-tail-pos) + (nth 7 (file-attributes buffer-file-name))))) ;; Functions: @@ -334,9 +334,25 @@ Use `auto-revert-mode' for changes other than appends!" (auto-revert-tail-mode 0) (error "This buffer is not visiting a file")) (if (and (buffer-modified-p) - (not auto-revert-tail-pos) ; library was loaded only after finding file + (zerop auto-revert-tail-pos) ; library was loaded only after finding file (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? "))) (auto-revert-tail-mode 0) + ;; a-r-tail-pos stores the size of the file at the time of the + ;; last revert. After this package loads, it adds a + ;; find-file-hook to set this variable every time a file is + ;; loaded. If the package is loaded only _after_ visiting the + ;; file to be reverted, then we have no idea what the value of + ;; a-r-tail-pos should have been when the file was visited. If + ;; the file has changed on disk in the meantime, all we can do + ;; is offer to revert the whole thing. If you choose not to + ;; revert, then you might miss some output then happened + ;; between visiting the file and activating a-r-t-mode. + (and (zerop auto-revert-tail-pos) + (not (verify-visited-file-modtime (current-buffer))) + (y-or-n-p "File changed on disk, content may be missing. \ +Perform a full revert? ") + ;; Use this (not just revert-buffer) for point-preservation. + (auto-revert-handler)) ;; else we might reappend our own end when we save (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position -- cgit v1.2.1 From d6d6746a84b760f2c32ee1c5785f88bb30e421fd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:31:52 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3ba13245336..2b78164cd15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-08-04 Glenn Morris + + * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is + zero, not nil, when the library is first loaded. Check for a file + that has been modified on disk. + + * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist): + Remove duplicate defvar preventing initialization. + (cperl-mode): Fix compilation-error-regexp-alist-alist setting. + 2007-08-03 Stefan Monnier * diff-mode.el (diff-font-lock-keywords): Fix up false positives. -- cgit v1.2.1 From 08527c6137a5d9c411b3929c487fbb004b031345 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:32:43 +0000 Subject: (cperl-compilation-error-regexp-alist): Remove duplicate defvar preventing initialization. (cperl-mode): Fix compilation-error-regexp-alist-alist setting. --- lisp/progmodes/cperl-mode.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d1dc0e875c4..3badfed5d4f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1497,9 +1497,16 @@ the last)." (defvar cperl-use-major-mode 'cperl-mode) (defvar cperl-font-lock-multiline-start nil) (defvar cperl-font-lock-multiline nil) -(defvar cperl-compilation-error-regexp-alist nil) (defvar cperl-font-locking nil) +;; NB as it stands the code in cperl-mode assumes this only has one +;; element. If Xemacs 19 support were dropped, this could all be simplified. +(defvar cperl-compilation-error-regexp-alist + ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). + '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" + 2 3)) + "Alist that specifies how to match errors in perl output.") + ;;;###autoload (defun cperl-mode () "Major mode for editing Perl code. @@ -1786,7 +1793,7 @@ or as help on variables `cperl-tips', `cperl-problems', (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x (make-local-variable 'compilation-error-regexp-alist-alist) (set 'compilation-error-regexp-alist-alist - (cons (cons 'cperl cperl-compilation-error-regexp-alist) + (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) (symbol-value 'compilation-error-regexp-alist-alist))) (if (fboundp 'compilation-build-compilation-error-regexp-alist) (let ((f 'compilation-build-compilation-error-regexp-alist)) @@ -5702,13 +5709,6 @@ indentation and initial hashes. Behaves usually outside of comment." (t 5))) ; should not happen -(defvar cperl-compilation-error-regexp-alist - ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). - '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" - 2 3)) - "Alist that specifies how to match errors in perl output.") - - (defun cperl-windowed-init () "Initialization under windowed version." (cond ((featurep 'ps-print) -- cgit v1.2.1 From 4d80564060cbb097fa8980abf6e168cec17f8f58 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:34:46 +0000 Subject: (auto-revert-tail-mode): auto-revert-tail-pos is zero, not nil, when the library is first loaded. Check for a file that has been modified on disk. --- lisp/autorevert.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lisp') diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 1f4ebc57b19..cad94e789d6 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -337,6 +337,22 @@ Use `auto-revert-mode' for changes other than appends!" (not auto-revert-tail-pos) ; library was loaded only after finding file (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? "))) (auto-revert-tail-mode 0) + ;; a-r-tail-pos stores the size of the file at the time of the + ;; last revert. After this package loads, it adds a + ;; find-file-hook to set this variable every time a file is + ;; loaded. If the package is loaded only _after_ visiting the + ;; file to be reverted, then we have no idea what the value of + ;; a-r-tail-pos should have been when the file was visited. If + ;; the file has changed on disk in the meantime, all we can do + ;; is offer to revert the whole thing. If you choose not to + ;; revert, then you might miss some output then happened + ;; between visiting the file and activating a-r-t-mode. + (and (zerop auto-revert-tail-pos) + (not (verify-visited-file-modtime (current-buffer))) + (y-or-n-p "File changed on disk, content may be missing. \ +Perform a full revert? ") + ;; Use this (not just revert-buffer) for point-preservation. + (auto-revert-handler)) ;; else we might reappend our own end when we save (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position -- cgit v1.2.1 From d2ce2e3f341ff0cf31ac7d3ce1ccff394b06f1ed Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 4 Aug 2007 02:35:10 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f31e3553249..cf4daf15b62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-08-04 Glenn Morris + + * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is + zero, not nil, when the library is first loaded. Check for a file + that has been modified on disk. + + * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist): + Remove duplicate defvar preventing initialization. + (cperl-mode): Fix compilation-error-regexp-alist-alist setting. + 2007-08-03 Miles Bader * vc-hooks.el (vc-handled-backends): Change capitalization of VC -- cgit v1.2.1 From 1b82c77d90053dbcfe30dbe572f6e044d40f3b4a Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 03:52:06 +0000 Subject: (calc-curve-fit): Add support for nonlinear curves and plotting. --- lisp/calc/calcalg3.el | 202 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 140 insertions(+), 62 deletions(-) (limited to 'lisp') diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 9f263a2281a..611e2d7f45d 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -115,6 +115,8 @@ (if (calc-is-hyperbolic) 'calcFunc-efit 'calcFunc-fit))) key (which 0) + (nonlinear nil) + (plot nil) n calc-curve-nvars temp data (homog nil) (msgs '( "(Press ? for help)" @@ -125,7 +127,11 @@ "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)" "q = a + b (x-c)^2" "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)" + "s = a/(1 + exp(b (x - c)))" + "b = a exp(b (x - c))/(1 + exp(b (x - c)))^2" + "o = (y/x) = a (1 - x/b)" "h prefix = homogeneous model (no constant term)" + "P prefix = plot result" "' = alg entry, $ = stack, u = Model1, U = Model2"))) (while (not calc-curve-model) (message "Fit to model: %s:%s" @@ -138,6 +144,14 @@ (setq which (% (1+ which) (length msgs)))) ((memq key '(?h ?H)) (setq homog (not homog))) + ((= key ?P) + (let ((data (calc-top 1))) + (if (or + (calc-is-hyperbolic) + (calc-is-inverse) + (not (= (length data) 3))) + (setq plot "Can't plot") + (setq plot data)))) ((progn (if (eq key ?\$) (setq n 1) @@ -164,8 +178,9 @@ ((= key ?1) ; linear or multilinear (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 0)) - (setq calc-curve-model (math-mul calc-curve-coefnames - (cons 'vec (cons 1 (cdr calc-curve-varnames)))))) + (setq calc-curve-model + (math-mul calc-curve-coefnames + (cons 'vec (cons 1 (cdr calc-curve-varnames)))))) ((and (>= key ?2) (<= key ?9)) ; polynomial (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0)) (setq calc-curve-model @@ -180,58 +195,88 @@ ((= key ?p) ; power law (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 1)) - (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) - (calcFunc-reduce - '(var mul var-mul) - (calcFunc-map - '(var pow var-pow) - calc-curve-varnames - (cons 'vec (cdr (cdr calc-curve-coefnames)))))))) + (setq calc-curve-model + (math-mul + (nth 1 calc-curve-coefnames) + (calcFunc-reduce + '(var mul var-mul) + (calcFunc-map + '(var pow var-pow) + calc-curve-varnames + (cons 'vec (cdr (cdr calc-curve-coefnames)))))))) ((= key ?^) ; exponential law (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 1)) - (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) - (calcFunc-reduce - '(var mul var-mul) - (calcFunc-map - '(var pow var-pow) - (cons 'vec (cdr (cdr calc-curve-coefnames))) - calc-curve-varnames))))) + (setq calc-curve-model + (math-mul (nth 1 calc-curve-coefnames) + (calcFunc-reduce + '(var mul var-mul) + (calcFunc-map + '(var pow var-pow) + (cons 'vec (cdr (cdr calc-curve-coefnames))) + calc-curve-varnames))))) + ((= key ?s) + (setq nonlinear t) + (setq calc-curve-model t) + (require 'calc-nlfit) + (calc-fit-s-shaped-logistic-curve func)) + ((= key ?b) + (setq nonlinear t) + (setq calc-curve-model t) + (require 'calc-nlfit) + (calc-fit-bell-shaped-logistic-curve func)) + ((= key ?o) + (setq nonlinear t) + (setq calc-curve-model t) + (require 'calc-nlfit) + (if (and plot (not (stringp plot))) + (setq plot + (list 'vec + (nth 1 plot) + (cons + 'vec + (mapcar* 'calcFunc-div + (cdr (nth 2 plot)) + (cdr (nth 1 plot))))))) + (calc-fit-hubbert-linear-curve func)) ((memq key '(?e ?E)) (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 1)) - (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) - (calcFunc-reduce - '(var mul var-mul) - (calcFunc-map - (if (eq key ?e) - '(var exp var-exp) - '(calcFunc-lambda - (var a var-a) - (^ 10 (var a var-a)))) - (calcFunc-map - '(var mul var-mul) - (cons 'vec (cdr (cdr calc-curve-coefnames))) - calc-curve-varnames)))))) + (setq calc-curve-model + (math-mul (nth 1 calc-curve-coefnames) + (calcFunc-reduce + '(var mul var-mul) + (calcFunc-map + (if (eq key ?e) + '(var exp var-exp) + '(calcFunc-lambda + (var a var-a) + (^ 10 (var a var-a)))) + (calcFunc-map + '(var mul var-mul) + (cons 'vec (cdr (cdr calc-curve-coefnames))) + calc-curve-varnames)))))) ((memq key '(?x ?X)) (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 0)) - (setq calc-curve-model (math-mul calc-curve-coefnames - (cons 'vec (cons 1 (cdr calc-curve-varnames))))) + (setq calc-curve-model + (math-mul calc-curve-coefnames + (cons 'vec (cons 1 (cdr calc-curve-varnames))))) (setq calc-curve-model (if (eq key ?x) (list 'calcFunc-exp calc-curve-model) (list '^ 10 calc-curve-model)))) ((memq key '(?l ?L)) (calc-get-fit-variables calc-curve-nvars (1+ calc-curve-nvars) (and homog 0)) - (setq calc-curve-model (math-mul calc-curve-coefnames - (cons 'vec - (cons 1 (cdr (calcFunc-map - (if (eq key ?l) - '(var ln var-ln) - '(var log10 - var-log10)) - calc-curve-varnames))))))) + (setq calc-curve-model + (math-mul calc-curve-coefnames + (cons 'vec + (cons 1 (cdr (calcFunc-map + (if (eq key ?l) + '(var ln var-ln) + '(var log10 + var-log10)) + calc-curve-varnames))))))) ((= key ?q) (calc-get-fit-variables calc-curve-nvars (1+ (* 2 calc-curve-nvars)) (and homog 0)) @@ -247,12 +292,14 @@ (list '- (car v) (nth 1 c)) 2))))))) ((= key ?g) - (setq calc-curve-model - (math-read-expr "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)") - calc-curve-varnames '(vec (var XFit var-XFit)) - calc-curve-coefnames '(vec (var AFit var-AFit) - (var BFit var-BFit) - (var CFit var-CFit))) + (setq + calc-curve-model + (math-read-expr + "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)") + calc-curve-varnames '(vec (var XFit var-XFit)) + calc-curve-coefnames '(vec (var AFit var-AFit) + (var BFit var-BFit) + (var CFit var-CFit))) (calc-get-fit-variables 1 (1- (length calc-curve-coefnames)) (and homog 1))) ((memq key '(?\$ ?\' ?u ?U)) @@ -262,8 +309,9 @@ (let* ((calc-dollar-values calc-arg-values) (calc-dollar-used 0) (calc-hashes-used 0)) - (setq calc-curve-model (calc-do-alg-entry "" "Model formula: " - nil 'calc-curve-fit-history)) + (setq calc-curve-model + (calc-do-alg-entry "" "Model formula: " + nil 'calc-curve-fit-history)) (if (/= (length calc-curve-model) 1) (error "Bad format")) (setq calc-curve-model (car calc-curve-model) @@ -296,11 +344,13 @@ (or (nth 3 calc-curve-model) (cons 'vec (math-all-vars-but - calc-curve-model calc-curve-varnames))) + calc-curve-model + calc-curve-varnames))) calc-curve-model (nth 1 calc-curve-model)) (error "Incorrect model specifier"))))) (or calc-curve-varnames - (let ((with-y (eq (car-safe calc-curve-model) 'calcFunc-eq))) + (let ((with-y + (eq (car-safe calc-curve-model) 'calcFunc-eq))) (if calc-curve-coefnames (calc-get-fit-variables (if with-y (1+ calc-curve-nvars) calc-curve-nvars) @@ -310,7 +360,10 @@ nil with-y) (let* ((coefs (math-all-vars-but calc-curve-model nil)) (vars nil) - (n (- (length coefs) calc-curve-nvars (if with-y 2 1))) + (n (- + (length coefs) + calc-curve-nvars + (if with-y 2 1))) p) (if (< n 0) (error "Not enough variables in model")) @@ -326,18 +379,43 @@ calc-curve-varnames calc-curve-coefnames) "modl")))) (t (beep)))) - (let ((calc-fit-to-trail t)) - (calc-enter-result n (substring (symbol-name func) 9) - (list func calc-curve-model - (if (= (length calc-curve-varnames) 2) - (nth 1 calc-curve-varnames) - calc-curve-varnames) - (if (= (length calc-curve-coefnames) 2) - (nth 1 calc-curve-coefnames) - calc-curve-coefnames) - data)) - (if (consp calc-fit-to-trail) - (calc-record (calc-normalize calc-fit-to-trail) "parm")))))) + (unless nonlinear + (let ((calc-fit-to-trail t)) + (calc-enter-result n (substring (symbol-name func) 9) + (list func calc-curve-model + (if (= (length calc-curve-varnames) 2) + (nth 1 calc-curve-varnames) + calc-curve-varnames) + (if (= (length calc-curve-coefnames) 2) + (nth 1 calc-curve-coefnames) + calc-curve-coefnames) + data)) + (if (consp calc-fit-to-trail) + (calc-record (calc-normalize calc-fit-to-trail) "parm")))) + (when plot + (if (stringp plot) + (message plot) + (let ((calc-graph-no-auto-view t)) + (calc-graph-delete t) + (calc-graph-add-curve + (calc-graph-lookup (nth 1 plot)) + (calc-graph-lookup (nth 2 plot))) + (unless (math-contains-sdev-p (nth 2 data)) + (calc-graph-set-styles nil nil) + (calc-graph-point-style nil)) + (setq plot (cdr (nth 1 plot))) + (setq plot + (list 'intv + 3 + (math-sub + (math-min-list (car plot) (cdr plot)) + '(float 5 -1)) + (math-add + '(float 5 -1) + (math-max-list (car plot) (cdr plot))))) + (calc-graph-add-curve (calc-graph-lookup plot) + (calc-graph-lookup (calc-top-n 1))) + (calc-graph-plot nil))))))) (defun calc-invent-independent-variables (n &optional but) (calc-invent-variables n but '(x y z t) "x")) -- cgit v1.2.1 From 0dc23234dfe9d0b317f415b78d6697fd2ae1edf1 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 03:54:14 +0000 Subject: New file. --- lisp/calc/calc-nlfit.el | 815 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 815 insertions(+) create mode 100644 lisp/calc/calc-nlfit.el (limited to 'lisp') diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el new file mode 100644 index 00000000000..9a982aa7352 --- /dev/null +++ b/lisp/calc/calc-nlfit.el @@ -0,0 +1,815 @@ +;;; calc-nlfit.el --- nonlinear curve fitting for Calc + +;; Copyright (C) 2007 Free Software Foundation, Inc. + +;; Maintainer: Jay Belanger + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; This code uses the Levenberg-Marquardt method, as described in +;; _Numerical Analysis_ by H. R. Schwarz, to fit data to +;; nonlinear curves. Currently, the only the following curves are +;; supported: +;; The logistic S curve, y=a/(1+exp(b*(t-c))) +;; Here, y is usually interpreted as the population of some +;; quantity at time t. So we will think of the data as consisting +;; of quantities q0, q1, ..., qn and their respective times +;; t0, t1, ..., tn. + +;; The logistic bell curve, y=A*exp(B*(t-C))/(1+exp(B*(t-C)))^2 +;; Note that this is the derivative of the formula for the S curve. +;; We get A=-a*b, B=b and C=c. Here, y is interpreted as the rate +;; of growth of a population at time t. So we will think of the +;; data as consisting of rates p0, p1, ..., pn and their +;; respective times t0, t1, ..., tn. + +;; The Hubbert Linearization, y/x=A*(1-x/B) +;; Here, y is thought of as the rate of growth of a population +;; and x represents the actual population. This is essentially +;; the differential equation describing the actual population. + +;; The Levenberg-Marquardt method is an iterative process: it takes +;; an initial guess for the parameters and refines them. To get an +;; initial guess for the parameters, we'll use a method described by +;; Luis de Sousa in "Hubbert's Peak Mathematics". The idea is that +;; given quantities Q and the corresponding rates P, they should +;; satisfy P/Q= mQ+a. We can use the parameter a for an +;; approximation for the parameter a in the S curve, and +;; approximations for b and c are found using least squares on the +;; linearization log((a/y)-1) = log(bb) + cc*t of +;; y=a/(1+bb*exp(cc*t)), which is equivalent to the above s curve +;; formula, and then tranlating it to b and c. From this, we can +;; also get approximations for the bell curve parameters. + +;;; Code: + +(require 'calc-arith) + +(defun math-nlfit-least-squares (xdata ydata &optional sdata sigmas) + "Return the parameters A and B for the best least squares fit y=a+bx." + (let* ((n (length xdata)) + (s2data (if sdata + (mapcar 'calcFunc-sqr sdata) + (make-list n 1))) + (S (if sdata 0 n)) + (Sx 0) + (Sy 0) + (Sxx 0) + (Sxy 0) + D) + (while xdata + (let ((x (car xdata)) + (y (car ydata)) + (s (car s2data))) + (setq Sx (math-add Sx (if s (math-div x s) x))) + (setq Sy (math-add Sy (if s (math-div y s) y))) + (setq Sxx (math-add Sxx (if s (math-div (math-mul x x) s) + (math-mul x x)))) + (setq Sxy (math-add Sxy (if s (math-div (math-mul x y) s) + (math-mul x y)))) + (if sdata + (setq S (math-add S (math-div 1 s))))) + (setq xdata (cdr xdata)) + (setq ydata (cdr ydata)) + (setq s2data (cdr s2data))) + (setq D (math-sub (math-mul S Sxx) (math-mul Sx Sx))) + (let ((A (math-div (math-sub (math-mul Sxx Sy) (math-mul Sx Sxy)) D)) + (B (math-div (math-sub (math-mul S Sxy) (math-mul Sx Sy)) D))) + (if sigmas + (let ((C11 (math-div Sxx D)) + (C12 (math-neg (math-div Sx D))) + (C22 (math-div S D))) + (list (list 'sdev A (calcFunc-sqrt C11)) + (list 'sdev B (calcFunc-sqrt C22)) + (list 'vec + (list 'vec C11 C12) + (list 'vec C12 C22)))) + (list A B))))) + +;;; The methods described by de Sousa require the cumulative data qdata +;;; and the rates pdata. We will assume that we are given either +;;; qdata and the corresponding times tdata, or pdata and the corresponding +;;; tdata. The following two functions will find pdata or qdata, +;;; given the other.. + +;;; First, given two lists; one of values q0, q1, ..., qn and one of +;;; corresponding times t0, t1, ..., tn; return a list +;;; p0, p1, ..., pn of the rates of change of the qi with respect to t. +;;; p0 is the right hand derivative (q1 - q0)/(t1 - t0). +;;; pn is the left hand derivative (qn - q(n-1))/(tn - t(n-1)). +;;; The other pis are the averages of the two: +;;; (1/2)((qi - q(i-1))/(ti - t(i-1)) + (q(i+1) - qi)/(t(i+1) - ti)). + +(defun math-nlfit-get-rates-from-cumul (tdata qdata) + (let ((pdata (list + (math-div + (math-sub (nth 1 qdata) + (nth 0 qdata)) + (math-sub (nth 1 tdata) + (nth 0 tdata)))))) + (while (> (length qdata) 2) + (setq pdata + (cons + (math-mul + '(float 5 -1) + (math-add + (math-div + (math-sub (nth 2 qdata) + (nth 1 qdata)) + (math-sub (nth 2 tdata) + (nth 1 tdata))) + (math-div + (math-sub (nth 1 qdata) + (nth 0 qdata)) + (math-sub (nth 1 tdata) + (nth 0 tdata))))) + pdata)) + (setq qdata (cdr qdata))) + (setq pdata + (cons + (math-div + (math-sub (nth 1 qdata) + (nth 0 qdata)) + (math-sub (nth 1 tdata) + (nth 0 tdata))) + pdata)) + (reverse pdata))) + +;;; Next, given two lists -- one of rates p0, p1, ..., pn and one of +;;; corresponding times t0, t1, ..., tn -- and an initial values q0, +;;; return a list q0, q1, ..., qn of the cumulative values. +;;; q0 is the initial value given. +;;; For i>0, qi is computed using the trapezoid rule: +;;; qi = q(i-1) + (1/2)(pi + p(i-1))(ti - t(i-1)) + +(defun math-nlfit-get-cumul-from-rates (tdata pdata q0) + (let* ((qdata (list q0))) + (while (cdr pdata) + (setq qdata + (cons + (math-add (car qdata) + (math-mul + (math-mul + '(float 5 -1) + (math-add (nth 1 pdata) (nth 0 pdata))) + (math-sub (nth 1 tdata) + (nth 0 tdata)))) + qdata)) + (setq pdata (cdr pdata)) + (setq tdata (cdr tdata))) + (reverse qdata))) + +;;; Given the qdata, pdata and tdata, find the parameters +;;; a, b and c that fit q = a/(1+b*exp(c*t)). +;;; a is found using the method described by de Sousa. +;;; b and c are found using least squares on the linearization +;;; log((a/q)-1) = log(b) + c*t +;;; In some cases (where the logistic curve may well be the wrong +;;; model), the computed a will be less than or equal to the maximum +;;; value of q in qdata; in which case the above linearization won't work. +;;; In this case, a will be replaced by a number slightly above +;;; the maximum value of q. + +(defun math-nlfit-find-qmax (qdata pdata tdata) + (let* ((ratios (mapcar* 'math-div pdata qdata)) + (lsdata (math-nlfit-least-squares ratios tdata)) + (qmax (math-max-list (car qdata) (cdr qdata))) + (a (math-neg (math-div (nth 1 lsdata) (nth 0 lsdata))))) + (if (math-lessp a qmax) + (math-add '(float 5 -1) qmax) + a))) + +(defun math-nlfit-find-logistic-parameters (qdata pdata tdata) + (let* ((a (math-nlfit-find-qmax qdata pdata tdata)) + (newqdata + (mapcar (lambda (q) (calcFunc-ln (math-sub (math-div a q) 1))) + qdata)) + (bandc (math-nlfit-least-squares tdata newqdata))) + (list + a + (calcFunc-exp (nth 0 bandc)) + (nth 1 bandc)))) + +;;; Next, given the pdata and tdata, we can find the qdata if we know q0. +;;; We first try to find q0, using the fact that when p takes on its largest +;;; value, q is half of its maximum value. So we'll find the maximum value +;;; of q given various q0, and use bisection to approximate the correct q0. + +;;; First, given pdata and tdata, find what half of qmax would be if q0=0. + +(defun math-nlfit-find-qmaxhalf (pdata tdata) + (let ((pmax (math-max-list (car pdata) (cdr pdata))) + (qmh 0)) + (while (math-lessp (car pdata) pmax) + (setq qmh + (math-add qmh + (math-mul + (math-mul + '(float 5 -1) + (math-add (nth 1 pdata) (nth 0 pdata))) + (math-sub (nth 1 tdata) + (nth 0 tdata))))) + (setq pdata (cdr pdata)) + (setq tdata (cdr tdata))) + qmh)) + +;;; Next, given pdata and tdata, approximate q0. + +(defun math-nlfit-find-q0 (pdata tdata) + (let* ((qhalf (math-nlfit-find-qmaxhalf pdata tdata)) + (q0 (math-mul 2 qhalf)) + (qdata (math-nlfit-get-cumul-from-rates tdata pdata q0))) + (while (math-lessp (math-nlfit-find-qmax + (mapcar + (lambda (q) (math-add q0 q)) + qdata) + pdata tdata) + (math-mul + '(float 5 -1) + (math-add + q0 + qhalf))) + (setq q0 (math-add q0 qhalf))) + (let* ((qmin (math-sub q0 qhalf)) + (qmax q0) + (qt (math-nlfit-find-qmax + (mapcar + (lambda (q) (math-add q0 q)) + qdata) + pdata tdata)) + (i 0)) + (while (< i 10) + (setq q0 (math-mul '(float 5 -1) (math-add qmin qmax))) + (if (math-lessp + (math-nlfit-find-qmax + (mapcar + (lambda (q) (math-add q0 q)) + qdata) + pdata tdata) + (math-mul '(float 5 -1) (math-add qhalf q0))) + (setq qmin q0) + (setq qmax q0)) + (setq i (1+ i))) + (math-mul '(float 5 -1) (math-add qmin qmax))))) + +;;; To improve the approximations to the parameters, we can use +;;; Marquardt method as described in Schwarz's book. + +;;; Small numbers used in the Givens algorithm +(defvar math-nlfit-delta '(float 1 -8)) + +(defvar math-nlfit-epsilon '(float 1 -5)) + +;;; Maximum number of iterations +(defvar math-nlfit-max-its 100) + +;;; Next, we need some functions for dealing with vectors and +;;; matrices. For convenience, we'll work with Emacs lists +;;; as vectors, rather than Calc's vectors. + +(defun math-nlfit-set-elt (vec i x) + (setcar (nthcdr (1- i) vec) x)) + +(defun math-nlfit-get-elt (vec i) + (nth (1- i) vec)) + +(defun math-nlfit-make-matrix (i j) + (let ((row (make-list j 0)) + (mat nil) + (k 0)) + (while (< k i) + (setq mat (cons (copy-list row) mat)) + (setq k (1+ k))) + mat)) + +(defun math-nlfit-set-matx-elt (mat i j x) + (setcar (nthcdr (1- j) (nth (1- i) mat)) x)) + +(defun math-nlfit-get-matx-elt (mat i j) + (nth (1- j) (nth (1- i) mat))) + +;;; For solving the linearized system. +;;; (The Givens method, from Schwarz.) + +(defun math-nlfit-givens (C d) + (let* ((C (copy-tree C)) + (d (copy-tree d)) + (n (length (car C))) + (N (length C)) + (j 1) + (r (make-list N 0)) + (x (make-list N 0)) + w + gamma + sigma + rho) + (while (<= j n) + (let ((i (1+ j))) + (while (<= i N) + (let ((cij (math-nlfit-get-matx-elt C i j)) + (cjj (math-nlfit-get-matx-elt C j j))) + (when (not (math-equal 0 cij)) + (if (math-lessp (calcFunc-abs cjj) + (math-mul math-nlfit-delta (calcFunc-abs cij))) + (setq w (math-neg cij) + gamma 0 + sigma 1 + rho 1) + (setq w (math-mul + (calcFunc-sign cjj) + (calcFunc-sqrt + (math-add + (math-mul cjj cjj) + (math-mul cij cij)))) + gamma (math-div cjj w) + sigma (math-neg (math-div cij w))) + (if (math-lessp (calcFunc-abs sigma) gamma) + (setq rho sigma) + (setq rho (math-div (calcFunc-sign sigma) gamma)))) + (setq cjj w + cij rho) + (math-nlfit-set-matx-elt C j j w) + (math-nlfit-set-matx-elt C i j rho) + (let ((k (1+ j))) + (while (<= k n) + (let* ((cjk (math-nlfit-get-matx-elt C j k)) + (cik (math-nlfit-get-matx-elt C i k)) + (h (math-sub + (math-mul gamma cjk) (math-mul sigma cik)))) + (setq cik (math-add + (math-mul sigma cjk) + (math-mul gamma cik))) + (setq cjk h) + (math-nlfit-set-matx-elt C i k cik) + (math-nlfit-set-matx-elt C j k cjk) + (setq k (1+ k))))) + (let* ((di (math-nlfit-get-elt d i)) + (dj (math-nlfit-get-elt d j)) + (h (math-sub + (math-mul gamma dj) + (math-mul sigma di)))) + (setq di (math-add + (math-mul sigma dj) + (math-mul gamma di))) + (setq dj h) + (math-nlfit-set-elt d i di) + (math-nlfit-set-elt d j dj)))) + (setq i (1+ i)))) + (setq j (1+ j))) + (let ((i n)) + (while (>= i 1) + (math-nlfit-set-elt r i 0) + (setq s (math-nlfit-get-elt d i)) + (let ((k (1+ i))) + (while (<= k n) + (setq s (math-add s (math-mul (math-nlfit-get-matx-elt C i k) + (math-nlfit-get-elt x k)))) + (setq k (1+ k)))) + (math-nlfit-set-elt x i + (math-neg + (math-div s + (math-nlfit-get-matx-elt C i i)))) + (setq i (1- i)))) + (let ((i (1+ n))) + (while (<= i N) + (math-nlfit-set-elt r i (math-nlfit-get-elt d i)) + (setq i (1+ i)))) + (let ((j n)) + (while (>= j 1) + (let ((i N)) + (while (>= i (1+ j)) + (setq rho (math-nlfit-get-matx-elt C i j)) + (if (math-equal rho 1) + (setq gamma 0 + sigma 1) + (if (math-lessp (calcFunc-abs rho) 1) + (setq sigma rho + gamma (calcFunc-sqrt + (math-sub 1 (math-mul sigma sigma)))) + (setq gamma (math-div 1 (calcFunc-abs rho)) + sigma (math-mul (calcFunc-sign rho) + (calcFunc-sqrt + (math-sub 1 (math-mul gamma gamma))))))) + (let ((ri (math-nlfit-get-elt r i)) + (rj (math-nlfit-get-elt r j))) + (setq h (math-add (math-mul gamma rj) + (math-mul sigma ri))) + (setq ri (math-sub + (math-mul gamma ri) + (math-mul sigma rj))) + (setq rj h) + (math-nlfit-set-elt r i ri) + (math-nlfit-set-elt r j rj)) + (setq i (1- i)))) + (setq j (1- j)))) + + x)) + +(defun math-nlfit-jacobian (grad xlist parms &optional slist) + (let ((j nil)) + (while xlist + (let ((row (apply grad (car xlist) parms))) + (setq j + (cons + (if slist + (mapcar (lambda (x) (math-div x (car slist))) row) + row) + j))) + (setq slist (cdr slist)) + (setq xlist (cdr xlist))) + (reverse j))) + +(defun math-nlfit-make-ident (l n) + (let ((m (math-nlfit-make-matrix n n)) + (i 1)) + (while (<= i n) + (math-nlfit-set-matx-elt m i i l) + (setq i (1+ i))) + m)) + +(defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist) + (let ((cs 0)) + (while xlist + (let ((c + (math-sub + (apply fn (car xlist) parms) + (car ylist)))) + (if slist + (setq c (math-div c (car slist)))) + (setq cs + (math-add cs + (math-mul c c)))) + (setq xlist (cdr xlist)) + (setq ylist (cdr ylist)) + (setq slist (cdr slist))) + cs)) + +(defun math-nlfit-init-lambda (C) + (let ((l 0) + (n (length (car C))) + (N (length C))) + (while C + (let ((row (car C))) + (while row + (setq l (math-add l (math-mul (car row) (car row)))) + (setq row (cdr row)))) + (setq C (cdr C))) + (calcFunc-sqrt (math-div l (math-mul n N))))) + +(defun math-nlfit-make-Ctilda (C l) + (let* ((n (length (car C))) + (bot (math-nlfit-make-ident l n))) + (append C bot))) + +(defun math-nlfit-make-d (fn xdata ydata parms &optional sdata) + (let ((d nil)) + (while xdata + (setq d (cons + (let ((dd (math-sub (apply fn (car xdata) parms) + (car ydata)))) + (if sdata (math-div dd (car sdata)) dd)) + d)) + (setq xdata (cdr xdata)) + (setq ydata (cdr ydata)) + (setq sdata (cdr sdata))) + (reverse d))) + +(defun math-nlfit-make-dtilda (d n) + (append d (make-list n 0))) + +(defun math-nlfit-fit (xlist ylist parms fn grad &optional slist) + (let* + ((C (math-nlfit-jacobian grad xlist parms slist)) + (d (math-nlfit-make-d fn xlist ylist parms slist)) + (chisq (math-nlfit-chi-sq xlist ylist parms fn slist)) + (lambda (math-nlfit-init-lambda C)) + (really-done nil) + (iters 0)) + (while (and + (not really-done) + (< iters math-nlfit-max-its)) + (setq iters (1+ iters)) + (let ((done nil)) + (while (not done) + (let* ((Ctilda (math-nlfit-make-Ctilda C lambda)) + (dtilda (math-nlfit-make-dtilda d (length (car C)))) + (zeta (math-nlfit-givens Ctilda dtilda)) + (newparms (mapcar* 'math-add (copy-tree parms) zeta)) + (newchisq (math-nlfit-chi-sq xlist ylist newparms fn slist))) + (if (math-lessp newchisq chisq) + (progn + (if (math-lessp + (math-div + (math-sub chisq newchisq) newchisq) math-nlfit-epsilon) + (setq really-done t)) + (setq lambda (math-div lambda 10)) + (setq chisq newchisq) + (setq parms newparms) + (setq done t)) + (setq lambda (math-mul lambda 10))))) + (setq C (math-nlfit-jacobian grad xlist parms slist)) + (setq d (math-nlfit-make-d fn xlist ylist parms slist)))) + (list chisq parms))) + +;;; The functions that describe our models, and their gradients. + +(defun math-nlfit-s-logistic-fn (x a b c) + (math-div a (math-add 1 (math-mul b (calcFunc-exp (math-mul c x)))))) + +(defun math-nlfit-s-logistic-grad (x a b c) + (let* ((ep (calcFunc-exp (math-mul c x))) + (d (math-add 1 (math-mul b ep))) + (d2 (math-mul d d))) + (list + (math-div 1 d) + (math-neg (math-div (math-mul a ep) d2)) + (math-neg (math-div (math-mul a (math-mul b (math-mul x ep))) d2))))) + +(defun math-nlfit-b-logistic-fn (x a c d) + (let ((ex (calcFunc-exp (math-mul c (math-sub x d))))) + (math-div + (math-mul a ex) + (math-sqr + (math-add + 1 ex))))) + +(defun math-nlfit-b-logistic-grad (x a c d) + (let* ((ex (calcFunc-exp (math-mul c (math-sub x d)))) + (ex1 (math-add 1 ex)) + (xd (math-sub x d))) + (list + (math-div + ex + (math-sqr ex1)) + (math-sub + (math-div + (math-mul a (math-mul xd ex)) + (math-sqr ex1)) + (math-div + (math-mul 2 (math-mul a (math-mul xd (math-sqr ex)))) + (math-pow ex1 3))) + (math-sub + (math-div + (math-mul 2 (math-mul a (math-mul c (math-sqr ex)))) + (math-pow ex1 3)) + (math-div + (math-mul a (math-mul c ex)) + (math-sqr ex1)))))) + +;;; Functions to get the final covariance matrix and the sdevs + +(defun math-nlfit-find-covar (grad xlist pparms) + (let ((j nil)) + (while xlist + (setq j (cons (cons 'vec (apply grad (car xlist) pparms)) j)) + (setq xlist (cdr xlist))) + (setq j (cons 'vec (reverse j))) + (setq j + (math-mul + (calcFunc-trn j) j)) + (calcFunc-inv j))) + +(defun math-nlfit-get-sigmas (grad xlist pparms chisq) + (let* ((sgs nil) + (covar (math-nlfit-find-covar grad xlist pparms)) + (n (1- (length covar))) + (N (length xlist)) + (i 1)) + (when (> N n) + (while (<= i n) + (setq sgs (cons (calcFunc-sqrt (nth i (nth i covar))) sgs)) + (setq i (1+ i))) + (setq sgs (reverse sgs))) + (list sgs covar))) + +;;; Now the Calc functions + +(defun math-nlfit-s-logistic-params (xdata ydata) + (let ((pdata (math-nlfit-get-rates-from-cumul xdata ydata))) + (math-nlfit-find-logistic-parameters ydata pdata xdata))) + +(defun math-nlfit-b-logistic-params (xdata ydata) + (let* ((q0 (math-nlfit-find-q0 ydata xdata)) + (qdata (math-nlfit-get-cumul-from-rates xdata ydata q0)) + (abc (math-nlfit-find-logistic-parameters qdata ydata xdata)) + (B (nth 1 abc)) + (C (nth 2 abc)) + (A (math-neg + (math-mul + (nth 0 abc) + (math-mul B C)))) + (D (math-neg (math-div (calcFunc-ln B) C))) + (A (math-div A B))) + (list A C D))) + +;;; Some functions to turn the parameter lists and variables +;;; into the appropriate functions. + +(defun math-nlfit-s-logistic-solnexpr (pms var) + (let ((a (nth 0 pms)) + (b (nth 1 pms)) + (c (nth 2 pms))) + (list '/ a + (list '+ + 1 + (list '* + b + (calcFunc-exp + (list '* + c + var))))))) + +(defun math-nlfit-b-logistic-solnexpr (pms var) + (let ((a (nth 0 pms)) + (c (nth 1 pms)) + (d (nth 2 pms))) + (list '/ + (list '* + a + (calcFunc-exp + (list '* + c + (list '- var d)))) + (list '^ + (list '+ + 1 + (calcFunc-exp + (list '* + c + (list '- var d)))) + 2)))) + +(defun math-nlfit-enter-result (n prefix vals) + (setq calc-aborted-prefix prefix) + (calc-pop-push-record-list n prefix vals) + (calc-handle-whys)) + +(defun math-nlfit-fit-curve (fn grad solnexpr initparms &optional sdv) + (calc-slow-wrapper + (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit))) + (calc-display-working-message nil) + (data (calc-top 1)) + (xdata (cdr (car (cdr data)))) + (ydata (cdr (car (cdr (cdr data))))) + (sdata (if (math-contains-sdev-p ydata) + (mapcar (lambda (x) (math-get-sdev x t)) ydata) + nil)) + (ydata (mapcar (lambda (x) (math-get-value x)) ydata)) + (zzz (progn (setq j1 xdata j2 ydata j3 sdata) 1)) + + (calc-curve-varnames nil) + (calc-curve-coefnames nil) + (calc-curve-nvars 1) + (fitvars (calc-get-fit-variables 1 3)) + (var (nth 1 calc-curve-varnames)) + (parms (cdr calc-curve-coefnames)) + (parmguess + (funcall initparms xdata ydata)) + (fit (math-nlfit-fit xdata ydata parmguess fn grad sdata)) + (finalparms (nth 1 fit)) + (sigmacovar + (if sdevv + (math-nlfit-get-sigmas grad xdata finalparms (nth 0 fit)))) + (sigmas + (if sdevv + (nth 0 sigmacovar))) + (finalparms + (if sigmas + (mapcar* (lambda (x y) (list 'sdev x y)) finalparms sigmas) + finalparms)) + (soln (funcall solnexpr finalparms var))) + (let ((calc-fit-to-trail t) + (traillist nil)) + (while parms + (setq traillist (cons (list 'calcFunc-eq (car parms) (car finalparms)) + traillist)) + (setq finalparms (cdr finalparms)) + (setq parms (cdr parms))) + (setq traillist (calc-normalize (cons 'vec (nreverse traillist)))) + (cond ((eq sdv 'calcFunc-efit) + (math-nlfit-enter-result 1 "efit" soln)) + ((eq sdv 'calcFunc-xfit) + (let (sln) + (setq sln + (list 'vec + soln + traillist + (nth 1 sigmacovar) + '(vec) + (nth 0 fit) + (let ((n (length xdata)) + (m (length finalparms))) + (if (and sdata (> n m)) + (calcFunc-utpc (nth 0 fit) + (- n m)) + '(var nan var-nan))))) + (math-nlfit-enter-result 1 "xfit" sln))) + (t + (math-nlfit-enter-result 1 "fit" soln))) + (calc-record traillist "parm"))))) + +(defun calc-fit-s-shaped-logistic-curve (arg) + (interactive "P") + (math-nlfit-fit-curve 'math-nlfit-s-logistic-fn + 'math-nlfit-s-logistic-grad + 'math-nlfit-s-logistic-solnexpr + 'math-nlfit-s-logistic-params + arg)) + +(defun calc-fit-bell-shaped-logistic-curve (arg) + (interactive "P") + (math-nlfit-fit-curve 'math-nlfit-b-logistic-fn + 'math-nlfit-b-logistic-grad + 'math-nlfit-b-logistic-solnexpr + 'math-nlfit-b-logistic-params + arg)) + +(defun calc-fit-hubbert-linear-curve (&optional sdv) + (calc-slow-wrapper + (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit))) + (calc-display-working-message nil) + (data (calc-top 1)) + (qdata (cdr (car (cdr data)))) + (pdata (cdr (car (cdr (cdr data))))) + (sdata (if (math-contains-sdev-p pdata) + (mapcar (lambda (x) (math-get-sdev x t)) pdata) + nil)) + (pdata (mapcar (lambda (x) (math-get-value x)) pdata)) + (poverqdata (mapcar* 'math-div pdata qdata)) + (parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv)) + (finalparms (list (nth 0 parmvals) + (math-neg + (math-div (nth 0 parmvals) + (nth 1 parmvals))))) + (calc-curve-varnames nil) + (calc-curve-coefnames nil) + (calc-curve-nvars 1) + (fitvars (calc-get-fit-variables 1 2)) + (var (nth 1 calc-curve-varnames)) + (parms (cdr calc-curve-coefnames)) + (soln (list '* (nth 0 finalparms) + (list '- 1 + (list '/ var (nth 1 finalparms)))))) + (let ((calc-fit-to-trail t) + (traillist nil)) + (setq traillist + (list 'vec + (list 'calcFunc-eq (nth 0 parms) (nth 0 finalparms)) + (list 'calcFunc-eq (nth 1 parms) (nth 1 finalparms)))) + (cond ((eq sdv 'calcFunc-efit) + (math-nlfit-enter-result 1 "efit" soln)) + ((eq sdv 'calcFunc-xfit) + (let (sln + (chisq + (math-nlfit-chi-sq + qdata poverqdata + (list (nth 1 (nth 0 finalparms)) + (nth 1 (nth 1 finalparms))) + (lambda (x a b) + (math-mul a + (math-sub + 1 + (math-div x b)))) + sdata))) + (setq sln + (list 'vec + soln + traillist + (nth 2 parmvals) + (list + 'vec + '(calcFunc-fitdummy 1) + (list 'calcFunc-neg + (list '/ + '(calcFunc-fitdummy 1) + '(calcFunc-fitdummy 2)))) + chisq + (let ((n (length qdata))) + (if (and sdata (> n 2)) + (calcFunc-utpc + chisq + (- n 2)) + '(var nan var-nan))))) + (math-nlfit-enter-result 1 "xfit" sln))) + (t + (math-nlfit-enter-result 1 "fit" soln))) + (calc-record traillist "parm"))))) + +(provide 'calc-nlfit) -- cgit v1.2.1 From 7e3edb272e84937ddeaa29a4029c6c3a500d4723 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 04:00:54 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2b78164cd15..ed8eb53c85e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-04 Jay Belanger + + * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear + curves and plotting. + + * calc/calc-nlfit.el: New file. + 2007-08-04 Glenn Morris * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is -- cgit v1.2.1 From 81e73518726b38ce64c575b3ccb682158d3f3faa Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 04:33:07 +0000 Subject: (calc-curve-fit): Add "plot" indicator. --- lisp/calc/calcalg3.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 611e2d7f45d..287eb114ac2 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -134,9 +134,12 @@ "P prefix = plot result" "' = alg entry, $ = stack, u = Model1, U = Model2"))) (while (not calc-curve-model) - (message "Fit to model: %s:%s" - (nth which msgs) - (if homog " h" "")) + (message + (if plot + "Fit to model (plot): %s:%s" + "Fit to model: %s:%s") + (nth which msgs) + (if homog " h" "")) (setq key (read-char)) (cond ((= key ?\C-g) (keyboard-quit)) @@ -145,13 +148,15 @@ ((memq key '(?h ?H)) (setq homog (not homog))) ((= key ?P) - (let ((data (calc-top 1))) - (if (or - (calc-is-hyperbolic) - (calc-is-inverse) - (not (= (length data) 3))) - (setq plot "Can't plot") - (setq plot data)))) + (if plot + (setq plot nil) + (let ((data (calc-top 1))) + (if (or + (calc-is-hyperbolic) + (calc-is-inverse) + (not (= (length data) 3))) + (setq plot "Can't plot") + (setq plot data))))) ((progn (if (eq key ?\$) (setq n 1) -- cgit v1.2.1 From a0e481410839089003dfed1bc58e318b4934a364 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 04:39:35 +0000 Subject: (calc-curve-fit): Change plot indicator. --- lisp/calc/calcalg3.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 287eb114ac2..eb3611c3fd0 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -135,11 +135,10 @@ "' = alg entry, $ = stack, u = Model1, U = Model2"))) (while (not calc-curve-model) (message - (if plot - "Fit to model (plot): %s:%s" - "Fit to model: %s:%s") + "Fit to model: %s:%s%s" (nth which msgs) - (if homog " h" "")) + (if plot "p" " ") + (if homog "h" "")) (setq key (read-char)) (cond ((= key ?\C-g) (keyboard-quit)) -- cgit v1.2.1 From b030533ff5c1ee3254efc83d8543f76cd00a1091 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 4 Aug 2007 15:12:22 +0000 Subject: (calc-curve-fit): Change plot indicator. --- lisp/calc/calcalg3.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index eb3611c3fd0..5aa410be19e 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -137,7 +137,7 @@ (message "Fit to model: %s:%s%s" (nth which msgs) - (if plot "p" " ") + (if plot "P" " ") (if homog "h" "")) (setq key (read-char)) (cond ((= key ?\C-g) -- cgit v1.2.1 From 75f7bc8f71ecc99fd215b059f83d71be9c8d0246 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 4 Aug 2007 15:19:51 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ed8eb53c85e..c8124c20944 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -54,7 +54,7 @@ * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info) (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'. -2007-08-02 Richard Stallman +2007-08-03 Richard Stallman * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number to update deleted flag. @@ -74,13 +74,13 @@ buffer immediately if suitable. (compile, compilation-buffer-name, compilation-start): Doc fixes. -2007-07-31 Daiki Ueno +2007-08-03 Daiki Ueno * faces.el (face-normalize-spec): New function. (frame-set-background-mode): Normalize face-spec before calling face-spec-match-p. -2007-07-31 Stefan Monnier +2007-07-03 Stefan Monnier * server.el (server-window): Add switch-to-buffer-other-frame option. -- cgit v1.2.1 From 49c28691044c5ec4a7c68908430b8af3ba4d685a Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sun, 5 Aug 2007 02:09:12 +0000 Subject: Add arch tagline --- lisp/calc/calc-nlfit.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el index 9a982aa7352..2880ff837bd 100644 --- a/lisp/calc/calc-nlfit.el +++ b/lisp/calc/calc-nlfit.el @@ -813,3 +813,5 @@ (calc-record traillist "parm"))))) (provide 'calc-nlfit) + +;; arch-tag: 6eba3cd6-f48b-4a84-8174-10c15a024928 -- cgit v1.2.1 From 7d98ad02fd92c5323f7eb0f74780b3fe07d19301 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 08:50:52 +0000 Subject: * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c8124c20944..5e5682be511 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Michael Albinus + + * files.el (set-auto-mode): Handle also remote files wrt + `auto-mode-alist'. + 2007-08-04 Jay Belanger * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear diff --git a/lisp/files.el b/lisp/files.el index 9cc64284d15..e2cde74d6a1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2310,7 +2310,12 @@ we don't actually set it to the same mode the buffer already has." ;; Next compare the filename against the entries in auto-mode-alist. (unless done (if buffer-file-name - (let ((name buffer-file-name)) + (let ((name buffer-file-name) + (remote-id (file-remote-p buffer-file-name))) + ;; Remove remote file name identification. + (when (and (stringp remote-id) + (string-match remote-id name)) + (setq name (substring name (match-end 0)))) ;; Remove backup-suffixes from file name. (setq name (file-name-sans-versions name)) (while name -- cgit v1.2.1 From f4ef535bcf07af2c5e9a91a38cba6b3312a26a0a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 08:57:24 +0000 Subject: * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf4daf15b62..4330c92ac6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Michael Albinus + + * files.el (set-auto-mode): Handle also remote files wrt + `auto-mode-alist'. + 2007-08-04 Glenn Morris * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is diff --git a/lisp/files.el b/lisp/files.el index 444e402f438..135ccfafb92 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2259,7 +2259,12 @@ we don't actually set it to the same mode the buffer already has." ;; Next compare the filename against the entries in auto-mode-alist. (unless done (if buffer-file-name - (let ((name buffer-file-name)) + (let ((name buffer-file-name) + (remote-id (file-remote-p buffer-file-name))) + ;; Remove remote file name identification. + (when (and (stringp remote-id) + (string-match remote-id name)) + (setq name (substring name (match-end 0)))) ;; Remove backup-suffixes from file name. (setq name (file-name-sans-versions name)) (while name -- cgit v1.2.1 From 6b78052709d6eecf2f25c317016f9286317a9cbe Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 5 Aug 2007 10:34:43 +0000 Subject: Update. --- lisp/emacs-lisp/cl-loaddefs.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 1589e19cbb2..7d94faa4456 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -10,7 +10,7 @@ ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively ;;;;;; notevery notany every some mapcon mapcan mapl maplist map -;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4") +;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "53c2b3ede19dac62cff13a37f58cdf9c") ;;; Generated autoloads from cl-extra.el (autoload (quote coerce) "cl-extra" "\ @@ -283,7 +283,7 @@ Not documented ;;;;;; do* do loop return-from return block etypecase typecase ecase ;;;;;; case load-time-value eval-when destructuring-bind function* ;;;;;; defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" -;;;;;; "cl-macs.el" "7ccc827d272482ca276937ca18a7895a") +;;;;;; "cl-macs.el" "d9759da97810bc01423e77442b459468") ;;; Generated autoloads from cl-macs.el (autoload (quote cl-compile-time-init) "cl-macs" "\ @@ -745,7 +745,7 @@ Not documented ;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not ;;;;;; substitute-if substitute delete-duplicates remove-duplicates ;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove* -;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f") +;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "c972a97c053d4e001ac1d1012c315b28") ;;; Generated autoloads from cl-seq.el (autoload (quote reduce) "cl-seq" "\ -- cgit v1.2.1 From 9fd25d141e926833cf5885603d11c2122c471fe8 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:43:06 +0000 Subject: * net/tramp.el (tramp-handle-file-remote-p): Return a string as remote identification. --- lisp/ChangeLog | 3 +++ lisp/files.el | 2 +- lisp/net/tramp.el | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4330c92ac6b..f471a883526 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,9 @@ * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. + * net/tramp.el (tramp-handle-file-remote-p): Return a string as + remote identification. + 2007-08-04 Glenn Morris * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is diff --git a/lisp/files.el b/lisp/files.el index 135ccfafb92..8e6fb9ff725 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2260,7 +2260,7 @@ we don't actually set it to the same mode the buffer already has." (unless done (if buffer-file-name (let ((name buffer-file-name) - (remote-id (file-remote-p buffer-file-name))) + (remote-id (regexp-quote (file-remote-p buffer-file-name)))) ;; Remove remote file name identification. (when (and (stringp remote-id) (string-match remote-id name)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 03e97b747da..9f665ca4707 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3872,7 +3872,7 @@ This will break if COMMAND prints a newline, followed by the value of "Like `file-remote-p' for tramp files." (when (tramp-tramp-file-p filename) (with-parsed-tramp-file-name filename nil - (vector multi-method method user host "")))) + (tramp-make-tramp-file-name multi-method method user host "")))) (defun tramp-handle-insert-file-contents (filename &optional visit beg end replace) -- cgit v1.2.1 From 31c855e2a5015e9c0013d8f24bbc6eab7dc74112 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:46:33 +0000 Subject: *** empty log message *** --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/files.el b/lisp/files.el index e2cde74d6a1..3be6c2429cd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2314,7 +2314,7 @@ we don't actually set it to the same mode the buffer already has." (remote-id (file-remote-p buffer-file-name))) ;; Remove remote file name identification. (when (and (stringp remote-id) - (string-match remote-id name)) + (string-match (regexp-quote remote-id) name)) (setq name (substring name (match-end 0)))) ;; Remove backup-suffixes from file name. (setq name (file-name-sans-versions name)) -- cgit v1.2.1 From 972c4265e726f3fb1fdcb3f0b06b428a6f0af8e3 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:48:27 +0000 Subject: *** empty log message *** --- lisp/files.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/files.el b/lisp/files.el index 8e6fb9ff725..dfa3cef384d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2260,10 +2260,10 @@ we don't actually set it to the same mode the buffer already has." (unless done (if buffer-file-name (let ((name buffer-file-name) - (remote-id (regexp-quote (file-remote-p buffer-file-name)))) + (remote-id (file-remote-p buffer-file-name))) ;; Remove remote file name identification. (when (and (stringp remote-id) - (string-match remote-id name)) + (string-match (regexp-quote remote-id) name)) (setq name (substring name (match-end 0)))) ;; Remove backup-suffixes from file name. (setq name (file-name-sans-versions name)) -- cgit v1.2.1 From 557124d7ac70f39ed5b2d8fa3c19ca42311f7e20 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Sun, 5 Aug 2007 12:54:13 +0000 Subject: Require lpr and ps-print when loading printing package --- lisp/ChangeLog | 5 +++++ lisp/printing.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e5682be511..2666c565969 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Vinicius Jose Latorre + + * printing.el: Require lpr and ps-print when loading printing package. + Reported by Glenn Morris . + 2007-08-05 Michael Albinus * files.el (set-auto-mode): Handle also remote files wrt diff --git a/lisp/printing.el b/lisp/printing.el index 98cb442ed00..5ab1c9baee3 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1025,9 +1025,8 @@ Please send all bug fixes and enhancements to ;;; Code: -(eval-when-compile - (require 'lpr) - (require 'ps-print)) +(require 'lpr) +(require 'ps-print) (and (string< ps-print-version "6.6.4") -- cgit v1.2.1 From d1df162618a38f6fe0c83cc99eb3cef9855ac436 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Sun, 5 Aug 2007 12:58:00 +0000 Subject: Require lpr and ps-print when loading printing package --- lisp/ChangeLog | 5 + lisp/printing.el | 922 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 477 insertions(+), 450 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f471a883526..0e12e4627df 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Vinicius Jose Latorre + + * printing.el: Require lpr and ps-print when loading printing package. + Reported by Glenn Morris . + 2007-08-05 Michael Albinus * files.el (set-auto-mode): Handle also remote files wrt diff --git a/lisp/printing.el b/lisp/printing.el index f84a2112661..5ab1c9baee3 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -6,11 +6,11 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 6.8.4 +;; Version: 6.9.1 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst pr-version "6.8.4" - "printing.el, v 6.8.4 <2005/06/11 vinicius> +(defconst pr-version "6.9.1" + "printing.el, v 6.9.1 <2007/08/02 vinicius> Please send all bug fixes and enhancements to Vinicius Jose Latorre @@ -1093,46 +1093,457 @@ If SUFFIX is non-nil, add that at the end of the file name." (set-default-file-modes umask))))) -;; GNU Emacs -(defalias 'pr-e-frame-char-height 'frame-char-height) -(defalias 'pr-e-frame-char-width 'frame-char-width) -(defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) -;; XEmacs -(defalias 'pr-x-add-submenu 'add-submenu) -(defalias 'pr-x-event-function 'event-function) -(defalias 'pr-x-event-object 'event-object) -(defalias 'pr-x-find-menu-item 'find-menu-item) -(defalias 'pr-x-font-height 'font-height) -(defalias 'pr-x-font-width 'font-width) -(defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) -(defalias 'pr-x-make-event 'make-event) -(defalias 'pr-x-misc-user-event-p 'misc-user-event-p) -(defalias 'pr-x-relabel-menu-item 'relabel-menu-item) -(defalias 'pr-x-event-x-pixel 'event-x-pixel) -(defalias 'pr-x-event-y-pixel 'event-y-pixel) + +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; XEmacs Definitions + (cond ((featurep 'xemacs) ; XEmacs - (defvar current-menubar nil) - (defvar current-mouse-event nil) - (defvar zmacs-region-stays nil) + ;; XEmacs (defalias 'pr-f-set-keymap-parents 'set-keymap-parents) (defalias 'pr-f-set-keymap-name 'set-keymap-name) + + ;; XEmacs (defun pr-f-read-string (prompt initial history default) (let ((str (read-string prompt initial))) (if (and str (not (string= str ""))) str default))) + + ;; XEmacs + (defvar zmacs-region-stays nil) + + ;; XEmacs (defun pr-keep-region-active () - (setq zmacs-region-stays t))) + (setq zmacs-region-stays t)) + + ;; XEmacs + (defun pr-region-active-p () + (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))) + + ;; XEmacs + (defun pr-menu-char-height () + (font-height (face-font 'default))) + + ;; XEmacs + (defun pr-menu-char-width () + (font-width (face-font 'default))) + + ;; XEmacs + (defmacro pr-xemacs-global-menubar (&rest body) + `(save-excursion + (let ((temp (get-buffer-create (make-temp-name " *Temp")))) + ;; be sure to access global menubar + (set-buffer temp) + ,@body + (kill-buffer temp)))) + + ;; XEmacs + (defun pr-global-menubar (pr-menu-spec) + ;; Menu binding + (pr-xemacs-global-menubar + (add-submenu nil (cons "Printing" pr-menu-spec) "Apps")) + (setq pr-menu-print-item nil)) + + ;; XEmacs + (defvar current-mouse-event nil) + (defun pr-menu-position (entry index horizontal) + (make-event + 'button-release + (list 'button 1 + 'x (- (event-x-pixel current-mouse-event) ; X + (* horizontal pr-menu-char-width)) + 'y (- (event-y-pixel current-mouse-event) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))))) + + (defvar pr-menu-position nil) + (defvar pr-menu-state nil) + + ;; XEmacs + (defvar current-menubar nil) ; to avoid compilation gripes + (defun pr-menu-lookup (path) + (car (find-menu-item current-menubar (cons "Printing" path)))) + + ;; XEmacs + (defun pr-menu-lock (entry index horizontal state path) + (when pr-menu-lock + (or (and pr-menu-position (eq state pr-menu-state)) + (setq pr-menu-position (pr-menu-position entry index horizontal) + pr-menu-state state)) + (let* ((menu (pr-menu-lookup path)) + (result (get-popup-menu-response menu pr-menu-position))) + (and (misc-user-event-p result) + (funcall (event-function result) + (event-object result)))) + (setq pr-menu-position nil))) + + ;; XEmacs + (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) + + ;; XEmacs + (defvar pr-ps-name-old "PostScript Printers") + (defvar pr-txt-name-old "Text Printers") + (defvar pr-ps-utility-old "PostScript Utility") + (defvar pr-even-or-odd-old "Print All Pages") + + ;; XEmacs + (defun pr-do-update-menus (&optional force) + (pr-menu-alist pr-ps-printer-alist + 'pr-ps-name + 'pr-menu-set-ps-title + '("Printing") + 'pr-ps-printer-menu-modified + force + pr-ps-name-old + 'postscript 2) + (pr-menu-alist pr-txt-printer-alist + 'pr-txt-name + 'pr-menu-set-txt-title + '("Printing") + 'pr-txt-printer-menu-modified + force + pr-txt-name-old + 'text 2) + (let ((save-var pr-ps-utility-menu-modified)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("Printing" "PostScript Print" "File") + 'save-var + force + pr-ps-utility-old + nil 1)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("Printing" "PostScript Preview" "File") + 'pr-ps-utility-menu-modified + force + pr-ps-utility-old + nil 1) + (pr-even-or-odd-pages ps-even-or-odd-pages force)) + + ;; XEmacs + (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name + entry index) + (when (and alist (or force (symbol-value modified-sym))) + (pr-xemacs-global-menubar + (add-submenu menu-path + (pr-menu-create name alist var-sym + fun entry index))) + (funcall fun (symbol-value var-sym)) + (set modified-sym nil))) + + ;; XEmacs + (defun pr-relabel-menu-item (newname var-sym) + (pr-xemacs-global-menubar + (relabel-menu-item + (list "Printing" (symbol-value var-sym)) + newname) + (set var-sym newname))) + + ;; XEmacs + (defun pr-menu-set-ps-title (value &optional item entry index) + (pr-relabel-menu-item (format "PostScript Printer: %s" value) + 'pr-ps-name-old) + (pr-ps-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; XEmacs + (defun pr-menu-set-txt-title (value &optional item entry index) + (pr-relabel-menu-item (format "Text Printer: %s" value) + 'pr-txt-name-old) + (pr-txt-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; XEmacs + (defun pr-menu-set-utility-title (value &optional item entry index) + (pr-xemacs-global-menubar + (let ((newname (format "%s" value))) + (relabel-menu-item + (list "Printing" "PostScript Print" "File" pr-ps-utility-old) + newname) + (relabel-menu-item + (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) + newname) + (setq pr-ps-utility-old newname))) + (pr-ps-set-utility value) + (and index + (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) + + ;; XEmacs + (defun pr-even-or-odd-pages (value &optional no-lock) + (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) + 'pr-even-or-odd-old) + (setq ps-even-or-odd-pages value) + (or no-lock + (pr-menu-lock 'postscript-options 8 12 'toggle nil))) + ) (t ; GNU Emacs - (defvar deactivate-mark nil) + ;; Do nothing + )) ; end cond featurep + + + +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GNU Emacs Definitions + + +(cond + ((featurep 'xemacs) ; XEmacs + ;; Do nothing + ) + (t ; GNU Emacs + ;; GNU Emacs (defalias 'pr-f-set-keymap-parents 'set-keymap-parent) (defalias 'pr-f-set-keymap-name 'ignore) (defalias 'pr-f-read-string 'read-string) + + ;; GNU Emacs + (defvar deactivate-mark) + + ;; GNU Emacs (defun pr-keep-region-active () - (setq deactivate-mark nil)))) + (setq deactivate-mark nil)) + + ;; GNU Emacs + (defun pr-region-active-p () + (and pr-auto-region transient-mark-mode mark-active)) + + ;; GNU Emacs + (defun pr-menu-char-height () + (frame-char-height)) + + ;; GNU Emacs + (defun pr-menu-char-width () + (frame-char-width)) + + ;; GNU Emacs + ;; Menu binding + ;; Replace existing "print" item by "Printing" item. + ;; If you're changing this file, you'll load it a second, + ;; third... time, but "print" item exists only in the first load. + (eval-and-compile + (cond + ;; GNU Emacs 20 + ((< emacs-major-version 21) + (defun pr-global-menubar (pr-menu-spec) + (require 'easymenu) + (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) + (when pr-menu-print-item + (easy-menu-remove-item nil '("tools") pr-menu-print-item) + (setq pr-menu-print-item nil + pr-menu-bar (vector 'menu-bar 'tools + (pr-get-symbol "Printing"))))) + ) + ;; GNU Emacs 21 & 22 + (t + (defun pr-global-menubar (pr-menu-spec) + (require 'easymenu) + (let ((menu-file (if (= emacs-major-version 21) + '("menu-bar" "files") ; GNU Emacs 21 + '("menu-bar" "file")))) ; GNU Emacs 22 or higher + (cond + (pr-menu-print-item + (easy-menu-add-item global-map menu-file + (easy-menu-create-menu "Print" pr-menu-spec) + "print-buffer") + (dolist (item '("print-buffer" "print-region" + "ps-print-buffer-faces" "ps-print-region-faces" + "ps-print-buffer" "ps-print-region")) + (easy-menu-remove-item global-map menu-file item)) + (setq pr-menu-print-item nil + pr-menu-bar (vector 'menu-bar + (pr-get-symbol (nth 1 menu-file)) + (pr-get-symbol "Print")))) + (t + (easy-menu-add-item global-map menu-file + (easy-menu-create-menu "Print" pr-menu-spec))) + ))) + ))) + + (eval-and-compile + (cond + (ps-windows-system + ;; GNU Emacs for Windows 9x/NT + (defun pr-menu-position (entry index horizontal) + (let ((pos (cdr (mouse-pixel-position)))) + (list + (list (or (car pos) 0) ; X + (- (or (cdr pos) 0) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))) + (selected-frame)))) ; frame + ) + (t + ;; GNU Emacs + (defun pr-menu-position (entry index horizontal) + (let ((pos (cdr (mouse-pixel-position)))) + (list + (list (- (or (car pos) 0) ; X + (* horizontal pr-menu-char-width)) + (- (or (cdr pos) 0) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))) + (selected-frame)))) ; frame + ))) + + (defvar pr-menu-position nil) + (defvar pr-menu-state nil) + + ;; GNU Emacs + (defun pr-menu-lookup (path) + (lookup-key global-map + (if path + (vconcat pr-menu-bar + (mapcar 'pr-get-symbol + (if (listp path) + path + (list path)))) + pr-menu-bar))) + + ;; GNU Emacs + (defun pr-menu-lock (entry index horizontal state path) + (when pr-menu-lock + (or (and pr-menu-position (eq state pr-menu-state)) + (setq pr-menu-position (pr-menu-position entry index horizontal) + pr-menu-state state)) + (let* ((menu (pr-menu-lookup path)) + (result (x-popup-menu pr-menu-position menu))) + (and result + (let ((command (lookup-key menu (vconcat result)))) + (if (fboundp command) + (funcall command) + (eval command))))) + (setq pr-menu-position nil))) + + ;; GNU Emacs + (defalias 'pr-update-mode-line 'force-mode-line-update) + + ;; GNU Emacs + (defun pr-do-update-menus (&optional force) + (pr-menu-alist pr-ps-printer-alist + 'pr-ps-name + 'pr-menu-set-ps-title + "PostScript Printers" + 'pr-ps-printer-menu-modified + force + "PostScript Printers" + 'postscript 2) + (pr-menu-alist pr-txt-printer-alist + 'pr-txt-name + 'pr-menu-set-txt-title + "Text Printers" + 'pr-txt-printer-menu-modified + force + "Text Printers" + 'text 2) + (let ((save-var pr-ps-utility-menu-modified)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("PostScript Print" "File" "PostScript Utility") + 'save-var + force + "PostScript Utility" + nil 1)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("PostScript Preview" "File" "PostScript Utility") + 'pr-ps-utility-menu-modified + force + "PostScript Utility" + nil 1) + (pr-even-or-odd-pages ps-even-or-odd-pages force)) + + ;; GNU Emacs + (defun pr-menu-get-item (name-list) + ;; NAME-LIST is a string or a list of strings. + (or (listp name-list) + (setq name-list (list name-list))) + (and name-list + (let* ((reversed (reverse name-list)) + (name (pr-get-symbol (car reversed))) + (path (nreverse (cdr reversed))) + (menu (lookup-key + global-map + (vconcat pr-menu-bar + (mapcar 'pr-get-symbol path))))) + (assq name (nthcdr 2 menu))))) + + ;; GNU Emacs + (defvar pr-temp-menu nil) + + ;; GNU Emacs + (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name + entry index) + (when (and alist (or force (symbol-value modified-sym))) + (easy-menu-define pr-temp-menu nil "" + (pr-menu-create name alist var-sym fun entry index)) + (let ((item (pr-menu-get-item menu-path))) + (and item + (let* ((binding (nthcdr 3 item)) + (key-binding (cdr binding))) + (setcar binding pr-temp-menu) + (and key-binding (listp (car key-binding)) + (setcdr binding (cdr key-binding))) ; skip KEY-BINDING + (funcall fun (symbol-value var-sym) item)))) + (set modified-sym nil))) + + ;; GNU Emacs + (defun pr-menu-set-item-name (item name) + (and item + (setcar (nthcdr 2 item) name))) ; ITEM-NAME + + ;; GNU Emacs + (defun pr-menu-set-ps-title (value &optional item entry index) + (pr-menu-set-item-name (or item + (pr-menu-get-item "PostScript Printers")) + (format "PostScript Printer: %s" value)) + (pr-ps-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; GNU Emacs + (defun pr-menu-set-txt-title (value &optional item entry index) + (pr-menu-set-item-name (or item + (pr-menu-get-item "Text Printers")) + (format "Text Printer: %s" value)) + (pr-txt-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; GNU Emacs + (defun pr-menu-set-utility-title (value &optional item entry index) + (let ((name (symbol-name value))) + (if item + (pr-menu-set-item-name item name) + (pr-menu-set-item-name + (pr-menu-get-item + '("PostScript Print" "File" "PostScript Utility")) + name) + (pr-menu-set-item-name + (pr-menu-get-item + '("PostScript Preview" "File" "PostScript Utility")) + name))) + (pr-ps-set-utility value) + (and index + (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) + + ;; GNU Emacs + (defun pr-even-or-odd-pages (value &optional no-lock) + (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") + (cdr (assq value pr-even-or-odd-alist))) + (setq ps-even-or-odd-pages value) + (or no-lock + (pr-menu-lock 'postscript-options 8 12 'toggle nil))) + + )) ; end cond featurep ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1592,7 +2003,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE . VALUE) - That associates VARIABLE with VALUE. when this entry is + Which associates VARIABLE with VALUE. When this entry is selected, it's executed the following command: (set VARIABLE (eval VALUE)) @@ -2147,7 +2558,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE-SYM . VALUE) - That associates VARIABLE-SYM with VALUE. when this entry is + Which associates VARIABLE-SYM with VALUE. When this entry is selected, it's executed the following command: (set (make-local-variable VARIABLE-SYM) (eval VALUE)) @@ -2327,7 +2738,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE . VALUE) - That associates VARIABLE with VALUE. when this entry is + Which associates VARIABLE with VALUE. When this entry is selected, it's executed the following command: (set VARIABLE (eval VALUE)) @@ -2452,11 +2863,7 @@ See also `pr-menu-char-height' and `pr-menu-char-width'." :group 'printing) -(defcustom pr-menu-char-height - (cond ((featurep 'xemacs) ; XEmacs - (pr-x-font-height (face-font 'default))) - (t ; GNU Emacs - (pr-e-frame-char-height))) +(defcustom pr-menu-char-height (pr-menu-char-height) "*Specify menu char height in pixels. This variable is used to guess which vertical position should be locked the @@ -2468,11 +2875,7 @@ See also `pr-menu-lock' and `pr-menu-char-width'." :group 'printing) -(defcustom pr-menu-char-width - (cond ((featurep 'xemacs) ; XEmacs - (pr-x-font-width (face-font 'default))) - (t ; GNU Emacs - (pr-e-frame-char-width))) +(defcustom pr-menu-char-width (pr-menu-char-width) "*Specify menu char width in pixels. This variable is used to guess which horizontal position should be locked the @@ -2544,7 +2947,7 @@ SETTING It's a cons like: (VARIABLE . VALUE) - That associates VARIABLE with VALUE. when this entry is + Which associates VARIABLE with VALUE. When this entry is selected, it's executed the following command: * If LOCAL is non-nil: @@ -2772,15 +3175,6 @@ See `pr-ps-printer-alist'.") ;; Keys & Menus -(defmacro pr-xemacs-global-menubar (&rest body) - `(save-excursion - (let ((temp (get-buffer-create (make-temp-name " *Temp")))) - ;; be sure to access global menubar - (set-buffer temp) - ,@body - (kill-buffer temp)))) - - (defsubst pr-visible-p (key) (memq key pr-visible-entry-list)) @@ -2802,16 +3196,6 @@ See `pr-ps-printer-alist'.") 'easy-menu-intern (lambda (s) (if (stringp s) (intern s) s)))) -(cond - ((featurep 'xemacs) ; XEmacs - (defvar zmacs-region-stays nil) ; to avoid compilation gripes - (defun pr-region-active-p () - (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))) - - (t ; GNU Emacs - (defun pr-region-active-p () - (and pr-auto-region transient-mark-mode mark-active)))) - (defconst pr-menu-spec ;; Menu mapping: @@ -3070,51 +3454,7 @@ menu. Calls `pr-update-menus' to adjust menus." (interactive) - (cond - ((featurep 'xemacs) ; XEmacs - ;; Menu binding - (pr-xemacs-global-menubar - (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps")) - (setq pr-menu-print-item nil)) - - - (t ; GNU Emacs - ;; Menu binding - (require 'easymenu) - ;; Replace existing "print" item by "Printing" item. - ;; If you're changing this file, you'll load it a second, - ;; third... time, but "print" item exists only in the first load. - (cond - ;; Emacs 20 - ((< emacs-major-version 21) - (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) - (when pr-menu-print-item - (easy-menu-remove-item nil '("tools") pr-menu-print-item) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar 'tools - (pr-get-symbol "Printing"))))) - ;; Emacs 21 & 22 - (t - (let ((menu-file (if (= emacs-major-version 21) - '("menu-bar" "files") ; Emacs 21 - '("menu-bar" "file")))) ; Emacs 22 or higher - (cond - (pr-menu-print-item - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" pr-menu-spec) - "print-buffer") - (dolist (item '("print-buffer" "print-region" - "ps-print-buffer-faces" "ps-print-region-faces" - "ps-print-buffer" "ps-print-region")) - (easy-menu-remove-item global-map menu-file item)) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar - (pr-get-symbol (nth 1 menu-file)) - (pr-get-symbol "Print")))) - (t - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" pr-menu-spec))) - )))))) + (pr-global-menubar pr-menu-spec) (pr-update-menus t)) @@ -4815,118 +5155,30 @@ Each element has the form: (MENU-PART . NUMBER-OF-ITEMS) -See `pr-visible-entry-alist'.") - - -(defun pr-menu-index (entry index) - (let ((base-list - (cond ((eq entry 'text) - '(postscript)) - ((eq entry 'postscript-options) - '(postscript text)) - ((eq entry 'postscript-process) - '(postscript text postscript-options)) - ((eq entry 'printing) - '(postscript text postscript-options postscript-process)) - (t - nil) - )) - key) - (while base-list - (setq key (car base-list) - base-list (cdr base-list)) - (and (pr-visible-p key) - (setq index (+ index - (cdr (assq key pr-menu-entry-alist))))))) - (+ index 2)) - - -(defvar pr-menu-position nil) -(defvar pr-menu-state nil) - - -(cond - ((featurep 'xemacs) - ;; XEmacs - (defvar current-mouse-event nil) ; to avoid compilation gripes - (defun pr-menu-position (entry index horizontal) - (pr-x-make-event - 'button-release - (list 'button 1 - 'x (- (pr-x-event-x-pixel current-mouse-event) ; X - (* horizontal pr-menu-char-width)) - 'y (- (pr-x-event-y-pixel current-mouse-event) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))))) - ) - (ps-windows-system - ;; GNU Emacs for Windows 9x/NT - (defun pr-menu-position (entry index horizontal) - (let ((pos (cdr (pr-e-mouse-pixel-position)))) - (list - (list (or (car pos) 0) ; X - (- (or (cdr pos) 0) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))) - (selected-frame)))) ; frame - ) - (t - ;; GNU Emacs - (defun pr-menu-position (entry index horizontal) - (let ((pos (cdr (pr-e-mouse-pixel-position)))) - (list - (list (- (or (car pos) 0) ; X - (* horizontal pr-menu-char-width)) - (- (or (cdr pos) 0) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))) - (selected-frame)))) ; frame - )) - -(cond - ((featurep 'xemacs) - ;; XEmacs - (defvar current-menubar nil) ; to avoid compilation gripes - (defun pr-menu-lookup (path) - (car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) - - ;; XEmacs - (defun pr-menu-lock (entry index horizontal state path) - (when pr-menu-lock - (or (and pr-menu-position (eq state pr-menu-state)) - (setq pr-menu-position (pr-menu-position entry index horizontal) - pr-menu-state state)) - (let* ((menu (pr-menu-lookup path)) - (result (pr-x-get-popup-menu-response menu pr-menu-position))) - (and (pr-x-misc-user-event-p result) - (funcall (pr-x-event-function result) - (pr-x-event-object result)))) - (setq pr-menu-position nil)))) - - - (t - ;; GNU Emacs - (defun pr-menu-lookup (path) - (lookup-key global-map - (if path - (vconcat pr-menu-bar - (mapcar 'pr-get-symbol - (if (listp path) - path - (list path)))) - pr-menu-bar))) - - ;; GNU Emacs - (defun pr-menu-lock (entry index horizontal state path) - (when pr-menu-lock - (or (and pr-menu-position (eq state pr-menu-state)) - (setq pr-menu-position (pr-menu-position entry index horizontal) - pr-menu-state state)) - (let* ((menu (pr-menu-lookup path)) - (result (x-popup-menu pr-menu-position menu))) - (and result - (let ((command (lookup-key menu (vconcat result)))) - (if (fboundp command) - (funcall command) - (eval command))))) - (setq pr-menu-position nil))))) +See `pr-visible-entry-alist'.") + + +(defun pr-menu-index (entry index) + (let ((base-list + (cond ((eq entry 'text) + '(postscript)) + ((eq entry 'postscript-options) + '(postscript text)) + ((eq entry 'postscript-process) + '(postscript text postscript-options)) + ((eq entry 'printing) + '(postscript text postscript-options postscript-process)) + (t + nil) + )) + key) + (while base-list + (setq key (car base-list) + base-list (cdr base-list)) + (and (pr-visible-p key) + (setq index (+ index + (cdr (assq key pr-menu-entry-alist))))))) + (+ index 2)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -4991,237 +5243,6 @@ If menu binding was not done, calls `pr-menu-bind'." alist))) -(cond - ((featurep 'xemacs) - ;; XEmacs - (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) - - ;; XEmacs - (defvar pr-ps-name-old "PostScript Printers") - (defvar pr-txt-name-old "Text Printers") - (defvar pr-ps-utility-old "PostScript Utility") - (defvar pr-even-or-odd-old "Print All Pages") - - ;; XEmacs - (defun pr-do-update-menus (&optional force) - (pr-menu-alist pr-ps-printer-alist - 'pr-ps-name - 'pr-menu-set-ps-title - '("Printing") - 'pr-ps-printer-menu-modified - force - pr-ps-name-old - 'postscript 2) - (pr-menu-alist pr-txt-printer-alist - 'pr-txt-name - 'pr-menu-set-txt-title - '("Printing") - 'pr-txt-printer-menu-modified - force - pr-txt-name-old - 'text 2) - (let ((save-var pr-ps-utility-menu-modified)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("Printing" "PostScript Print" "File") - 'save-var - force - pr-ps-utility-old - nil 1)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("Printing" "PostScript Preview" "File") - 'pr-ps-utility-menu-modified - force - pr-ps-utility-old - nil 1) - (pr-even-or-odd-pages ps-even-or-odd-pages force)) - - ;; XEmacs - (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name - entry index) - (when (and alist (or force (symbol-value modified-sym))) - (pr-xemacs-global-menubar - (pr-x-add-submenu menu-path - (pr-menu-create name alist var-sym - fun entry index))) - (funcall fun (symbol-value var-sym)) - (set modified-sym nil))) - - ;; XEmacs - (defun pr-relabel-menu-item (newname var-sym) - (pr-xemacs-global-menubar - (pr-x-relabel-menu-item - (list "Printing" (symbol-value var-sym)) - newname) - (set var-sym newname))) - - ;; XEmacs - (defun pr-menu-set-ps-title (value &optional item entry index) - (pr-relabel-menu-item (format "PostScript Printer: %s" value) - 'pr-ps-name-old) - (pr-ps-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; XEmacs - (defun pr-menu-set-txt-title (value &optional item entry index) - (pr-relabel-menu-item (format "Text Printer: %s" value) - 'pr-txt-name-old) - (pr-txt-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; XEmacs - (defun pr-menu-set-utility-title (value &optional item entry index) - (pr-xemacs-global-menubar - (let ((newname (format "%s" value))) - (pr-x-relabel-menu-item - (list "Printing" "PostScript Print" "File" pr-ps-utility-old) - newname) - (pr-x-relabel-menu-item - (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) - newname) - (setq pr-ps-utility-old newname))) - (pr-ps-set-utility value) - (and index - (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) - - ;; XEmacs - (defun pr-even-or-odd-pages (value &optional no-lock) - (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) - 'pr-even-or-odd-old) - (setq ps-even-or-odd-pages value) - (or no-lock - (pr-menu-lock 'postscript-options 8 12 'toggle nil)))) - - - (t - ;; GNU Emacs - (defalias 'pr-update-mode-line 'force-mode-line-update) - - ;; GNU Emacs - (defun pr-do-update-menus (&optional force) - (pr-menu-alist pr-ps-printer-alist - 'pr-ps-name - 'pr-menu-set-ps-title - "PostScript Printers" - 'pr-ps-printer-menu-modified - force - "PostScript Printers" - 'postscript 2) - (pr-menu-alist pr-txt-printer-alist - 'pr-txt-name - 'pr-menu-set-txt-title - "Text Printers" - 'pr-txt-printer-menu-modified - force - "Text Printers" - 'text 2) - (let ((save-var pr-ps-utility-menu-modified)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("PostScript Print" "File" "PostScript Utility") - 'save-var - force - "PostScript Utility" - nil 1)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("PostScript Preview" "File" "PostScript Utility") - 'pr-ps-utility-menu-modified - force - "PostScript Utility" - nil 1) - (pr-even-or-odd-pages ps-even-or-odd-pages force)) - - ;; GNU Emacs - (defun pr-menu-get-item (name-list) - ;; NAME-LIST is a string or a list of strings. - (or (listp name-list) - (setq name-list (list name-list))) - (and name-list - (let* ((reversed (reverse name-list)) - (name (pr-get-symbol (car reversed))) - (path (nreverse (cdr reversed))) - (menu (lookup-key - global-map - (vconcat pr-menu-bar - (mapcar 'pr-get-symbol path))))) - (assq name (nthcdr 2 menu))))) - - ;; GNU Emacs - (defvar pr-temp-menu nil) - - ;; GNU Emacs - (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name - entry index) - (when (and alist (or force (symbol-value modified-sym))) - (easy-menu-define pr-temp-menu nil "" - (pr-menu-create name alist var-sym fun entry index)) - (let ((item (pr-menu-get-item menu-path))) - (and item - (let* ((binding (nthcdr 3 item)) - (key-binding (cdr binding))) - (setcar binding pr-temp-menu) - (and key-binding (listp (car key-binding)) - (setcdr binding (cdr key-binding))) ; skip KEY-BINDING - (funcall fun (symbol-value var-sym) item)))) - (set modified-sym nil))) - - ;; GNU Emacs - (defun pr-menu-set-item-name (item name) - (and item - (setcar (nthcdr 2 item) name))) ; ITEM-NAME - - ;; GNU Emacs - (defun pr-menu-set-ps-title (value &optional item entry index) - (pr-menu-set-item-name (or item - (pr-menu-get-item "PostScript Printers")) - (format "PostScript Printer: %s" value)) - (pr-ps-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; GNU Emacs - (defun pr-menu-set-txt-title (value &optional item entry index) - (pr-menu-set-item-name (or item - (pr-menu-get-item "Text Printers")) - (format "Text Printer: %s" value)) - (pr-txt-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; GNU Emacs - (defun pr-menu-set-utility-title (value &optional item entry index) - (let ((name (symbol-name value))) - (if item - (pr-menu-set-item-name item name) - (pr-menu-set-item-name - (pr-menu-get-item - '("PostScript Print" "File" "PostScript Utility")) - name) - (pr-menu-set-item-name - (pr-menu-get-item - '("PostScript Preview" "File" "PostScript Utility")) - name))) - (pr-ps-set-utility value) - (and index - (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) - - ;; GNU Emacs - (defun pr-even-or-odd-pages (value &optional no-lock) - (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") - (cdr (assq value pr-even-or-odd-alist))) - (setq ps-even-or-odd-pages value) - (or no-lock - (pr-menu-lock 'postscript-options 8 12 'toggle nil))))) - - (defun pr-ps-set-utility (value) (let ((item (cdr (assq value pr-ps-utility-alist)))) (or item @@ -5997,9 +6018,10 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." ;; Printing Interface (inspired on ps-print-interface.el) -(require 'widget) -(require 'wid-edit) -(require 'cus-edit) +(eval-when-compile + (require 'cus-edit) + (require 'wid-edit) + (require 'widget)) (defvar pr-i-window-configuration nil) -- cgit v1.2.1 From 5e06916eca3e6277e71e05c75b5e26b3046d1e45 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 5 Aug 2007 13:21:19 +0000 Subject: (math-nlfit-curve): Remove unnecessary variables. (math-nlfit-givens): Let bind free variables. --- lisp/calc/calc-nlfit.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el index 2880ff837bd..489599781f6 100644 --- a/lisp/calc/calc-nlfit.el +++ b/lisp/calc/calc-nlfit.el @@ -373,7 +373,8 @@ (math-nlfit-set-elt d j dj)))) (setq i (1+ i)))) (setq j (1+ j))) - (let ((i n)) + (let ((i n) + s) (while (>= i 1) (math-nlfit-set-elt r i 0) (setq s (math-nlfit-get-elt d i)) @@ -408,7 +409,8 @@ (calcFunc-sqrt (math-sub 1 (math-mul gamma gamma))))))) (let ((ri (math-nlfit-get-elt r i)) - (rj (math-nlfit-get-elt r j))) + (rj (math-nlfit-get-elt r j)) + h) (setq h (math-add (math-mul gamma rj) (math-mul sigma ri))) (setq ri (math-sub @@ -672,8 +674,6 @@ (mapcar (lambda (x) (math-get-sdev x t)) ydata) nil)) (ydata (mapcar (lambda (x) (math-get-value x)) ydata)) - (zzz (progn (setq j1 xdata j2 ydata j3 sdata) 1)) - (calc-curve-varnames nil) (calc-curve-coefnames nil) (calc-curve-nvars 1) -- cgit v1.2.1 From 1a60558695d47d4f4579c09d35abafb434240614 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 5 Aug 2007 13:22:45 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2666c565969..1340db105a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-05 Jay Belanger + + * calc/calc-nlfit.el (math-nlfit-curve): + Remove unnecessary variables. + (math-nlfit-givens): Let bind free variables. + 2007-08-05 Vinicius Jose Latorre * printing.el: Require lpr and ps-print when loading printing package. -- cgit v1.2.1 From c4b5bc9492a0dac016f36f04892f5b0b14eb04f2 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Sun, 5 Aug 2007 14:08:50 +0000 Subject: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/term.el | 24 ++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1340db105a1..c434acf53a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2007-08-05 Peter Povinec yahoo.com> (tiny change) + + * term.el: Honor term-default-fg-color and term-default-bg-color + settings when modifying term-current-face. + (term-default-fg-color, term-default-bg-color): Initialized from + default term-current-face. + (term-mode, term-reset-terminal): Set term-current-face with + term-default-fg-color and term-default-bg-color. + (term-handle-colors-array): term-current-face has term-default-fg-color + and term-default-bg-color after reset escape sequence. + (term-handle-colors-array): Set term-current-color with + term-default-fg/bg-color instead of ansi-term-color-vector when the + index (term-ansi-current-color or term-ansi-current-bg-color) is zero. + 2007-08-05 Jay Belanger * calc/calc-nlfit.el (math-nlfit-curve): diff --git a/lisp/term.el b/lisp/term.el index 55c5090fb2c..d7f083adfa6 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -695,12 +695,12 @@ Buffer local variable.") ;;; faces -mm -(defcustom term-default-fg-color 'unspecified +(defcustom term-default-fg-color (face-foreground term-current-face) "Default color for foreground in `term'." :group 'term :type 'string) -(defcustom term-default-bg-color 'unspecified +(defcustom term-default-bg-color (face-background term-current-face) "Default color for background in `term'." :group 'term :type 'string) @@ -1098,6 +1098,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'term-pending-delete-marker) (setq term-pending-delete-marker (make-marker)) (make-local-variable 'term-current-face) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (make-local-variable 'term-pending-frame) (setq term-pending-frame nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. @@ -3055,7 +3057,8 @@ See `term-prompt-regexp'." (setq term-scroll-start 0) (setq term-scroll-end term-height) (setq term-insert-mode nil) - (setq term-current-face nil) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) @@ -3117,7 +3120,8 @@ See `term-prompt-regexp'." ;;; 0 (Reset) or unknown (reset anyway) (t - (setq term-current-face nil) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) @@ -3154,11 +3158,11 @@ See `term-prompt-regexp'." (setq term-current-face (list :background (if (= term-ansi-current-color 0) - (face-foreground 'default) + term-default-fg-color (elt ansi-term-color-vector term-ansi-current-color)) :foreground (if (= term-ansi-current-bg-color 0) - (face-background 'default) + term-default-bg-color (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face @@ -3181,9 +3185,13 @@ See `term-prompt-regexp'." ) (setq term-current-face (list :foreground - (elt ansi-term-color-vector term-ansi-current-color) + (if (= term-ansi-current-color 0) + term-default-fg-color + (elt ansi-term-color-vector term-ansi-current-color)) :background - (elt ansi-term-color-vector term-ansi-current-bg-color))) + (if (= term-ansi-current-bg-color 0) + term-default-bg-color + (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face (append '(:weight bold) term-current-face))) -- cgit v1.2.1 From 83ee4165d7bfc13329f45f93f0ce843954045472 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Sun, 5 Aug 2007 14:09:30 +0000 Subject: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/term.el | 24 ++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0e12e4627df..5909a670ed3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2007-08-05 Peter Povinec yahoo.com> (tiny change) + + * term.el: Honor term-default-fg-color and term-default-bg-color + settings when modifying term-current-face. + (term-default-fg-color, term-default-bg-color): Initialized from + default term-current-face. + (term-mode, term-reset-terminal): Set term-current-face with + term-default-fg-color and term-default-bg-color. + (term-handle-colors-array): term-current-face has term-default-fg-color + and term-default-bg-color after reset escape sequence. + (term-handle-colors-array): Set term-current-color with + term-default-fg/bg-color instead of ansi-term-color-vector when the + index (term-ansi-current-color or term-ansi-current-bg-color) is zero. + 2007-08-05 Vinicius Jose Latorre * printing.el: Require lpr and ps-print when loading printing package. diff --git a/lisp/term.el b/lisp/term.el index c7b5ee249d1..4d1c660543a 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -695,12 +695,12 @@ Buffer local variable.") ;;; faces -mm -(defcustom term-default-fg-color 'unspecified +(defcustom term-default-fg-color (face-foreground term-current-face) "Default color for foreground in `term'." :group 'term :type 'string) -(defcustom term-default-bg-color 'unspecified +(defcustom term-default-bg-color (face-background term-current-face) "Default color for background in `term'." :group 'term :type 'string) @@ -1098,6 +1098,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'term-pending-delete-marker) (setq term-pending-delete-marker (make-marker)) (make-local-variable 'term-current-face) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (make-local-variable 'term-pending-frame) (setq term-pending-frame nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. @@ -3055,7 +3057,8 @@ See `term-prompt-regexp'." (setq term-scroll-start 0) (setq term-scroll-end term-height) (setq term-insert-mode nil) - (setq term-current-face nil) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) @@ -3117,7 +3120,8 @@ See `term-prompt-regexp'." ;;; 0 (Reset) or unknown (reset anyway) (t - (setq term-current-face nil) + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) @@ -3154,11 +3158,11 @@ See `term-prompt-regexp'." (setq term-current-face (list :background (if (= term-ansi-current-color 0) - (face-foreground 'default) + term-default-fg-color (elt ansi-term-color-vector term-ansi-current-color)) :foreground (if (= term-ansi-current-bg-color 0) - (face-background 'default) + term-default-bg-color (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face @@ -3181,9 +3185,13 @@ See `term-prompt-regexp'." ) (setq term-current-face (list :foreground - (elt ansi-term-color-vector term-ansi-current-color) + (if (= term-ansi-current-color 0) + term-default-fg-color + (elt ansi-term-color-vector term-ansi-current-color)) :background - (elt ansi-term-color-vector term-ansi-current-bg-color))) + (if (= term-ansi-current-bg-color 0) + term-default-bg-color + (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face (append '(:weight bold) term-current-face))) -- cgit v1.2.1 From 523e641cc4c1f46b5a5a11e189e68dbd2ab01aa6 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 5 Aug 2007 21:46:00 +0000 Subject: (vc-rollback): Add norevert argument back. (vc-revert-buffer): Add back as obsolete alias. --- lisp/vc.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/vc.el b/lisp/vc.el index 78e098d874f..2b2dd9fb8c9 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -2635,6 +2635,9 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action] (vc-revert-file file) (message "Reverting %s...done" file))) +;;;###autoload +(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") + ;;;###autoload (defun vc-update () "Update the current buffer's file to the latest version on its branch. @@ -2718,8 +2721,9 @@ return its name; otherwise return nil." (vc-resynch-buffer file t t)) ;;;###autoload -(defun vc-rollback () - "Get rid of most recently checked in version of this file." +(defun vc-rollback (&optional norevert) + "Get rid of most recently checked in version of this file. +A prefix argument NOREVERT means do not revert the buffer afterwards." (interactive "P") (vc-ensure-vc-buffer) (let* ((file buffer-file-name) -- cgit v1.2.1 From 9ab8e9c2a9f6541c390917d95b4f6dd56ac2a979 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 5 Aug 2007 21:51:30 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c434acf53a3..667d7ca793e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Jason Rumney + + * vc.el (vc-rollback): Add norevert argument back. + (vc-revert-buffer): Add back as obsolete alias. + 2007-08-05 Peter Povinec yahoo.com> (tiny change) * term.el: Honor term-default-fg-color and term-default-bg-color -- cgit v1.2.1 From 731f63cad6f4c3203ee3a35e1762659d35cd1d1e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 6 Aug 2007 01:01:20 +0000 Subject: Wrap (require 'help-mode) by eval-when-compile. (quail-help-init): New function. (quail-help): Call quail-help-init. (quail-store-decode-map-key): Change it to a function. --- lisp/international/quail.el | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'lisp') diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 774e3c14269..98d4cc80ec5 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -55,7 +55,7 @@ ;;; Code: -(require 'help-mode) +(eval-when-compile (require 'help-mode)) (defgroup quail nil "Quail: multilingual input method." @@ -2431,22 +2431,27 @@ should be made by `quail-build-decode-map' (which see)." (insert ?\n)) (insert ?\n)))) -(define-button-type 'quail-keyboard-layout-button - :supertype 'help-xref - 'help-function '(lambda (layout) - (help-setup-xref `(quail-keyboard-layout-button ,layout) nil) - (quail-show-keyboard-layout layout)) - 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) - -(define-button-type 'quail-keyboard-customize-button - :supertype 'help-customize-variable - 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")) +(defun quail-help-init () + (unless (featurep 'help-mode) + (require 'help-mode) + (define-button-type 'quail-keyboard-layout-button + :supertype 'help-xref + 'help-function '(lambda (layout) + (help-setup-xref `(quail-keyboard-layout-button ,layout) + nil) + (quail-show-keyboard-layout layout)) + 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) + + (define-button-type 'quail-keyboard-customize-button + :supertype 'help-customize-variable + 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")))) (defun quail-help (&optional package) "Show brief description of the current Quail package. Optional arg PACKAGE specifies the name of alternative Quail package to describe." (interactive) + (quail-help-init) (let ((help-xref-mule-regexp help-xref-mule-regexp-template) (default-enable-multibyte-characters enable-multibyte-characters) (package-def @@ -2629,7 +2634,7 @@ KEY BINDINGS FOR CONVERSION ;; it is not yet stored. As a result, the element is a string or a ;; list of strings. -(defsubst quail-store-decode-map-key (table char key) +(defun quail-store-decode-map-key (table char key) (let ((elt (aref table char))) (if elt (if (consp elt) -- cgit v1.2.1 From 1e04da2a67d0a07133c67db3a011134ded7c266b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 6 Aug 2007 01:03:00 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 667d7ca793e..07a32b726c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-08-06 Kenichi Handa + + * international/quail.el: Wrap (require 'help-mode) by + eval-when-compile. + (quail-help-init): New function. + (quail-help): Call quail-help-init. + (quail-store-decode-map-key): Change it to a function. + 2007-08-05 Jason Rumney * vc.el (vc-rollback): Add norevert argument back. -- cgit v1.2.1 From 7a3bd0b6208132dcc8a21bc7fb65bbd4080a4190 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 6 Aug 2007 06:49:49 +0000 Subject: (resize-temp-buffer-window): Use window-full-width-p instead of comparing frame-width and window-width. --- lisp/help.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/help.el b/lisp/help.el index f75e26f93e6..4a94fd35bc7 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -958,14 +958,14 @@ This applies to `help', `apropos' and `completion' buffers, and some others." (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) (defun resize-temp-buffer-window () - "Resize the current window to fit its contents. + "Resize the selected window to fit its contents. Will not make it higher than `temp-buffer-max-height' nor smaller than `window-min-height'. Do nothing if it is the only window on its frame, if it is not as wide as the frame or if some of the window's contents are scrolled out of view." (unless (or (one-window-p 'nomini) (not (pos-visible-in-window-p (point-min))) - (/= (frame-width) (window-width))) + (not (window-full-width-p))) (fit-window-to-buffer (selected-window) (if (functionp temp-buffer-max-height) -- cgit v1.2.1 From 37176846f292e110019c68e1e020df3136f667a7 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 6 Aug 2007 06:50:09 +0000 Subject: * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in process-filter. --- lisp/ChangeLog | 5 +++++ lisp/net/ange-ftp.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07a32b726c3..0b3cd847348 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-06 Michael Albinus + + * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in + process-filter. + 2007-08-06 Kenichi Handa * international/quail.el: Wrap (require 'help-mode) by diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index fd7f0682622..c3d27d3d124 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4285,7 +4285,12 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") ;;;###autoload (defun ange-ftp-hook-function (operation &rest args) (let ((fn (get operation 'ange-ftp))) - (if fn (save-match-data (apply fn args)) + (if fn + ;; Catch also errors in process-filter. + (condition-case err + (let ((debug-on-error t)) + (save-match-data (apply fn args))) + (error (error (error-message-string err)))) (ange-ftp-run-real-handler operation args)))) ;; The following code is commented out because Tramp now deals with -- cgit v1.2.1 From 239a39ca00e657ab66e439976817f399ca1f4d13 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 6 Aug 2007 06:51:13 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5909a670ed3..32dbd532298 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-06 Martin Rudalics + + * help.el (resize-temp-buffer-window): Use window-full-width-p + instead of comparing frame-width and window-width. + 2007-08-05 Peter Povinec yahoo.com> (tiny change) * term.el: Honor term-default-fg-color and term-default-bg-color -- cgit v1.2.1 From 76ae6fd21ad9addc1ce3904aea2ddab90a0cd954 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 6 Aug 2007 06:57:31 +0000 Subject: * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in process-filter. --- lisp/ChangeLog | 5 +++++ lisp/net/ange-ftp.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32dbd532298..1806e72e650 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-06 Michael Albinus + + * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in + process-filter. + 2007-08-06 Martin Rudalics * help.el (resize-temp-buffer-window): Use window-full-width-p diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 310442d4012..a05d9126dcd 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4274,7 +4274,12 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") ;;;###autoload (defun ange-ftp-hook-function (operation &rest args) (let ((fn (get operation 'ange-ftp))) - (if fn (save-match-data (apply fn args)) + (if fn + ;; Catch also errors in process-filter. + (condition-case err + (let ((debug-on-error t)) + (save-match-data (apply fn args))) + (error (error (error-message-string err)))) (ange-ftp-run-real-handler operation args)))) ;; The following code is commented out because Tramp now deals with -- cgit v1.2.1 From 5c1c757af470dc5989023ae9792f11ad44197902 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 6 Aug 2007 07:22:20 +0000 Subject: *** empty log message *** --- lisp/net/ange-ftp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index c3d27d3d124..2f06344ccda 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4290,7 +4290,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (condition-case err (let ((debug-on-error t)) (save-match-data (apply fn args))) - (error (error (error-message-string err)))) + (error (signal (car err) (cdr err)))) (ange-ftp-run-real-handler operation args)))) ;; The following code is commented out because Tramp now deals with -- cgit v1.2.1 From d48b1aa522c9eb251abf94d5eb619d94249866e1 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 6 Aug 2007 07:23:39 +0000 Subject: *** empty log message *** --- lisp/net/ange-ftp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index a05d9126dcd..67835c294fd 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4279,7 +4279,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (condition-case err (let ((debug-on-error t)) (save-match-data (apply fn args))) - (error (error (error-message-string err)))) + (error (signal (car err) (cdr err)))) (ange-ftp-run-real-handler operation args)))) ;; The following code is commented out because Tramp now deals with -- cgit v1.2.1 From 3fd48fbb859ce1d9a598642cb7cdd7cd6eb78240 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 6 Aug 2007 11:03:18 +0000 Subject: (menu-bar-vc-filter): Use vc-call-backend. --- lisp/menu-bar.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 48f4613287b..8bc0bd86a41 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1170,7 +1170,7 @@ mail status in mode line")) (defun menu-bar-vc-filter (orig-binding) (let ((ext-binding - (if vc-mode (vc-call 'extra-menu buffer-file-name)))) + (if vc-mode (vc-call-backend (vc-backend buffer-file-name) 'extra-menu)))) ;; Give the VC backend a chance to add menu entries ;; specific for that backend. (if (null ext-binding) -- cgit v1.2.1 From 47c2b95320f4bc40d568d39353830a8f9fcc0f37 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 6 Aug 2007 11:03:35 +0000 Subject: (vc-call): Add doc string. --- lisp/vc-hooks.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 09001e59691..d38bc000465 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -279,7 +279,10 @@ It is usually called via the `vc-call' macro." (t (apply f args))))) (defmacro vc-call (fun file &rest args) - ;; BEWARE!! `file' is evaluated twice!! + "A convenience macro for calling VC backend functions. +Functions called by this macro must accept FILE as the first argument. +ARGS specifies any additional arguments. FUN should be unquoted. +BEWARE!! `file' is evaluated twice!!" `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) (defsubst vc-parse-buffer (pattern i) -- cgit v1.2.1 From b162cd4109f4124471e0dbd7aa35ca6c86e6b4b1 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 6 Aug 2007 11:03:50 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b3cd847348..fb16a4f01d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-06 Jason Rumney + + * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend. + + * vc-hooks.el (vc-call): Add doc string. + 2007-08-06 Michael Albinus * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in -- cgit v1.2.1 From d6197871313497313813bc3dca0b6237e4207b3d Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Mon, 6 Aug 2007 12:34:45 +0000 Subject: Docstring fix --- lisp/ChangeLog | 4 ++++ lisp/printing.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb16a4f01d3..7bdba8d41bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-06 Vinicius Jose Latorre + + * printing.el (pr-update-menus): Docstring fix. + 2007-08-06 Jason Rumney * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend. diff --git a/lisp/printing.el b/lisp/printing.el index 5ab1c9baee3..a4b4c4217ed 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -5195,9 +5195,9 @@ See `pr-visible-entry-alist'.") If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist', `pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not; -otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is -non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is -non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is +otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is +non-nil, update text printer menu if `pr-txt-printer-menu-modified' is +non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is non-nil. If menu binding was not done, calls `pr-menu-bind'." -- cgit v1.2.1 From 7f8d3019c125bf9ff05d867ebb23a51181f35357 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Aug 2007 16:20:10 +0000 Subject: (tpu-before-save-hook): Rename from tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. (newline, newline-and-indent, do-auto-fill): Use advice instead of redefining the function. (tpu-set-scroll-margins): Activate the pieces of advice. --- lisp/ChangeLog | 10 ++++++- lisp/emulation/tpu-extras.el | 70 +++++++++++++++++--------------------------- 2 files changed, 36 insertions(+), 44 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1806e72e650..dd738668a32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2007-08-06 Stefan Monnier + + * emulation/tpu-extras.el (tpu-before-save-hook): Rename from + tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. + (newline, newline-and-indent, do-auto-fill): Use advice instead of + redefining the function. + (tpu-set-scroll-margins): Activate the pieces of advice. + 2007-08-06 Michael Albinus * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in @@ -12,7 +20,7 @@ * term.el: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. - (term-default-fg-color, term-default-bg-color): Initialized from + (term-default-fg-color, term-default-bg-color): Initialize from default term-current-face. (term-mode, term-reset-terminal): Set term-current-face with term-default-fg-color and term-default-bg-color. diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 019896c0eb2..609ce2e203b 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -141,13 +141,11 @@ the previous line when starting from a line beginning." (add-hook 'picture-mode-hook 'tpu-set-cursor-free) -(defun tpu-write-file-hook nil +(defun tpu-before-save-hook () "Eliminate whitespace at ends of lines, if the cursor is free." (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) -(or (memq 'tpu-write-file-hook write-file-functions) - (setq write-file-functions - (cons 'tpu-write-file-hook write-file-functions))) +(add-hook 'before-save-hook 'tpu-before-save-hook) ;;; Utility routines for implementing scroll margins @@ -246,7 +244,7 @@ Accepts a prefix argument for the number of lines to move." (end-of-line (- 1 num)))) (tpu-top-check beg num))) -(defun tpu-current-end-of-line nil +(defun tpu-current-end-of-line () "Move point to end of current line." (interactive) (let ((beg (point))) @@ -392,41 +390,24 @@ A repeat count means scroll that many sections." -;;; Replace the newline, newline-and-indent, and do-auto-fill functions - -(or (fboundp 'tpu-old-newline) - (fset 'tpu-old-newline (symbol-function 'newline))) -(or (fboundp 'tpu-old-do-auto-fill) - (fset 'tpu-old-do-auto-fill (symbol-function 'do-auto-fill))) -(or (fboundp 'tpu-old-newline-and-indent) - (fset 'tpu-old-newline-and-indent (symbol-function 'newline-and-indent))) - -(defun newline (&optional num) - "Insert a newline. With arg, insert that many newlines. -In Auto Fill mode, can break the preceding line if no numeric arg. -This is the TPU-edt version that respects the bottom scroll margin." - (interactive "p") - (let ((beg (tpu-current-line))) - (or num (setq num 1)) - (tpu-old-newline num) +;; Advise the newline, newline-and-indent, and do-auto-fill functions. +(defadvice newline (around tpu-respect-bottom-scroll-margin activate disable) + "Respect `tpu-bottom-scroll-margin'." + (let ((beg (tpu-current-line)) + (num (prefix-numeric-value (ad-get-arg 0)))) + ad-do-it (tpu-bottom-check beg num))) -(defun newline-and-indent nil - "Insert a newline, then indent according to major mode. -Indentation is done using the current indent-line-function. -In programming language modes, this is the same as TAB. -In some text modes, where TAB inserts a tab, this indents -to the specified left-margin column. This is the TPU-edt -version that respects the bottom scroll margin." - (interactive) +(defadvice newline-and-indent (around tpu-respect-bottom-scroll-margin) + "Respect `tpu-bottom-scroll-margin'." (let ((beg (tpu-current-line))) - (tpu-old-newline-and-indent) + ad-do-it (tpu-bottom-check beg 1))) -(defun do-auto-fill nil - "TPU-edt version that respects the bottom scroll margin." +(defadvice do-auto-fill (around tpu-respect-bottom-scroll-margin) + "Respect `tpu-bottom-scroll-margin'." (let ((beg (tpu-current-line))) - (tpu-old-do-auto-fill) + ad-do-it (tpu-bottom-check beg 1))) @@ -440,18 +421,21 @@ version that respects the bottom scroll margin." \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") ;; set top scroll margin (or (string= top "") - (if (string= "%" (substring top -1)) - (setq tpu-top-scroll-margin (string-to-number top)) - (setq tpu-top-scroll-margin + (setq tpu-top-scroll-margin + (if (string= "%" (substring top -1)) + (string-to-number top) (/ (1- (+ (* (string-to-number top) 100) (window-height))) (window-height))))) ;; set bottom scroll margin (or (string= bottom "") - (if (string= "%" (substring bottom -1)) - (setq tpu-bottom-scroll-margin (string-to-number bottom)) - (setq tpu-bottom-scroll-margin + (setq tpu-bottom-scroll-margin + (if (string= "%" (substring bottom -1)) + (string-to-number bottom) (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) (window-height))))) + (dolist (f '(newline newline-and-indent do-auto-fill)) + (ad-enable-advice f 'around 'tpu-respect-bottom-scroll-margin) + (ad-activate f)) ;; report scroll margin settings if running interactively (and (interactive-p) (message "Scroll margins set. Top = %s%%, Bottom = %s%%" @@ -461,7 +445,7 @@ version that respects the bottom scroll margin." ;;; Functions to set cursor bound or free ;;;###autoload -(defun tpu-set-cursor-free nil +(defun tpu-set-cursor-free () "Allow the cursor to move freely about the screen." (interactive) (setq tpu-cursor-free t) @@ -471,7 +455,7 @@ version that respects the bottom scroll margin." (message "The cursor will now move freely about the screen.")) ;;;###autoload -(defun tpu-set-cursor-bound nil +(defun tpu-set-cursor-bound () "Constrain the cursor to the flow of the text." (interactive) (tpu-trim-line-ends) @@ -481,5 +465,5 @@ version that respects the bottom scroll margin." GOLD-map) (message "The cursor is now bound to the flow of your text.")) -;;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a +;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a ;;; tpu-extras.el ends here -- cgit v1.2.1 From 55daf8dbc32b51834d17dcebf4342ed193d779f6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Aug 2007 16:21:33 +0000 Subject: (tpu-current-line): Use posn-at-point and count-screen-lines. (tpu-edt-off): Disable relevant pieces of advice. --- lisp/ChangeLog | 4 ++++ lisp/emulation/tpu-edt.el | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dd738668a32..05a6ac70376 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-08-06 Stefan Monnier + * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and + count-screen-lines. + (tpu-edt-off): Disable relevant pieces of advice. + * emulation/tpu-extras.el (tpu-before-save-hook): Rename from tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. (newline, newline-and-indent, do-auto-fill): Use advice instead of diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index 414ae7bf14e..9220090df25 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -826,10 +826,13 @@ Create the key map if necessary." (use-local-map tpu-buffer-local-map))) (local-set-key key func)) -(defun tpu-current-line nil +(defun tpu-current-line () "Return the vertical position of point in the selected window. Top line is 0. Counts each text line only once, even if it wraps." - (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1)) + (or + (cdr (nth 6 (posn-at-point))) + (if (eq (window-start) (point)) 0 + (1- (count-screen-lines (window-start) (point) 'count-final-newline))))) ;;; @@ -2479,6 +2482,7 @@ If FILE is nil, try to load a default file. The default file names are (if (eq tpu-global-map parent) (set-keymap-parent map (keymap-parent parent)) (setq map parent))))) + (ad-disable-regexp "\\`tpu-") (setq tpu-edt-mode nil)) (provide 'tpu-edt) -- cgit v1.2.1 From bca329a8fad5e1860ccf7e7cd30667490be6ac84 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Mon, 6 Aug 2007 17:19:26 +0000 Subject: (mouse-buffer-menu): Pass mode-name through format-mode-line because it may be a list, e.g., (sgml-xml-mode "XML" "SGML"), and not a string. --- lisp/ChangeLog | 6 ++++++ lisp/mouse.el | 38 +++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bdba8d41bb..fe8df86bd58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-06 Sam Steingold + + * mouse.el (mouse-buffer-menu): Pass mode-name through + format-mode-line because it may be a list, + e.g., (sgml-xml-mode "XML" "SGML"), and not a string. + 2007-08-06 Vinicius Jose Latorre * printing.el (pr-update-menus): Docstring fix. diff --git a/lisp/mouse.el b/lisp/mouse.el index cbbaf73fcbb..27c5dd901f7 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1814,27 +1814,23 @@ and selects that window." (mouse-minibuffer-check event) (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). - (let ((tail buffers)) - (while tail - ;; Divide all buffers into buckets for various major modes. - ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). - (with-current-buffer (car tail) - (let* ((adjusted-major-mode major-mode) elt) - (let ((tail mouse-buffer-menu-mode-groups)) - (while tail - (if (string-match (car (car tail)) mode-name) - (setq adjusted-major-mode (cdr (car tail)))) - (setq tail (cdr tail)))) - (setq elt (assoc adjusted-major-mode split-by-major-mode)) - (if (null elt) - (setq elt (list adjusted-major-mode - (if (stringp adjusted-major-mode) - adjusted-major-mode - mode-name)) - split-by-major-mode (cons elt split-by-major-mode))) - (or (memq (car tail) (cdr (cdr elt))) - (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt))))))) - (setq tail (cdr tail)))) + (dolist (buf buffers) + ;; Divide all buffers into buckets for various major modes. + ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). + (with-current-buffer buf + (let* ((adjusted-major-mode major-mode) elt) + (dolist (group mouse-buffer-menu-mode-groups) + (when (string-match (car group) (format-mode-line mode-name)) + (setq adjusted-major-mode (cdr group)))) + (setq elt (assoc adjusted-major-mode split-by-major-mode)) + (unless elt + (setq elt (list adjusted-major-mode + (if (stringp adjusted-major-mode) + adjusted-major-mode + mode-name)) + split-by-major-mode (cons elt split-by-major-mode))) + (or (memq buf (cdr (cdr elt))) + (setcdr (cdr elt) (cons buf (cdr (cdr elt)))))))) ;; Compute the sum of squares of sizes of the major-mode buckets. (let ((tail split-by-major-mode)) (setq sum-of-squares 0) -- cgit v1.2.1 From 9cb7a414fe5605811dbc98da33c277ef2a261eb9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Aug 2007 20:08:08 +0000 Subject: (diff-unified->context, diff-reverse-direction, diff-fixup-modifs): Typo in docstring. --- lisp/ChangeLog | 3 +++ lisp/diff-mode.el | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05a6ac70376..fc78e377e49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-08-06 Stefan Monnier + * diff-mode.el (diff-unified->context, diff-reverse-direction) + (diff-fixup-modifs): Typo in docstring. + * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and count-screen-lines. (tpu-edt-off): Disable relevant pieces of advice. diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f2800f1c337..e0aee67a62b 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -685,7 +685,7 @@ PREFIX is only used internally: don't use it." (defun diff-unified->context (start end) "Convert unified diffs to context diffs. START and END are either taken from the region (if a prefix arg is given) or -else cover the whole bufer." +else cover the whole buffer." (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) @@ -847,7 +847,7 @@ With a prefix argument, convert unified format to context format." (defun diff-reverse-direction (start end) "Reverse the direction of the diffs. START and END are either taken from the region (if a prefix arg is given) or -else cover the whole bufer." +else cover the whole buffer." (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) @@ -909,7 +909,7 @@ else cover the whole bufer." (defun diff-fixup-modifs (start end) "Fixup the hunk headers (in case the buffer was modified). START and END are either taken from the region (if a prefix arg is given) or -else cover the whole bufer." +else cover the whole buffer." (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) -- cgit v1.2.1 From d3cbab3a28e4da07fdad28a0b9047df16f6c497b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Aug 2007 20:08:55 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc78e377e49..c0d5d4d0bc2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,10 @@ -2007-08-06 Stefan Monnier +2007-08-06 Tom Tromey * diff-mode.el (diff-unified->context, diff-reverse-direction) (diff-fixup-modifs): Typo in docstring. +2007-08-06 Stefan Monnier + * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and count-screen-lines. (tpu-edt-off): Disable relevant pieces of advice. -- cgit v1.2.1 From e374b65ff39c620a7d31c1b667c7ea9570e354a3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Aug 2007 21:17:34 +0000 Subject: (vc-bzr-registered): Gracefully handle missing "bzr" program, and return nil (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil. (vc-bzr-state): Look for path names relative to the repository root after status keyword. (vc-bzr-file-name-relative): New function. (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths depend on it. (vc-bzr-admin-dirname, ...-checkout-format-file) (...-branch-format-file, ...-revhistory): Paths to some Bzr internal files that we now parse directly for speed. (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness. (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists. (vc-bzr-state): "bzr status" successful only if exitcode is 0 (vc-bzr-root): Use `vc-bzr-shell-command'. Stderr may contain Bzr warnings, so we must discard it. (vc-bzr-workfile-version): Speedup counting lines from `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno" if that file doesn't exist. (vc-bzr-responsible-p): Use `vc-bzr-root' instead of `vc-bzr-root-dir' for speed. add `vc-bzr-admin-dirname' (not ".bzr"!) to `vc-directory-exclusion-list' (vc-bzr-shell-command): New function. --- lisp/ChangeLog | 26 ++++++++++++++++++++++++++ lisp/vc-bzr.el | Bin 21032 -> 23605 bytes 2 files changed, 26 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c0d5d4d0bc2..461c59e8c53 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,29 @@ +2007-08-06 Riccardo Murri + + * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr" + program, and return nil + (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil. + (vc-bzr-state): Look for path names relative to the repository + root after status keyword. + (vc-bzr-file-name-relative): New function. + (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths + depend on it. + (vc-bzr-admin-dirname, ...-checkout-format-file) + (...-branch-format-file, ...-revhistory): Paths to some Bzr internal + files that we now parse directly for speed. + (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness. + (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists. + (vc-bzr-state): "bzr status" successful only if exitcode is 0 + (vc-bzr-root): Use `vc-bzr-shell-command'. Stderr may contain + Bzr warnings, so we must discard it. + (vc-bzr-workfile-version): Speedup counting lines from + `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno" + if that file doesn't exist. + (vc-bzr-responsible-p): Use `vc-bzr-root' instead of + `vc-bzr-root-dir' for speed. + add `vc-bzr-admin-dirname' (not ".bzr"!) to `vc-directory-exclusion-list' + (vc-bzr-shell-command): New function. + 2007-08-06 Tom Tromey * diff-mode.el (diff-unified->context, diff-reverse-direction) diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index c2128de90c9..907bcc5200c 100644 Binary files a/lisp/vc-bzr.el and b/lisp/vc-bzr.el differ -- cgit v1.2.1 From 56974614ac692ec8cc4432e800e2815e2f7bf1b7 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Mon, 6 Aug 2007 23:33:37 +0000 Subject: Returning back printing.el --- lisp/ChangeLog | 5 - lisp/printing.el | 916 +++++++++++++++++++++++++++---------------------------- 2 files changed, 447 insertions(+), 474 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 461c59e8c53..9dde41dc692 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -65,11 +65,6 @@ term-default-fg/bg-color instead of ansi-term-color-vector when the index (term-ansi-current-color or term-ansi-current-bg-color) is zero. -2007-08-05 Vinicius Jose Latorre - - * printing.el: Require lpr and ps-print when loading printing package. - Reported by Glenn Morris . - 2007-08-05 Michael Albinus * files.el (set-auto-mode): Handle also remote files wrt diff --git a/lisp/printing.el b/lisp/printing.el index 5ab1c9baee3..f84a2112661 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -6,11 +6,11 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 6.9.1 +;; Version: 6.8.4 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst pr-version "6.9.1" - "printing.el, v 6.9.1 <2007/08/02 vinicius> +(defconst pr-version "6.8.4" + "printing.el, v 6.8.4 <2005/06/11 vinicius> Please send all bug fixes and enhancements to Vinicius Jose Latorre @@ -1093,457 +1093,46 @@ If SUFFIX is non-nil, add that at the end of the file name." (set-default-file-modes umask))))) - -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; XEmacs Definitions - +;; GNU Emacs +(defalias 'pr-e-frame-char-height 'frame-char-height) +(defalias 'pr-e-frame-char-width 'frame-char-width) +(defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) +;; XEmacs +(defalias 'pr-x-add-submenu 'add-submenu) +(defalias 'pr-x-event-function 'event-function) +(defalias 'pr-x-event-object 'event-object) +(defalias 'pr-x-find-menu-item 'find-menu-item) +(defalias 'pr-x-font-height 'font-height) +(defalias 'pr-x-font-width 'font-width) +(defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) +(defalias 'pr-x-make-event 'make-event) +(defalias 'pr-x-misc-user-event-p 'misc-user-event-p) +(defalias 'pr-x-relabel-menu-item 'relabel-menu-item) +(defalias 'pr-x-event-x-pixel 'event-x-pixel) +(defalias 'pr-x-event-y-pixel 'event-y-pixel) (cond ((featurep 'xemacs) ; XEmacs - ;; XEmacs + (defvar current-menubar nil) + (defvar current-mouse-event nil) + (defvar zmacs-region-stays nil) (defalias 'pr-f-set-keymap-parents 'set-keymap-parents) (defalias 'pr-f-set-keymap-name 'set-keymap-name) - - ;; XEmacs (defun pr-f-read-string (prompt initial history default) (let ((str (read-string prompt initial))) (if (and str (not (string= str ""))) str default))) - - ;; XEmacs - (defvar zmacs-region-stays nil) - - ;; XEmacs (defun pr-keep-region-active () - (setq zmacs-region-stays t)) - - ;; XEmacs - (defun pr-region-active-p () - (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))) - - ;; XEmacs - (defun pr-menu-char-height () - (font-height (face-font 'default))) - - ;; XEmacs - (defun pr-menu-char-width () - (font-width (face-font 'default))) - - ;; XEmacs - (defmacro pr-xemacs-global-menubar (&rest body) - `(save-excursion - (let ((temp (get-buffer-create (make-temp-name " *Temp")))) - ;; be sure to access global menubar - (set-buffer temp) - ,@body - (kill-buffer temp)))) - - ;; XEmacs - (defun pr-global-menubar (pr-menu-spec) - ;; Menu binding - (pr-xemacs-global-menubar - (add-submenu nil (cons "Printing" pr-menu-spec) "Apps")) - (setq pr-menu-print-item nil)) + (setq zmacs-region-stays t))) - ;; XEmacs - (defvar current-mouse-event nil) - (defun pr-menu-position (entry index horizontal) - (make-event - 'button-release - (list 'button 1 - 'x (- (event-x-pixel current-mouse-event) ; X - (* horizontal pr-menu-char-width)) - 'y (- (event-y-pixel current-mouse-event) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))))) - - (defvar pr-menu-position nil) - (defvar pr-menu-state nil) - - ;; XEmacs - (defvar current-menubar nil) ; to avoid compilation gripes - (defun pr-menu-lookup (path) - (car (find-menu-item current-menubar (cons "Printing" path)))) - - ;; XEmacs - (defun pr-menu-lock (entry index horizontal state path) - (when pr-menu-lock - (or (and pr-menu-position (eq state pr-menu-state)) - (setq pr-menu-position (pr-menu-position entry index horizontal) - pr-menu-state state)) - (let* ((menu (pr-menu-lookup path)) - (result (get-popup-menu-response menu pr-menu-position))) - (and (misc-user-event-p result) - (funcall (event-function result) - (event-object result)))) - (setq pr-menu-position nil))) - - ;; XEmacs - (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) - - ;; XEmacs - (defvar pr-ps-name-old "PostScript Printers") - (defvar pr-txt-name-old "Text Printers") - (defvar pr-ps-utility-old "PostScript Utility") - (defvar pr-even-or-odd-old "Print All Pages") - - ;; XEmacs - (defun pr-do-update-menus (&optional force) - (pr-menu-alist pr-ps-printer-alist - 'pr-ps-name - 'pr-menu-set-ps-title - '("Printing") - 'pr-ps-printer-menu-modified - force - pr-ps-name-old - 'postscript 2) - (pr-menu-alist pr-txt-printer-alist - 'pr-txt-name - 'pr-menu-set-txt-title - '("Printing") - 'pr-txt-printer-menu-modified - force - pr-txt-name-old - 'text 2) - (let ((save-var pr-ps-utility-menu-modified)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("Printing" "PostScript Print" "File") - 'save-var - force - pr-ps-utility-old - nil 1)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("Printing" "PostScript Preview" "File") - 'pr-ps-utility-menu-modified - force - pr-ps-utility-old - nil 1) - (pr-even-or-odd-pages ps-even-or-odd-pages force)) - - ;; XEmacs - (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name - entry index) - (when (and alist (or force (symbol-value modified-sym))) - (pr-xemacs-global-menubar - (add-submenu menu-path - (pr-menu-create name alist var-sym - fun entry index))) - (funcall fun (symbol-value var-sym)) - (set modified-sym nil))) - - ;; XEmacs - (defun pr-relabel-menu-item (newname var-sym) - (pr-xemacs-global-menubar - (relabel-menu-item - (list "Printing" (symbol-value var-sym)) - newname) - (set var-sym newname))) - - ;; XEmacs - (defun pr-menu-set-ps-title (value &optional item entry index) - (pr-relabel-menu-item (format "PostScript Printer: %s" value) - 'pr-ps-name-old) - (pr-ps-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; XEmacs - (defun pr-menu-set-txt-title (value &optional item entry index) - (pr-relabel-menu-item (format "Text Printer: %s" value) - 'pr-txt-name-old) - (pr-txt-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; XEmacs - (defun pr-menu-set-utility-title (value &optional item entry index) - (pr-xemacs-global-menubar - (let ((newname (format "%s" value))) - (relabel-menu-item - (list "Printing" "PostScript Print" "File" pr-ps-utility-old) - newname) - (relabel-menu-item - (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) - newname) - (setq pr-ps-utility-old newname))) - (pr-ps-set-utility value) - (and index - (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) - - ;; XEmacs - (defun pr-even-or-odd-pages (value &optional no-lock) - (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) - 'pr-even-or-odd-old) - (setq ps-even-or-odd-pages value) - (or no-lock - (pr-menu-lock 'postscript-options 8 12 'toggle nil))) - - ) - (t ; GNU Emacs - ;; Do nothing - )) ; end cond featurep - - - -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; GNU Emacs Definitions - - -(cond - ((featurep 'xemacs) ; XEmacs - ;; Do nothing - ) (t ; GNU Emacs - ;; GNU Emacs + (defvar deactivate-mark nil) (defalias 'pr-f-set-keymap-parents 'set-keymap-parent) (defalias 'pr-f-set-keymap-name 'ignore) (defalias 'pr-f-read-string 'read-string) - - ;; GNU Emacs - (defvar deactivate-mark) - - ;; GNU Emacs (defun pr-keep-region-active () - (setq deactivate-mark nil)) - - ;; GNU Emacs - (defun pr-region-active-p () - (and pr-auto-region transient-mark-mode mark-active)) - - ;; GNU Emacs - (defun pr-menu-char-height () - (frame-char-height)) - - ;; GNU Emacs - (defun pr-menu-char-width () - (frame-char-width)) - - ;; GNU Emacs - ;; Menu binding - ;; Replace existing "print" item by "Printing" item. - ;; If you're changing this file, you'll load it a second, - ;; third... time, but "print" item exists only in the first load. - (eval-and-compile - (cond - ;; GNU Emacs 20 - ((< emacs-major-version 21) - (defun pr-global-menubar (pr-menu-spec) - (require 'easymenu) - (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) - (when pr-menu-print-item - (easy-menu-remove-item nil '("tools") pr-menu-print-item) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar 'tools - (pr-get-symbol "Printing"))))) - ) - ;; GNU Emacs 21 & 22 - (t - (defun pr-global-menubar (pr-menu-spec) - (require 'easymenu) - (let ((menu-file (if (= emacs-major-version 21) - '("menu-bar" "files") ; GNU Emacs 21 - '("menu-bar" "file")))) ; GNU Emacs 22 or higher - (cond - (pr-menu-print-item - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" pr-menu-spec) - "print-buffer") - (dolist (item '("print-buffer" "print-region" - "ps-print-buffer-faces" "ps-print-region-faces" - "ps-print-buffer" "ps-print-region")) - (easy-menu-remove-item global-map menu-file item)) - (setq pr-menu-print-item nil - pr-menu-bar (vector 'menu-bar - (pr-get-symbol (nth 1 menu-file)) - (pr-get-symbol "Print")))) - (t - (easy-menu-add-item global-map menu-file - (easy-menu-create-menu "Print" pr-menu-spec))) - ))) - ))) - - (eval-and-compile - (cond - (ps-windows-system - ;; GNU Emacs for Windows 9x/NT - (defun pr-menu-position (entry index horizontal) - (let ((pos (cdr (mouse-pixel-position)))) - (list - (list (or (car pos) 0) ; X - (- (or (cdr pos) 0) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))) - (selected-frame)))) ; frame - ) - (t - ;; GNU Emacs - (defun pr-menu-position (entry index horizontal) - (let ((pos (cdr (mouse-pixel-position)))) - (list - (list (- (or (car pos) 0) ; X - (* horizontal pr-menu-char-width)) - (- (or (cdr pos) 0) ; Y - (* (pr-menu-index entry index) pr-menu-char-height))) - (selected-frame)))) ; frame - ))) - - (defvar pr-menu-position nil) - (defvar pr-menu-state nil) - - ;; GNU Emacs - (defun pr-menu-lookup (path) - (lookup-key global-map - (if path - (vconcat pr-menu-bar - (mapcar 'pr-get-symbol - (if (listp path) - path - (list path)))) - pr-menu-bar))) - - ;; GNU Emacs - (defun pr-menu-lock (entry index horizontal state path) - (when pr-menu-lock - (or (and pr-menu-position (eq state pr-menu-state)) - (setq pr-menu-position (pr-menu-position entry index horizontal) - pr-menu-state state)) - (let* ((menu (pr-menu-lookup path)) - (result (x-popup-menu pr-menu-position menu))) - (and result - (let ((command (lookup-key menu (vconcat result)))) - (if (fboundp command) - (funcall command) - (eval command))))) - (setq pr-menu-position nil))) - - ;; GNU Emacs - (defalias 'pr-update-mode-line 'force-mode-line-update) - - ;; GNU Emacs - (defun pr-do-update-menus (&optional force) - (pr-menu-alist pr-ps-printer-alist - 'pr-ps-name - 'pr-menu-set-ps-title - "PostScript Printers" - 'pr-ps-printer-menu-modified - force - "PostScript Printers" - 'postscript 2) - (pr-menu-alist pr-txt-printer-alist - 'pr-txt-name - 'pr-menu-set-txt-title - "Text Printers" - 'pr-txt-printer-menu-modified - force - "Text Printers" - 'text 2) - (let ((save-var pr-ps-utility-menu-modified)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("PostScript Print" "File" "PostScript Utility") - 'save-var - force - "PostScript Utility" - nil 1)) - (pr-menu-alist pr-ps-utility-alist - 'pr-ps-utility - 'pr-menu-set-utility-title - '("PostScript Preview" "File" "PostScript Utility") - 'pr-ps-utility-menu-modified - force - "PostScript Utility" - nil 1) - (pr-even-or-odd-pages ps-even-or-odd-pages force)) - - ;; GNU Emacs - (defun pr-menu-get-item (name-list) - ;; NAME-LIST is a string or a list of strings. - (or (listp name-list) - (setq name-list (list name-list))) - (and name-list - (let* ((reversed (reverse name-list)) - (name (pr-get-symbol (car reversed))) - (path (nreverse (cdr reversed))) - (menu (lookup-key - global-map - (vconcat pr-menu-bar - (mapcar 'pr-get-symbol path))))) - (assq name (nthcdr 2 menu))))) - - ;; GNU Emacs - (defvar pr-temp-menu nil) - - ;; GNU Emacs - (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name - entry index) - (when (and alist (or force (symbol-value modified-sym))) - (easy-menu-define pr-temp-menu nil "" - (pr-menu-create name alist var-sym fun entry index)) - (let ((item (pr-menu-get-item menu-path))) - (and item - (let* ((binding (nthcdr 3 item)) - (key-binding (cdr binding))) - (setcar binding pr-temp-menu) - (and key-binding (listp (car key-binding)) - (setcdr binding (cdr key-binding))) ; skip KEY-BINDING - (funcall fun (symbol-value var-sym) item)))) - (set modified-sym nil))) - - ;; GNU Emacs - (defun pr-menu-set-item-name (item name) - (and item - (setcar (nthcdr 2 item) name))) ; ITEM-NAME - - ;; GNU Emacs - (defun pr-menu-set-ps-title (value &optional item entry index) - (pr-menu-set-item-name (or item - (pr-menu-get-item "PostScript Printers")) - (format "PostScript Printer: %s" value)) - (pr-ps-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; GNU Emacs - (defun pr-menu-set-txt-title (value &optional item entry index) - (pr-menu-set-item-name (or item - (pr-menu-get-item "Text Printers")) - (format "Text Printer: %s" value)) - (pr-txt-set-printer value) - (and index - (pr-menu-lock entry index 12 'toggle nil))) - - ;; GNU Emacs - (defun pr-menu-set-utility-title (value &optional item entry index) - (let ((name (symbol-name value))) - (if item - (pr-menu-set-item-name item name) - (pr-menu-set-item-name - (pr-menu-get-item - '("PostScript Print" "File" "PostScript Utility")) - name) - (pr-menu-set-item-name - (pr-menu-get-item - '("PostScript Preview" "File" "PostScript Utility")) - name))) - (pr-ps-set-utility value) - (and index - (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) - - ;; GNU Emacs - (defun pr-even-or-odd-pages (value &optional no-lock) - (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") - (cdr (assq value pr-even-or-odd-alist))) - (setq ps-even-or-odd-pages value) - (or no-lock - (pr-menu-lock 'postscript-options 8 12 'toggle nil))) - - )) ; end cond featurep + (setq deactivate-mark nil)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2003,7 +1592,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE . VALUE) - Which associates VARIABLE with VALUE. When this entry is + That associates VARIABLE with VALUE. when this entry is selected, it's executed the following command: (set VARIABLE (eval VALUE)) @@ -2558,7 +2147,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE-SYM . VALUE) - Which associates VARIABLE-SYM with VALUE. When this entry is + That associates VARIABLE-SYM with VALUE. when this entry is selected, it's executed the following command: (set (make-local-variable VARIABLE-SYM) (eval VALUE)) @@ -2738,7 +2327,7 @@ DEFAULT It's a way to set default values when this entry is selected. (VARIABLE . VALUE) - Which associates VARIABLE with VALUE. When this entry is + That associates VARIABLE with VALUE. when this entry is selected, it's executed the following command: (set VARIABLE (eval VALUE)) @@ -2863,7 +2452,11 @@ See also `pr-menu-char-height' and `pr-menu-char-width'." :group 'printing) -(defcustom pr-menu-char-height (pr-menu-char-height) +(defcustom pr-menu-char-height + (cond ((featurep 'xemacs) ; XEmacs + (pr-x-font-height (face-font 'default))) + (t ; GNU Emacs + (pr-e-frame-char-height))) "*Specify menu char height in pixels. This variable is used to guess which vertical position should be locked the @@ -2875,7 +2468,11 @@ See also `pr-menu-lock' and `pr-menu-char-width'." :group 'printing) -(defcustom pr-menu-char-width (pr-menu-char-width) +(defcustom pr-menu-char-width + (cond ((featurep 'xemacs) ; XEmacs + (pr-x-font-width (face-font 'default))) + (t ; GNU Emacs + (pr-e-frame-char-width))) "*Specify menu char width in pixels. This variable is used to guess which horizontal position should be locked the @@ -2947,7 +2544,7 @@ SETTING It's a cons like: (VARIABLE . VALUE) - Which associates VARIABLE with VALUE. When this entry is + That associates VARIABLE with VALUE. when this entry is selected, it's executed the following command: * If LOCAL is non-nil: @@ -3175,6 +2772,15 @@ See `pr-ps-printer-alist'.") ;; Keys & Menus +(defmacro pr-xemacs-global-menubar (&rest body) + `(save-excursion + (let ((temp (get-buffer-create (make-temp-name " *Temp")))) + ;; be sure to access global menubar + (set-buffer temp) + ,@body + (kill-buffer temp)))) + + (defsubst pr-visible-p (key) (memq key pr-visible-entry-list)) @@ -3196,6 +2802,16 @@ See `pr-ps-printer-alist'.") 'easy-menu-intern (lambda (s) (if (stringp s) (intern s) s)))) +(cond + ((featurep 'xemacs) ; XEmacs + (defvar zmacs-region-stays nil) ; to avoid compilation gripes + (defun pr-region-active-p () + (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))) + + (t ; GNU Emacs + (defun pr-region-active-p () + (and pr-auto-region transient-mark-mode mark-active)))) + (defconst pr-menu-spec ;; Menu mapping: @@ -3454,7 +3070,51 @@ menu. Calls `pr-update-menus' to adjust menus." (interactive) - (pr-global-menubar pr-menu-spec) + (cond + ((featurep 'xemacs) ; XEmacs + ;; Menu binding + (pr-xemacs-global-menubar + (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps")) + (setq pr-menu-print-item nil)) + + + (t ; GNU Emacs + ;; Menu binding + (require 'easymenu) + ;; Replace existing "print" item by "Printing" item. + ;; If you're changing this file, you'll load it a second, + ;; third... time, but "print" item exists only in the first load. + (cond + ;; Emacs 20 + ((< emacs-major-version 21) + (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) + (when pr-menu-print-item + (easy-menu-remove-item nil '("tools") pr-menu-print-item) + (setq pr-menu-print-item nil + pr-menu-bar (vector 'menu-bar 'tools + (pr-get-symbol "Printing"))))) + ;; Emacs 21 & 22 + (t + (let ((menu-file (if (= emacs-major-version 21) + '("menu-bar" "files") ; Emacs 21 + '("menu-bar" "file")))) ; Emacs 22 or higher + (cond + (pr-menu-print-item + (easy-menu-add-item global-map menu-file + (easy-menu-create-menu "Print" pr-menu-spec) + "print-buffer") + (dolist (item '("print-buffer" "print-region" + "ps-print-buffer-faces" "ps-print-region-faces" + "ps-print-buffer" "ps-print-region")) + (easy-menu-remove-item global-map menu-file item)) + (setq pr-menu-print-item nil + pr-menu-bar (vector 'menu-bar + (pr-get-symbol (nth 1 menu-file)) + (pr-get-symbol "Print")))) + (t + (easy-menu-add-item global-map menu-file + (easy-menu-create-menu "Print" pr-menu-spec))) + )))))) (pr-update-menus t)) @@ -5158,27 +4818,115 @@ Each element has the form: See `pr-visible-entry-alist'.") -(defun pr-menu-index (entry index) - (let ((base-list - (cond ((eq entry 'text) - '(postscript)) - ((eq entry 'postscript-options) - '(postscript text)) - ((eq entry 'postscript-process) - '(postscript text postscript-options)) - ((eq entry 'printing) - '(postscript text postscript-options postscript-process)) - (t - nil) - )) - key) - (while base-list - (setq key (car base-list) - base-list (cdr base-list)) - (and (pr-visible-p key) - (setq index (+ index - (cdr (assq key pr-menu-entry-alist))))))) - (+ index 2)) +(defun pr-menu-index (entry index) + (let ((base-list + (cond ((eq entry 'text) + '(postscript)) + ((eq entry 'postscript-options) + '(postscript text)) + ((eq entry 'postscript-process) + '(postscript text postscript-options)) + ((eq entry 'printing) + '(postscript text postscript-options postscript-process)) + (t + nil) + )) + key) + (while base-list + (setq key (car base-list) + base-list (cdr base-list)) + (and (pr-visible-p key) + (setq index (+ index + (cdr (assq key pr-menu-entry-alist))))))) + (+ index 2)) + + +(defvar pr-menu-position nil) +(defvar pr-menu-state nil) + + +(cond + ((featurep 'xemacs) + ;; XEmacs + (defvar current-mouse-event nil) ; to avoid compilation gripes + (defun pr-menu-position (entry index horizontal) + (pr-x-make-event + 'button-release + (list 'button 1 + 'x (- (pr-x-event-x-pixel current-mouse-event) ; X + (* horizontal pr-menu-char-width)) + 'y (- (pr-x-event-y-pixel current-mouse-event) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))))) + ) + (ps-windows-system + ;; GNU Emacs for Windows 9x/NT + (defun pr-menu-position (entry index horizontal) + (let ((pos (cdr (pr-e-mouse-pixel-position)))) + (list + (list (or (car pos) 0) ; X + (- (or (cdr pos) 0) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))) + (selected-frame)))) ; frame + ) + (t + ;; GNU Emacs + (defun pr-menu-position (entry index horizontal) + (let ((pos (cdr (pr-e-mouse-pixel-position)))) + (list + (list (- (or (car pos) 0) ; X + (* horizontal pr-menu-char-width)) + (- (or (cdr pos) 0) ; Y + (* (pr-menu-index entry index) pr-menu-char-height))) + (selected-frame)))) ; frame + )) + +(cond + ((featurep 'xemacs) + ;; XEmacs + (defvar current-menubar nil) ; to avoid compilation gripes + (defun pr-menu-lookup (path) + (car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) + + ;; XEmacs + (defun pr-menu-lock (entry index horizontal state path) + (when pr-menu-lock + (or (and pr-menu-position (eq state pr-menu-state)) + (setq pr-menu-position (pr-menu-position entry index horizontal) + pr-menu-state state)) + (let* ((menu (pr-menu-lookup path)) + (result (pr-x-get-popup-menu-response menu pr-menu-position))) + (and (pr-x-misc-user-event-p result) + (funcall (pr-x-event-function result) + (pr-x-event-object result)))) + (setq pr-menu-position nil)))) + + + (t + ;; GNU Emacs + (defun pr-menu-lookup (path) + (lookup-key global-map + (if path + (vconcat pr-menu-bar + (mapcar 'pr-get-symbol + (if (listp path) + path + (list path)))) + pr-menu-bar))) + + ;; GNU Emacs + (defun pr-menu-lock (entry index horizontal state path) + (when pr-menu-lock + (or (and pr-menu-position (eq state pr-menu-state)) + (setq pr-menu-position (pr-menu-position entry index horizontal) + pr-menu-state state)) + (let* ((menu (pr-menu-lookup path)) + (result (x-popup-menu pr-menu-position menu))) + (and result + (let ((command (lookup-key menu (vconcat result)))) + (if (fboundp command) + (funcall command) + (eval command))))) + (setq pr-menu-position nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -5243,6 +4991,237 @@ If menu binding was not done, calls `pr-menu-bind'." alist))) +(cond + ((featurep 'xemacs) + ;; XEmacs + (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) + + ;; XEmacs + (defvar pr-ps-name-old "PostScript Printers") + (defvar pr-txt-name-old "Text Printers") + (defvar pr-ps-utility-old "PostScript Utility") + (defvar pr-even-or-odd-old "Print All Pages") + + ;; XEmacs + (defun pr-do-update-menus (&optional force) + (pr-menu-alist pr-ps-printer-alist + 'pr-ps-name + 'pr-menu-set-ps-title + '("Printing") + 'pr-ps-printer-menu-modified + force + pr-ps-name-old + 'postscript 2) + (pr-menu-alist pr-txt-printer-alist + 'pr-txt-name + 'pr-menu-set-txt-title + '("Printing") + 'pr-txt-printer-menu-modified + force + pr-txt-name-old + 'text 2) + (let ((save-var pr-ps-utility-menu-modified)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("Printing" "PostScript Print" "File") + 'save-var + force + pr-ps-utility-old + nil 1)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("Printing" "PostScript Preview" "File") + 'pr-ps-utility-menu-modified + force + pr-ps-utility-old + nil 1) + (pr-even-or-odd-pages ps-even-or-odd-pages force)) + + ;; XEmacs + (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name + entry index) + (when (and alist (or force (symbol-value modified-sym))) + (pr-xemacs-global-menubar + (pr-x-add-submenu menu-path + (pr-menu-create name alist var-sym + fun entry index))) + (funcall fun (symbol-value var-sym)) + (set modified-sym nil))) + + ;; XEmacs + (defun pr-relabel-menu-item (newname var-sym) + (pr-xemacs-global-menubar + (pr-x-relabel-menu-item + (list "Printing" (symbol-value var-sym)) + newname) + (set var-sym newname))) + + ;; XEmacs + (defun pr-menu-set-ps-title (value &optional item entry index) + (pr-relabel-menu-item (format "PostScript Printer: %s" value) + 'pr-ps-name-old) + (pr-ps-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; XEmacs + (defun pr-menu-set-txt-title (value &optional item entry index) + (pr-relabel-menu-item (format "Text Printer: %s" value) + 'pr-txt-name-old) + (pr-txt-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; XEmacs + (defun pr-menu-set-utility-title (value &optional item entry index) + (pr-xemacs-global-menubar + (let ((newname (format "%s" value))) + (pr-x-relabel-menu-item + (list "Printing" "PostScript Print" "File" pr-ps-utility-old) + newname) + (pr-x-relabel-menu-item + (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) + newname) + (setq pr-ps-utility-old newname))) + (pr-ps-set-utility value) + (and index + (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) + + ;; XEmacs + (defun pr-even-or-odd-pages (value &optional no-lock) + (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) + 'pr-even-or-odd-old) + (setq ps-even-or-odd-pages value) + (or no-lock + (pr-menu-lock 'postscript-options 8 12 'toggle nil)))) + + + (t + ;; GNU Emacs + (defalias 'pr-update-mode-line 'force-mode-line-update) + + ;; GNU Emacs + (defun pr-do-update-menus (&optional force) + (pr-menu-alist pr-ps-printer-alist + 'pr-ps-name + 'pr-menu-set-ps-title + "PostScript Printers" + 'pr-ps-printer-menu-modified + force + "PostScript Printers" + 'postscript 2) + (pr-menu-alist pr-txt-printer-alist + 'pr-txt-name + 'pr-menu-set-txt-title + "Text Printers" + 'pr-txt-printer-menu-modified + force + "Text Printers" + 'text 2) + (let ((save-var pr-ps-utility-menu-modified)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("PostScript Print" "File" "PostScript Utility") + 'save-var + force + "PostScript Utility" + nil 1)) + (pr-menu-alist pr-ps-utility-alist + 'pr-ps-utility + 'pr-menu-set-utility-title + '("PostScript Preview" "File" "PostScript Utility") + 'pr-ps-utility-menu-modified + force + "PostScript Utility" + nil 1) + (pr-even-or-odd-pages ps-even-or-odd-pages force)) + + ;; GNU Emacs + (defun pr-menu-get-item (name-list) + ;; NAME-LIST is a string or a list of strings. + (or (listp name-list) + (setq name-list (list name-list))) + (and name-list + (let* ((reversed (reverse name-list)) + (name (pr-get-symbol (car reversed))) + (path (nreverse (cdr reversed))) + (menu (lookup-key + global-map + (vconcat pr-menu-bar + (mapcar 'pr-get-symbol path))))) + (assq name (nthcdr 2 menu))))) + + ;; GNU Emacs + (defvar pr-temp-menu nil) + + ;; GNU Emacs + (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name + entry index) + (when (and alist (or force (symbol-value modified-sym))) + (easy-menu-define pr-temp-menu nil "" + (pr-menu-create name alist var-sym fun entry index)) + (let ((item (pr-menu-get-item menu-path))) + (and item + (let* ((binding (nthcdr 3 item)) + (key-binding (cdr binding))) + (setcar binding pr-temp-menu) + (and key-binding (listp (car key-binding)) + (setcdr binding (cdr key-binding))) ; skip KEY-BINDING + (funcall fun (symbol-value var-sym) item)))) + (set modified-sym nil))) + + ;; GNU Emacs + (defun pr-menu-set-item-name (item name) + (and item + (setcar (nthcdr 2 item) name))) ; ITEM-NAME + + ;; GNU Emacs + (defun pr-menu-set-ps-title (value &optional item entry index) + (pr-menu-set-item-name (or item + (pr-menu-get-item "PostScript Printers")) + (format "PostScript Printer: %s" value)) + (pr-ps-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; GNU Emacs + (defun pr-menu-set-txt-title (value &optional item entry index) + (pr-menu-set-item-name (or item + (pr-menu-get-item "Text Printers")) + (format "Text Printer: %s" value)) + (pr-txt-set-printer value) + (and index + (pr-menu-lock entry index 12 'toggle nil))) + + ;; GNU Emacs + (defun pr-menu-set-utility-title (value &optional item entry index) + (let ((name (symbol-name value))) + (if item + (pr-menu-set-item-name item name) + (pr-menu-set-item-name + (pr-menu-get-item + '("PostScript Print" "File" "PostScript Utility")) + name) + (pr-menu-set-item-name + (pr-menu-get-item + '("PostScript Preview" "File" "PostScript Utility")) + name))) + (pr-ps-set-utility value) + (and index + (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) + + ;; GNU Emacs + (defun pr-even-or-odd-pages (value &optional no-lock) + (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") + (cdr (assq value pr-even-or-odd-alist))) + (setq ps-even-or-odd-pages value) + (or no-lock + (pr-menu-lock 'postscript-options 8 12 'toggle nil))))) + + (defun pr-ps-set-utility (value) (let ((item (cdr (assq value pr-ps-utility-alist)))) (or item @@ -6018,10 +5997,9 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." ;; Printing Interface (inspired on ps-print-interface.el) -(eval-when-compile - (require 'cus-edit) - (require 'wid-edit) - (require 'widget)) +(require 'widget) +(require 'wid-edit) +(require 'cus-edit) (defvar pr-i-window-configuration nil) -- cgit v1.2.1 From bfffc9657df9272e15bd116a9076df534f27c517 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 7 Aug 2007 03:02:04 +0000 Subject: (PC-lisp-complete-symbol): Complete symbol around point. (PC-do-completion): Add "acronym completion" for symbols and filenames, so e.g. "mvbl" expands to "make-variable-buffer-local". --- lisp/complete.el | 77 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 16 deletions(-) (limited to 'lisp') diff --git a/lisp/complete.el b/lisp/complete.el index 9be68d833e5..75774b65db0 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -450,6 +450,7 @@ GOTO-END is non-nil, however, it instead replaces up to END." env-on regex p offset + abbreviated (poss nil) helpposs (case-fold-search completion-ignore-case)) @@ -586,17 +587,42 @@ GOTO-END is non-nil, however, it instead replaces up to END." pred nil)) ;; Find an initial list of possible completions - (if (not (setq p (string-match (concat PC-delim-regex + (unless (setq p (string-match (concat PC-delim-regex (if filename "\\|\\*" "")) str - (+ (length dirname) offset)))) + (+ (length dirname) offset))) ;; Minibuffer contains no hyphens -- simple case! - (setq poss (all-completions (if env-on - basestr str) + (setq poss (all-completions (if env-on basestr str) table pred)) - + (unless poss + ;; Try completion as an abbreviation, e.g. "mvb" -> + ;; "m-v-b" -> "multiple-value-bind" + (setq origstr str + abbreviated t) + (if filename + (cond + ;; "alpha" or "/alpha" -> expand whole path. + ((string-match "^/?\\([A-Za-z0-9]+\\)$" str) + (setq + basestr "" + p nil + poss (PC-expand-many-files + (concat "/" + (mapconcat #'list (match-string 1 str) "*/") + "*")) + beg (1- beg))) + ;; Alphanumeric trailer -> expand trailing file + ((string-match "^\\(.+/\\)\\([A-Za-z0-9]+\\)$" str) + (setq regex (concat "\\`" + (mapconcat #'list + (match-string 2 str) + "[A-Za-z0-9]*[^A-Za-z0-9]")) + p (1+ (length (match-string 1 str)))))) + (setq regex (concat "\\`" (mapconcat #'list str "[^-]*-")) + p 1)))) + (when p ;; Use all-completions to do an initial cull. This is a big win, ;; since all-completions is written in C! (let ((compl (all-completions (if env-on @@ -605,12 +631,24 @@ GOTO-END is non-nil, however, it instead replaces up to END." table pred))) (setq p compl) + (when (and compl abbreviated) + (if filename + (progn + (setq p nil) + (dolist (x compl) + (when (string-match regex x) + (push x p))) + (setq basestr (try-completion "" p))) + (setq basestr (mapconcat 'list str "-")) + (delete-region beg end) + (setq end (+ beg (length basestr))) + (insert basestr)))) (while p (and (string-match regex (car p)) (progn (set-text-properties 0 (length (car p)) '() (car p)) (setq poss (cons (car p) poss)))) - (setq p (cdr p))))) + (setq p (cdr p)))) ;; If table had duplicates, they can be here. (delete-dups poss) @@ -644,6 +682,7 @@ GOTO-END is non-nil, however, it instead replaces up to END." (and p (setq poss p)))) ;; Now we have a list of possible completions + (cond ;; No valid completions found @@ -653,6 +692,9 @@ GOTO-END is non-nil, however, it instead replaces up to END." (let ((PC-word-failed-flag t)) (delete-backward-char 1) (PC-do-completion 'word)) + (when abbreviated + (delete-region beg end) + (insert origstr)) (beep) (PC-temp-minibuffer-message (if ambig " [Ambiguous dir name]" @@ -789,13 +831,18 @@ GOTO-END is non-nil, however, it instead replaces up to END." (setq completion-base-size (if dirname dirlength (- beg prompt-end)))))) - (PC-temp-minibuffer-message " [Next char not unique]")) - nil))))) + (PC-temp-minibuffer-message " [Next char not unique]")))))) + ;; Expansion of filenames is not reversible, so just keep + ;; the prefix. + (when (and abbreviated filename) + (delete-region (point) end)) + nil) ;; Only one possible completion (t (if (and (equal basestr (car poss)) - (not (and env-on filename))) + (not (and env-on filename)) + (not abbreviated)) (if (null mode) (PC-temp-minibuffer-message " [Sole completion]")) (delete-region beg end) @@ -853,13 +900,11 @@ only symbols with function definitions are considered. Otherwise, all symbols with function definitions, values or properties are considered." (interactive) - (let* ((end (point)) - ;; To complete the word under point, rather than just the portion - ;; before point, use this: -;;; (save-excursion -;;; (with-syntax-table lisp-mode-syntax-table -;;; (forward-sexp 1) -;;; (point)))) + (let* ((end + (save-excursion + (with-syntax-table lisp-mode-syntax-table + (skip-syntax-forward "_w") + (point)))) (beg (save-excursion (with-syntax-table lisp-mode-syntax-table (backward-sexp 1) -- cgit v1.2.1 From cd7741b12d6871f5711b3ba8acadd18e55376384 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 7 Aug 2007 03:04:23 +0000 Subject: (default-indent-new-line): New function. It calls comment-line-break-function if there are comments. (do-auto-fill): Use that. --- lisp/simple.el | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/simple.el b/lisp/simple.el index ab7370b02ec..330c6978f84 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4329,13 +4329,6 @@ If optional arg REALLY-WORD is non-nil, it finds just a word." regexp) :group 'fill) -(defvar comment-line-break-function 'comment-indent-new-line - "*Mode-specific function which line breaks and continues a comment. - -This function is only called during auto-filling of a comment section. -The function should take a single optional argument, which is a flag -indicating whether it should use soft newlines.") - ;; This function is used as the auto-fill-function of a buffer ;; when Auto-Fill mode is enabled. ;; It returns t if it really did any work. @@ -4409,10 +4402,10 @@ indicating whether it should use soft newlines.") (if (save-excursion (skip-chars-backward " \t") (= (point) fill-point)) - (funcall comment-line-break-function t) + (default-indent-new-line t) (save-excursion (goto-char fill-point) - (funcall comment-line-break-function t))) + (default-indent-new-line t))) ;; Now do justification, if required (if (not (eq justify 'left)) (save-excursion @@ -4427,6 +4420,43 @@ indicating whether it should use soft newlines.") (justify-current-line justify t t) t))) +(defvar comment-line-break-function 'comment-indent-new-line + "*Mode-specific function which line breaks and continues a comment. +This function is called during auto-filling when a comment syntax +is defined. +The function should take a single optional argument, which is a flag +indicating whether it should use soft newlines.") + +(defun default-indent-new-line (&optional soft) + "Break line at point and indent. +If a comment syntax is defined, call `comment-indent-new-line'. + +The inserted newline is marked hard if variable `use-hard-newlines' is true, +unless optional argument SOFT is non-nil." + (interactive) + (if comment-start + (funcall comment-line-break-function soft) + ;; Insert the newline before removing empty space so that markers + ;; get preserved better. + (if soft (insert-and-inherit ?\n) (newline 1)) + (save-excursion (forward-char -1) (delete-horizontal-space)) + (delete-horizontal-space) + + (if (and fill-prefix (not adaptive-fill-mode)) + ;; Blindly trust a non-adaptive fill-prefix. + (progn + (indent-to-left-margin) + (insert-before-markers-and-inherit fill-prefix)) + + (cond + ;; If there's an adaptive prefix, use it unless we're inside + ;; a comment and the prefix is not a comment starter. + (fill-prefix + (indent-to-left-margin) + (insert-and-inherit fill-prefix)) + ;; If we're not inside a comment, just try to indent. + (t (indent-according-to-mode)))))) + (defvar normal-auto-fill-function 'do-auto-fill "The function to use for `auto-fill-function' if Auto Fill mode is turned on. Some major modes set this.") -- cgit v1.2.1 From a17fed5fe9a483a5870e2e3bd92b555600052c63 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 7 Aug 2007 03:05:06 +0000 Subject: (term): Remove group `unix'. --- lisp/term.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/term.el b/lisp/term.el index d7f083adfa6..649aa79b818 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -407,8 +407,7 @@ (defgroup term nil "General command interpreter in a window." - :group 'processes - :group 'unix) + :group 'processes) ;;; Buffer Local Variables: -- cgit v1.2.1 From 4213ede665757685224567600ac515bfd67a3899 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 7 Aug 2007 03:10:23 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe8df86bd58..9f1f0468b36 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2007-08-07 Richard Stallman + + * term.el (term): Remove parent group `unix'. + + * simple.el (default-indent-new-line): New function. + It calls comment-line-break-function if there are comments. + (do-auto-fill): Use that. + +2007-08-07 Sean O'Rourke + + * complete.el (PC-lisp-complete-symbol): Complete symbol around point. + (PC-do-completion): Add "acronym completion" for symbols and + filenames, so e.g. "mvbl" expands to "make-variable-buffer-local". + 2007-08-06 Sam Steingold * mouse.el (mouse-buffer-menu): Pass mode-name through @@ -144,7 +158,7 @@ (frame-set-background-mode): Normalize face-spec before calling face-spec-match-p. -2007-07-03 Stefan Monnier +2007-08-03 Stefan Monnier * server.el (server-window): Add switch-to-buffer-other-frame option. -- cgit v1.2.1 From 2b682f6259eb9fcf4dcf8c97e8f876f6844ed2ed Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 7 Aug 2007 03:32:24 +0000 Subject: (vc-annotate): Select temp-buffer before running vc-exec-after. Select the buffer's window before moving point. --- lisp/ChangeLog | 7 ++++++- lisp/vc.el | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f1f0468b36..c6a6d849351 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Stefan Monnier + + * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after. + Select the buffer's window before moving point. + 2007-08-07 Richard Stallman * term.el (term): Remove parent group `unix'. @@ -50,7 +55,7 @@ * term.el: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. - (term-default-fg-color, term-default-bg-color): Initialized from + (term-default-fg-color, term-default-bg-color): Initialize from default term-current-face. (term-mode, term-reset-terminal): Set term-current-face with term-default-fg-color and term-default-bg-color. diff --git a/lisp/vc.el b/lisp/vc.el index 2b2dd9fb8c9..76253bdfd5b 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -3272,12 +3272,19 @@ colors. `vc-annotate-background' specifies the background color." (set (make-local-variable 'vc-annotate-parent-display-mode) display-mode))) - (vc-exec-after - `(progn - (when ,current-line - (goto-line ,current-line ,temp-buffer-name)) - (unless (active-minibuffer-window) - (message "Annotating... done")))))) + (with-current-buffer temp-buffer-name + (vc-exec-after + `(progn + ;; Ideally, we'd rather not move point if the user has already + ;; moved it elsewhere, but really point here is not the position + ;; of the user's cursor :-( + (when ,current-line ;(and (bobp)) + (let ((win (get-buffer-window (current-buffer) 0))) + (when win + (with-selected-window win + (goto-line ,current-line))))) + (unless (active-minibuffer-window) + (message "Annotating... done"))))))) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one. -- cgit v1.2.1 From 35b63f8367d1b5676cb46f0b486856c6b0544329 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 7 Aug 2007 04:23:50 +0000 Subject: Remove comments about vc-bzr.el being a modified unofficial version. (vc-bzr-command): Remove redundant setting of process-connection-type. (vc-bzr-admin-checkout-format-file): Add autoload. (vc-bzr-root-dir): Remove in favor of vc-bzr-root. (vc-bzr-root): Switch to implementation of vc-bzr-root-dir. (vc-bzr-registered): Compare dirstate format tag with known good value, abort parsing if match fails. Warn user in docstring. (vc-bzr-workfile-version): Case for different Bzr branch formats. See bzrlib/branch.py in Bzr sources. (vc-bzr-diff): First argument FILES may be a string rather than a list. (vc-bzr-shell-command): Remove in favor of vc-bzr-command-discarding-stderr. (vc-bzr-command-discarding-stderr): New function. --- lisp/ChangeLog | 21 +++++++++++++++++++-- lisp/vc-bzr.el | Bin 23605 -> 23462 bytes 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9dde41dc692..8a24dbe4a84 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2007-08-07 Riccardo Murri + + * vc-bzr.el: Remove comments about vc-bzr.el being a modified + unofficial version. + (vc-bzr-command): Remove redundant setting of process-connection-type. + (vc-bzr-admin-checkout-format-file): Add autoload. + (vc-bzr-root-dir): Remove in favor of vc-bzr-root. + (vc-bzr-root): Switch to implementation of vc-bzr-root-dir. + (vc-bzr-registered): Compare dirstate format tag with known good + value, abort parsing if match fails. Warn user in docstring. + (vc-bzr-workfile-version): Case for different Bzr branch formats. + See bzrlib/branch.py in Bzr sources. + (vc-bzr-diff): First argument FILES may be a string rather than a list. + (vc-bzr-shell-command): Remove in favor of + vc-bzr-command-discarding-stderr. + (vc-bzr-command-discarding-stderr): New function. + 2007-08-06 Riccardo Murri * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr" @@ -20,8 +37,8 @@ `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno" if that file doesn't exist. (vc-bzr-responsible-p): Use `vc-bzr-root' instead of - `vc-bzr-root-dir' for speed. - add `vc-bzr-admin-dirname' (not ".bzr"!) to `vc-directory-exclusion-list' + `vc-bzr-root-dir' for speed. Add `vc-bzr-admin-dirname' + (not ".bzr"!) to `vc-directory-exclusion-list' (vc-bzr-shell-command): New function. 2007-08-06 Tom Tromey diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 907bcc5200c..cfb417519d3 100644 Binary files a/lisp/vc-bzr.el and b/lisp/vc-bzr.el differ -- cgit v1.2.1 From c25fd8ff23673778c3a30a6c961c061d92063842 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 7 Aug 2007 12:42:48 +0000 Subject: (format-insert-file): Make sure that at most one undo entry is recorded for the insertion. Inhibit point-motion and modification hooks around call to insert-file-contents. --- lisp/format.el | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/format.el b/lisp/format.el index d029e3d4683..35e47efadbf 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -429,13 +429,34 @@ a list (ABSOLUTE-FILE-NAME SIZE)." (fmt (format-read (format "Read file `%s' in format: " (file-name-nondirectory file))))) (list file fmt))) - (let (value size) - (let ((format-alist nil)) - (setq value (insert-file-contents filename nil beg end)) - (setq size (nth 1 value))) - (if format - (setq size (format-decode format size) - value (list (car value) size))) + (let (value size old-undo) + ;; Record only one undo entry for the insertion. Inhibit point-motion and + ;; modification hooks as with `insert-file-contents'. + (let ((inhibit-point-motion-hooks t) + (inhibit-modification-hooks t)) + ;; Don't bind `buffer-undo-list' to t here to assert that + ;; `insert-file-contents' may record whether the buffer was unmodified + ;; before. + (let ((format-alist nil)) + (setq value (insert-file-contents filename nil beg end)) + (setq size (nth 1 value))) + (when (consp buffer-undo-list) + (let ((head (car buffer-undo-list))) + (when (and (consp head) + (equal (car head) (point)) + (equal (cdr head) (+ (point) size))) + ;; Remove first entry from `buffer-undo-list', we shall insert + ;; another one below. + (setq old-undo (cdr buffer-undo-list))))) + (when format + (let ((buffer-undo-list t)) + (setq size (format-decode format size) + value (list (car value) size))) + (unless (eq buffer-undo-list t) + (setq buffer-undo-list + (cons (cons (point) (+ (point) size)) old-undo))))) + (unless inhibit-modification-hooks + (run-hook-with-args 'after-change-functions (point) (+ (point) size) 0)) value)) (defun format-read (&optional prompt) -- cgit v1.2.1 From 983d7f351b02ccb621cc34adc806d411deb98e2d Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 7 Aug 2007 12:43:40 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6a6d849351..b4ac9903813 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-07 Martin Rudalics + + * format.el (format-insert-file): Make sure that at most one undo + entry is recorded for the insertion. Inhibit point-motion and + modification hooks around call to insert-file-contents. + 2007-08-07 Stefan Monnier * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after. -- cgit v1.2.1 From 2de614fa64cd77efc1d1cff0d95abeebdec1363f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:08:26 +0000 Subject: * longlines.el (longlines-decoded): New variable. (longlines-mode): Avoid encoding or decoding the buffer twice. --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a24dbe4a84..9987b37bcb0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Chong Yidong + + * longlines.el (longlines-decoded): New variable. + (longlines-mode): Avoid encoding or decoding the buffer twice. + 2007-08-07 Riccardo Murri * vc-bzr.el: Remove comments about vc-bzr.el being a modified -- cgit v1.2.1 From 0906859b14da5107b5b5a2331f148e606d5a8c0d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:08:39 +0000 Subject: (longlines-decoded): New variable. (longlines-mode): Avoid encoding or decoding the buffer twice. --- lisp/longlines.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/longlines.el b/lisp/longlines.el index fa73ef7057d..07977910a22 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -79,11 +79,13 @@ This is used when `longlines-show-hard-newlines' is on." (defvar longlines-wrap-end nil) (defvar longlines-wrap-point nil) (defvar longlines-showing nil) +(defvar longlines-decoded nil) (make-variable-buffer-local 'longlines-wrap-beg) (make-variable-buffer-local 'longlines-wrap-end) (make-variable-buffer-local 'longlines-wrap-point) (make-variable-buffer-local 'longlines-showing) +(make-variable-buffer-local 'longlines-decoded) ;; Mode @@ -128,7 +130,9 @@ are indicated with a symbol." ;; longlines-wrap-lines that we'll never encounter from here (save-restriction (widen) - (longlines-decode-buffer) + (unless longlines-decoded + (longlines-decode-buffer) + (setq longlines-decoded t)) (longlines-wrap-region (point-min) (point-max))) (set-buffer-modified-p mod)) (when (and longlines-show-hard-newlines @@ -161,9 +165,11 @@ are indicated with a symbol." (let ((buffer-undo-list t) (after-change-functions nil) (inhibit-read-only t)) - (save-restriction - (widen) - (longlines-encode-region (point-min) (point-max)))) + (if longlines-decoded + (save-restriction + (widen) + (longlines-encode-region (point-min) (point-max)) + (setq longlines-decoded nil)))) (remove-hook 'change-major-mode-hook 'longlines-mode-off t) (remove-hook 'after-change-functions 'longlines-after-change-function t) (remove-hook 'post-command-hook 'longlines-post-command-function t) -- cgit v1.2.1 From 3d7da0e848731cc15356c3e93c0d3f99283522d6 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:10:11 +0000 Subject: * longlines.el (longlines-decoded): New variable. (longlines-mode): Avoid encoding or decoding the buffer twice. --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4ac9903813..e5f7b08e6de 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Chong Yidong + + * longlines.el (longlines-decoded): New variable. + (longlines-mode): Avoid encoding or decoding the buffer twice. + 2007-08-07 Martin Rudalics * format.el (format-insert-file): Make sure that at most one undo -- cgit v1.2.1 From 9a3e9821d6233563833f78157bdc1c5cf2de9d0f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:10:20 +0000 Subject: (longlines-decoded): New variable. (longlines-mode): Avoid encoding or decoding the buffer twice. --- lisp/longlines.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/longlines.el b/lisp/longlines.el index fa73ef7057d..07977910a22 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -79,11 +79,13 @@ This is used when `longlines-show-hard-newlines' is on." (defvar longlines-wrap-end nil) (defvar longlines-wrap-point nil) (defvar longlines-showing nil) +(defvar longlines-decoded nil) (make-variable-buffer-local 'longlines-wrap-beg) (make-variable-buffer-local 'longlines-wrap-end) (make-variable-buffer-local 'longlines-wrap-point) (make-variable-buffer-local 'longlines-showing) +(make-variable-buffer-local 'longlines-decoded) ;; Mode @@ -128,7 +130,9 @@ are indicated with a symbol." ;; longlines-wrap-lines that we'll never encounter from here (save-restriction (widen) - (longlines-decode-buffer) + (unless longlines-decoded + (longlines-decode-buffer) + (setq longlines-decoded t)) (longlines-wrap-region (point-min) (point-max))) (set-buffer-modified-p mod)) (when (and longlines-show-hard-newlines @@ -161,9 +165,11 @@ are indicated with a symbol." (let ((buffer-undo-list t) (after-change-functions nil) (inhibit-read-only t)) - (save-restriction - (widen) - (longlines-encode-region (point-min) (point-max)))) + (if longlines-decoded + (save-restriction + (widen) + (longlines-encode-region (point-min) (point-max)) + (setq longlines-decoded nil)))) (remove-hook 'change-major-mode-hook 'longlines-mode-off t) (remove-hook 'after-change-functions 'longlines-after-change-function t) (remove-hook 'post-command-hook 'longlines-post-command-function t) -- cgit v1.2.1 From e515f34a0edf510190c9a1db369bfc745133fd35 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:40:18 +0000 Subject: * image-mode.el (image-toggle-display): Use image-refresh. --- lisp/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9987b37bcb0..28eacfbc270 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2007-08-07 Chong Yidong + * image-mode.el (image-toggle-display): Use image-refresh. + * longlines.el (longlines-decoded): New variable. (longlines-mode): Avoid encoding or decoding the buffer twice. -- cgit v1.2.1 From b3ce269c08a0bdd9008b80de2f0e7069bd85195c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 7 Aug 2007 16:40:29 +0000 Subject: (image-toggle-display): Use image-refresh. --- lisp/image-mode.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/image-mode.el b/lisp/image-mode.el index deacf38c48d..7604d2911e2 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -295,16 +295,17 @@ and showing the image as an image." (message "Repeat this command to go back to displaying the image"))) ;; Turn the image data into a real image, but only if the whole file ;; was inserted - (let* ((image - (if (and (buffer-file-name) - (not (file-remote-p (buffer-file-name))) + (let* ((filename (buffer-file-name)) + (image + (if (and filename + (file-readable-p filename) + (not (file-remote-p filename)) (not (buffer-modified-p)) (not (and (boundp 'archive-superior-buffer) archive-superior-buffer)) (not (and (boundp 'tar-superior-buffer) tar-superior-buffer))) - (progn (clear-image-cache) - (create-image (buffer-file-name))) + (create-image filename) (create-image (string-make-unibyte (buffer-substring-no-properties (point-min) (point-max))) @@ -313,13 +314,11 @@ and showing the image as an image." `(display ,image intangible ,image rear-nonsticky (display intangible) - ;; This a cheap attempt to make the whole buffer - ;; read-only when we're visiting the file (as - ;; opposed to just inserting it). read-only t front-sticky (read-only))) (inhibit-read-only t) (buffer-undo-list t) (modified (buffer-modified-p))) + (image-refresh image) (add-text-properties (point-min) (point-max) props) (set-buffer-modified-p modified) ;; Inhibit the cursor when the buffer contains only an image, -- cgit v1.2.1 From ab1ed8963e9ce398bec2074f227d071a97387127 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 7 Aug 2007 17:00:44 +0000 Subject: (tcl-indent-level, tcl-continued-indent-level): Add safe-local-variable prop. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/tcl.el | 2 ++ 2 files changed, 7 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28eacfbc270..6ed8668428f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Tom Tromey + + * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level): + Add safe-local-variable property. + 2007-08-07 Chong Yidong * image-mode.el (image-toggle-display): Use image-refresh. diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index c7576a27114..f9fd7beffd2 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -126,11 +126,13 @@ "*Indentation of Tcl statements with respect to containing block." :type 'integer :group 'tcl) +(put 'tcl-indent-level 'safe-local-variable 'integerp) (defcustom tcl-continued-indent-level 4 "*Indentation of continuation line relative to first line of command." :type 'integer :group 'tcl) +(put 'tcl-continued-indent-level 'safe-local-variable 'integerp) (defcustom tcl-auto-newline nil "*Non-nil means automatically newline before and after braces you insert." -- cgit v1.2.1 From ef8b1028be3392e71ab040df7cfb2219261a1dd3 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 7 Aug 2007 20:04:27 +0000 Subject: * net/tramp.el (tramp-handle-file-remote-p): Handle optional parameters IDENTIFICATION and CONNECTED. (tramp-handle-insert-file-contents): VISIT must be handled after insertion of the local copy. Reported by Peter Gordon . (tramp-file-name-handler): No special handling for `expand-file-name'. But for `file-name-as-directory'. (tramp-find-shell, tramp-open-connection-telnet) (tramp-open-connection-rsh, tramp-open-connection-su) (tramp-open-connection-multi) (tramp-open-connection-setup-interactive-shell): Guard against $PROMPT_COMMAND shell var. Reported by Steve Youngs . (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in the hint. * net/trampver.el: Update release number. --- lisp/ChangeLog | 20 +++++++++++++++++++ lisp/net/tramp.el | 54 ++++++++++++++++++++++++++++++++++------------------ lisp/net/trampver.el | 2 +- 3 files changed, 56 insertions(+), 20 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ed8668428f..f8e7622ee1f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2007-08-07 Michael Albinus + + * net/tramp.el (tramp-handle-file-remote-p): Handle optional + parameters IDENTIFICATION and CONNECTED. + (tramp-handle-insert-file-contents): VISIT must be handled after + insertion of the local copy. Reported by Peter Gordon + . + (tramp-file-name-handler): No special handling for + `expand-file-name'. But for `file-name-as-directory'. + (tramp-find-shell, tramp-open-connection-telnet) + (tramp-open-connection-rsh, tramp-open-connection-su) + (tramp-open-connection-multi) + (tramp-open-connection-setup-interactive-shell): Guard against + $PROMPT_COMMAND shell var. Reported by Steve Youngs + . + (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in + the hint. + + * net/trampver.el: Update release number. + 2007-08-07 Tom Tromey * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level): diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9f665ca4707..09167d674eb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3868,11 +3868,20 @@ This will break if COMMAND prints a newline, followed by the value of (t (error "Wrong method specification for `%s'" method))) tmpfil))) -(defun tramp-handle-file-remote-p (filename) - "Like `file-remote-p' for tramp files." +(defun tramp-handle-file-remote-p (filename &optional identification connected) + "Like `file-remote-p' for Tramp files." (when (tramp-tramp-file-p filename) (with-parsed-tramp-file-name filename nil - (tramp-make-tramp-file-name multi-method method user host "")))) + (and (or (not connected) + (let ((p (get-buffer-process + (tramp-get-buffer multi-method method user host)))) + (and p (processp p) (memq (process-status p) '(run open))))) + (cond + ((eq identification 'method) method) + ((eq identification 'user) user) + ((eq identification 'host) host) + (t (tramp-make-tramp-file-name + multi-method method user host ""))))))) (defun tramp-handle-insert-file-contents (filename &optional visit beg end replace) @@ -3899,14 +3908,14 @@ This will break if COMMAND prints a newline, followed by the value of 'file-local-copy))) (file-local-copy filename))) coding-system-used result) - (when visit - (setq buffer-file-name filename) - (set-visited-file-modtime) - (set-buffer-modified-p nil)) (tramp-message-for-buffer multi-method method user host 9 "Inserting local temp file `%s'..." local-copy) (setq result (insert-file-contents local-copy nil beg end replace)) + (when visit + (setq buffer-file-name filename) + (set-visited-file-modtime) + (set-buffer-modified-p nil)) ;; Now `last-coding-system-used' has right value. Remember it. (when (boundp 'last-coding-system-used) (setq coding-system-used (symbol-value 'last-coding-system-used))) @@ -4354,11 +4363,12 @@ Falls back to normal file name handler if no tramp file name handler exists." (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) + ((and completion (zerop (length localname)) + (memq operation '(file-name-as-directory))) + filename) ;; Call the backend function. (foreign (apply foreign operation args)) ;; Nothing to do for us. @@ -5351,7 +5361,7 @@ file exists and nonzero exit status otherwise." 5 "Starting remote shell `%s' for tilde expansion..." shell) (tramp-send-command multi-method method user host - (concat "PS1='$ ' exec " shell)) ; + (concat "PROMPT_COMMAND='' PS1='$ ' exec " shell)) ; (tramp-barf-if-no-shell-prompt (get-buffer-process (current-buffer)) 60 "Couldn't find remote `%s' prompt" shell) @@ -5361,11 +5371,12 @@ file exists and nonzero exit status otherwise." ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the ;; last tramp-rsh-end-of-line, Douglas wanted to replace that, ;; as well. - (process-send-string nil (format "PS1='%s%s%s'; PS2=''; PS3=''%s" - tramp-rsh-end-of-line - tramp-end-of-output - tramp-rsh-end-of-line - tramp-rsh-end-of-line)) + (process-send-string + nil (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''%s" + tramp-rsh-end-of-line + tramp-end-of-output + tramp-rsh-end-of-line + tramp-rsh-end-of-line)) (tramp-wait-for-output) (tramp-message 9 "Setting remote shell prompt...done") @@ -5690,6 +5701,7 @@ Maybe the different regular expressions need to be tuned. (or user (user-login-name)) host method) (let ((process-environment (copy-sequence process-environment))) (setenv "TERM" tramp-terminal-type) + (setenv "PROMPT_COMMAND") (setenv "PS1" "$ ") (let* ((default-directory (tramp-temporary-file-directory)) ;; If we omit the conditional here, then we would use @@ -5771,6 +5783,7 @@ arguments, and xx will be used as the host name to connect to. (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) (setq real-host (match-string 1 host))) (setenv "TERM" tramp-terminal-type) + (setenv "PROMPT_COMMAND") (setenv "PS1" "$ ") (let* ((default-directory (tramp-temporary-file-directory)) ;; If we omit the conditional, we would use @@ -5823,6 +5836,7 @@ prompt than you do, so it is not at all unlikely that the variable (or user "") method) (let ((process-environment (copy-sequence process-environment))) (setenv "TERM" tramp-terminal-type) + (setenv "PROMPT_COMMAND") (setenv "PS1" "$ ") (let* ((default-directory (tramp-temporary-file-directory)) ;; If we omit the conditional, we use `undecided-dos' in @@ -5888,6 +5902,7 @@ log in as u2 to h2." (tramp-message 7 "Opening `%s' connection..." multi-method) (let ((process-environment (copy-sequence process-environment))) (setenv "TERM" tramp-terminal-type) + (setenv "PROMPT_COMMAND") (setenv "PS1" "$ ") (let* ((default-directory (tramp-temporary-file-directory)) ;; If we omit the conditional, we use `undecided-dos' in @@ -6127,10 +6142,11 @@ to set up. METHOD, USER and HOST specify the connection." ;; makes it work under `rc', too. We also unset the variable $ENV ;; because that is read by some sh implementations (eg, bash when ;; called as sh) on startup; this way, we avoid the startup file - ;; clobbering $PS1. + ;; clobbering $PS1. $PROMP_COMMAND is another way to set the prompt + ;; in /bin/bash, it must be discarded as well. (tramp-send-command-internal multi-method method user host - (format "exec env 'ENV=' 'PS1=$ ' %s" + (format "exec env 'ENV=' 'PROMPT_COMMAND=' 'PS1=$ ' %s" (tramp-get-method-parameter multi-method method user host 'tramp-remote-sh)) (format "remote `%s' to come up" @@ -6227,7 +6243,7 @@ to set up. METHOD, USER and HOST specify the connection." (setq tramp-last-cmd-time (current-time)) (tramp-send-command multi-method method user host - (format "PS1='%s%s%s'; PS2=''; PS3=''" + (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''" tramp-rsh-end-of-line tramp-end-of-output tramp-rsh-end-of-line)) @@ -7713,7 +7729,7 @@ Used for non-7bit chars in strings." (kill-region start (point))))) (insert " The buffer(s) above will be appended to this message. If you don't want -to append a buffer because it contains sensible data, or because the buffer +to append a buffer because it contains sensitive data, or because the buffer is too large, you should delete the respective buffer. The buffer(s) will contain user and host names. Passwords will never be included there.") diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index d265fa5393b..5734b5c9138 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -30,7 +30,7 @@ ;; are auto-frobbed from configure.ac, so you should edit that file and run ;; "autoconf && ./configure" to change them. -(defconst tramp-version "2.0.56" +(defconst tramp-version "2.0.57-pre" "This version of Tramp.") (defconst tramp-bug-report-address "tramp-devel@gnu.org" -- cgit v1.2.1 From b4001caa6b29eaf2894d7fd0c2ccf88820eb5f41 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Tue, 7 Aug 2007 20:10:15 +0000 Subject: (compilation-start): Pass nil as startfile to comint-exec. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5f7b08e6de..fe5750c9ffc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Sam Steingold + + * progmodes/compile.el (compilation-start): Pass nil as startfile + to comint-exec. + 2007-08-07 Chong Yidong * longlines.el (longlines-decoded): New variable. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index caf0e94b927..d7283037b6f 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -170,7 +170,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) (maven ;; Maven is a popular build tool for Java. Maven is Free Software. "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) - + (bash "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) @@ -1136,7 +1136,7 @@ Returns the compilation buffer created." (if (file-remote-p default-directory) "/bin/sh" shell-file-name) - `("-c" ,command)))) + nil `("-c" ,command)))) (start-file-process-shell-command (downcase mode-name) outbuf command)))) ;; Make the buffer's mode line show process state. -- cgit v1.2.1 From f7f4bbea4fda37853732f0036103e02ec48a1db1 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 7 Aug 2007 20:30:20 +0000 Subject: * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more global matching. (tramp-handle-process-file): Fix bug inserting resulting output. (tramp-handle-shell-command): Handle OUTPUT-BUFFER and ERROR-BUFFER more robust. Display output. (tramp-file-name-handler): Add a connection property when we found a foreign file name handler. This allows backends like ftp to profit also from usr/host name completion based on connection cache. (tramp-send-command-and-read): Search for trash after the regexp until eol only. In XEmacs, there is a problem with \n. * net/tramp-cache.el (top): Read persistent connection history when cache is empty. --- lisp/ChangeLog | 45 +++++++++++++++++++++++++++++++++------------ lisp/net/tramp-cache.el | 5 ++--- lisp/net/tramp.el | 49 ++++++++++++++++++++++++++++++++++--------------- lisp/net/trampver.el | 2 +- 4 files changed, 70 insertions(+), 31 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe5750c9ffc..e10c3dbff2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2007-08-07 Michael Albinus + + * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more + global matching. + (tramp-handle-shell-command): Handle OUTPUT-BUFFER and + ERROR-BUFFER more robust. Display output. + (tramp-file-name-handler): Add a connection property when we found + a foreign file name handler. This allows backends like ftp to + profit also from usr/host name completion based on connection + cache. + (tramp-send-command-and-read): Search for trash after the regexp + until eol only. In XEmacs, there is a problem with \n. + + * net/tramp-cache.el (top): Read persistent connection history + when cache is empty. + +2007-08-07 Nic Ferrier (tiny change) + + * net/tramp.el (tramp-handle-process-file): Fix bug inserting + resulting output. + 2007-08-07 Sam Steingold * progmodes/compile.el (compilation-start): Pass nil as startfile @@ -295,21 +316,21 @@ 2007-07-29 Michael Albinus - * tramp.el: - * tramp-uu.el: - * trampver.el: Use utf-8 encoding with coding cookie. + * net/tramp.el: + * net/tramp-uu.el: + * net/trampver.el: Use utf-8 encoding with coding cookie. - * tramp-cache.el: - * tramp-fish.el: - * tramp-ftp.el: - * tramp-gw.el: - * tramp-smb.el: Remove coding cookie. + * net/tramp-cache.el: + * net/tramp-fish.el: + * net/tramp-ftp.el: + * net/tramp-gw.el: + * net/tramp-smb.el: Remove coding cookie. - * tramp.el (tramp-handle-verify-visited-file-modtime): + * net/tramp.el (tramp-handle-verify-visited-file-modtime): Flush buffer file-name's file property. (tramp-handle-file-remote-p): The first parameter is FILENAME. - * trampver.el: Update release number. + * net/trampver.el: Update release number. 2007-07-29 Juri Linkov @@ -863,9 +884,9 @@ Sync with Tramp 2.1.10. - * tramp.el (tramp-get-ls-command): Fyx typo. + * net/tramp.el (tramp-get-ls-command): Fyx typo. - * trampver.el: Update release number. + * net/trampver.el: Update release number. 2007-07-22 Jan Dj,Ad(Brv diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 79b0b537837..db08fe3b6df 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -290,9 +290,8 @@ history." tramp-cache-data) res)) -;; Read persistent connection history. Applied with -;; `load-in-progress', because it shall be evaluated only once. -(when load-in-progress +;; Read persistent connection history. +(when (zerop (hash-table-count tramp-cache-data)) (condition-case err (with-temp-buffer (insert-file-contents tramp-persistency-file-name) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5285b87313a..1070d61cba6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1027,7 +1027,7 @@ The `sudo' program appears to insert a `^@' character into the prompt." "Login incorrect" "Login Incorrect" "Connection refused" - "Connection closed by foreign host." + "Connection closed" "Sorry, try again." "Name or service not known" "Host key verification failed." @@ -3581,8 +3581,11 @@ beginning of local filename are not substituted." (tramp-send-command v command) ;; We should show the output anyway. (when outbuf - (with-current-buffer outbuf - (insert-buffer-substring (tramp-get-connection-buffer v))) + (let ((output-string + (with-current-buffer (tramp-get-connection-buffer v) + (buffer-substring (point-min) (point-max))))) + (with-current-buffer outbuf + (insert output-string))) (when display (display-buffer outbuf)))) ;; When the user did interrupt, we should do it also. (error @@ -3614,12 +3617,20 @@ beginning of local filename are not substituted." (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) (args (split-string (substring command 0 asynchronous) " ")) (output-buffer - (or output-buffer - (if asynchronous - "*Async Shell Command*" - "*Shell Command Output*"))) + (cond + ((bufferp output-buffer) output-buffer) + ((stringp output-buffer) (get-buffer-create output-buffer)) + (output-buffer (current-buffer)) + (t (generate-new-buffer + (if asynchronous + "*Async Shell Command*" + "*Shell Command Output*"))))) + (error-buffer + (cond + ((bufferp error-buffer) error-buffer) + ((stringp error-buffer) (get-buffer-create error-buffer)))) (buffer - (if (and (not asynchronous) (bufferp error-buffer)) + (if (and (not asynchronous) error-buffer) (with-parsed-tramp-file-name default-directory nil (list output-buffer (tramp-make-tramp-temp-file v))) output-buffer))) @@ -3637,7 +3648,10 @@ beginning of local filename are not substituted." (when (listp buffer) (with-current-buffer error-buffer (insert-file-contents (cadr buffer))) - (delete-file (cadr buffer)))))) + (delete-file (buffer-file-name (cadr buffer)))) + ;; There's some output, display it. + (when (with-current-buffer output-buffer (> (point-max) (point-min))) + (display-message-or-buffer output-buffer))))) ;; File Editing. @@ -4177,8 +4191,12 @@ Falls back to normal file name handler if no tramp file name handler exists." ((and completion (zerop (length localname)) (memq operation '(file-name-as-directory))) filename) - ;; Call the backend function. - (foreign (apply foreign operation args)) + ;; Call the backend function. Set a connection property + ;; first, it will be reused for user/host name completion. + (foreign + (unless (zerop (length localname)) + (tramp-set-connection-property v "started" nil)) + (apply foreign operation args)) ;; Nothing to do for us. (t (tramp-run-real-handler operation args))))))) @@ -6116,7 +6134,8 @@ In case there is no valid Lisp expression, it raises an error" (condition-case nil (prog1 (read (current-buffer)) ;; Error handling. - (when (re-search-forward "\\S-" nil t) (error))) + (when (re-search-forward "\\S-" (tramp-line-end-position) t) + (error))) (error (tramp-error vec 'file-error "`%s' does not return a valid Lisp expression: `%s'" @@ -6125,7 +6144,7 @@ In case there is no valid Lisp expression, it raises an error" ;; It seems that Tru64 Unix does not like it if long strings are sent ;; to it in one go. (This happens when sending the Perl ;; `file-attributes' implementation, for instance.) Therefore, we -;; have this function which waits a bit at each line. +;; have this function which sends the string in chunks. (defun tramp-send-string (vec string) "Send the STRING via connection VEC. @@ -6143,7 +6162,7 @@ the remote host use line-endings as defined in the variable ;; Clean up the buffer. We cannot call `erase-buffer' because ;; narrowing might be in effect. (let (buffer-read-only) (delete-region (point-min) (point-max))) - ;; replace "\n" by `tramp-rsh-end-of-line' + ;; Replace "\n" by `tramp-rsh-end-of-line'. (setq string (mapconcat 'identity (split-string string "\n") @@ -6151,7 +6170,7 @@ the remote host use line-endings as defined in the variable (unless (or (string= string "") (string-equal (substring string -1) tramp-rsh-end-of-line)) (setq string (concat string tramp-rsh-end-of-line))) - ;; send the string + ;; Send the string. (if (and chunksize (not (zerop chunksize))) (let ((pos 0) (end (length string))) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index f10f08e1031..6e48c3c7f47 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -;; Author: Kai Großjohann +;; Author: Kai Großjohann ;; Keywords: comm, processes ;; This file is part of GNU Emacs. -- cgit v1.2.1 From 7a498f6557e491d4f62b8de9a9d3d9719b5102f2 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 7 Aug 2007 21:03:40 +0000 Subject: (calc-convert-temperature): Use `/' to create fractions. --- lisp/calc/calc-units.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 82769a66b13..e823a57aef0 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -49,7 +49,7 @@ (defvar math-standard-units '( ;; Length ( m nil "*Meter" ) - ( in "2.54 cm" "Inch" ) + ( in "2.54 cm" "Inch" ) ( ft "12 in" "Foot" ) ( yd "3 ft" "Yard" ) ( mi "5280 ft" "Mile" ) @@ -971,17 +971,17 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") (symbol-name v))))))) (or (eq (nth 3 uold) (nth 3 unew)) (cond ((eq (nth 3 uold) 'K) - (setq expr (list '- expr '(float 27315 -2))) + (setq expr (list '- expr '(/ 27315 100))) (if (eq (nth 3 unew) 'F) - (setq expr (list '+ (list '* expr '(frac 9 5)) 32)))) + (setq expr (list '+ (list '* expr '(/ 9 5)) 32)))) ((eq (nth 3 uold) 'C) (if (eq (nth 3 unew) 'F) - (setq expr (list '+ (list '* expr '(frac 9 5)) 32)) - (setq expr (list '+ expr '(float 27315 -2))))) + (setq expr (list '+ (list '* expr '(/ 9 5)) 32)) + (setq expr (list '+ expr '(/ 27315 100))))) (t - (setq expr (list '* (list '- expr 32) '(frac 5 9))) + (setq expr (list '* (list '- expr 32) '(/ 5 9))) (if (eq (nth 3 unew) 'K) - (setq expr (list '+ expr '(float 27315 -2))))))) + (setq expr (list '+ expr '(/ 27315 100))))))) (if pure expr (list '* expr new)))) -- cgit v1.2.1 From 8890c973f3a2d6c2cb6e356f7ecf58dd3eff3a82 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 7 Aug 2007 21:06:29 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e10c3dbff2a..de7d0584a9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Jay Belanger + + * calc/calc-units.el (calc-convert-temperature): + Use `/' to create fractions. + 2007-08-07 Michael Albinus * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more -- cgit v1.2.1 From d0f893d7ca3c0241f59edccfa628b8197c07370e Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 05:46:49 +0000 Subject: Use window-full-width-p instead of comparing frame-width and window-width. --- lisp/dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/dired.el b/lisp/dired.el index 3639f44b553..bd160df7bda 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2547,12 +2547,12 @@ deletion of non-empty directories is allowed." (cond ;; if split-height-threshold is enabled, use the largest window ((and (> (window-height (setq w2 (get-largest-window))) split-height-threshold) - (= (frame-width) (window-width w2))) + (window-full-width-p w2)) (setq window w2)) ;; if the least-recently-used window is big enough, use it ((and (> (window-height (setq w2 (get-lru-window))) (* 2 window-min-height)) - (= (frame-width) (window-width w2))) + (window-full-width-p w2)) (setq window w2))) (save-excursion (set-buffer buf) -- cgit v1.2.1 From 6865a89b0a7486409c33f713324da11575c63208 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 05:49:21 +0000 Subject: Use window-full-width-p instead of comparing frame-width and window-width. --- lisp/mouse-drag.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index f1d56eccc66..bfb199ab897 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -158,7 +158,7 @@ Keep the cursor on the screen as needed." Basically, we check for existing horizontal scrolling." (or truncate-lines (> (window-hscroll (selected-window)) 0) - (< (window-width) (frame-width)) + (not (window-full-width-p)) (and mouse-drag-electric-col-scrolling (save-excursion ;; on a long line? -- cgit v1.2.1 From 9589dff65f25b421eecbf8931c98eb198d73a3a4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 05:51:36 +0000 Subject: Use window-full-width-p instead of comparing frame-width and window-width. --- lisp/calendar/calendar.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 719f32be3c1..330cf8521f3 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -2078,7 +2078,7 @@ Or, for optional MON, YR." ;; Don't do any window-related stuff if we weren't called from a ;; window displaying the calendar (when in-calendar-window - (if (or (one-window-p t) (/= (frame-width) (window-width))) + (if (or (one-window-p t) (not (window-full-width-p))) ;; Don't mess with the window size, but ensure that the first ;; line is fully visible (set-window-vscroll nil 0) -- cgit v1.2.1 From 3a6c2a7d3a82f2366c681ac4e7d0e9e48392c563 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 05:57:54 +0000 Subject: (compilation-set-window-height): Use window-full-width-p instead of comparing frame-width and window-width. (compilation-find-buffer): Remove extra argument in call to compilation-buffer-internal-p. --- lisp/progmodes/compile.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 529194ffa7e..fcb20ede56d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1153,7 +1153,7 @@ exited abnormally with code %d\n" "Set the height of WINDOW according to `compilation-window-height'." (let ((height (buffer-local-value 'compilation-window-height (window-buffer window)))) (and height - (= (window-width window) (frame-width (window-frame window))) + (window-full-width-p window) ;; If window is alone in its frame, aside from a minibuffer, ;; don't change its height. (not (eq window (frame-root-window (window-frame window)))) @@ -1611,12 +1611,10 @@ Use this command in a compilation log buffer. Sets the mark at point there." (defun compilation-find-buffer (&optional avoid-current) "Return a compilation buffer. -If AVOID-CURRENT is nil, and -the current buffer is a compilation buffer, return it. -If AVOID-CURRENT is non-nil, return the current buffer -only as a last resort." - (if (and (compilation-buffer-internal-p (current-buffer)) - (not avoid-current)) +If AVOID-CURRENT is nil, and the current buffer is a compilation buffer, +return it. If AVOID-CURRENT is non-nil, return the current buffer only +as a last resort." + (if (and (compilation-buffer-internal-p) (not avoid-current)) (current-buffer) (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) -- cgit v1.2.1 From 3b52a009a7f57ab4675d42d487a6ef6a5aab1260 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 06:01:52 +0000 Subject: (2C-two-columns, 2C-merge): Use window-full-width-p instead of comparing frame-width and window-width. --- lisp/textmodes/two-column.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 2568b53fe36..eebd1923b63 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -347,8 +347,8 @@ When called again, restores the screen layout with the current buffer first and the associated buffer to its right." (interactive "P") ;; first go to full width, so that we can certainly split into two windows - (if (< (window-width) (frame-width)) - (enlarge-window 99999 t)) + (unless (window-full-width-p) + (enlarge-window 99999 t)) (split-window-horizontally (max window-min-width (min 2C-window-width (- (frame-width) window-min-width)))) @@ -533,8 +533,8 @@ off trailing spaces with \\[delete-trailing-whitespace]." (insert 2C-separator string)) (next-line 1) ; add one if necessary (set-buffer b2)))) - (if (< (window-width) (frame-width)) - (enlarge-window 99999 t))) + (unless (window-full-width-p) + (enlarge-window 99999 t))) ;;;;; utility functions ;;;;; -- cgit v1.2.1 From 85c6dd3fe7ed75f0ac633c4cc9a4e18056bf72b0 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Aug 2007 06:04:51 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f8e7622ee1f..9bc99517ca0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2007-08-08 Martin Rudalics + + * dired.el (dired-pop-to-buffer): + * mouse-drag.el (mouse-drag-should-do-col-scrolling): + * calendar/calendar.el (generate-calendar-window): + * progmodes/compile.el (compilation-set-window-height): + * textmodes/two-column.el (2C-two-columns, 2C-merge): + Use window-full-width-p instead of comparing frame-width and + window-width. + + * progmodes/compile.el (compilation-find-buffer): Remove extra + argument in call to compilation-buffer-internal-p. + 2007-08-07 Michael Albinus * net/tramp.el (tramp-handle-file-remote-p): Handle optional -- cgit v1.2.1 From 7aef1b42fc9f6cfbca100451200338ea67693369 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:15:01 +0000 Subject: (checkdoc-ispell-lisp-words): Remove `iff'. Replace `iff' in doc-strings and comments. --- lisp/emacs-lisp/checkdoc.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 0374ad7b34c..e1835d75fcb 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -263,7 +263,7 @@ system. Possible values are: (const t))) (defvar checkdoc-ispell-lisp-words - '("alist" "emacs" "etags" "iff" "keymap" "paren" "regexp" "sexp" "xemacs") + '("alist" "emacs" "etags" "keymap" "paren" "regexp" "sexp" "xemacs") "List of words that are correct when spell-checking Lisp documentation.") (defcustom checkdoc-max-keyref-before-warn 10 @@ -1243,7 +1243,8 @@ generating a buffered list of errors." ;;;###autoload (define-minor-mode checkdoc-minor-mode "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings. -With prefix ARG, turn Checkdoc minor mode on iff ARG is positive. +With prefix ARG, turn Checkdoc minor mode on if ARG is positive, otherwise +turn it off. In Checkdoc minor mode, the usual bindings for `eval-defun' which is bound to \\\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include -- cgit v1.2.1 From eb71e34b3cc94ea2c1806a4d13dd3323c7e3dc63 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:15:45 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/emacs-lisp/byte-opt.el | 2 +- lisp/emacs-lisp/easymenu.el | 2 +- lisp/emacs-lisp/rx.el | 2 +- lisp/emacs-lisp/unsafep.el | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 811dc699bd0..82a5cf0a75a 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -564,7 +564,7 @@ (cons fn args))))))) (defun byte-optimize-all-constp (list) - "Non-nil iff all elements of LIST satisfy `byte-compile-constp'." + "Non-nil if all elements of LIST satisfy `byte-compile-constp'." (let ((constant t)) (while (and list constant) (unless (byte-compile-constp (car list)) diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 5d53a70531c..030e1bccbd4 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -539,7 +539,7 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'." (easy-menu-do-add-item map item before))) (defun easy-menu-item-present-p (map path name) - "In submenu of MAP with path PATH, return non-nil iff item NAME is present. + "In submenu of MAP with path PATH, return non-nil if item NAME is present. MAP and PATH are defined as in `easy-menu-add-item'. NAME should be a string, the name of the element to be looked for." (easy-menu-return-item (easy-menu-get-map map path) name)) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index cf915c1b15d..45a1e9c8d10 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -554,7 +554,7 @@ appended to R will apply to all of R. For example, \"a\" This function may return false negatives, but it will not return false positives. It is nevertheless useful in -situations where an efficiency shortcut can be taken iff a +situations where an efficiency shortcut can be taken only if a regexp is atomic. The function can be improved to detect more cases of atomic regexps. Presently, this function detects the following categories of atomic regexp; diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index bf52acef382..d7dd1f19300 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -212,7 +212,7 @@ of symbols with local bindings." (defun unsafep-function (fun) - "Return nil iff FUN is a safe function. + "Return nil if FUN is a safe function. \(either a safe lambda or a symbol that names a safe function). Otherwise result is a reason code." (cond -- cgit v1.2.1 From 4b11da4c0095c3d16ab7a1f7154b21aeaf6dbc62 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:17:12 +0000 Subject: *** empty log message *** --- lisp/erc/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp') diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 9baafe61257..d72d472d69f 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2007-08-08 Glenn Morris + + * erc-log.el, erc.el: Replace `iff' in doc-strings and comments. + 2007-07-30 Michael Olson * erc-nicklist.el: Remove from the Emacs source tree. This file -- cgit v1.2.1 From 38b1c970cae965c98730164846a3df856cacc216 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:17:27 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/erc/erc-log.el | 2 +- lisp/erc/erc.el | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 194f8ae6bf1..88132afae0c 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -261,7 +261,7 @@ The current buffer is given by BUFFER." (defun erc-log-all-but-server-buffers (buffer) "Returns t if logging should be enabled in BUFFER. -Returns nil iff `erc-server-buffer-p' returns t." +Returns nil if `erc-server-buffer-p' returns t." (save-excursion (save-window-excursion (set-buffer buffer) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index d5a823ac825..c26bdf2a19f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3958,7 +3958,7 @@ and always returns t." (defun erc-echo-notice-in-target-buffer (s parsed buffer sender) "Echos a private notice in BUFFER, if BUFFER is non-nil. This function is designed to be added to either `erc-echo-notice-hook' -or `erc-echo-notice-always-hook', and returns non-nil iff BUFFER +or `erc-echo-notice-always-hook', and returns non-nil if BUFFER is non-nil." (if buffer (progn (erc-display-message parsed nil buffer s) t) @@ -3982,7 +3982,7 @@ designed to be added to either `erc-echo-notice-hook' or "Echos a private notice in the active buffer if the active buffer is not the server buffer. This function is designed to be added to either `erc-echo-notice-hook' or -`erc-echo-notice-always-hook', and returns non-nil iff the active +`erc-echo-notice-always-hook', and returns non-nil if the active buffer is not the server buffer." (if (not (eq (erc-server-buffer) (erc-active-buffer))) (progn (erc-display-message parsed nil 'active s) t) @@ -3999,7 +3999,7 @@ designed to be added to either `erc-echo-notice-hook' or "Echos a private notice in all of the buffers for which SENDER is a member. This function is designed to be added to either `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and -returns non-nil iff there is at least one buffer for which the +returns non-nil if there is at least one buffer for which the sender is a member. See also: `erc-echo-notice-in-first-user-buffer', @@ -4013,7 +4013,7 @@ See also: `erc-echo-notice-in-first-user-buffer', "Echos a private notice in BUFFER and in all of the buffers for which SENDER is a member. This function is designed to be added to either `erc-echo-notice-hook' or -`erc-echo-notice-always-hook', and returns non-nil iff there is +`erc-echo-notice-always-hook', and returns non-nil if there is at least one buffer for which the sender is a member or the default target. @@ -4029,7 +4029,7 @@ See also: `erc-echo-notice-in-user-buffers', "Echos a private notice in one of the buffers for which SENDER is a member. This function is designed to be added to either `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and -returns non-nil iff there is at least one buffer for which the +returns non-nil if there is at least one buffer for which the sender is a member. See also: `erc-echo-notice-in-user-buffers', @@ -4938,7 +4938,7 @@ Specifically, return the position of `erc-insert-marker'." (defun erc-send-input (input) "Treat INPUT as typed in by the user. It is assumed that the input and the prompt is already deleted. -This returns non-nil only iff we actually send anything." +This returns non-nil only if we actually send anything." ;; Handle different kinds of inputs (cond ;; Ignore empty input -- cgit v1.2.1 From 7b94ca6bb746d4cc2bbb402894dcf3cbf7230ed8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:18:14 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/mail/mspools.el | 2 +- lisp/mail/rmail.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el index d14be55735f..988ce2f8e02 100644 --- a/lisp/mail/mspools.el +++ b/lisp/mail/mspools.el @@ -398,7 +398,7 @@ nil." )) (defun mspools-size-folder (spool) - "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero." + "Return (SPOOL . SIZE ), if SIZE of spool file is non-zero." ;; 7th file attribute is the size of the file in bytes. (let ((file (concat mspools-folder-directory spool)) size) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 37a0533acc9..ee990f2fdd3 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3992,13 +3992,13 @@ specifying headers which should not be copied into the new message." (mail-position-on-field (if resending "Resent-To" "To") t)))))) (defun rmail-summary-exists () - "Non-nil iff in an RMAIL buffer and an associated summary buffer exists. + "Non-nil if in an RMAIL buffer and an associated summary buffer exists. In fact, the non-nil value returned is the summary buffer itself." (and rmail-summary-buffer (buffer-name rmail-summary-buffer) rmail-summary-buffer)) (defun rmail-summary-displayed () - "t iff in RMAIL buffer and an associated summary buffer is displayed." + "t if in RMAIL buffer and an associated summary buffer is displayed." (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer))) (defcustom rmail-redisplay-summary nil -- cgit v1.2.1 From 7053c5b1f572a420edcee68b8dec5e0f01618a4f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:18:57 +0000 Subject: *** empty log message *** --- lisp/mh-e/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 51b3c80f4d5..f8134b0911e 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,8 @@ +2007-08-08 Glenn Morris + + * mh-folder.el, mh-letter.el, mh-show.el: Replace `iff' in + doc-strings and comments. + 2007-07-25 Glenn Morris * Relicense all FSF files to GPLv3 or later. -- cgit v1.2.1 From 7e7b6ba09e7c940dc17ccac8b10c24f3c9efdb8e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:19:27 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/mh-e/mh-folder.el | 2 +- lisp/mh-e/mh-letter.el | 2 +- lisp/mh-e/mh-show.el | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 63d55459cf4..42abad4536a 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -1495,7 +1495,7 @@ function doesn't recenter the folder buffer." (defun mh-update-unseen () "Synchronize the unseen sequence with MH. -Return non-nil iff the MH folder was set. +Return non-nil if the MH folder was set. The hook `mh-unseen-updated-hook' is called after the unseen sequence is updated." (if mh-seen-list diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index c70c9d8c7e4..7b2cab77d04 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -844,7 +844,7 @@ body." (defun mh-position-on-field (field &optional ignored) "Move to the end of the FIELD in the header. Move to end of entire header if FIELD not found. -Returns non-nil iff FIELD was found. +Returns non-nil if FIELD was found. The optional second arg is for pre-version 4 compatibility and is IGNORED." (cond ((mh-goto-header-field field) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index d3b93ca65ab..4e1a19c3a06 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -161,7 +161,7 @@ displayed." (defun mh-showing-mode (&optional arg) "Change whether messages should be displayed. -With ARG, display messages iff ARG is positive." +With ARG, display messages if ARG is positive, otherwise don't display them." (setq mh-showing-mode (if (null arg) (not mh-showing-mode) -- cgit v1.2.1 From 4b9ee75493dc5ddcd42f50e8500a331c8816eb64 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:21:11 +0000 Subject: *** empty log message *** --- lisp/url/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index ef18be7403d..da5410fe600 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2007-08-08 Glenn Morris + + * url-auth.el, url-cache.el, url-dav.el, url-file.el, vc-dav.el: + Replace `iff' in doc-strings and comments. + 2007-07-25 Glenn Morris * Relicense all FSF files to GPLv3 or later. -- cgit v1.2.1 From 1645bfd36403bf80b4cf9833ea0f656188b587f6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:21:23 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/url/url-auth.el | 2 +- lisp/url/url-cache.el | 2 +- lisp/url/url-dav.el | 6 +++--- lisp/url/url-file.el | 2 +- lisp/url/vc-dav.el | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index c57a96cc81b..030409c3391 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -310,7 +310,7 @@ RATING a rating between 1 and 10 of the strength of the authentication. url-registered-auth-schemes))))) (defun url-auth-registered (scheme) - ;; Return non-nil iff SCHEME is registered as an auth type + "Return non-nil if SCHEME is registered as an auth type." (assoc scheme url-registered-auth-schemes)) (provide 'url-auth) diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 8fbe01d472a..6db30eacda9 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el @@ -186,7 +186,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise." ;;;###autoload (defun url-cache-expired (url mod) - "Return t iff a cached file has expired." + "Return t if a cached file has expired." (let* ((urlobj (if (vectorp url) url (url-generic-parse-url url))) (type (url-type urlobj))) (cond diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index afae0041b68..b58c1672865 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el @@ -562,7 +562,7 @@ FAILURE-RESULTS is a list of (URL STATUS)." (defun url-dav-unlock-resource (url lock-token) "Release the lock on URL represented by LOCK-TOKEN. -Returns t iff the lock was successfully released." +Returns t if the lock was successfully released." (declare (special url-http-response-status)) (let* ((url-request-extra-headers (list (cons "Lock-Token" (concat "<" lock-token ">")))) @@ -654,13 +654,13 @@ Returns t iff the lock was successfully released." (or (plist-get properties 'DAV:getcontentlength) 0) ;; file modes as a string like `ls -l' - ;; + ;; ;; Should be able to build this up from the ;; DAV:supportedlock attribute pretty easily. Getting ;; the group info could be impossible though. (url-dav-file-attributes-mode-string properties) - ;; t iff file's gid would change if it were deleted & + ;; t if file's gid would change if it were deleted & ;; recreated. No way for us to know that thru DAV. nil diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el index e899493f1ce..6e771c9cd69 100644 --- a/lisp/url/url-file.el +++ b/lisp/url/url-file.el @@ -52,7 +52,7 @@ to them." found)) (defun url-file-host-is-local-p (host) - "Return t iff HOST references our local machine." + "Return t if HOST references our local machine." (let ((case-fold-search t)) (or (null host) diff --git a/lisp/url/vc-dav.el b/lisp/url/vc-dav.el index ce0d3275a5f..7e9b6606ca4 100644 --- a/lisp/url/vc-dav.el +++ b/lisp/url/vc-dav.el @@ -31,7 +31,7 @@ ;;; Required functions for a vc backend (defun vc-dav-registered (url) - "Return t iff URL is registered with a DAV aware server." + "Return t if URL is registered with a DAV aware server." (url-dav-vc-registered url)) (defun vc-dav-state (url) -- cgit v1.2.1 From 57339971405c4f8e6c8c15d0a024452474c611d3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:22:47 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/textmodes/artist.el | 2 +- lisp/textmodes/flyspell.el | 5 +++-- lisp/textmodes/ispell.el | 3 ++- lisp/textmodes/nroff-mode.el | 2 +- lisp/textmodes/refill.el | 2 +- lisp/textmodes/reftex-global.el | 2 +- lisp/textmodes/sgml-mode.el | 2 +- lisp/textmodes/two-column.el | 6 ++++-- 8 files changed, 14 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index dbb41f13ec0..274de28e6a0 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1768,7 +1768,7 @@ info-variant-part." ;; Macro that won't funcall the function if it is nil. ;; (defmacro artist-funcall (fn &rest args) - "Call function FN with ARGS iff FN is not nil." + "Call function FN with ARGS, if FN is not nil." (list 'if fn (cons 'funcall (cons fn args)))) (defun artist-uniq (l) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 8b95a159477..0b5dfa4cc54 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -457,7 +457,8 @@ See also `flyspell-duplicate-distance'." This spawns a single Ispell process and checks each word. The default flyspell behavior is to highlight incorrect words. With no argument, this command toggles Flyspell mode. -With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive. +With a prefix argument ARG, turn Flyspell minor mode on if ARG is positive, +otherwise turn it off. Bindings: \\[ispell-word]: correct words (using Ispell). @@ -1621,7 +1622,7 @@ FLYSPELL-BUFFER." ;;* flyspell-overlay-p ... */ ;;*---------------------------------------------------------------------*/ (defun flyspell-overlay-p (o) - "A predicate that return true iff O is an overlay used by flyspell." + "Return true if O is an overlay used by flyspell." (and (overlayp o) (overlay-get o 'flyspell-overlay))) ;;*---------------------------------------------------------------------*/ diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 047fb141331..3d6a17c5d93 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3324,7 +3324,8 @@ available on the net." ;;;###autoload (defun ispell-minor-mode (&optional arg) "Toggle Ispell minor mode. -With prefix arg, turn Ispell minor mode on iff arg is positive. +With prefix argument ARG, turn Ispell minor mode on if ARG is positive, +otherwise turn it off. In Ispell minor mode, pressing SPC or RET warns you if the previous word is incorrectly spelled. diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index a96d4845857..18156071e1c 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el @@ -261,7 +261,7 @@ automatically inserts the matching closing request after point." `nroff-electric-newline' forces Emacs to check for an nroff request at the beginning of the line, and insert the matching closing request if necessary. This command toggles that mode (off->on, on->off), with an argument, -turns it on iff arg is positive, otherwise off." +turns it on if arg is positive, otherwise off." :lighter " Electric" (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode"))) diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index a20a482a1c9..3717faa8ad2 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el @@ -217,7 +217,7 @@ complex processing.") ;;;###autoload (define-minor-mode refill-mode "Toggle Refill minor mode. -With prefix arg, turn Refill mode on iff arg is positive. +With prefix arg, turn Refill mode on if arg is positive, otherwise turn it off. When Refill mode is on, the current paragraph will be formatted when changes are made within it. Self-inserting characters only cause diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index c551083240c..2a39949431c 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el @@ -431,7 +431,7 @@ the current TeX document. With no argument, this command toggles `reftex-isearch-minor-mode'. With a prefix argument ARG, turn -`reftex-isearch-minor-mode' on iff ARG is positive." +`reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off." (interactive "P") (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode)) (setq reftex-isearch-minor-mode diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 1c81a1e7028..9da49fcc599 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -757,7 +757,7 @@ With prefix argument ARG, repeat this ARG times." (defun sgml-skip-tag-forward (arg) "Skip to end of tag or matching closing tag if present. With prefix argument ARG, repeat this ARG times. -Return t iff after a closing tag." +Return t if after a closing tag." (interactive "p") ;; FIXME: Use sgml-get-context or something similar. ;; It currently might jump to an unrelated

if the

diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index eebd1923b63..e1f55c0dece 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -561,8 +561,10 @@ off trailing spaces with \\[delete-trailing-whitespace]." (newline arg)) (defun 2C-toggle-autoscroll (arg) - "Toggle autoscrolling, or set it iff prefix ARG is non-nil and positive. -When autoscrolling is turned on, this also realigns the two buffers." + "Toggle autoscrolling. +With prefix argument ARG, turn on autoscrolling if ARG is +positive, otherwise turn it off. When autoscrolling is turned +on, this also realigns the two buffers." (interactive "P") ;(sit-for 0) (setq 2C-autoscroll-start (window-start)) -- cgit v1.2.1 From 66992c0a20af72a504f880bec24f7ef1d60b34b6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:23:19 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/term/sun-mouse.el | 2 +- lisp/term/tvi970.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el index 280bfb67081..65ebe193c71 100644 --- a/lisp/term/sun-mouse.el +++ b/lisp/term/sun-mouse.el @@ -230,7 +230,7 @@ Handles wrapped and horizontally scrolled lines correctly." (defun minibuffer-window-p (window) - "True iff this WINDOW is minibuffer." + "True if this WINDOW is minibuffer." (= (frame-height) (nth 3 (window-edges window)) ; The bottom edge. )) diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index 4af21f08522..1c0bda519ac 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -106,8 +106,8 @@ ;;; Should keypad numbers send ordinary digits or distinct escape sequences? (defvar tvi970-keypad-numeric nil - "The terminal should be in numeric keypad mode iff this variable is non-nil. -Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") + "Non-nil means the terminal should be in numeric keypad mode. +Do not set this variable! Call the function `tvi970-set-keypad-mode'.") (defun tvi970-set-keypad-mode (&optional arg) "Set the current mode of the TVI 970 numeric keypad. -- cgit v1.2.1 From d9c621d105901f326820dd9880a3e9b801070f56 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:24:27 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/international/ja-dic-cnv.el | 4 ++-- lisp/international/latin1-disp.el | 4 ++-- lisp/international/mule-cmds.el | 10 +++++----- lisp/international/quail.el | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el index 5fa18221327..e7c9b633b3b 100644 --- a/lisp/international/ja-dic-cnv.el +++ b/lisp/international/ja-dic-cnv.el @@ -215,8 +215,8 @@ ;; Return t if substring of STR (between FROM and TO) can be broken up ;; to chunks all of which can be derived from another entry in SKK ;; dictionary. SKKBUF is the buffer where the original SKK dictionary -;; is visited, KANA is the current entry for STR. FIRST is t iff this -;; is called at top level. +;; is visited, KANA is the current entry for STR. FIRST is t only if +;; this is called at top level. (defun skkdic-breakup-string (skkbuf kana str from to &optional first) (let ((len (- to from))) diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index 515695bf503..ebeef71b0b7 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el @@ -777,9 +777,9 @@ use either \\[customize] or the function `latin1-display'." "Set up Latin-1/ASCII display for Unicode characters. This uses the transliterations of the Lynx browser. -With argument ARG, turn such display on iff ARG is positive, otherwise +With argument ARG, turn such display on if ARG is positive, otherwise turn it off and display Unicode characters literally. The display -is't changed if the display can render Unicode characters." +isn't changed if the display can render Unicode characters." (interactive "p") (if (> arg 0) (unless (char-displayable-p diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 9501d5f7cc0..a858066f47c 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -445,11 +445,11 @@ non-nil, it is used to sort CODINGS instead." (let ((base (coding-system-base x))) ;; We calculate the priority number 0..255 by ;; using the 8 bits PMMLCEII as this: - ;; P: 1 iff most preferred. - ;; MM: greater than 0 iff mime-charset. - ;; L: 1 iff one of the current lang. env.'s codings. - ;; C: 1 iff one of codings listed in the category list. - ;; E: 1 iff not XXX-with-esc + ;; P: 1 if most preferred. + ;; MM: greater than 0 if mime-charset. + ;; L: 1 if one of the current lang. env.'s codings. + ;; C: 1 if one of codings listed in the category list. + ;; E: 1 if not XXX-with-esc ;; II: if iso-2022 based, 0..3, else 1. (logior (lsh (if (eq base most-preferred) 1 0) 7) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 774e3c14269..f9f497699a0 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1942,7 +1942,7 @@ Remaining args are for FUNC." (overlay-put quail-overlay 'face 'highlight)))) (defun quail-require-guidance-buf () - "Return t iff the current Quail package requires showing guidance buffer." + "Return t if the current Quail package requires showing guidance buffer." (and input-method-verbose-flag (if (eq input-method-verbose-flag 'default) (not (and (eq (selected-window) (minibuffer-window)) -- cgit v1.2.1 From a076a5ee9cfa354d2dba608225854ef389409576 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:27:21 +0000 Subject: *** empty log message *** --- lisp/gnus/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 83ca62ca0de..807a853ba56 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2007-08-08 Glenn Morris + + * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el + * gnus-util.el, imap.el, mailcap.el, nnimap.el: Replace `iff' in + doc-strings and comments. + 2007-07-25 Glenn Morris * Relicense all FSF files to GPLv3 or later. -- cgit v1.2.1 From 15e136d25e0c366d4c820ac1ece1b741040c5f47 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:27:37 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/gnus/gmm-utils.el | 2 +- lisp/gnus/gnus-async.el | 2 +- lisp/gnus/gnus-msg.el | 8 ++++---- lisp/gnus/gnus-score.el | 2 +- lisp/gnus/gnus-util.el | 2 +- lisp/gnus/imap.el | 2 +- lisp/gnus/mailcap.el | 6 +++--- lisp/gnus/nnimap.el | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp') diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index d7e3c344b0e..71a0662f35a 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -79,7 +79,7 @@ ARGS are passed to `message'." ;;;###autoload (defun gmm-widget-p (symbol) - "Non-nil iff SYMBOL is a widget." + "Non-nil if SYMBOL is a widget." (get symbol 'widget-type)) ;; Copy of the `nnmail-lazy' code from `nnmail.el': diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index 3493d51950d..a06724855c5 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el @@ -320,7 +320,7 @@ It should return non-nil if the article is to be prefetched." (pop alist)))))) (defun gnus-async-prefetched-article-entry (group article) - "Return the entry for ARTICLE in GROUP iff it has been prefetched." + "Return the entry for ARTICLE in GROUP if it has been prefetched." (let ((entry (save-excursion (gnus-async-set-buffer) (assq (intern (format "%s-%d" group article) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index c9aedab7019..f8e4a7a67d0 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -260,15 +260,15 @@ See also the `mml-default-encrypt-method' variable." This is done because new users often reply by mistake when reading news. This can also be a function receiving the group name as the only -parameter which should return non-nil iff a confirmation is needed, or -a regexp, in which case a confirmation is asked for iff the group name +parameter, which should return non-nil if a confirmation is needed; or +a regexp, in which case a confirmation is asked for if the group name matches the regexp." :version "22.1" :group 'gnus-message :type '(choice (const :tag "No" nil) (const :tag "Yes" t) - (regexp :tag "Iff group matches regexp") - (function :tag "Iff function evaluates to non-nil"))) + (regexp :tag "If group matches regexp") + (function :tag "If function evaluates to non-nil"))) (defcustom gnus-confirm-treat-mail-like-news nil diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index e833c8ccc6a..f7ba9222937 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -381,7 +381,7 @@ If nil, the user will be asked for a match type." (const :tag "ask" nil))) (defcustom gnus-score-default-fold nil - "Use case folding for new score file entries iff not nil." + "Non-nil means use case folding for new score file entries." :group 'gnus-score-default :type 'boolean) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index d065acd75ea..74aacdd2860 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1108,7 +1108,7 @@ Return the modified alist." `(setq ,alist (delq (,fun ,key ,alist) ,alist)))) (defun gnus-globalify-regexp (re) - "Return a regexp that matches a whole line, iff RE matches a part of it." + "Return a regexp that matches a whole line, if RE matches a part of it." (concat (unless (string-match "^\\^" re) "^.*") re (unless (string-match "\\$$" re) ".*$"))) diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el index abe1c7e1c9e..f60801e9ba8 100644 --- a/lisp/gnus/imap.el +++ b/lisp/gnus/imap.el @@ -1581,7 +1581,7 @@ is non-nil return these properties." (imap-mailbox-get-1 'search imap-current-mailbox))))) (defun imap-message-flag-permanent-p (flag &optional mailbox buffer) - "Return t iff FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER." + "Return t if FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER." (with-current-buffer (or buffer (current-buffer)) (or (member "\\*" (imap-mailbox-get 'permanentflags mailbox)) (member flag (imap-mailbox-get 'permanentflags mailbox))))) diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index 422b99d0e0f..e8b624aa546 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el @@ -538,7 +538,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus results))) (defun mailcap-mailcap-entry-passes-test (info) - "Return non-nil iff mailcap entry INFO passes its test clause. + "Return non-nil if mailcap entry INFO passes its test clause. Also return non-nil if no test clause is present." (let ((test (assq 'test info)) ; The test clause status) @@ -631,7 +631,7 @@ Also return non-nil if no test clause is present." (defvar mailcap-viewer-test-cache nil) (defun mailcap-viewer-passes-test (viewer-info type-info) - "Return non-nil iff viewer specified by VIEWER-INFO passes its test clause. + "Return non-nil if viewer specified by VIEWER-INFO passes its test clause. Also return non-nil if it has no test clause. TYPE-INFO is an argument to supply to the test." (let* ((test-info (assq 'test viewer-info)) @@ -704,7 +704,7 @@ If TEST is not given, it defaults to t." ;;; (defun mailcap-viewer-lessp (x y) - "Return t iff viewer X is more desirable than viewer Y." + "Return t if viewer X is more desirable than viewer Y." (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) ""))) (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) ""))) (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) "")))) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 235039c3ee9..ba23280658a 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1645,7 +1645,7 @@ be used in a STORE FLAGS command." result))) (defun nnimap-mark-permanent-p (mark &optional group) - "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP." + "Return t if MARK can be permanently (between IMAP sessions) saved on articles, in GROUP." (imap-message-flag-permanent-p (nnimap-mark-to-flag mark))) (when nnimap-debug -- cgit v1.2.1 From 9c7f99b4ce6f1684699f5140f51344c7ecc2217f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:31:11 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/progmodes/antlr-mode.el | 6 +++--- lisp/progmodes/cc-awk.el | 2 +- lisp/progmodes/cc-engine.el | 2 +- lisp/progmodes/cc-vars.el | 2 +- lisp/progmodes/cperl-mode.el | 4 ++-- lisp/progmodes/cpp.el | 6 ++++-- lisp/progmodes/etags.el | 8 ++++---- lisp/progmodes/fortran.el | 2 +- lisp/progmodes/gdb-ui.el | 12 ++++++++---- lisp/progmodes/gud.el | 2 +- lisp/progmodes/hideshow.el | 6 +++--- lisp/progmodes/octave-mod.el | 10 +++++----- lisp/progmodes/python.el | 8 ++++---- lisp/progmodes/which-func.el | 2 +- lisp/progmodes/xscheme.el | 4 ++-- 15 files changed, 41 insertions(+), 35 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 7fbeeab6eea..594b628ad44 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -568,7 +568,7 @@ The standard value contains the following functions as READ-FN: general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which reads a boolean value or a member of TABLE. PROMPT is the prompt when asking for a new value. If non-nil, TABLE is a table for completion or -a function evaluating to such a table. The return value is quoted iff +a function evaluating to such a table. The return value is quoted if AS-STRING is non-nil and is either t or a symbol which is a member of `antlr-options-style'.") @@ -2203,8 +2203,8 @@ part SUPER in the result of `antlr-file-dependencies'. CLASSES is the part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'. The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the -complete \"-glib\" option. WITH-UNKNOWN has value t iff there is none -or more than one grammar file for at least one super grammar. +complete \"-glib\" option. WITH-UNKNOWN is t if there is none or more +than one grammar file for at least one super grammar. Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file in which a super-grammar is defined. EVOCAB is the value of the export diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 997e6c44f1a..33467671170 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -478,7 +478,7 @@ (defun c-awk-get-NL-prop-prev-line (&optional do-lim) ;; Get the c-awk-NL-prop text-property from the previous line, calculating - ;; it if necessary. Return nil iff we're already at BOB. + ;; it if necessary. Return nil if we're at BOB. ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. ;; ;; This function might do hidden buffer changes. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 44463a07f15..97dcc61460f 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -5116,7 +5116,7 @@ comment at the start of cc-engine.el for more info." ;; Foo::Foo (int b) : Base (b) {} ;; car ^ ^ point ;; - ;; The cdr of the return value is non-nil iff a + ;; The cdr of the return value is non-nil if a ;; `c-typedef-decl-kwds' specifier is found in the declaration, ;; i.e. the declared identifier(s) are types. ;; diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index a80833c0043..76b0e5a898c 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -186,7 +186,7 @@ the value set here overrides the style system (there is a variable (bq-process type))))))))) (defun c-valid-offset (offset) - "Return non-nil iff OFFSET is a valid offset for a syntactic symbol. + "Return non-nil if OFFSET is a valid offset for a syntactic symbol. See `c-offsets-alist'." (or (eq offset '+) (eq offset '-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3badfed5d4f..cd7dabb8825 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3558,7 +3558,7 @@ modify syntax-type text property if the situation is too hard." (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) (if ender (modify-syntax-entry ender "." st)))) ;; i: have 2 args, after end of the first arg - ;; i2: start of the second arg, if any (before delim iff `ender'). + ;; i2: start of the second arg, if any (before delim if `ender'). ;; ender: the last arg bounded by parens-like chars, the second one of them ;; starter: the starting delimiter of the first arg ;; go-forward: has 2 args, and the second part is empty @@ -8090,7 +8090,7 @@ prototype \\&SUB Returns prototype of the function given a reference. (defun cperl-beautify-regexp-piece (b e embed level) ;; b is before the starting delimiter, e before the ending ;; e should be a marker, may be changed, but remains "correct". - ;; EMBED is nil iff we process the whole REx. + ;; EMBED is nil if we process the whole REx. ;; The REx is guaranteed to have //x ;; LEVEL shows how many levels deep to go ;; position at enter and at leave is not defined diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index e85c4752412..05b8b59c00f 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -623,7 +623,8 @@ You can also use the keyboard accelerators indicated like this: [K]ey." (defun cpp-edit-toggle-known (arg) "Toggle writable status for known conditionals. -With optional argument ARG, make them writable iff ARG is positive." +With optional argument ARG, make them writable if ARG is positive, +otherwise make them unwritable." (interactive "@P") (if (or (and (null arg) cpp-known-writable) (<= (prefix-numeric-value arg) 0)) @@ -633,7 +634,8 @@ With optional argument ARG, make them writable iff ARG is positive." (defun cpp-edit-toggle-unknown (arg) "Toggle writable status for unknown conditionals. -With optional argument ARG, make them writable iff ARG is positive." +With optional argument ARG, make them writable if ARG is positive, +otherwise make them unwritable." (interactive "@P") (if (or (and (null arg) cpp-unknown-writable) (<= (prefix-numeric-value arg) 0)) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 196c22b4a08..96af63849a4 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -256,10 +256,10 @@ One argument, the tag info returned by `snarf-tag-function'.") (defvar tags-included-tables-function nil "Function to do the work of `tags-included-tables' (which see).") (defvar verify-tags-table-function nil - "Function to return t iff current buffer contains valid tags file.") + "Function to return t if current buffer contains valid tags file.") ;; Initialize the tags table in the current buffer. -;; Returns non-nil iff it is a valid tags table. On +;; Returns non-nil if it is a valid tags table. On ;; non-nil return, the tags table state variable are ;; made buffer-local and initialized to nil. (defun initialize-new-tags-table () @@ -417,7 +417,7 @@ file the tag was in." (defun tags-verify-table (file) "Read FILE into a buffer and verify that it is a valid tags table. Sets the current buffer to one visiting FILE (if it exists). -Returns non-nil iff it is a valid table." +Returns non-nil if it is a valid table." (if (get-file-buffer file) ;; The file is already in a buffer. Check for the visited file ;; having changed since we last used it. @@ -1219,8 +1219,8 @@ where they were found." (verify-tags-table-function . etags-verify-tags-table) )))) -;; Return non-nil iff the current buffer is a valid etags TAGS file. (defun etags-verify-tags-table () + "Return non-nil if the current buffer is a valid etags TAGS file." ;; Use eq instead of = in case char-after returns nil. (eq (char-after (point-min)) ?\f)) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index b9865613765..16992c54523 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1763,7 +1763,7 @@ If ALL is nil, only match comments that start in column > 0." ;; From: ralf@up3aud1.gwdg.de (Ralf Fassel) ;; Test if TAB format continuation lines work. (defun fortran-is-in-string-p (where) - "Return non-nil iff WHERE (a buffer position) is inside a Fortran string." + "Return non-nil if WHERE (a buffer position) is inside a Fortran string." (save-excursion (goto-char where) (cond diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 8f6be334465..c4d14462245 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -347,7 +347,8 @@ for `gdba'." (defun gdb-many-windows (arg) "Toggle the number of windows in the basic arrangement. -With arg, display additional buffers iff arg is positive." +With prefix argument ARG, display additional buffers if ARG is positive, +otherwise use a single window." (interactive "P") (setq gdb-many-windows (if (null arg) @@ -363,7 +364,8 @@ With arg, display additional buffers iff arg is positive." (defun gdb-use-separate-io-buffer (arg) "Toggle separate IO for debugged program. -With arg, use separate IO iff arg is positive." +With prefix argument ARG, use separate IO if ARG is positive, +otherwise do not." (interactive "P") (setq gdb-use-separate-io-buffer (if (null arg) @@ -664,7 +666,8 @@ line, and no execution takes place." (defun gdb-speedbar-auto-raise (arg) "Toggle automatic raising of the speedbar for watch expressions. -With arg, automatically raise speedbar iff arg is positive." +With prefix argument ARG, automatically raise speedbar if ARG is +positive, otherwise don't automatically raise it." (interactive "P") (setq gdb-speedbar-auto-raise (if (null arg) @@ -1381,7 +1384,8 @@ directives." (defun gdb-find-source-frame (arg) "Toggle trying to find a source frame further up stack. -With arg, look for a source frame further up stack iff arg is positive." +With prefix argument ARG, look for a source frame further up +stack if ARG is positive, otherwise don't look further up." (interactive "P") (setq gdb-find-source-frame (if (null arg) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index ec5b901f691..06bdd6a0b5f 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3353,7 +3353,7 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.") (defun gud-tooltip-dereference (&optional arg) "Toggle whether tooltips should show `* expr' or `expr'. -With arg, dereference expr iff arg is positive." +With arg, dereference expr if ARG is positive, otherwise do not derereference." (interactive "P") (setq gud-tooltip-dereference (if (null arg) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 3f2580a5d4b..fb990d6bf3a 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -262,7 +262,7 @@ One of the following symbols: t -- open both code and comment blocks nil -- open neither code nor comment blocks -This has effect iff `search-invisible' is set to `open'." +This has effect only if `search-invisible' is set to `open'." :type '(choice (const :tag "open only code blocks" code) (const :tag "open only comment blocks" comment) (const :tag "open both code and comment blocks" t) @@ -515,7 +515,7 @@ Optional arg REPOS-END means reposition at end." (goto-char (if repos-end end beg))) (defun hs-hide-block-at-point (&optional end comment-reg) - "Hide block iff on block beginning. + "Hide block if on block beginning. Optional arg END means reposition at end. Optional arg COMMENT-REG is a list of the form (BEGIN END) and specifies the limits of the comment, or nil if the block is not @@ -679,7 +679,7 @@ Return point, or nil if original point was not in a block." (goto-char maxp)) (defmacro hs-life-goes-on (&rest body) - "Evaluate BODY forms iff variable `hs-minor-mode' is non-nil. + "Evaluate BODY forms if variable `hs-minor-mode' is non-nil. In the dynamic context of this macro, `inhibit-point-motion-hooks' and `case-fold-search' are both t." `(when hs-minor-mode diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index adc1b44edaa..3da3434cda2 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -567,24 +567,24 @@ including a reproducible test case and send the message." (describe-function major-mode)) (defsubst octave-in-comment-p () - "Returns t if point is inside an Octave comment, nil otherwise." + "Return t if point is inside an Octave comment." (interactive) (save-excursion (nth 4 (parse-partial-sexp (line-beginning-position) (point))))) (defsubst octave-in-string-p () - "Returns t if point is inside an Octave string, nil otherwise." + "Return t if point is inside an Octave string." (interactive) (save-excursion (nth 3 (parse-partial-sexp (line-beginning-position) (point))))) (defsubst octave-not-in-string-or-comment-p () - "Returns t iff point is not inside an Octave string or comment." + "Return t if point is not inside an Octave string or comment." (let ((pps (parse-partial-sexp (line-beginning-position) (point)))) (not (or (nth 3 pps) (nth 4 pps))))) (defun octave-in-block-p () - "Returns t if point is inside an Octave block, nil otherwise. + "Return t if point is inside an Octave block. The block is taken to start at the first letter of the begin keyword and to end after the end keyword." (let ((pos (point))) @@ -599,7 +599,7 @@ to end after the end keyword." (< pos (point))))) (defun octave-in-defun-p () - "Returns t iff point is inside an Octave function declaration. + "Return t if point is inside an Octave function declaration. The function is taken to start at the `f' of `function' and to end after the end keyword." (let ((pos (point))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index ca18f772970..7c1abaf223d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -348,7 +348,7 @@ comments and strings, or that point is within brackets/parens." (error nil)))))))) (defun python-comment-line-p () - "Return non-nil iff current line has only a comment." + "Return non-nil if current line has only a comment." (save-excursion (end-of-line) (when (eq 'comment (syntax-ppss-context (syntax-ppss))) @@ -356,7 +356,7 @@ comments and strings, or that point is within brackets/parens." (looking-at (rx (or (syntax comment-start) line-end)))))) (defun python-blank-line-p () - "Return non-nil iff current line is blank." + "Return non-nil if current line is blank." (save-excursion (beginning-of-line) (looking-at "\\s-*$"))) @@ -850,7 +850,7 @@ multi-line bracketed expressions." "Skip out of any nested brackets. Skip forward if FORWARD is non-nil, else backward. If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. -Return non-nil iff skipping was done." +Return non-nil if skipping was done." (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) (forward (if forward -1 1))) (unless (zerop depth) @@ -1191,7 +1191,7 @@ local value.") (define-key map "\C-c\C-l" 'python-load-file) (define-key map "\C-c\C-v" 'python-check) ;; Note that we _can_ still use these commands which send to the - ;; Python process even at the prompt iff we have a normal prompt, + ;; Python process even at the prompt provided we have a normal prompt, ;; i.e. '>>> ' and not '... '. See the comment before ;; python-send-region. Fixme: uncomment these if we address that. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 922de2d54c6..7d953be1d5c 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -232,7 +232,7 @@ It creates the Imenu index for the buffer, if necessary." When Which Function mode is enabled, the current function name is continuously displayed in the mode line, in certain major modes. -With prefix ARG, turn Which Function mode on iff arg is positive, +With prefix ARG, turn Which Function mode on if arg is positive, and off otherwise." :global t :group 'which-func (if which-function-mode diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 0beca9e985e..a820ca4cede 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -868,7 +868,7 @@ Control returns to the top level rep loop." (sleep-for 1))) (defun xscheme-process-running-p () - "True iff there is a Scheme process whose status is `run'." + "True if there is a Scheme process whose status is `run'." (let ((process (get-process xscheme-process-name))) (and process (eq (process-status process) 'run)))) @@ -882,7 +882,7 @@ Control returns to the top level rep loop." (and buffer (get-buffer-window buffer)))) (defun xscheme-process-buffer-current-p () - "True iff the current buffer is the Scheme process buffer." + "True if the current buffer is the Scheme process buffer." (eq (xscheme-process-buffer) (current-buffer))) ;;;; Process Filter Operations -- cgit v1.2.1 From 6d942bebc55f07d7893e96b5193f04a4f756d803 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:32:27 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/obsolete/fast-lock.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el index a2405b0edb2..569771143e3 100644 --- a/lisp/obsolete/fast-lock.el +++ b/lisp/obsolete/fast-lock.el @@ -523,7 +523,7 @@ See `fast-lock-cache-directories'." ;; Just a directory. directory) (t - ;; A directory iff the file name matches the regexp. + ;; A directory if the file name matches the regexp. (let ((bufile (expand-file-name buffer-file-truename)) (case-fold-search nil)) (when (save-match-data (string-match (car directory) bufile)) -- cgit v1.2.1 From beccf4b19ac7549532e04bc153fb31ac0ce9efea Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:33:26 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/net/tramp.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 09167d674eb..33026451722 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2436,7 +2436,7 @@ target of the symlink differ." res-size ;; 8. File modes, as a string of ten letters or dashes as in ls -l. res-filemodes - ;; 9. t iff file's gid would change if file were deleted and + ;; 9. t if file's gid would change if file were deleted and ;; recreated. Will be set in `tramp-convert-file-attributes' t ;; 10. inode number. @@ -7028,7 +7028,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" (and (tramp-file-name-p obj) (aref obj 4))) (defun tramp-tramp-file-p (name) - "Return t iff NAME is a tramp file." + "Return t if NAME is a tramp file." (save-match-data (string-match tramp-file-name-regexp name))) -- cgit v1.2.1 From 2da5e87b3c39978f1ea7bd9345fc45870b0df51e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:34:30 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9bc99517ca0..81ac364d905 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-08 Glenn Morris + + * emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Remove `iff'. + + * Replace `iff' in doc-strings and comments. + 2007-08-08 Martin Rudalics * dired.el (dired-pop-to-buffer): -- cgit v1.2.1 From 449cacc6aafb2d7412d93339eeeb404853fe1441 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:37:59 +0000 Subject: Remove time-stamp. Replace `iff' in doc-strings and comments. --- lisp/winner.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/winner.el b/lisp/winner.el index bc7503b963c..ed840d37622 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -5,7 +5,6 @@ ;; Author: Ivar Rummelhoff ;; Created: 27 Feb 1997 -;; Time-stamp: <2006-02-06 15:13:57 ttn> ;; Keywords: convenience frames ;; This file is part of GNU Emacs. @@ -286,7 +285,7 @@ You may want to include buffer names such as *Help*, *Apropos*, (defun winner-get-point (buf win) ;; Consult (and possibly extend) `winner-point-alist'. - ;; Returns nil iff buf no longer exists. + ;; Returns nil if buf no longer exists. (when (buffer-name buf) (let ((entry (assq buf winner-point-alist))) (cond @@ -306,7 +305,7 @@ You may want to include buffer names such as *Help*, *Apropos*, ;; Make sure point does not end up in the minibuffer and delete ;; windows displaying dead or boring buffers -;; (c.f. `winner-boring-buffers'). Return nil iff all the windows +;; (c.f. `winner-boring-buffers'). Return nil if all the windows ;; should be deleted. Preserve correct points and marks. (defun winner-set (conf) ;; For the format of `conf', see `winner-conf'. -- cgit v1.2.1 From a68f2006ee8483b49da5d168aba2ab447623af18 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:38:50 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/abbrev.el | 6 +++--- lisp/allout.el | 5 +++-- lisp/autorevert.el | 2 +- lisp/bindings.el | 2 +- lisp/custom.el | 10 +++++----- lisp/diff.el | 3 ++- lisp/dired-aux.el | 4 ++-- lisp/double.el | 3 ++- lisp/ediff-diff.el | 4 ++-- lisp/files.el | 7 ++++--- lisp/font-lock.el | 6 +++--- lisp/frame.el | 6 +++--- lisp/hilit-chg.el | 2 +- lisp/ibuf-ext.el | 2 +- lisp/ibuffer.el | 4 ++-- lisp/icomplete.el | 5 +++-- lisp/ido.el | 2 +- lisp/image.el | 2 +- lisp/imenu.el | 2 +- lisp/info-look.el | 2 +- lisp/isearch.el | 4 ++-- lisp/iswitchb.el | 6 +++--- lisp/log-edit.el | 2 +- lisp/printing.el | 6 +++--- lisp/select.el | 2 +- lisp/shadowfile.el | 2 +- lisp/simple.el | 53 +++++++++++++++++++++++++++-------------------------- lisp/skeleton.el | 4 ++-- lisp/strokes.el | 4 ++-- lisp/t-mouse.el | 3 ++- lisp/term.el | 2 +- lisp/userlock.el | 2 +- lisp/vc.el | 2 +- lisp/view.el | 3 ++- lisp/whitespace.el | 2 +- lisp/wid-edit.el | 6 +++--- lisp/window.el | 10 +++++----- lisp/xt-mouse.el | 3 ++- 38 files changed, 102 insertions(+), 93 deletions(-) (limited to 'lisp') diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 1471ca7bebd..b2b03fe63bb 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -39,9 +39,9 @@ define global abbrevs instead." (defun abbrev-mode (&optional arg) "Toggle Abbrev mode in the current buffer. -With argument ARG, turn abbrev mode on iff ARG is positive. -In Abbrev mode, inserting an abbreviation causes it to expand -and be replaced by its expansion." +With optional argument ARG, turn abbrev mode on if ARG is +positive, otherwise turn it off. In Abbrev mode, inserting an +abbreviation causes it to expand and be replaced by its expansion." (interactive "P") (setq abbrev-mode (if (null arg) (not abbrev-mode) diff --git a/lisp/allout.el b/lisp/allout.el index f6598063e97..d243a188812 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1658,8 +1658,9 @@ the following two lines in your Emacs init file: "Toggle minor mode for controlling exposure and editing of text outlines. \\ -Optional arg forces mode to re-initialize iff arg is positive num or -symbol. Allout outline mode always runs as a minor mode. +Optional prefix argument TOGGLE forces the mode to re-initialize +if it is positive, otherwise it turns the mode off. Allout +outline mode always runs as a minor mode. Allout outline mode provides extensive outline oriented formatting and manipulation. It enables structural editing of outlines, as well as diff --git a/lisp/autorevert.el b/lisp/autorevert.el index cad94e789d6..5220f3f6dea 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -315,7 +315,7 @@ This function is designed to be added to hooks, for example: ;;;###autoload (define-minor-mode auto-revert-tail-mode "Toggle reverting tail of buffer when file on disk grows. -With arg, turn Tail mode on iff arg is positive. +With arg, turn Tail mode on if arg is positive, otherwise turn it off. When Tail mode is enabled, the tail of the file is constantly followed, as with the shell command `tail -f'. This means that diff --git a/lisp/bindings.el b/lisp/bindings.el index 4ce58c204eb..3c7237a52fa 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -476,7 +476,7 @@ Menu of mode operations in the mode line.") (defvar minor-mode-alist nil "\ Alist saying how to show minor modes in the mode line. Each element looks like (VARIABLE STRING); -STRING is included in the mode line iff VARIABLE's value is non-nil. +STRING is included in the mode line if VARIABLE's value is non-nil. Actually, STRING need not be a string; any possible mode-line element is okay. See `mode-line-format'.") diff --git a/lisp/custom.el b/lisp/custom.el index c50fcb05f42..e5925dd18d0 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -642,7 +642,7 @@ this sets the local binding in that buffer instead." (funcall variable (if value 1 0)))) (defun custom-quote (sexp) - "Quote SEXP iff it is not self quoting." + "Quote SEXP if it is not self quoting." (if (or (memq sexp '(t nil)) (keywordp sexp) (and (listp sexp) @@ -665,14 +665,14 @@ default value. Otherwise, set it to nil. To actually save the value, call `custom-save-all'. -Return non-nil iff the `saved-value' property actually changed." +Return non-nil if the `saved-value' property actually changed." (custom-load-symbol symbol) (let* ((get (or (get symbol 'custom-get) 'default-value)) (value (funcall get symbol)) (saved (get symbol 'saved-value)) (standard (get symbol 'standard-value)) (comment (get symbol 'customized-variable-comment))) - ;; Save default value iff different from standard value. + ;; Save default value if different from standard value. (if (or (null standard) (not (equal value (condition-case nil (eval (car standard)) @@ -694,13 +694,13 @@ or else if it is different from the standard value, set the `customized-value' property to a list whose car evaluates to the default value. Otherwise, set it to nil. -Return non-nil iff the `customized-value' property actually changed." +Return non-nil if the `customized-value' property actually changed." (custom-load-symbol symbol) (let* ((get (or (get symbol 'custom-get) 'default-value)) (value (funcall get symbol)) (customized (get symbol 'customized-value)) (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) - ;; Mark default value as set iff different from old value. + ;; Mark default value as set if different from old value. (if (not (and old (equal value (condition-case nil (eval (car old)) diff --git a/lisp/diff.el b/lisp/diff.el index c612b2fb77c..75ae34d5f2a 100644 --- a/lisp/diff.el +++ b/lisp/diff.el @@ -62,7 +62,8 @@ (defun diff-sentinel (code) "Code run when the diff process exits. -CODE is the exit code of the process. It should be 0 iff no diffs were found." +CODE is the exit code of the process. It should be 0 only if no diffs +were found." (if diff-old-temp-file (delete-file diff-old-temp-file)) (if diff-new-temp-file (delete-file diff-new-temp-file)) (save-excursion diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index fd57c4b8885..4d9849cd534 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2006,8 +2006,8 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well." (defun dired-tree-lessp (dir1 dir2) ;; Lexicographic order on file name components, like `ls -lR': - ;; DIR1 < DIR2 iff DIR1 comes *before* DIR2 in an `ls -lR' listing, - ;; i.e., iff DIR1 is a (grand)parent dir of DIR2, + ;; DIR1 < DIR2 if DIR1 comes *before* DIR2 in an `ls -lR' listing, + ;; i.e., if DIR1 is a (grand)parent dir of DIR2, ;; or DIR1 and DIR2 are in the same parentdir and their last ;; components are string-lessp. ;; Thus ("/usr/" "/usr/bin") and ("/usr/a/" "/usr/b/") are tree-lessp. diff --git a/lisp/double.el b/lisp/double.el index 4b1d59ff1ec..0b5cf110fbd 100644 --- a/lisp/double.el +++ b/lisp/double.el @@ -186,7 +186,8 @@ use either \\[customize] or the function `double-mode'." ;;;###autoload (defun double-mode (arg) "Toggle Double mode. -With prefix arg, turn Double mode on iff arg is positive. +With prefix argument ARG, turn Double mode on if ARG is positive, otherwise +turn it off. When Double mode is on, some keys will insert different strings when pressed twice. See variable `double-map' for details." diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index 48cd7c79d4e..ec153fde625 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el @@ -867,7 +867,7 @@ one optional arguments, diff-number to refine.") (ediff-make-fine-diffs n 'noforce) (ediff-make-fine-diffs n 'skip))) - ;; highlight iff fine diffs already exist + ;; highlight if fine diffs already exist ((eq ediff-auto-refine 'off) (ediff-make-fine-diffs n 'skip)))) @@ -1459,7 +1459,7 @@ arguments to `skip-chars-forward'." (defun ediff-same-contents (d1 d2 &optional filter-re) - "Returns t iff D1 and D2 have the same content. + "Return t if D1 and D2 have the same content. D1 and D2 can either be both directories or both regular files. Symlinks and the likes are not handled. If FILTER-RE is non-nil, recursive checking in directories diff --git a/lisp/files.el b/lisp/files.el index dfa3cef384d..4d952f3f935 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3941,8 +3941,9 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." (defun toggle-read-only (&optional arg) "Change whether this buffer is visiting its file read-only. -With arg, set read-only iff arg is positive. -If visiting file read-only and `view-read-only' is non-nil, enter view mode." +With prefix argument ARG, make the buffer read-only if ARG is +positive, otherwise make it writable. If visiting file read-only +and `view-read-only' is non-nil, enter view mode." (interactive "P") (if (and arg (if (> (prefix-numeric-value arg) 0) buffer-read-only @@ -4568,7 +4569,7 @@ FILENAME should lack slashes. You can redefine this for customization." (defun wildcard-to-regexp (wildcard) "Given a shell file name pattern WILDCARD, return an equivalent regexp. -The generated regexp will match a filename iff the filename +The generated regexp will match a filename only if the filename matches that wildcard according to shell rules. Only wildcards known by `sh' are supported." (let* ((i (string-match "[[.*+\\^$?]" wildcard)) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 9eb4fdde2df..6bc5fd8716f 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -355,7 +355,7 @@ Each element in a user-level keywords list should have one of these forms: where MATCHER can be either the regexp to search for, or the function name to call to make the search (called with one argument, the limit of the search; -it should return non-nil, move point, and set `match-data' appropriately iff +it should return non-nil, move point, and set `match-data' appropriately if it succeeds; like `re-search-forward' would). MATCHER regexps can be generated via the function `regexp-opt'. @@ -1068,7 +1068,7 @@ that tries to find such elements and move the boundaries such that they do not fall in the middle of one. Each function is called with no argument; it is expected to adjust the dynamically bound variables `font-lock-beg' and `font-lock-end'; and return -non-nil iff it did make such an adjustment. +non-nil if it did make such an adjustment. These functions are run in turn repeatedly until they all return nil. Put first the functions more likely to cause a change and cheaper to compute.") ;; Mark it as a special hook which doesn't use any global setting @@ -1746,7 +1746,7 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to "Set fontification defaults appropriately for this mode. Sets various variables using `font-lock-defaults' (or, if nil, using `font-lock-defaults-alist') and `font-lock-maximum-decoration'." - ;; Set fontification defaults iff not previously set for correct major mode. + ;; Set fontification defaults if not previously set for correct major mode. (unless (and font-lock-set-defaults (eq font-lock-mode-major-mode major-mode)) (setq font-lock-mode-major-mode major-mode) diff --git a/lisp/frame.el b/lisp/frame.el index 13c42ed5ad1..97133dee87c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1310,9 +1310,9 @@ itself as a pre-command hook." (define-minor-mode blink-cursor-mode "Toggle blinking cursor mode. -With a numeric argument, turn blinking cursor mode on iff ARG is positive. -When blinking cursor mode is enabled, the cursor of the selected -window blinks. +With a numeric argument, turn blinking cursor mode on if ARG is positive, +otherwise turn it off. When blinking cursor mode is enabled, the +cursor of the selected window blinks. Note that this command is effective only when Emacs displays through a window system, because then Emacs does its own diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index b1238b66419..a167b2bc1e7 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -131,7 +131,7 @@ ;; an example, if the value is `buffer-file-name' then all buffers ;; who are visiting files are suitable, but others (like dired ;; buffers) are not; -;; * a list -- then the buffer is suitable iff its mode is in the +;; * a list -- then the buffer is suitable if its mode is in the ;; list, except if the first element is `not', in which case the test ;; is reversed (i.e. it is a list of unsuitable modes). ;; * Otherwise, the buffer is suitable if its name does not begin with diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index b077342e5f5..7847bed6f2d 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1331,7 +1331,7 @@ If a buffer has no filename, it is ignored. With no prefix arg, use the filename sans its directory of each marked file. With a zero prefix arg, use the complete filename of each marked file. With \\[universal-argument], use the filename of each marked file relative -to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'. +to `ibuffer-default-directory' if non-nil, otherwise `default-directory'. You can then feed the file name(s) to other commands with \\[yank]." (interactive "p") diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c4842b9d982..80133d227ab 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1835,7 +1835,7 @@ If point is on a group name, this function operates on that group." (defun ibuffer-map-lines (function &optional nomodify group) "Call FUNCTION for each buffer. -Don't set the ibuffer modification flag iff NOMODIFY is non-nil. +Set the ibuffer modification flag unless NOMODIFY is non-nil. If optional argument GROUP is non-nil, then only call FUNCTION on buffers in filtering group GROUP. @@ -2267,7 +2267,7 @@ If optional arg SILENT is non-nil, do not display progress messages." (defun ibuffer-quit () "Quit this `ibuffer' session. -Try to restore the previous window configuration iff +Try to restore the previous window configuration if `ibuffer-restore-window-config-on-quit' is non-nil." (interactive) (if ibuffer-restore-window-config-on-quit diff --git a/lisp/icomplete.el b/lisp/icomplete.el index d1e8f9cc3f8..44c854f2f46 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -99,7 +99,7 @@ completions - see `icomplete-delay-completions-threshold'." (defcustom icomplete-minibuffer-setup-hook nil "*Icomplete-specific customization of minibuffer setup. -This hook is run during minibuffer setup iff icomplete will be active. +This hook is run during minibuffer setup if icomplete is active. It is intended for use in customizing icomplete for interoperation with other features and packages. For instance: @@ -168,7 +168,8 @@ except those on this list.") ;;;###autoload (define-minor-mode icomplete-mode "Toggle incremental minibuffer completion for this Emacs session. -With a numeric argument, turn Icomplete mode on iff ARG is positive." +With a numeric argument, turn Icomplete mode on if ARG is positive, +otherwise turn it off." :global t :group 'icomplete (if icomplete-mode ;; The following is not really necessary after first time - diff --git a/lisp/ido.el b/lisp/ido.el index e5c4b644f95..ca44e99b594 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -898,7 +898,7 @@ See documentation of `walk-windows' for useful values.") (defcustom ido-minibuffer-setup-hook nil "*Ido-specific customization of minibuffer setup. -This hook is run during minibuffer setup iff `ido' will be active. +This hook is run during minibuffer setup if `ido' is active. It is intended for use in customizing ido for interoperation with other packages. For instance: diff --git a/lisp/image.el b/lisp/image.el index cf909da0e95..480b5610311 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -342,7 +342,7 @@ Image types are symbols like `xbm' or `jpeg'." ;;;###autoload (defun image-type-auto-detected-p () - "Return t iff the current buffer contains an auto-detectable image. + "Return t if the current buffer contains an auto-detectable image. This function is intended to be used from `magic-fallback-mode-alist'. The buffer is considered to contain an auto-detectable image if diff --git a/lisp/imenu.el b/lisp/imenu.el index 9aa1f5ea088..6c1de967e66 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -727,7 +727,7 @@ definitions, etc. It contains a substring which is the name to appear in the menu. See the info section on Regexps for more information. REGEXP may also be a function, called without arguments. It is expected to search backwards. It shall return -true and set `match-data' iff it finds another element. +true and set `match-data' if it finds another element. INDEX points to the substring in REGEXP that contains the name (of the function, variable or type) that is to appear in the diff --git a/lisp/info-look.el b/lisp/info-look.el index 8ace7730a12..4ed13ba08e0 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -144,7 +144,7 @@ to `symbol', and the help mode defaults to the current major mode." (apply 'info-lookup-add-help* nil arg)) (defun info-lookup-maybe-add-help (&rest arg) - "Add a help specification iff none is defined. + "Add a help specification if none is defined. See the documentation of the function `info-lookup-add-help' for more details." (apply 'info-lookup-add-help* t arg)) diff --git a/lisp/isearch.el b/lisp/isearch.el index 7b90e319766..cc68ee297bd 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -819,7 +819,7 @@ NOPUSH is t and EDIT is t." (run-hooks 'isearch-mode-end-hook)) ;; If there was movement, mark the starting position. - ;; Maybe should test difference between and set mark iff > threshold. + ;; Maybe should test difference between and set mark only if > threshold. (if (/= (point) isearch-opoint) (or (and transient-mark-mode mark-active) (progn @@ -2321,7 +2321,7 @@ since they have special meaning in a regexp." ;; - the direction of the current search is expected to be given by ;; `isearch-forward'; ;; - the variable `isearch-error' is expected to be true -;; iff `isearch-string' is an invalid regexp. +;; only if `isearch-string' is an invalid regexp. (defvar isearch-lazy-highlight-overlays nil) (defvar isearch-lazy-highlight-wrapped nil) diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 068f5fff2cd..233997285c9 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -396,7 +396,7 @@ See documentation of `walk-windows' for useful values.") (defcustom iswitchb-minibuffer-setup-hook nil "Iswitchb-specific customization of minibuffer setup. -This hook is run during minibuffer setup iff `iswitchb' will be active. +This hook is run during minibuffer setup if `iswitchb' is active. For instance: \(add-hook 'iswitchb-minibuffer-setup-hook '\(lambda () (set (make-local-variable 'max-mini-window-height) 3))) @@ -1440,7 +1440,7 @@ This is an example function which can be hooked on to (iswitchb-to-end summaries))) (defun iswitchb-case () - "Return non-nil iff we should ignore case when matching. + "Return non-nil if we should ignore case when matching. See the variable `iswitchb-case' for details." (if iswitchb-case (if (featurep 'xemacs) @@ -1450,7 +1450,7 @@ See the variable `iswitchb-case' for details." ;;;###autoload (define-minor-mode iswitchb-mode "Toggle Iswitchb global minor mode. -With arg, turn Iswitchb mode on if and only iff ARG is positive. +With arg, turn Iswitchb mode on if ARG is positive, otherwise turn it off. This mode enables switching between buffers using substrings. See `iswitchb' for details." nil nil iswitchb-global-map :global t :group 'iswitchb diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 94d97abc8a5..c8ee5db812b 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el @@ -568,7 +568,7 @@ for more details." (defvar user-mail-address) (defun log-edit-changelog-ours-p () "See if ChangeLog entry at point is for the current user, today. -Return non-nil iff it is." +Return non-nil if it is." ;; Code adapted from add-change-log-entry. (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name) (and (fboundp 'user-full-name) (user-full-name)) diff --git a/lisp/printing.el b/lisp/printing.el index f84a2112661..412f0b342fc 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -4943,9 +4943,9 @@ See `pr-visible-entry-alist'.") If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist', `pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not; -otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is -non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is -non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is +otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is +non-nil, update text printer menu if `pr-txt-printer-menu-modified' is +non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is non-nil. If menu binding was not done, calls `pr-menu-bind'." diff --git a/lisp/select.el b/lisp/select.el index b1fa729a664..60259142522 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -178,7 +178,7 @@ Cut buffers are considered obsolete; you should use selections instead." If it is valid, set the register `r0' to 1, else set it to 0.") (defun string-utf-8-p (string) - "Return non-nil iff STRING is a unibyte string of valid UTF-8 sequence." + "Return non-nil if STRING is a unibyte string of valid UTF-8 sequence." (if (or (not (stringp string)) (multibyte-string-p string)) (error "Not a unibyte string: %s" string)) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index ee6dcc15b7e..d1de8be3910 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -285,7 +285,7 @@ information defining the cluster. For interactive use, call ans))) (defun shadow-site-match (site1 site2) - "Non-nil iff SITE1 is or includes SITE2. + "Non-nil if SITE1 is or includes SITE2. Each may be a host or cluster name; if they are clusters, regexp of SITE1 will be matched against the primary of SITE2." (or (string-equal site1 site2) ; quick check diff --git a/lisp/simple.el b/lisp/simple.el index 6148a917f59..b71dffd3c35 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4343,8 +4343,9 @@ The variable `selective-display' has a separate value for each buffer." (defun toggle-truncate-lines (&optional arg) "Toggle whether to fold or truncate long lines for the current buffer. -With arg, truncate long lines iff arg is positive. -Note that in side-by-side windows, truncation is always enabled." +With prefix argument ARG, truncate long lines if ARG is positive, +otherwise don't truncate them. Note that in side-by-side +windows, truncation is always enabled." (interactive "P") (setq truncate-lines (if (null arg) @@ -4367,11 +4368,11 @@ Note that in side-by-side windows, truncation is always enabled." (defun overwrite-mode (arg) "Toggle overwrite mode. -With arg, turn overwrite mode on iff arg is positive. -In overwrite mode, printing characters typed in replace existing text -on a one-for-one basis, rather than pushing it to the right. At the -end of a line, such characters extend the line. Before a tab, -such characters insert until the tab is filled in. +With prefix argument ARG, turn overwrite mode on if ARG is positive, +otherwise turn it off. In overwrite mode, printing characters typed +in replace existing text on a one-for-one basis, rather than pushing +it to the right. At the end of a line, such characters extend the line. +Before a tab, such characters insert until the tab is filled in. \\[quoted-insert] still inserts characters in overwrite mode; this is supposed to make it easier to insert characters when necessary." (interactive "P") @@ -4383,14 +4384,13 @@ is supposed to make it easier to insert characters when necessary." (defun binary-overwrite-mode (arg) "Toggle binary overwrite mode. -With arg, turn binary overwrite mode on iff arg is positive. -In binary overwrite mode, printing characters typed in replace -existing text. Newlines are not treated specially, so typing at the -end of a line joins the line to the next, with the typed character -between them. Typing before a tab character simply replaces the tab -with the character typed. -\\[quoted-insert] replaces the text at the cursor, just as ordinary -typing characters do. +With prefix argument ARG, turn binary overwrite mode on if ARG is +positive, otherwise turn it off. In binary overwrite mode, printing +characters typed in replace existing text. Newlines are not treated +specially, so typing at the end of a line joins the line to the next, +with the typed character between them. Typing before a tab character +simply replaces the tab with the character typed. \\[quoted-insert] +replaces the text at the cursor, just as ordinary typing characters do. Note that binary overwrite mode is not its own minor mode; it is a specialization of overwrite mode, entered by setting the @@ -4405,9 +4405,9 @@ specialization of overwrite mode, entered by setting the (define-minor-mode line-number-mode "Toggle Line Number mode. -With arg, turn Line Number mode on iff arg is positive. -When Line Number mode is enabled, the line number appears -in the mode line. +With arg, turn Line Number mode on if arg is positive, otherwise +turn it off. When Line Number mode is enabled, the line number +appears in the mode line. Line numbers do not appear for very large buffers and buffers with very long lines; see variables `line-number-display-limit' @@ -4416,16 +4416,16 @@ and `line-number-display-limit-width'." (define-minor-mode column-number-mode "Toggle Column Number mode. -With arg, turn Column Number mode on iff arg is positive. -When Column Number mode is enabled, the column number appears -in the mode line." +With arg, turn Column Number mode on if arg is positive, +otherwise turn it off. When Column Number mode is enabled, the +column number appears in the mode line." :global t :group 'mode-line) (define-minor-mode size-indication-mode "Toggle Size Indication mode. -With arg, turn Size Indication mode on iff arg is positive. When -Size Indication mode is enabled, the size of the accessible part -of the buffer appears in the mode line." +With arg, turn Size Indication mode on if arg is positive, +otherwise turn it off. When Size Indication mode is enabled, the +size of the accessible part of the buffer appears in the mode line." :global t :group 'mode-line) (defgroup paren-blinking nil @@ -4960,7 +4960,7 @@ With prefix argument N, move N items (negative N means move backward)." These functions are called in order with four arguments: CHOICE - the string to insert in the buffer, BUFFER - the buffer in which the choice should be inserted, -MINI-P - non-nil iff BUFFER is a minibuffer, and +MINI-P - non-nil if BUFFER is a minibuffer, and BASE-SIZE - the number of characters in BUFFER before the string being completed. @@ -5568,7 +5568,8 @@ See also `normal-erase-is-backspace'." (define-minor-mode visible-mode "Toggle Visible mode. -With argument ARG turn Visible mode on iff ARG is positive. +With argument ARG turn Visible mode on if ARG is positive, otherwise +turn it off. Enabling Visible mode makes all invisible text temporarily visible. Disabling Visible mode turns off that effect. Visible mode diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 33e223e4b2b..4425bb0389a 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -209,8 +209,8 @@ If ELEMENT is a string or a character it gets inserted (see also interesting point set by _ > indent line (or interregion if > _) according to major mode @ add position to `skeleton-positions' - & do next ELEMENT iff previous moved point - | do next ELEMENT iff previous didn't move point + & do next ELEMENT if previous moved point + | do next ELEMENT if previous didn't move point -num delete num preceding characters (see `skeleton-untabify') resume: skipped, continue here if quit is signaled nil skipped diff --git a/lisp/strokes.el b/lisp/strokes.el index 528ea477363..de4123453f5 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1370,7 +1370,7 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." (goto-char (point-min)))) (defun strokes-alphabetic-lessp (stroke1 stroke2) - "T iff command name for STROKE1 is less than STROKE2's in lexicographic order." + "T if command name for STROKE1 is less than STROKE2's in lexicographic order." (let ((command-name-1 (symbol-name (cdr stroke1))) (command-name-2 (symbol-name (cdr stroke2)))) (string-lessp command-name-1 command-name-2))) @@ -1520,7 +1520,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer], (eq char ?*))) ;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ### -;; "T iff one and only one of A and B is non-nil; otherwise, returns nil. +;; "T if one and only one of A and B is non-nil; otherwise, returns nil. ;;NOTE: Don't use this as a numeric xor since it treats all non-nil ;; values as t including `0' (zero)." ;; (eq (null a) (not (null b)))) diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el index 12129d93602..99e42fe288b 100644 --- a/lisp/t-mouse.el +++ b/lisp/t-mouse.el @@ -271,7 +271,8 @@ The (secret) scrollbar interface is not implemented yet." ;;;###autoload (define-minor-mode t-mouse-mode "Toggle t-mouse mode to use the mouse in Linux consoles. -With prefix arg, turn t-mouse mode on iff arg is positive. +With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it +off. This allows the use of the mouse when operating on a Linux console, in the same way as you can use the mouse under X11. diff --git a/lisp/term.el b/lisp/term.el index 4d1c660543a..370f643225b 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -470,7 +470,7 @@ (defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if ;; forward scrolling should be implemented by delete to ;; top-most line(s); and nil if scrolling should be implemented -;; by moving term-home-marker. It is set to t iff there is a +;; by moving term-home-marker. It is set to t if there is a ;; (non-default) scroll-region OR the alternate buffer is used. (defvar term-pending-delete-marker) ;; New user input in line mode needs to ;; be deleted, because it gets echoed by the inferior. diff --git a/lisp/userlock.el b/lisp/userlock.el index 17cbc0c3e55..8e4a6753a31 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -134,7 +134,7 @@ The buffer in question is current when this function is called." (setq answer nil)) ((eq answer 'revert) (revert-buffer nil (not (buffer-modified-p))) - ; ask confirmation iff buffer modified + ; ask confirmation if buffer modified (signal 'file-supersession (list "File reverted" fn))) ((eq answer 'yield) diff --git a/lisp/vc.el b/lisp/vc.el index 835d2c50685..9065b2d2bcd 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1103,7 +1103,7 @@ Used by `vc-restore-buffer-context' to later restore the context." ;; ;; We may want to reparse the compilation buffer after revert ;; (reparse (and (boundp 'compilation-error-list) ;compile loaded ;; ;; Construct a list; each elt is nil or a buffer - ;; ;; iff that buffer is a compilation output buffer + ;; ;; if that buffer is a compilation output buffer ;; ;; that contains markers into the current buffer. ;; (save-current-buffer ;; (mapcar (lambda (buffer) diff --git a/lisp/view.el b/lisp/view.el index 2f541fbf360..f6722f53756 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -375,7 +375,8 @@ Use this argument instead of explicitly setting `view-exit-action'." ;; bindings instead of using the \\[] construction. The reason for this ;; is that most commands have more than one key binding. "Toggle View mode, a minor mode for viewing text but not editing it. -With ARG, turn View mode on iff ARG is positive. +With prefix argument ARG, turn View mode on if ARG is positive, otherwise +turn it off. Emacs commands that do not change the buffer contents are available as usual. Kill commands insert text in kill buffers but do not delete. Other commands diff --git a/lisp/whitespace.el b/lisp/whitespace.el index c38b6563592..3ea8394b0b7 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -763,7 +763,7 @@ If timer is not set, then set it to scan the files in ;;;###autoload (define-minor-mode whitespace-global-mode "Toggle using Whitespace mode in new buffers. -With ARG, turn the mode on iff ARG is positive. +With ARG, turn the mode on if ARG is positive, otherwise turn it off. When this mode is active, `whitespace-buffer' is added to `find-file-hook' and `kill-buffer-hook'." diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 04d91998e2a..6725144e682 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -483,7 +483,7 @@ new value.") ;;;###autoload (defun widgetp (widget) - "Return non-nil iff WIDGET is a widget." + "Return non-nil if WIDGET is a widget." (if (symbolp widget) (get widget 'widget-type) (and (consp widget) @@ -500,7 +500,7 @@ Otherwise, just return the value." value))) (defun widget-member (widget property) - "Non-nil iff there is a definition in WIDGET for PROPERTY." + "Non-nil if there is a definition in WIDGET for PROPERTY." (cond ((plist-member (cdr widget) property) t) ((car widget) @@ -1641,7 +1641,7 @@ If that does not exists, call the value of `widget-complete-field'." (widget-princ-to-string (widget-get widget :value)))) (defun widget-default-active (widget) - "Return t iff this widget active (user modifiable)." + "Return t if this widget is active (user modifiable)." (or (widget-get widget :always-active) (and (not (widget-get widget :inactive)) (let ((parent (widget-get widget :parent))) diff --git a/lisp/window.el b/lisp/window.el index 508d78caeb4..7a64588c076 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -120,7 +120,7 @@ bars (top, bottom, or nil)." PROC is called with a window as argument. Optional second arg MINIBUF t means count the minibuffer window even -if not active. MINIBUF nil or omitted means count the minibuffer iff +if not active. MINIBUF nil or omitted means count the minibuffer only if it is active. MINIBUF neither t nor nil means not to count the minibuffer even if it is active. @@ -165,7 +165,7 @@ value is returned. If no window satisfies PREDICATE, DEFAULT is returned. Optional second arg MINIBUF t means count the minibuffer window even -if not active. MINIBUF nil or omitted means count the minibuffer iff +if not active. MINIBUF nil or omitted means count the minibuffer only if it is active. MINIBUF neither t nor nil means not to count the minibuffer even if it is active. @@ -833,7 +833,7 @@ means suspend autoselection." (defun mouse-autoselect-window-select () "Select window with delayed window autoselection. If the mouse position has stabilized in a non-selected window, select -that window. The minibuffer window is selected iff the minibuffer is +that window. The minibuffer window is selected only if the minibuffer is active. This function is run by `mouse-autoselect-window-timer'." (condition-case nil (let* ((mouse-position (mouse-position)) @@ -858,14 +858,14 @@ active. This function is run by `mouse-autoselect-window-timer'." ;; If `mouse-autoselect-window' is positive, select ;; window if the window is the same as before. (eq window mouse-autoselect-window-window)) - ;; Otherwise select window iff the mouse is at the same + ;; Otherwise select window if the mouse is at the same ;; position as before. Observe that the first test after ;; starting autoselection usually fails since the value of ;; `mouse-autoselect-window-position' recorded there is the ;; position where the mouse has entered the new window and ;; not necessarily where the mouse has stopped moving. (equal mouse-position mouse-autoselect-window-position)) - ;; The minibuffer is a candidate window iff it's active. + ;; The minibuffer is a candidate window if it's active. (or (not (window-minibuffer-p window)) (eq window (active-minibuffer-window)))) ;; Mouse position has stabilized in non-selected window: Cancel diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index b9d711a3e4b..d14c9c85cd3 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -187,7 +187,8 @@ ;;;###autoload (define-minor-mode xterm-mouse-mode "Toggle XTerm mouse mode. -With prefix arg, turn XTerm mouse mode on iff arg is positive. +With prefix arg, turn XTerm mouse mode on if arg is positive, otherwise turn +it off. Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. This works in terminal emulators compatible with xterm. It only -- cgit v1.2.1 From c04c9be602334a4cd3327f384bd4a2aa0942ecb2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 08:00:43 +0000 Subject: (help-make-xrefs): Search for symbol constituents, rather than just `-'. --- lisp/help-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 28ac693f870..fd17a93a29f 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -461,9 +461,9 @@ that." ;; An obvious case of a key substitution: (save-excursion (while (re-search-forward - ;; Assume command name is only word characters - ;; and dashes to get things like `use M-x foo.'. - "\\bar'. + "\\= (current-column) col) - (looking-at "\\(\\sw\\|-\\)+$")) + (looking-at "\\(\\sw\\|\\s_\\)+$")) (let ((sym (intern-soft (match-string 0)))) (if (fboundp sym) (help-xref-button 0 'help-function sym)))) -- cgit v1.2.1 From 2c49e9dd0862ad653b199dc60673bd1406f6a320 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 08:01:42 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81ac364d905..a31846723e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,9 @@ * Replace `iff' in doc-strings and comments. + * help-mode.el (help-make-xrefs): Search for symbol constituents, + rather than just `-'. + 2007-08-08 Martin Rudalics * dired.el (dired-pop-to-buffer): -- cgit v1.2.1 From 5976ef8ebb725059de4e195916e2e8aeb645aa6d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 08:03:53 +0000 Subject: (help-make-xrefs): Search for symbol constituents, rather than just `-'. --- lisp/help-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 5344d750eef..818a0111cb8 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -436,9 +436,9 @@ that." ;; An obvious case of a key substitution: (save-excursion (while (re-search-forward - ;; Assume command name is only word characters - ;; and dashes to get things like `use M-x foo.'. - "\\bar'. + "\\= (current-column) col) - (looking-at "\\(\\sw\\|-\\)+$")) + (looking-at "\\(\\sw\\|\\s_\\)+$")) (let ((sym (intern-soft (match-string 0)))) (if (fboundp sym) (help-xref-button 0 'help-function sym)))) -- cgit v1.2.1 From 3a0dad65f7e6a53c65da981286d33387352f304a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 08:13:41 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index de7d0584a9a..8aa9db71fc5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-08-08 Glenn Morris + + * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second + argument optional, for backwards compatibility, and only highlight + args when present. Fix symbol name typo (doc/args). + + * help-mode.el (help-make-xrefs): Search for symbol constituents, + rather than just `-'. + 2007-08-07 Jay Belanger * calc/calc-units.el (calc-convert-temperature): @@ -93,7 +102,7 @@ * vc.el (vc-rollback): Add norevert argument back. (vc-revert-buffer): Add back as obsolete alias. -2007-08-05 Peter Povinec yahoo.com> (tiny change) +2007-08-05 Peter Povinec (tiny change) * term.el: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. -- cgit v1.2.1 From 1d8b82fdc006503c5b665edf43a765cccec7d8ca Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 08:14:03 +0000 Subject: (eldoc-get-fnsym-args-string): Make second argument optional, for backwards compatibility, and only highlight args when present. Fix symbol name typo (doc/args). --- lisp/emacs-lisp/eldoc.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index c1bc6dae515..2ff273ebab3 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -267,13 +267,13 @@ Emacs Lisp mode) that support Eldoc.") ;; Return a string containing the function parameter list, or 1-line ;; docstring if function is a subr and no arglist is obtainable from the ;; docstring or elsewhere. -(defun eldoc-get-fnsym-args-string (sym argument-index) +(defun eldoc-get-fnsym-args-string (sym &optional argument-index) (let ((args nil) (doc nil)) (cond ((not (and sym (symbolp sym) (fboundp sym)))) ((and (eq sym (aref eldoc-last-data 0)) (eq 'function (aref eldoc-last-data 2))) - (setq args (aref eldoc-last-data 1))) + (setq doc (aref eldoc-last-data 1))) ((setq doc (help-split-fundoc (documentation sym t) sym)) (setq args (car doc)) (string-match "\\`[^ )]* ?" args) @@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.") (eldoc-last-data-store sym args 'function)) (t (setq args (eldoc-function-argstring sym)))) - (when args - (setq doc (eldoc-highlight-function-argument sym args argument-index))) + (and args + argument-index + (setq doc (eldoc-highlight-function-argument sym args argument-index))) doc)) ;; Highlight argument INDEX in ARGS list for SYM. -- cgit v1.2.1 From 1325da8a3155fd3bb5b5a81e06a4cd9005d1be12 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 8 Aug 2007 11:51:25 +0000 Subject: (sendmail-pre-abbrev-expand-hook): Check for self-insert-command, not self-insert. --- lisp/mail/mailabbrev.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index b3e2c051e7d..8862e6ca2d2 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -495,7 +495,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (or (and (integerp last-command-char) ;; Some commands such as M-> may want to expand first. - (equal this-command 'self-insert) + (equal this-command 'self-insert-command) (or (eq (char-syntax last-command-char) ?_) ;; Don't expand on @. (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) -- cgit v1.2.1 From b58d0a7d54ba7476b71a571418268108fddb1dee Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 8 Aug 2007 11:51:48 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a31846723e8..1bdb4b5ba4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-08 Andreas Schwab + + * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for + self-insert-command, not self-insert. + 2007-08-08 Glenn Morris * emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Remove `iff'. -- cgit v1.2.1 From 902bee9eda0f8e8cc3d0a134fabf8ff468aaff88 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 8 Aug 2007 11:52:06 +0000 Subject: (sendmail-pre-abbrev-expand-hook): Check for self-insert-command, not self-insert. --- lisp/mail/mailabbrev.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index b3e2c051e7d..8862e6ca2d2 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -495,7 +495,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (or (and (integerp last-command-char) ;; Some commands such as M-> may want to expand first. - (equal this-command 'self-insert) + (equal this-command 'self-insert-command) (or (eq (char-syntax last-command-char) ?_) ;; Don't expand on @. (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) -- cgit v1.2.1 From 875f6d4c736c3ab3fafb58dcc48d24b480b2a80c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 8 Aug 2007 11:52:16 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8aa9db71fc5..6141837c790 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-08 Andreas Schwab + + * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for + self-insert-command, not self-insert. + 2007-08-08 Glenn Morris * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second -- cgit v1.2.1 From cb69b6a210d71b60972d019348612cd8bba8b0a0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 8 Aug 2007 14:06:02 +0000 Subject: (auto-mode-alist): Use the purecopied text (duh!). --- lisp/ChangeLog | 4 ++++ lisp/files.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bdb4b5ba4b..abdda0d756c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-08 Stefan Monnier + + * files.el (auto-mode-alist): Use the purecopied text (duh!). + 2007-08-08 Andreas Schwab * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for diff --git a/lisp/files.el b/lisp/files.el index 4d952f3f935..8ade456ee07 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1886,7 +1886,7 @@ since only a single case-insensitive search through the alist is made." ;; c++-mode, java-mode and more) are added through autoload ;; directives in that file. That way is discouraged since it ;; spreads out the definition of the initial value. - (mapc + (mapcar (lambda (elt) (cons (purecopy (car elt)) (cdr elt))) `(;; do this first, so that .html.pl is Polish html, not Perl -- cgit v1.2.1 From 2b9df93ddd55f717e09ee1773cdf49cda522d0e4 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 8 Aug 2007 16:37:46 +0000 Subject: ps-print-color-p fix --- lisp/ChangeLog | 7 +++++++ lisp/ps-print.el | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index abdda0d756c..418a44e40d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-08 Vinicius Jose Latorre + + * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. + (ps-begin-job): Use ps-default-fg and ps-default-bg only when + ps-print-color-p is neither nil nor black-white. Reported by Christian + Schlauer . + 2007-08-08 Stefan Monnier * files.el (auto-mode-alist): Use the purecopied text (duh!). diff --git a/lisp/ps-print.el b/lisp/ps-print.el index a2346b8f76b..4f5f67fd91e 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -3016,7 +3016,8 @@ Valid values are: Any other value is ignored and black color will be used. -It's used only when `ps-print-color-p' is non-nil." +This variable is used only when `ps-print-color-p' (which see) is neither nil +nor black-white." :type '(choice :menu-tag "Default Foreground Gray/Color" :tag "Default Foreground Gray/Color" (const :tag "Session Foreground" t) @@ -3059,7 +3060,8 @@ Valid values are: Any other value is ignored and white color will be used. -It's used only when `ps-print-color-p' is non-nil. +This variable is used only when `ps-print-color-p' (which see) is neither nil +nor black-white. See also `ps-use-face-background'." :type '(choice :menu-tag "Default Background Gray/Color" @@ -5920,7 +5922,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") 1.0) ps-default-background (ps-rgb-color (cond - ((or (not (eq ps-print-color-p t)) + ((or (member ps-print-color-p + '(nil back-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-bg 'frame-parameter) @@ -5933,7 +5936,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") 1.0) ps-default-foreground (ps-rgb-color (cond - ((or (not (eq ps-print-color-p t)) + ((or (member ps-print-color-p + '(nil back-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-fg 'frame-parameter) @@ -5944,7 +5948,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-default-fg)) "unspecified-fg" 0.0) - ps-default-color (and (eq ps-print-color-p t) + ps-default-color (and (not (member ps-print-color-p + '(nil back-white))) ps-default-foreground) ps-current-color ps-default-color) ;; initialize page dimensions -- cgit v1.2.1 From fb6db51f6b47d92e9e751c6e3bd263c3f75723d2 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 8 Aug 2007 16:38:32 +0000 Subject: ps-print-color-p fix --- lisp/ChangeLog | 7 +++++++ lisp/ps-print.el | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6141837c790..74bafdd83e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-08 Vinicius Jose Latorre + + * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. + (ps-begin-job): Use ps-default-fg and ps-default-bg only when + ps-print-color-p is neither nil nor black-white. Reported by Christian + Schlauer . + 2007-08-08 Andreas Schwab * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 3526c170e1f..f7abe472fe5 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -3016,7 +3016,8 @@ Valid values are: Any other value is ignored and black color will be used. -It's used only when `ps-print-color-p' is non-nil." +This variable is used only when `ps-print-color-p' (which see) is neither nil +nor black-white." :type '(choice :menu-tag "Default Foreground Gray/Color" :tag "Default Foreground Gray/Color" (const :tag "Session Foreground" t) @@ -3059,7 +3060,8 @@ Valid values are: Any other value is ignored and white color will be used. -It's used only when `ps-print-color-p' is non-nil. +This variable is used only when `ps-print-color-p' (which see) is neither nil +nor black-white. See also `ps-use-face-background'." :type '(choice :menu-tag "Default Background Gray/Color" @@ -5920,7 +5922,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") 1.0) ps-default-background (ps-rgb-color (cond - ((or (not (eq ps-print-color-p t)) + ((or (member ps-print-color-p + '(nil back-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-bg 'frame-parameter) @@ -5933,7 +5936,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") 1.0) ps-default-foreground (ps-rgb-color (cond - ((or (not (eq ps-print-color-p t)) + ((or (member ps-print-color-p + '(nil back-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-fg 'frame-parameter) @@ -5944,7 +5948,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-default-fg)) "unspecified-fg" 0.0) - ps-default-color (and (eq ps-print-color-p t) + ps-default-color (and (not (member ps-print-color-p + '(nil back-white))) ps-default-foreground) ps-current-color ps-default-color) ;; initialize page dimensions -- cgit v1.2.1 From a962a7b14bcc5b3db7dcaf88dcc1b81b63bb4cca Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 8 Aug 2007 19:44:55 +0000 Subject: (Man-next-section): Make sure we do not move backward. --- lisp/man.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/man.el b/lisp/man.el index 56539072439..03003a46d1b 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -64,7 +64,7 @@ ;; ========== Features ========== ;; + Runs "man" in the background and pipes the results through a ;; series of sed and awk scripts so that all retrieving and cleaning -;; is done in the background. The cleaning commands are configurable. +;; is done in the background. The cleaning commands are configurable. ;; + Syntax is the same as Un*x man ;; + Functionality is the same as Un*x man, including "man -k" and ;; "man

", etc. @@ -1291,14 +1291,18 @@ The following key bindings are currently in effect in the buffer: (defun Man-next-section (n) "Move point to Nth next section (default 1)." (interactive "p") - (let ((case-fold-search nil)) + (let ((case-fold-search nil) + (start (point))) (if (looking-at Man-heading-regexp) (forward-line 1)) (if (re-search-forward Man-heading-regexp (point-max) t n) (beginning-of-line) (goto-char (point-max)) ;; The last line doesn't belong to any section. - (forward-line -1)))) + (forward-line -1)) + ;; But don't move back from the starting point (can happen if `start' + ;; is somewhere on the last line). + (if (< (point) start) (goto-char start)))) (defun Man-previous-section (n) "Move point to Nth previous section (default 1)." -- cgit v1.2.1 From 7fa997e3fda74f785d49e4066e5cc7de4949adcd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 8 Aug 2007 19:52:03 +0000 Subject: Remove spurious * in docstrings. Merge defvars and toplevel setq-defaults. (Man-highlight-references0): Limit=nil rather than point-max. (Man-mode-map): Move initialization into the declaration. (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only. (Man-view-header-file): Use expand-file-name rather than concat. (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer. --- lisp/ChangeLog | 12 +++++ lisp/man.el | 136 +++++++++++++++++++++++++-------------------------------- 2 files changed, 72 insertions(+), 76 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 418a44e40d6..dc6b8e910fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2007-08-08 Stefan Monnier + + * man.el: Remove spurious * in docstrings. + Merge defvars and toplevel setq-defaults. + (Man-highlight-references0): Limit=nil rather than point-max. + (Man-mode-map): Move initialization into the declaration. + (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only. + (Man-view-header-file): Use expand-file-name rather than concat. + (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer. + + * man.el (Man-next-section): Make sure we do not move backward. + 2007-08-08 Vinicius Jose Latorre * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. diff --git a/lisp/man.el b/lisp/man.el index 03003a46d1b..c7593e88dda 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -37,7 +37,7 @@ ;; ========== Credits and History ========== ;; In mid 1991, several people posted some interesting improvements to -;; man.el from the standard emacs 18.57 distribution. I liked many of +;; man.el from the standard Emacs 18.57 distribution. I liked many of ;; these, but wanted everything in one single package, so I decided ;; to incorporate them into a single manual browsing mode. While ;; much of the code here has been rewritten, and some features added, @@ -109,8 +109,6 @@ (defvar Man-notify) -(defvar Man-current-page) -(defvar Man-page-list) (defcustom Man-filter-list nil "*Manpage cleaning filter command phrases. This variable contains a list of the following form: @@ -127,13 +125,8 @@ the manpage buffer." (string :tag "Phrase String")))) :group 'man) -(defvar Man-original-frame) -(defvar Man-arguments) -(defvar Man-sections-alist) -(defvar Man-refpages-alist) (defvar Man-uses-untabify-flag t "Non-nil means use `untabify' instead of `Man-untabify-command'.") -(defvar Man-page-mode-string) (defvar Man-sed-script nil "Script for sed to nuke backspaces and ANSI codes from manpages.") @@ -141,28 +134,28 @@ the manpage buffer." ;; user variables (defcustom Man-fontify-manpage-flag t - "*Non-nil means make up the manpage with fonts." + "Non-nil means make up the manpage with fonts." :type 'boolean :group 'man) (defcustom Man-overstrike-face 'bold - "*Face to use when fontifying overstrike." + "Face to use when fontifying overstrike." :type 'face :group 'man) (defcustom Man-underline-face 'underline - "*Face to use when fontifying underlining." + "Face to use when fontifying underlining." :type 'face :group 'man) (defcustom Man-reverse-face 'highlight - "*Face to use when fontifying reverse video." + "Face to use when fontifying reverse video." :type 'face :group 'man) ;; Use the value of the obsolete user option Man-notify, if set. (defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly) - "*Selects the behavior when manpage is ready. + "Selects the behavior when manpage is ready. This variable may have one of the following values, where (sf) means that the frames are switched, so the manpage is displayed in the frame where the man command was called from: @@ -183,7 +176,7 @@ Any other value of `Man-notify-method' is equivalent to `meek'." :group 'man) (defcustom Man-width nil - "*Number of columns for which manual pages should be formatted. + "Number of columns for which manual pages should be formatted. If nil, the width of the window selected at the moment of man invocation is used. If non-nil, the width of the frame selected at the moment of man invocation is used. The value also can be a @@ -194,12 +187,12 @@ positive integer." :group 'man) (defcustom Man-frame-parameters nil - "*Frame parameter list for creating a new frame for a manual page." + "Frame parameter list for creating a new frame for a manual page." :type 'sexp :group 'man) (defcustom Man-downcase-section-letters-flag t - "*Non-nil means letters in sections are converted to lower case. + "Non-nil means letters in sections are converted to lower case. Some Un*x man commands can't handle uppercase letters in sections, for example \"man 2V chmod\", but they are often displayed in the manpage with the upper case letter. When this variable is t, the section @@ -209,7 +202,7 @@ being sent to the man background process." :group 'man) (defcustom Man-circular-pages-flag t - "*Non-nil means the manpage list is treated as circular for traversal." + "Non-nil means the manpage list is treated as circular for traversal." :type 'boolean :group 'man) @@ -220,7 +213,7 @@ being sent to the man background process." ;; '("3X" . "3") ; Xlib man pages '("3X11" . "3") '("1-UCB" . "")) - "*Association list of bogus sections to real section numbers. + "Association list of bogus sections to real section numbers. Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in their references which Un*x `man' does not recognize. This association list is used to translate those sections, when found, to @@ -250,9 +243,6 @@ the associated section number." (defvar Man-awk-command "awk" "Command used for processing awk scripts.") -(defvar Man-mode-map nil - "Keymap for Man mode.") - (defvar Man-mode-hook nil "Hook run when Man mode is enabled.") @@ -349,20 +339,22 @@ Otherwise, the value is whatever the function ;; end user variables ;; other variables and keymap initializations +(defvar Man-original-frame) +(make-variable-buffer-local 'Man-original-frame) +(defvar Man-arguments) +(make-variable-buffer-local 'Man-arguments) +(put 'Man-arguments 'permanent-local t) + +(defvar Man-sections-alist nil) (make-variable-buffer-local 'Man-sections-alist) +(defvar Man-refpages-alist nil) (make-variable-buffer-local 'Man-refpages-alist) +(defvar Man-page-list nil) (make-variable-buffer-local 'Man-page-list) +(defvar Man-current-page 0) (make-variable-buffer-local 'Man-current-page) +(defvar Man-page-mode-string "1 of 1") (make-variable-buffer-local 'Man-page-mode-string) -(make-variable-buffer-local 'Man-original-frame) -(make-variable-buffer-local 'Man-arguments) -(put 'Man-arguments 'permanent-local t) - -(setq-default Man-sections-alist nil) -(setq-default Man-refpages-alist nil) -(setq-default Man-page-list nil) -(setq-default Man-current-page 0) -(setq-default Man-page-mode-string "1 of 1") (defconst Man-sysv-sed-script "\ /\b/ { s/_\b//g @@ -398,30 +390,32 @@ Otherwise, the value is whatever the function table) "Syntax table used in Man mode buffers.") -(unless Man-mode-map - (setq Man-mode-map (make-sparse-keymap)) - (suppress-keymap Man-mode-map) - (set-keymap-parent Man-mode-map button-buffer-map) - - (define-key Man-mode-map " " 'scroll-up) - (define-key Man-mode-map "\177" 'scroll-down) - (define-key Man-mode-map "n" 'Man-next-section) - (define-key Man-mode-map "p" 'Man-previous-section) - (define-key Man-mode-map "\en" 'Man-next-manpage) - (define-key Man-mode-map "\ep" 'Man-previous-manpage) - (define-key Man-mode-map ">" 'end-of-buffer) - (define-key Man-mode-map "<" 'beginning-of-buffer) - (define-key Man-mode-map "." 'beginning-of-buffer) - (define-key Man-mode-map "r" 'Man-follow-manual-reference) - (define-key Man-mode-map "g" 'Man-goto-section) - (define-key Man-mode-map "s" 'Man-goto-see-also-section) - (define-key Man-mode-map "k" 'Man-kill) - (define-key Man-mode-map "q" 'Man-quit) - (define-key Man-mode-map "m" 'man) - ;; Not all the man references get buttons currently. The text in the - ;; manual page can contain references to other man pages - (define-key Man-mode-map "\r" 'man-follow) - (define-key Man-mode-map "?" 'describe-mode)) +(defvar Man-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map) + (set-keymap-parent map button-buffer-map) + + (define-key map " " 'scroll-up) + (define-key map "\177" 'scroll-down) + (define-key map "n" 'Man-next-section) + (define-key map "p" 'Man-previous-section) + (define-key map "\en" 'Man-next-manpage) + (define-key map "\ep" 'Man-previous-manpage) + (define-key map ">" 'end-of-buffer) + (define-key map "<" 'beginning-of-buffer) + (define-key map "." 'beginning-of-buffer) + (define-key map "r" 'Man-follow-manual-reference) + (define-key map "g" 'Man-goto-section) + (define-key map "s" 'Man-goto-see-also-section) + (define-key map "k" 'Man-kill) + (define-key map "q" 'Man-quit) + (define-key map "m" 'man) + ;; Not all the man references get buttons currently. The text in the + ;; manual page can contain references to other man pages + (define-key map "\r" 'man-follow) + (define-key map "?" 'describe-mode) + map) + "Keymap for Man mode.") ;; buttons (define-button-type 'Man-abstract-xref-man-page @@ -730,8 +724,7 @@ all sections related to a subject, put something appropriate into the (require 'env) (message "Invoking %s %s in the background" manual-program man-args) (setq buffer (generate-new-buffer bufname)) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (setq buffer-undo-list t) (setq Man-original-frame (selected-frame)) (setq Man-arguments man-args)) @@ -802,8 +795,7 @@ all sections related to a subject, put something appropriate into the (defun Man-notify-when-ready (man-buffer) "Notify the user when MAN-BUFFER is ready. See the variable `Man-notify-method' for the different notification behaviors." - (let ((saved-frame (save-excursion - (set-buffer man-buffer) + (let ((saved-frame (with-current-buffer man-buffer Man-original-frame))) (cond ((eq Man-notify-method 'newframe) @@ -975,7 +967,7 @@ default type, `Man-xref-man-page' is used for the buttons." (Man-next-section 1) (point))) (goto-char (point-min)) - (point-max)))) + nil))) (while (re-search-forward regexp end t) (make-text-button (match-beginning button-pos) @@ -1031,8 +1023,7 @@ manpage command." (or (stringp process) (set-process-buffer process nil)) - (save-excursion - (set-buffer Man-buffer) + (with-current-buffer Man-buffer (let ((case-fold-search nil)) (goto-char (point-min)) (cond ((or (looking-at "No \\(manual \\)*entry for") @@ -1223,13 +1214,10 @@ The following key bindings are currently in effect in the buffer: (defun Man-strip-page-headers () "Strip all the page headers but the first from the manpage." - (let ((buffer-read-only nil) + (let ((inhibit-read-only t) (case-fold-search nil) - (page-list Man-page-list) - (page ()) (header "")) - (while page-list - (setq page (car page-list)) + (dolist (page Man-page-list) (and (nth 2 page) (goto-char (car page)) (re-search-forward Man-first-heading-regexp nil t) @@ -1243,17 +1231,14 @@ The following key bindings are currently in effect in the buffer: ;; line. ;; (setq header (concat "\n" header))) (while (search-forward header (nth 1 page) t) - (replace-match ""))) - (setq page-list (cdr page-list))))) + (replace-match "")))))) (defun Man-unindent () "Delete the leading spaces that indent the manpage." - (let ((buffer-read-only nil) - (case-fold-search nil) - (page-list Man-page-list)) - (while page-list - (let ((page (car page-list)) - (indent "") + (let ((inhibit-read-only t) + (case-fold-search nil)) + (dolist (page Man-page-list) + (let ((indent "") (nindent 0)) (narrow-to-region (car page) (car (cdr page))) (if Man-uses-untabify-flag @@ -1281,7 +1266,6 @@ The following key bindings are currently in effect in the buffer: (or (eolp) (delete-char nindent)) (forward-line 1))) - (setq page-list (cdr page-list)) )))) @@ -1466,7 +1450,7 @@ Specify which REFERENCE to use; default is based on word at point." (let ((path Man-header-file-path) complete-path) (while path - (setq complete-path (concat (car path) "/" file) + (setq complete-path (expand-file-name file (car path)) path (cdr path)) (if (file-readable-p complete-path) (progn (view-file complete-path) -- cgit v1.2.1 From de9b22dd03ea5f6c5c0081910a60538c1725f765 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Thu, 9 Aug 2007 01:41:08 +0000 Subject: username and password default --- lisp/ChangeLog | 5 +++++ lisp/url/url-auth.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc6b8e910fb..e7df3ec223d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-09 Edward O'Connor (tiny change) + + * url/url-auth.el (url-basic-auth): When prompting for username + and password, default to the username and password in the URL. + 2007-08-08 Stefan Monnier * man.el: Remove spurious * in docstrings. diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index 030409c3391..3c33fd914e5 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -68,7 +68,9 @@ instead of the pathname inheritance method." (server (url-host href)) (port (url-port href)) (path (url-filename href)) - user pass byserv retval data) + (user (url-user href)) + (pass (url-password href)) + byserv retval data) (setq server (format "%s:%d" server port) path (cond (realm realm) @@ -79,8 +81,8 @@ instead of the pathname inheritance method." (cond ((and prompt (not byserv)) (setq user (read-string (url-auth-user-prompt url realm) - (user-real-login-name)) - pass (read-passwd "Password: ")) + (or user (user-real-login-name))) + pass (read-passwd "Password: " nil (or pass ""))) (set url-basic-auth-storage (cons (list server (cons path -- cgit v1.2.1 From 97204204bd427c6cb9afe027009509cad831ba78 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Thu, 9 Aug 2007 01:42:13 +0000 Subject: username and password default --- lisp/ChangeLog | 5 +++++ lisp/url/url-auth.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 74bafdd83e9..21751a27d21 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-09 Edward O'Connor (tiny change) + + * url/url-auth.el (url-basic-auth): When prompting for username + and password, default to the username and password in the URL. + 2007-08-08 Vinicius Jose Latorre * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index c57a96cc81b..45b78e51f90 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -68,7 +68,9 @@ instead of the pathname inheritance method." (server (url-host href)) (port (url-port href)) (path (url-filename href)) - user pass byserv retval data) + (user (url-user href)) + (pass (url-password href)) + byserv retval data) (setq server (format "%s:%d" server port) path (cond (realm realm) @@ -79,8 +81,8 @@ instead of the pathname inheritance method." (cond ((and prompt (not byserv)) (setq user (read-string (url-auth-user-prompt url realm) - (user-real-login-name)) - pass (read-passwd "Password: ")) + (or user (user-real-login-name))) + pass (read-passwd "Password: " nil (or pass ""))) (set url-basic-auth-storage (cons (list server (cons path -- cgit v1.2.1 From b9fdc14be986206d7ef672c0b0b15b4690bc3f08 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 9 Aug 2007 02:48:42 +0000 Subject: (help-make-xrefs): Fix previous change. --- lisp/help-mode.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/help-mode.el b/lisp/help-mode.el index fd17a93a29f..1435eb019ec 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -461,9 +461,11 @@ that." ;; An obvious case of a key substitution: (save-excursion (while (re-search-forward - ;; Assume command name is only word and symbol + ;; Assume command name is only word and symbol ;; characters to get things like `use M-x foo->bar'. - "\\ Date: Thu, 9 Aug 2007 02:49:10 +0000 Subject: (help-make-xrefs): Fix previous change. --- lisp/help-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 818a0111cb8..74daa9b8afb 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -438,7 +438,9 @@ that." (while (re-search-forward ;; Assume command name is only word and symbol ;; characters to get things like `use M-x foo->bar'. - "\\ Date: Thu, 9 Aug 2007 14:39:20 +0000 Subject: (vc-rcs-find-file-not-found-hook): Move from vc-default-find-file-not-found-hook. --- lisp/vc-rcs.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp') diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el index d73f8522115..b341f82a73b 100644 --- a/lisp/vc-rcs.el +++ b/lisp/vc-rcs.el @@ -225,6 +225,14 @@ When VERSION is given, perform check for that version." ;; The workfile is unchanged if rcsdiff found no differences. (zerop status))) +(defun vc-rcs-find-file-not-found-hook () + (if (yes-or-no-p + (format "File %s was lost; check out from version control? " + (file-name-nondirectory buffer-file-name))) + (save-excursion + (require 'vc) + (let ((default-directory (file-name-directory buffer-file-name))) + (not (vc-error-occurred (vc-checkout buffer-file-name))))))) ;;; ;;; State-changing functions -- cgit v1.2.1 From b84e1fd7e44a9ba32bcb7b79dadd385f8a29501b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 9 Aug 2007 14:42:00 +0000 Subject: (vc-default-find-file-not-found-hook): Do nothing. --- lisp/ChangeLog | 11 +++++++++-- lisp/vc-hooks.el | 10 +++------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e7df3ec223d..3a63fea4389 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,14 @@ +2007-08-09 Stefan Monnier + + * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing. + + * vc-rcs.el (vc-rcs-find-file-not-found-hook): + Move from vc-default-find-file-not-found-hook. + 2007-08-09 Edward O'Connor (tiny change) - * url/url-auth.el (url-basic-auth): When prompting for username - and password, default to the username and password in the URL. + * url/url-auth.el (url-basic-auth): When prompting for username + and password, default to the username and password in the URL. 2007-08-08 Stefan Monnier diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 052365945f2..0356e10fe5c 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -838,13 +838,9 @@ Used in `find-file-not-found-functions'." (if backend (vc-call-backend backend 'find-file-not-found-hook)))) (defun vc-default-find-file-not-found-hook (backend) - (if (yes-or-no-p - (format "File %s was lost; check out from version control? " - (file-name-nondirectory buffer-file-name))) - (save-excursion - (require 'vc) - (setq default-directory (file-name-directory buffer-file-name)) - (not (vc-error-occurred (vc-checkout buffer-file-name)))))) + ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only + ;; really makes sense for RCS. For other backends, better not do anything. + nil) (add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) -- cgit v1.2.1 From 86e1693b48ab9dad490a7c12452a09bc6184d729 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 9 Aug 2007 14:57:45 +0000 Subject: (vc-bzr-registered): Use \0 instead of literal NULs. (vc-bzr-state-words): Add "kind changed" state word. (vc-bzr-status): New function. Return Bzr idea of file status, which is different from VC's. (vc-bzr-state): Use vc-bzr-status. (vc-workfile-unchanged-p): Use vc-bzr-status. (vc-bzr-revert): Use synchronous process; expect exitcode 0. (vc-dired-state): Process "kind changed" state word. --- lisp/ChangeLog | 11 +++++++++++ lisp/vc-bzr.el | Bin 23462 -> 24827 bytes 2 files changed, 11 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a63fea4389..8d1681ac12f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2007-08-09 Riccardo Murri + + * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs. + (vc-bzr-state-words): Add "kind changed" state word. + (vc-bzr-status): New function. Return Bzr idea of file status, + which is different from VC's. + (vc-bzr-state): Use vc-bzr-status. + (vc-workfile-unchanged-p): Use vc-bzr-status. + (vc-bzr-revert): Use synchronous process; expect exitcode 0. + (vc-dired-state): Process "kind changed" state word. + 2007-08-09 Stefan Monnier * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing. diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index cfb417519d3..a11aa2e7ba8 100644 Binary files a/lisp/vc-bzr.el and b/lisp/vc-bzr.el differ -- cgit v1.2.1 From 2caba598b57566a3f32f0160144f49ad61987063 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Aug 2007 04:16:21 +0000 Subject: (tex-font-lock-unfontify-region): Take tex-font-script-display into account. (tex-font-script-display, tex-font-lock-suscript): Change from a cons cell to a list of 2 elements to simplify the unfontify code. --- lisp/ChangeLog | 22 ++++++++++++++-------- lisp/textmodes/tex-mode.el | 14 ++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 21751a27d21..56c30361d54 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,14 @@ +2007-08-10 Stefan Monnier + + * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to + take tex-font-script-display into account. + (tex-font-script-display, tex-font-lock-suscript): Change from a cons + cell to a list of 2 elements to simplify the unfontify code. + 2007-08-09 Edward O'Connor (tiny change) - * url/url-auth.el (url-basic-auth): When prompting for username - and password, default to the username and password in the URL. + * url/url-auth.el (url-basic-auth): When prompting for username + and password, default to the username and password in the URL. 2007-08-08 Vinicius Jose Latorre @@ -285,16 +292,15 @@ (fortran-mode): Use fortran-line-length, and fortran-font-lock-syntactic-keywords as a function. Add a hack-local-variables-hook function. - (fortran-line-length, fortran-hack-local-variables): New - functions. - (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use - fortran-line-length rather than 72. + (fortran-line-length, fortran-hack-local-variables): New functions. + (fortran-window-create, fortran-strip-sequence-nos): Doc fix. + Use fortran-line-length rather than 72. (fortran-window-create-momentarily): Doc fix. 2007-07-31 Drew Adams (tiny change) - * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix - parent groups link. + * cus-edit.el (custom-group-value-create, custom-goto-parent): + Fix parent groups link. 2007-07-31 Paul Pogonyshev diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 240ebbcb229..44bc31d36d6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -249,14 +249,12 @@ Normally set to either `plain-tex-mode' or `latex-mode'." :group 'tex) (put 'tex-fontify-script 'safe-local-variable 'booleanp) -(defcustom tex-font-script-display '(-0.2 . 0.2) +(defcustom tex-font-script-display '(-0.2 0.2) "Display specification for subscript and superscript content. -The car is used for subscript, the cdr is used for superscripts." +The first is used for subscript, the second is used for superscripts." :group 'tex - :type '(cons (choice (float :tag "Subscript") - (const :tag "No lowering" nil)) - (choice (float :tag "Superscript") - (const :tag "No raising" nil)))) + :type '(list (float :tag "Subscript") + (float :tag "Superscript"))) (defvar tex-last-temp-file nil "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. @@ -609,7 +607,7 @@ An alternative value is \" . \", if you use a font with a narrow period." odd)) (if (eq (char-after pos) ?_) `(face subscript display (raise ,(car tex-font-script-display))) - `(face superscript display (raise ,(cdr tex-font-script-display)))))) + `(face superscript display (raise ,(cadr tex-font-script-display)))))) (defun tex-font-lock-match-suscript (limit) "Match subscript and superscript patterns up to LIMIT." @@ -669,7 +667,7 @@ An alternative value is \" . \", if you use a font with a narrow period." (let ((next (next-single-property-change beg 'display nil end)) (prop (get-text-property beg 'display))) (if (and (eq (car-safe prop) 'raise) - (member (car-safe (cdr prop)) '(-0.3 +0.3)) + (member (car-safe (cdr prop)) tex-font-script-display) (null (cddr prop))) (put-text-property beg next 'display nil)) (setq beg next)))) -- cgit v1.2.1 From 6b618fd343db178dbf0acfb1b2a723a3ce4aa0db Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Aug 2007 06:52:30 +0000 Subject: (backquote-delay-process): New function. (backquote-process): Add internal arg `level'. Use the two to correctly handle nested backquotes. --- lisp/emacs-lisp/backquote.el | 54 ++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 15 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el index 54fcfc3df8a..6daaf001433 100644 --- a/lisp/emacs-lisp/backquote.el +++ b/lisp/emacs-lisp/backquote.el @@ -118,10 +118,28 @@ Vectors work just like lists. Nested backquotes are permitted." ;; constant, 1 => to be unquoted, 2 => to be spliced in. ;; The top-level backquote macro just discards the tag. -(defun backquote-process (s) +(defun backquote-delay-process (s level) + "Process a (un|back|splice)quote inside a backquote. +This simply recurses through the body." + (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level) + (cons 0 (list 'quote (car s)))) + '(0)))) + (if (eq (car-safe exp) 'quote) + (cons 0 (list 'quote s)) + (cons 1 exp)))) + +(defun backquote-process (s &optional level) + "Process the body of a backquote. +S is the body. Returns a cons cell whose cdr is piece of code which +is the macro-expansion of S, and whose car is a small integer whose value +can either indicate that the code is constant (0), or not (1), or returns +a list which should be spliced into its environment (2). +LEVEL is only used internally and indicates the nesting level: +0 (the default) is for the toplevel nested inside a single backquote." + (unless level (setq level 0)) (cond ((vectorp s) - (let ((n (backquote-process (append s ())))) + (let ((n (backquote-process (append s ()) level))) (if (= (car n) 0) (cons 0 s) (cons 1 (cond @@ -138,11 +156,15 @@ Vectors work just like lists. Nested backquotes are permitted." s (list 'quote s)))) ((eq (car s) backquote-unquote-symbol) - (cons 1 (nth 1 s))) + (if (<= level 0) + (cons 1 (nth 1 s)) + (backquote-delay-process s (1- level)))) ((eq (car s) backquote-splice-symbol) - (cons 2 (nth 1 s))) + (if (<= level 0) + (cons 2 (nth 1 s)) + (backquote-delay-process s (1- level)))) ((eq (car s) backquote-backquote-symbol) - (backquote-process (cdr (backquote-process (nth 1 s))))) + (backquote-delay-process s (1+ level))) (t (let ((rest s) item firstlist list lists expression) @@ -154,11 +176,13 @@ Vectors work just like lists. Nested backquotes are permitted." ;; at the beginning, put them in FIRSTLIST, ;; as a list of tagged values (TAG . FORM). ;; If there are any at the end, they go in LIST, likewise. - (while (consp rest) - ;; Turn . (, foo) into (,@ foo). - (if (eq (car rest) backquote-unquote-symbol) - (setq rest (list (list backquote-splice-symbol (nth 1 rest))))) - (setq item (backquote-process (car rest))) + (while (and (consp rest) + ;; Stop if the cdr is an expression inside a backquote or + ;; unquote since this needs to go recursively through + ;; backquote-process. + (not (or (eq (car rest) backquote-unquote-symbol) + (eq (car rest) backquote-backquote-symbol)))) + (setq item (backquote-process (car rest) level)) (cond ((= (car item) 2) ;; Put the nonspliced items before the first spliced item @@ -168,8 +192,8 @@ Vectors work just like lists. Nested backquotes are permitted." list nil)) ;; Otherwise, put any preceding nonspliced items into LISTS. (if list - (setq lists (cons (backquote-listify list '(0 . nil)) lists))) - (setq lists (cons (cdr item) lists)) + (push (backquote-listify list '(0 . nil)) lists)) + (push (cdr item) lists) (setq list nil)) (t (setq list (cons item list)))) @@ -177,8 +201,8 @@ Vectors work just like lists. Nested backquotes are permitted." ;; Handle nonsplicing final elements, and the tail of the list ;; (which remains in REST). (if (or rest list) - (setq lists (cons (backquote-listify list (backquote-process rest)) - lists))) + (push (backquote-listify list (backquote-process rest level)) + lists)) ;; Turn LISTS into a form that produces the combined list. (setq expression (if (or (cdr lists) @@ -221,5 +245,5 @@ Vectors work just like lists. Nested backquotes are permitted." tail)) (t (cons 'list heads))))) -;;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a +;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a ;;; backquote.el ends here -- cgit v1.2.1 From e61958687bf470ea26fb7389e268b8976bee9b70 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Aug 2007 06:52:54 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++ lisp/textmodes/bibtex-style.el | 155 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 lisp/textmodes/bibtex-style.el (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8d1681ac12f..81ded0e261a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-10 Stefan Monnier + + * emacs-lisp/backquote.el (backquote-delay-process): New function. + (backquote-process): Add internal arg `level'. Use the two to + correctly handle nested backquotes. + 2007-08-09 Riccardo Murri * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs. diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el new file mode 100644 index 00000000000..99c2f92cab0 --- /dev/null +++ b/lisp/textmodes/bibtex-style.el @@ -0,0 +1,155 @@ +;;; bibtex-style.el --- Major mode for BibTeX Style files + +;; Copyright (C) 2005,2007 Free Software Foundation, Inc. + +;; Author: Stefan Monnier +;; Keywords: + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; Done: font-lock, imenu, outline, commenting, indentation. +;; Todo: tab-completion. +;; Bugs: + +;;; Code: + +(defvar bibtex-style-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?% "<" st) + (modify-syntax-entry ?\n ">" st) + (modify-syntax-entry ?\{ "(}" st) + (modify-syntax-entry ?\} "){" st) + (modify-syntax-entry ?\" "\"" st) + (modify-syntax-entry ?. "_" st) + (modify-syntax-entry ?' "'" st) + (modify-syntax-entry ?# "'" st) + (modify-syntax-entry ?* "." st) + (modify-syntax-entry ?= "." st) + (modify-syntax-entry ?$ "_" st) + st)) + + +(defconst bibtex-style-commands + '("ENTRY" "EXECUTE" "FUNCTION" "INTEGERS" "ITERATE" "MACRO" "READ" + "REVERSE" "SORT" "STRINGS")) + +(defconst bibtex-style-functions + ;; From http://www.eeng.dcu.ie/local-docs/btxdocs/btxhak/btxhak/node4.html. + '("<" ">" "=" "+" "-" "*" ":=" + "add.period$" "call.type$" "change.case$" "chr.to.int$" "cite$" + "duplicate$" "empty$" "format.name$" "if$" "int.to.chr$" "int.to.str$" + "missing$" "newline$" "num.names$" "pop$" "preamble$" "purify$" "quote$" + "skip$" "stack$" "substring$" "swap$" "text.length$" "text.prefix$" + "top$" "type$" "warning$" "while$" "width$" "write$")) + +(defvar bibtex-style-font-lock-keywords + `((,(regexp-opt bibtex-style-commands 'words) . font-lock-keyword-face) + ("\\w+\\$" . font-lock-keyword-face) + ("\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" + (2 font-lock-function-name-face)))) + +;;;###autoload (add-to-list 'auto-mode-alist '("\\.bst\\'" . bibtex-style-mode)) + +;;;###autoload +(define-derived-mode bibtex-style-mode nil "BibStyle" + "Major mode for editing BibTeX style files." + (set (make-local-variable 'comment-start) "%") + (set (make-local-variable 'outline-regexp) "^[a-z]") + (set (make-local-variable 'imenu-generic-expression) + '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2))) + (set (make-local-variable 'indent-line-function) 'bibtex-style-indent-line) + (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq font-lock-defaults + '(bibtex-style-font-lock-keywords nil t + ((?. . "w"))))) + +(defun bibtex-style-indent-line () + "Indent current line of BibTeX Style code." + (interactive) + (let* ((savep (point)) + (indent (condition-case nil + (save-excursion + (forward-line 0) + (skip-chars-forward " \t") + (if (>= (point) savep) (setq savep nil)) + (max (bibtex-style-calculate-indentation) 0)) + (error 0)))) + (if savep + (save-excursion (indent-line-to indent)) + (indent-line-to indent)))) + +(defcustom bibtex-style-indent-basic 2 + "Basic amount of indentation to use in BibTeX Style mode." + :type 'integer) + +(defun bibtex-style-calculate-indentation (&optional virt) + (or + ;; Stick the first line at column 0. + (and (= (point-min) (line-beginning-position)) 0) + ;; Commands start at column 0. + (and (looking-at (regexp-opt bibtex-style-commands 'words)) 0) + ;; Trust the current indentation, if such info is applicable. + (and virt (save-excursion (skip-chars-backward " \t{") (bolp)) + (current-column)) + ;; Put leading close-paren where the matching open brace would be. + (and (looking-at "}") + (condition-case nil + (save-excursion + (up-list -1) + (bibtex-style-calculate-indentation 'virt)) + (scan-error nil))) + ;; Align leading "if$" with previous command. + (and (looking-at "if\\$") + (condition-case nil + (save-excursion + (backward-sexp 3) + (bibtex-style-calculate-indentation 'virt)) + (scan-error + ;; There is no command before the "if$". + (condition-case nil + (save-excursion + (up-list -1) + (+ bibtex-style-indent-basic + (bibtex-style-calculate-indentation 'virt))) + (scan-error nil))))) + ;; Right after an opening brace. + (condition-case err (save-excursion (backward-sexp 1) nil) + (scan-error (goto-char (nth 2 err)) + (+ bibtex-style-indent-basic + (bibtex-style-calculate-indentation 'virt)))) + ;; Default, align with previous command. + (let ((fai ;; First arm of an "if$". + (condition-case nil + (save-excursion + (forward-sexp 2) + (forward-comment (point-max)) + (looking-at "if\\$")) + (scan-error nil)))) + (save-excursion + (condition-case err + (while (progn + (backward-sexp 1) + (save-excursion (skip-chars-backward " \t{") (not (bolp))))) + (scan-error nil)) + (+ (current-column) + (if (or fai (looking-at "ENTRY")) bibtex-style-indent-basic 0)))))) + + +(provide 'bibtex-style) +;; arch-tag: b20ad41a-fd36-466e-8fd2-cc6137f9c55c +;;; bibtex-style.el ends here -- cgit v1.2.1 From e56a29d72ea208679c3b0eb7efd35554b7358c20 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Aug 2007 08:20:20 +0000 Subject: (log-view-font-lock-keywords): Use `eval' so as to adapt to buffer settings. --- lisp/ChangeLog | 3 +++ lisp/log-view.el | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81ded0e261a..c894e5e7823 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-08-10 Stefan Monnier + * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt + to buffer-local settings. + * emacs-lisp/backquote.el (backquote-delay-process): New function. (backquote-process): Add internal arg `level'. Use the two to correctly handle nested backquotes. diff --git a/lisp/log-view.el b/lisp/log-view.el index 6a1fc9a11b1..41e689f0025 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el @@ -160,14 +160,18 @@ (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]" ;;Email of user and finally Msg, used as revision name. " .*@.*\n\\(?: \\* \\(.*\\)\\)?") - "\\)$")) - -(defconst log-view-font-lock-keywords - `((,log-view-file-re - (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) - (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) - (0 log-view-file-face append)) - (,log-view-message-re . log-view-message-face))) + "\\)$") + "Regexp matching the text identifying a revision.") + +(defvar log-view-font-lock-keywords + ;; We use `eval' so as to use the buffer-local value of log-view-file-re + ;; and log-view-message-re, if applicable. + '((eval . `(,log-view-file-re + (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) + (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) + (0 log-view-file-face append))) + (eval . `(,log-view-message-re . log-view-message-face)))) + (defconst log-view-font-lock-defaults '(log-view-font-lock-keywords t nil nil nil)) -- cgit v1.2.1 From 8a7d3fb528090e3cef2720a59b3611fa9c9da7f8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 10 Aug 2007 10:13:25 +0000 Subject: (mac-ae-reopen-application): New function. (mac-apple-event-map): Bind "reopen application" Apple event to it. --- lisp/term/mac-win.el | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 3fb07dd004a..44f8f70a252 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1710,6 +1710,19 @@ in `selection-converter-alist', which see." (setq modifiers (cons (car modifier-mask) modifiers))))) modifiers)) +(defun mac-ae-reopen-application (event) + "Show some frame in response to the Apple event EVENT. +The frame to be shown is chosen from visible or iconified frames +if possible. If there's no such frame, a new frame is created." + (interactive "e") + (unless (frame-visible-p (selected-frame)) + (let ((frame (or (car (visible-frame-list)) + (car (filtered-frame-list 'frame-visible-p))))) + (if frame + (select-frame frame) + (switch-to-buffer-other-frame "*scratch*")))) + (select-frame-set-input-focus (selected-frame))) + (defun mac-ae-open-documents (event) "Open the documents specified by the Apple event EVENT." (interactive "e") @@ -1766,9 +1779,9 @@ Currently the `mailto' scheme is supported." (define-key mac-apple-event-map [core-event open-application] 0) ;; Received when a dock or application icon is clicked and Emacs is -;; already running. Simply ignored. Another idea is to make a new -;; frame if all frames are invisible. -(define-key mac-apple-event-map [core-event reopen-application] 'ignore) +;; already running. +(define-key mac-apple-event-map [core-event reopen-application] + 'mac-ae-reopen-application) (define-key mac-apple-event-map [core-event open-documents] 'mac-ae-open-documents) -- cgit v1.2.1 From 34a5deb94d55fd18cc4b43051714aed52e8c99e7 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 10 Aug 2007 10:13:44 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 56c30361d54..3b17077b978 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-10 YAMAMOTO Mitsuharu + + * term/mac-win.el (mac-ae-reopen-application): New function. + (mac-apple-event-map): Bind "reopen application" Apple event to it. + 2007-08-10 Stefan Monnier * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to -- cgit v1.2.1 From 4a3eaf6d189de933fcb40d39f87e40909cbfe45f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 11 Aug 2007 03:01:46 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3b17077b978..89361af9b7f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-11 Glenn Morris + + * progmodes/compile.el (compilation-buffer-name): Don't check + compilation-arguments. It is superfluous, and the variable isn't + even set when this function is called. + 2007-08-10 YAMAMOTO Mitsuharu * term/mac-win.el (mac-ae-reopen-application): New function. -- cgit v1.2.1 From c4e0c56d9a136b1ada0268a5313a97d965cf4967 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 11 Aug 2007 03:02:05 +0000 Subject: (compilation-buffer-name): Don't check compilation-arguments. It is superfluous, and the variable isn't even set when this function is called. --- lisp/progmodes/compile.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d7283037b6f..2bed6ce39a6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -979,8 +979,7 @@ Otherwise, construct a buffer name from MODE-NAME." (funcall name-function mode-name)) (compilation-buffer-name-function (funcall compilation-buffer-name-function mode-name)) - ((and (eq mode-command major-mode) - (eq major-mode (nth 1 compilation-arguments))) + ((eq mode-command major-mode) (buffer-name)) (t (concat "*" (downcase mode-name) "*")))) @@ -1032,7 +1031,7 @@ Returns the compilation buffer created." (with-current-buffer (setq outbuf (get-buffer-create - (compilation-buffer-name name-of-mode mode name-function))) + (compilation-buffer-name name-of-mode mode name-function))) (let ((comp-proc (get-buffer-process (current-buffer)))) (if comp-proc (if (or (not (eq (process-status comp-proc) 'run)) -- cgit v1.2.1 From 323a67b407a87c982369e7083e4db0c24f8d0775 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 17:53:21 +0000 Subject: (gud): Change to group `processes'. --- lisp/progmodes/gud.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 2131aebe2a8..f4c31ac203a 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -59,7 +59,7 @@ (defgroup gud nil "Grand Unified Debugger mode for gdb and other debuggers under Emacs. Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb." - :group 'unix + :group 'processes :group 'tools) -- cgit v1.2.1 From 1e8e64ce5c11a519ce7f7145b84fd02185b2afb1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 17:54:37 +0000 Subject: (sh): Delete group `unix'. --- lisp/progmodes/sh-script.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f6ef646069b..c3948280f76 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -212,7 +212,6 @@ (defgroup sh nil "Shell programming utilities." - :group 'unix :group 'languages) (defgroup sh-script nil -- cgit v1.2.1 From e1c5fe19f0f417a12bd2e2efda5974524c398426 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 17:55:05 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 89361af9b7f..1bfb7ac5de5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-12 Richard Stallman + + * progmodes/sh-script.el (sh): Delete group `unix'. + + * progmodes/gud.el (gud): Change to group `processes'. + 2007-08-11 Glenn Morris * progmodes/compile.el (compilation-buffer-name): Don't check @@ -97,6 +103,15 @@ It calls comment-line-break-function if there are comments. (do-auto-fill): Use that. +2007-08-07 Ivan Kanis + + * time.el (display-time-world-mode, display-time-world-display) + (display-time-world, display-time-world-list) + (display-time-world-time-format, display-time-world-buffer-name) + (display-time-world-timer-enable) + (display-time-world-timer-second, display-time-world-mode-map): + New. + 2007-08-07 Sean O'Rourke * complete.el (PC-lisp-complete-symbol): Complete symbol around point. -- cgit v1.2.1 From c4e5cdbce6d8468f3ecd10d4a0a589d9f9750449 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 17:59:40 +0000 Subject: (combine-and-quote-strings): Renamed from strings->string. (split-string-and-unquote): Renamed from string->strings. --- lisp/subr.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/subr.el b/lisp/subr.el index 84f216b0861..8de09b032f5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2760,11 +2760,10 @@ Modifies the match data; use `save-match-data' if necessary." list))) (nreverse list))) -;; (string->strings (strings->string X)) == X -(defun strings->string (strings &optional separator) +(defun combine-and-quote-strings (strings &optional separator) "Concatenate the STRINGS, adding the SEPARATOR (default \" \"). This tries to quote the strings to avoid ambiguity such that - (string->strings (strings->string strs)) == strs + (split-string-and-unquote (combine-and-quote-strings strs)) == strs Only some SEPARATORs will work properly." (let ((sep (or separator " "))) (mapconcat @@ -2774,20 +2773,20 @@ Only some SEPARATORs will work properly." str)) strings sep))) -;; (string->strings (strings->string X)) == X -(defun string->strings (string &optional separator) +(defun split-string-and-unquote (string &optional separator) "Split the STRING into a list of strings. -It understands elisp style quoting within STRING such that - (string->strings (strings->string strs)) == strs +It understands Emacs Lisp quoting within STRING, such that + (split-string-and-unquote (combine-and-quote-strings strs)) == strs The SEPARATOR regexp defaults to \"\\s-+\"." (let ((sep (or separator "\\s-+")) (i (string-match "[\"]" string))) - (if (null i) (split-string string sep t) ; no quoting: easy + (if (null i) + (split-string string sep t) ; no quoting: easy (append (unless (eq i 0) (split-string (substring string 0 i) sep t)) (let ((rfs (read-from-string string i))) (cons (car rfs) - (string->strings (substring string (cdr rfs)) - sep))))))) + (split-string-and-unquote (substring string (cdr rfs)) + sep))))))) ;;;; Replacement in strings. -- cgit v1.2.1 From 3ca7e11cbb18b91ff2b390cfacf3565a82bc92cc Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:00:34 +0000 Subject: (cvs-qtypedesc-strings): Use new names combine-and-quote-strings and split-string-and-unquote. --- lisp/pcvs-util.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index 6991f796526..e5ab1638c60 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el @@ -211,7 +211,8 @@ arguments. If ARGS is not a list, no argument will be passed." (defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t)) (defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity)) (defconst cvs-qtypedesc-strings - (cvs-qtypedesc-create 'string->strings 'strings->string nil)) + (cvs-qtypedesc-create 'split-string-and-unquote + 'combine-and-quote-strings nil)) (defun cvs-query-read (default prompt qtypedesc &optional hist-sym) (let* ((qtypedesc (or qtypedesc cvs-qtypedesc-strings)) -- cgit v1.2.1 From fca5d87e3206919c455ddff47b0e8a184f106724 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:01:29 +0000 Subject: (flymake-err-line-patterns): Fix infloop in javac regexp. --- lisp/progmodes/flymake.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 0ce53f43937..99e5fb53823 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -927,7 +927,7 @@ Convert it to flymake internal format." ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) ;; ant/javac - (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" + (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" 2 4 nil 5)) ;; compilation-error-regexp-alist) (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) -- cgit v1.2.1 From f580b452f17e806a560827a1e1303547a83bf146 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:02:39 +0000 Subject: (gud-common-init): Use new name split-string-and-unquote. --- lisp/progmodes/gud.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 06bdd6a0b5f..d5632ffe09f 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2462,7 +2462,7 @@ comint mode, which see." ;; for local variables in the debugger buffer. (defun gud-common-init (command-line massage-args marker-filter &optional find-file) - (let* ((words (string->strings command-line)) + (let* ((words (split-string-and-unquote command-line)) (program (car words)) (dir default-directory) ;; Extract the file name from WORDS -- cgit v1.2.1 From f2f284e197eb1aa548819a03f59670e69ad9a704 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:05:08 +0000 Subject: (vi-next-line): Ignore return value of line-move. --- lisp/emulation/vi.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 54fb2d1e997..977a7980803 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -788,7 +788,7 @@ The given COUNT is remembered for future scrollings." "Go down count lines, try to keep at the same column." (interactive "p") (setq this-command 'next-line) ; this is a needed trick - (if (= (point) (or (line-move count) (point))) + (if (= (point) (progn (line-move count) (point))) (ding) ; no moving, already at end of buffer (setq last-command 'next-line))) -- cgit v1.2.1 From 9815f5d11c7469c58e9df2a7eb73d25e598ed96c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:07:07 +0000 Subject: (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout) (cvs-execute-single-file): Use new name split-string-and-unquote. (cvs-header-msg): Use new name combine-and-quote-strings. --- lisp/pcvs.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 901110bbfa3..6db3ed31a51 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -182,7 +182,7 @@ (when (re-search-forward (concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t) (let* ((sym (intern (concat "cvs-" cmd "-flags"))) - (val (string->strings (or (match-string 2) "")))) + (val (split-string-and-unquote (or (match-string 2) "")))) (cvs-flags-set sym 0 val)))) ;; ensure that cvs doesn't have -q or -Q (cvs-flags-set 'cvs-cvs-flags 0 @@ -612,7 +612,7 @@ If non-nil, NEW means to create a new buffer no matter what." (t arg))) args))) (concat cvs-program " " - (strings->string + (combine-and-quote-strings (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery) (if cvs-cvsroot (list "-d" cvs-cvsroot)) args @@ -941,7 +941,8 @@ With a prefix argument, prompt for cvs FLAGS to use." (let ((root (cvs-get-cvsroot))) (if (or (null root) current-prefix-arg) (setq root (read-string "CVS Root: "))) - (list (string->strings (read-string "Module(s): " (cvs-get-module))) + (list (split-string-and-unquote + (read-string "Module(s): " (cvs-get-module))) (read-directory-name "CVS Checkout Directory: " nil default-directory nil) (cvs-add-branch-prefix @@ -964,7 +965,7 @@ The files are stored to DIR." (if branch (format " (branch: %s)" branch) "")))) (list (read-directory-name prompt nil default-directory nil)))) - (let ((modules (string->strings (cvs-get-module))) + (let ((modules (split-string-and-unquote (cvs-get-module))) (flags (cvs-add-branch-prefix (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) (cvs-cvsroot (cvs-get-cvsroot))) @@ -2253,7 +2254,7 @@ With prefix argument, prompt for cvs flags." (let* ((args (append constant-args arg-list))) (insert (format "=== %s %s\n\n" - program (strings->string args))) + program (split-string-and-unquote args))) ;; FIXME: return the exit status? (apply 'call-process program nil t t args) -- cgit v1.2.1 From 3343c248576dfce39295cf1781aaf469f4cdc9cb Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2007 18:10:12 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c894e5e7823..975dc2913c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2007-08-12 Richard Stallman + + * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout) + (cvs-execute-single-file): Use new name split-string-and-unquote. + (cvs-header-msg): Use new name combine-and-quote-strings. + + * emulation/vi.el (vi-next-line): Ignore return value of line-move. + + * progmodes/gud.el (gud-common-init): Use new name + split-string-and-unquote. + + * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop + in javac regexp. + + * pcvs-util.el (cvs-qtypedesc-strings): Use new names + combine-and-quote-strings and split-string-and-unquote. + + * subr.el (combine-and-quote-strings): Renamed from strings->string. + (split-string-and-unquote): Renamed from string->strings. + 2007-08-10 Stefan Monnier * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt -- cgit v1.2.1 From af2ac592436e2941a679321ac66cc4e3e3eb4097 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 13 Aug 2007 05:35:43 +0000 Subject: (autoload-print-form): Use print-quoted. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/autoload.el | 2 ++ 2 files changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bfb7ac5de5..cc8b7422ce1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-13 Stefan Monnier + + * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted. + 2007-08-12 Richard Stallman * progmodes/sh-script.el (sh): Delete group `unix'. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 5eb9b8ce621..14877e1b18f 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -209,6 +209,7 @@ put the output in." (setcdr p nil) (princ "\n(" outbuf) (let ((print-escape-newlines t) + (print-quoted t) (print-escape-nonascii t)) (dolist (elt form) (prin1 elt outbuf) @@ -232,6 +233,7 @@ put the output in." outbuf)) (terpri outbuf))) (let ((print-escape-newlines t) + (print-quoted t) (print-escape-nonascii t)) (print form outbuf))))))) -- cgit v1.2.1 From b3eb7b570c5237d326a202acb782e1903372edc3 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 13 Aug 2007 09:26:45 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 975dc2913c6..1477c597589 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-13 Nick Roberts + + * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully. + 2007-08-12 Richard Stallman * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout) -- cgit v1.2.1 From f10ffe267a40b19b93c3d18cf859e4d317467985 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 13 Aug 2007 09:28:31 +0000 Subject: (gdb-send): Handle CTRL-D more carefully. --- lisp/progmodes/gdb-ui.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index c4d14462245..716b79138f9 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -1132,10 +1132,10 @@ This filter may simply queue input for a later time." (let ((item (concat string "\n"))) (if gdb-enable-debug (push (cons 'send item) gdb-debug-log)) (process-send-string proc item))) - (if (and (string-match "\\\\$" string) - (not comint-input-sender-no-newline)) ;;Try to catch C-d. + (if (string-match "\\\\\\'" string) (setq gdb-continuation (concat gdb-continuation string "\n")) - (let ((item (concat gdb-continuation string "\n"))) + (let ((item (concat gdb-continuation string + (if (not comint-input-sender-no-newline) "\n")))) (gdb-enqueue-input item) (setq gdb-continuation nil))))) -- cgit v1.2.1 From beb80d39c7c6a04dfe058602804e8b26e79ef3eb Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 10:41:40 +0000 Subject: (cvs-parse-table): Handle additional instance of optional quotes around files in NEED-UPDATE . REMOVED case. --- lisp/pcvs-parse.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index c26a27ed008..3ca1829030f 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el @@ -284,6 +284,8 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." ;; File removed, since it is removed (by third party) in repository. (and (cvs-or + ;; some cvs versions output quotes around these files + (cvs-match "warning: `\\(.*\\)' is not (any longer) pertinent$" (file 1)) (cvs-match "warning: \\(.*\\) is not (any longer) pertinent$" (file 1)) (cvs-match "`\\(.*\\)' is no longer in the repository$" (file 1)) (cvs-match "\\(.*\\) is no longer in the repository$" (file 1))) -- cgit v1.2.1 From 37752830c9e45cb2a13523750b88763792506095 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:10:47 +0000 Subject: (ada-gnatls-args): Fix docstring. (ada-treat-cmd-string): Improve error message. (ada-do-file-completion): Call `ada-require-project-file', so project variables are set properly. (ada-prj-find-prj-file): Delete Emacs 20.2 support. (ada-gnatfind-buffer-name): New constant. (ada-find-any-references): Use new constant. Set buffer name properly in compilation-start. Toggle read-only properly. (ada-find-in-src-path): Fix spelling error in docstring. --- lisp/progmodes/ada-xref.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index e8db3d51c2a..c37d11910d4 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -71,7 +71,7 @@ Set to 0, if you don't use crunched filenames. This should be a string." :type 'string :group 'ada) (defcustom ada-gnatls-args '("-v") - "*Arguments to pass to `gnatfind' to find location of the runtime. + "*Arguments to pass to `gnatls' to find location of the runtime. Typical use is to pass `--RTS=soft-floats' on some systems that support it. You can also add `-I-' if you do not want the current directory to be included. @@ -322,7 +322,6 @@ CROSS-PREFIX is the prefix to use for the `gnatls' command." (reverse ada-xref-runtime-library-ali-path)) )) - (defun ada-treat-cmd-string (cmd-string) "Replace meta-sequences like ${...} in CMD-STRING with the appropriate value. Assumes project exists. @@ -345,7 +344,7 @@ replaced by the name including the extension." ;; Check if there is an environment variable with the same name (if (null value) (if (not (setq value (getenv name))) - (message "%s" (concat "No environment variable " name " found")))) + (message "%s" (concat "No project or environment variable " name " found")))) (cond ((null value) @@ -535,6 +534,11 @@ All the directories are returned as absolute directories." Completion is attempted in all the directories in the source path, as defined in the project file." ;; FIXME: doc arguments + + ;; This function is not itself interactive, but it is called as part + ;; of the prompt of interactive functions, so we require a project + ;; file. + (ada-require-project-file) (let (list (dirs (ada-xref-get-src-dir-field))) @@ -663,9 +667,6 @@ is non-nil, prompt the user to select one. If none are found, return ada-prj-file-extension)) (dir (file-name-directory current-file)) - ;; on Emacs 20.2, directory-files does not work if - ;; parse-sexp-lookup-properties is set - (parse-sexp-lookup-properties nil) (prj-files (directory-files dir t (concat ".*" (regexp-quote @@ -905,6 +906,8 @@ If ARG is t, the contents of the old *gnatfind* buffer is preserved." (interactive "d\nP") (ada-find-references pos arg t)) +(defconst ada-gnatfind-buffer-name "*gnatfind*") + (defun ada-find-any-references (entity &optional file line column local-only append) "Search for references to any entity whose name is ENTITY. @@ -943,23 +946,25 @@ buffer `*gnatfind*', if there is one." (setq command (concat command " -P" ada-prj-default-project-file)) (setq command (concat command " -p" ada-prj-default-project-file)))) - (if (and append (get-buffer "*gnatfind*")) + (if (and append (get-buffer ada-gnatfind-buffer-name)) (save-excursion (set-buffer "*gnatfind*") (setq old-contents (buffer-string)))) (let ((compilation-error "reference")) - (compilation-start command)) + (compilation-start command 'compilation-mode (lambda (mode) ada-gnatfind-buffer-name))) ;; Hide the "Compilation" menu (save-excursion - (set-buffer "*gnatfind*") + (set-buffer ada-gnatfind-buffer-name) (local-unset-key [menu-bar compilation-menu]) (if old-contents (progn (goto-char 1) + (set 'buffer-read-only nil) (insert old-contents) + (set 'buffer-read-only t) (goto-char (point-max))))) ) ) @@ -1940,7 +1945,7 @@ This function attempts to find the possible declarations for the identifier anywhere in the object path. This command requires the external `egrep' program to be available. -This works well when one is using an external librarie and wants to find +This works well when one is using an external library and wants to find the declaration and documentation of the subprograms one is using." ;; FIXME: what does this function do? (let (list -- cgit v1.2.1 From 692e789e09edd66b7a5b543892960c45f28fb49a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:12:50 +0000 Subject: (vhdl-update-progress-info): Avoid divide by zero error. --- lisp/progmodes/vhdl-mode.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index a1bd32a313d..0d909a4a3ff 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -6982,10 +6982,13 @@ only-lines." (when (and vhdl-progress-info (not noninteractive) (< vhdl-progress-interval (- (nth 1 (current-time)) (aref vhdl-progress-info 2)))) - (message (concat string "... (%2d%s)") - (/ (* 100 (- pos (aref vhdl-progress-info 0))) - (- (aref vhdl-progress-info 1) - (aref vhdl-progress-info 0))) "%") + (let ((delta (- (aref vhdl-progress-info 1) + (aref vhdl-progress-info 0)))) + (if (= 0 delta) + (message (concat string "... (100%s)") "%") + (message (concat string "... (%2d%s)") + (/ (* 100 (- pos (aref vhdl-progress-info 0))) + delta) "%"))) (aset vhdl-progress-info 2 (nth 1 (current-time))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.2.1 From 69b9e6a3fa078a252ff2eea03d97b07fdb8008e4 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:27:41 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc8b7422ce1..c3fff40da35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2007-08-13 Stephen Leake + + * pcvs-parse.el (cvs-parse-table): Handle additional instance of + optional quotes around files in NEED-UPDATE . REMOVED case. + + * progmodes/ada-xref.el (ada-gnatls-args): Fix docstring. + (ada-treat-cmd-string): Improve error message. + (ada-do-file-completion): Call `ada-require-project-file', so + project variables are set properly. + (ada-prj-find-prj-file): Delete Emacs 20.2 support. + (ada-gnatfind-buffer-name): New constant. + (ada-find-any-references): Use new constant. Set buffer name + properly in compilation-start. Toggle read-only properly. + (ada-find-in-src-path): Fix spelling error in docstring. + + * progmodes/vhdl-mode.el (vhdl-update-progress-info): Avoid divide + by zero error. + 2007-08-13 Stefan Monnier * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted. @@ -26,7 +44,7 @@ (tex-font-script-display, tex-font-lock-suscript): Change from a cons cell to a list of 2 elements to simplify the unfontify code. -2007-08-09 Edward O'Connor (tiny change) +2007-08-09 Edward O'Connor (tiny change) * url/url-auth.el (url-basic-auth): When prompting for username and password, default to the username and password in the URL. @@ -112,10 +130,9 @@ * time.el (display-time-world-mode, display-time-world-display) (display-time-world, display-time-world-list) (display-time-world-time-format, display-time-world-buffer-name) - (display-time-world-timer-enable) - (display-time-world-timer-second, display-time-world-mode-map): - New. - + (display-time-world-timer-enable, display-time-world-timer-second) + (display-time-world-mode-map): New. + 2007-08-07 Sean O'Rourke * complete.el (PC-lisp-complete-symbol): Complete symbol around point. @@ -170,10 +187,9 @@ term-default-fg/bg-color instead of ansi-term-color-vector when the index (term-ansi-current-color or term-ansi-current-bg-color) is zero. -2007-08-05 Jay Belanger +2007-08-05 Jay Belanger - * calc/calc-nlfit.el (math-nlfit-curve): - Remove unnecessary variables. + * calc/calc-nlfit.el (math-nlfit-curve): Remove unnecessary variables. (math-nlfit-givens): Let bind free variables. 2007-08-05 Vinicius Jose Latorre @@ -186,7 +202,7 @@ * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. -2007-08-04 Jay Belanger +2007-08-04 Jay Belanger * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear curves and plotting. @@ -224,7 +240,7 @@ 2007-08-03 Jay Belanger - * calc/calc-ext.el (math-get-value,math-get-sdev) + * calc/calc-ext.el (math-get-value, math-get-sdev) (math-contains-sdev): New functions. * calc/calc-graph.el (calc-graph-format-data) @@ -279,8 +295,8 @@ * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t. - * progmodes/fortran.el (fortran-font-lock-syntactic-keywords): Fix - off-by-one error in previous change. + * progmodes/fortran.el (fortran-font-lock-syntactic-keywords): + Fix off-by-one error in previous change. 2007-08-03 Drew Adams @@ -289,8 +305,8 @@ 2007-08-01 Jay Belanger - * calc/calc-math.el (math-sqrt-raw,math-sin-raw-2) - (math-cos-raw-2,math-arctan-raw,math-ln-raw): + * calc/calc-math.el (math-sqrt-raw, math-sin-raw-2) + (math-cos-raw-2, math-arctan-raw, math-ln-raw): Use native Emacs functions, when appropriate. 2007-08-01 Dan Nicolaescu -- cgit v1.2.1 From a5ec0e53e317e2a6790ff64f6be010d9be913ff4 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:37:50 +0000 Subject: (cvs-parse-table): Handle additional instance of optional quotes around files in NEED-UPDATE . REMOVED case. --- lisp/pcvs-parse.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index c26a27ed008..3ca1829030f 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el @@ -284,6 +284,8 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." ;; File removed, since it is removed (by third party) in repository. (and (cvs-or + ;; some cvs versions output quotes around these files + (cvs-match "warning: `\\(.*\\)' is not (any longer) pertinent$" (file 1)) (cvs-match "warning: \\(.*\\) is not (any longer) pertinent$" (file 1)) (cvs-match "`\\(.*\\)' is no longer in the repository$" (file 1)) (cvs-match "\\(.*\\) is no longer in the repository$" (file 1))) -- cgit v1.2.1 From 404197b133407a4d820cbbef7595248b12c3cbda Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:38:37 +0000 Subject: (ada-gnatls-args): Fix docstring. (ada-treat-cmd-string): Improve error message. (ada-do-file-completion): Call `ada-require-project-file', so project variables are set properly. (ada-prj-find-prj-file): Delete Emacs 20.2 support. (ada-gnatfind-buffer-name): New constant. (ada-find-any-references): Use new constant. Set buffer name properly in compilation-start. Toggle read-only properly. (ada-find-in-src-path): Fix spelling error in docstring. --- lisp/progmodes/ada-xref.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index e8db3d51c2a..c37d11910d4 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -71,7 +71,7 @@ Set to 0, if you don't use crunched filenames. This should be a string." :type 'string :group 'ada) (defcustom ada-gnatls-args '("-v") - "*Arguments to pass to `gnatfind' to find location of the runtime. + "*Arguments to pass to `gnatls' to find location of the runtime. Typical use is to pass `--RTS=soft-floats' on some systems that support it. You can also add `-I-' if you do not want the current directory to be included. @@ -322,7 +322,6 @@ CROSS-PREFIX is the prefix to use for the `gnatls' command." (reverse ada-xref-runtime-library-ali-path)) )) - (defun ada-treat-cmd-string (cmd-string) "Replace meta-sequences like ${...} in CMD-STRING with the appropriate value. Assumes project exists. @@ -345,7 +344,7 @@ replaced by the name including the extension." ;; Check if there is an environment variable with the same name (if (null value) (if (not (setq value (getenv name))) - (message "%s" (concat "No environment variable " name " found")))) + (message "%s" (concat "No project or environment variable " name " found")))) (cond ((null value) @@ -535,6 +534,11 @@ All the directories are returned as absolute directories." Completion is attempted in all the directories in the source path, as defined in the project file." ;; FIXME: doc arguments + + ;; This function is not itself interactive, but it is called as part + ;; of the prompt of interactive functions, so we require a project + ;; file. + (ada-require-project-file) (let (list (dirs (ada-xref-get-src-dir-field))) @@ -663,9 +667,6 @@ is non-nil, prompt the user to select one. If none are found, return ada-prj-file-extension)) (dir (file-name-directory current-file)) - ;; on Emacs 20.2, directory-files does not work if - ;; parse-sexp-lookup-properties is set - (parse-sexp-lookup-properties nil) (prj-files (directory-files dir t (concat ".*" (regexp-quote @@ -905,6 +906,8 @@ If ARG is t, the contents of the old *gnatfind* buffer is preserved." (interactive "d\nP") (ada-find-references pos arg t)) +(defconst ada-gnatfind-buffer-name "*gnatfind*") + (defun ada-find-any-references (entity &optional file line column local-only append) "Search for references to any entity whose name is ENTITY. @@ -943,23 +946,25 @@ buffer `*gnatfind*', if there is one." (setq command (concat command " -P" ada-prj-default-project-file)) (setq command (concat command " -p" ada-prj-default-project-file)))) - (if (and append (get-buffer "*gnatfind*")) + (if (and append (get-buffer ada-gnatfind-buffer-name)) (save-excursion (set-buffer "*gnatfind*") (setq old-contents (buffer-string)))) (let ((compilation-error "reference")) - (compilation-start command)) + (compilation-start command 'compilation-mode (lambda (mode) ada-gnatfind-buffer-name))) ;; Hide the "Compilation" menu (save-excursion - (set-buffer "*gnatfind*") + (set-buffer ada-gnatfind-buffer-name) (local-unset-key [menu-bar compilation-menu]) (if old-contents (progn (goto-char 1) + (set 'buffer-read-only nil) (insert old-contents) + (set 'buffer-read-only t) (goto-char (point-max))))) ) ) @@ -1940,7 +1945,7 @@ This function attempts to find the possible declarations for the identifier anywhere in the object path. This command requires the external `egrep' program to be available. -This works well when one is using an external librarie and wants to find +This works well when one is using an external library and wants to find the declaration and documentation of the subprograms one is using." ;; FIXME: what does this function do? (let (list -- cgit v1.2.1 From 9e1d563f1bc752a96cf7b8a5c007631951c86a00 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:39:45 +0000 Subject: (vhdl-update-progress-info): Avoid divide by zero error. --- lisp/progmodes/vhdl-mode.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index a1bd32a313d..0d909a4a3ff 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -6982,10 +6982,13 @@ only-lines." (when (and vhdl-progress-info (not noninteractive) (< vhdl-progress-interval (- (nth 1 (current-time)) (aref vhdl-progress-info 2)))) - (message (concat string "... (%2d%s)") - (/ (* 100 (- pos (aref vhdl-progress-info 0))) - (- (aref vhdl-progress-info 1) - (aref vhdl-progress-info 0))) "%") + (let ((delta (- (aref vhdl-progress-info 1) + (aref vhdl-progress-info 0)))) + (if (= 0 delta) + (message (concat string "... (100%s)") "%") + (message (concat string "... (%2d%s)") + (/ (* 100 (- pos (aref vhdl-progress-info 0))) + delta) "%"))) (aset vhdl-progress-info 2 (nth 1 (current-time))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.2.1 From 3a7f95521d59933cb954ac34cc4c05b1ad4321b5 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 13 Aug 2007 11:47:43 +0000 Subject: *** empty log message *** --- lisp/ChangeLog | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1477c597589..fdc53a12f03 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2007-08-13 Stephen Leake + + * pcvs-parse.el (cvs-parse-table): Handle additional instance of + optional quotes around files in NEED-UPDATE . REMOVED case. + + * progmodes/ada-xref.el (ada-gnatls-args): Fix docstring. + (ada-treat-cmd-string): Improve error message. + (ada-do-file-completion): Call `ada-require-project-file', so + project variables are set properly. + (ada-prj-find-prj-file): Delete Emacs 20.2 support. + (ada-gnatfind-buffer-name): New constant. + (ada-find-any-references): Use new constant. Set buffer name + properly in compilation-start. Toggle read-only properly. + (ada-find-in-src-path): Fix spelling error in docstring. + + * progmodes/vhdl-mode.el (vhdl-update-progress-info): Avoid divide + by zero error. + 2007-08-13 Nick Roberts * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully. @@ -49,7 +67,7 @@ * vc-rcs.el (vc-rcs-find-file-not-found-hook): Move from vc-default-find-file-not-found-hook. -2007-08-09 Edward O'Connor (tiny change) +2007-08-09 Edward O'Connor (tiny change) * url/url-auth.el (url-basic-auth): When prompting for username and password, default to the username and password in the URL. @@ -308,8 +326,7 @@ 2007-07-30 Dan Nicolaescu - * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends): - Remove. + * vc-git.el (vc-directory-exclusion-list, vc-handled-backends): Remove. (vc-git-revision-completion-table): Enable. * vc-hooks.el (vc-handled-backends): Add GIT and HG. -- cgit v1.2.1