diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 82 | ||||
-rw-r--r-- | lisp/comint.el | 8 | ||||
-rw-r--r-- | lisp/complete.el | 20 | ||||
-rw-r--r-- | lisp/ffap.el | 2 | ||||
-rw-r--r-- | lisp/fringe.el | 2 | ||||
-rw-r--r-- | lisp/gdb-ui.el | 99 | ||||
-rw-r--r-- | lisp/info.el | 21 | ||||
-rw-r--r-- | lisp/international/mule-cmds.el | 5 | ||||
-rw-r--r-- | lisp/international/mule-conf.el | 8 | ||||
-rw-r--r-- | lisp/international/mule.el | 242 | ||||
-rw-r--r-- | lisp/international/ucs-tables.el | 2 | ||||
-rw-r--r-- | lisp/language/cyrillic.el | 11 | ||||
-rw-r--r-- | lisp/progmodes/gud.el | 16 | ||||
-rw-r--r-- | lisp/shell.el | 2 | ||||
-rw-r--r-- | lisp/vc.el | 4 |
15 files changed, 329 insertions, 195 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20b42e74cdf..5c667e0b353 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,88 @@ * dired.el (dired-between-files): Always use dired-move-to-filename, which is more robust in non-english locales. +2003-12-25 Markus Rost <rost@mathematik.uni-bielefeld.de> + + * vc.el (vc-dired-purge): Avoid error from `kill-line'. + +2003-12-24 Andreas Schwab <schwab@suse.de> + + * shell.el (shell-file-name-quote-list): Add backslash. + + * comint.el (comint-quote-filename): Correctly handle backslash + in comint-file-name-quote-list. + +2003-12-24 Kenichi Handa <handa@m17n.org> + + * international/mule-cmds.el (set-default-coding-systems): Call + ucs-set-table-for-input for all buffers that don't have local + value of buffer-file-coding-system. + + * international/ucs-tables.el (ucs-set-table-for-input): If + translation-table-for-encode is a symbol, get its + translation-table property. + +2003-12-23 Luc Teirlinck <teirllm@auburn.edu> + + * ffap.el (ffap-read-file-or-url): Eliminate reliance of the call + to `completing-read' on a recently fixed bug. + + * fringe.el (fringe-query-style): Suggest `?' in minibuffer prompt, + instead of SPACE, to get the list of possible fringe modes. SPACE + only works if both `partial-completion-mode' and + `completion-auto-help' are nil. + + * complete.el (PC-is-complete-p): delete. + (PC-do-completion): Replace all calls to `PC-is-complete-p' with + calls to `test-completion'. + +2003-12-23 Nick Roberts <nick@nick.uklinux.net> + + * progmodes/gud.el (gud-speedbar-buttons): Use speed-bar-edit-line + to edit values when there are no children. + + * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as + a mode called "Assembler" already exists. + (gdb-use-colon-colon-notation, gdb-show-changed-values): New + options. + (gud-watch): Use format option. Remove font properties from + string. + (gdb-var-create-handler, gdb-var-list-children-handler): Don't + bother about properties as there are none. + (gdb-var-create-handler, gdb-var-list-children-handler) + (gdb-var-update-handler): Call gdb-var-evaluate-expression-handler + with two arguments. + (gdb-var-evaluate-expression-handler, gdb-post-prompt): Let + speedbar show value changes with a different font. + (gdb-edit-value): New defun. + (gdb-clear-partial-output, gdb-clear-inferior-io) + (def-gdb-auto-update-handler): Use erase-buffer. + (gdb-frame-handler): Display watch expressions in + FUNCTION::VARIABLE format if required. + +2003-12-23 John Paul Wallington <jpw@gnu.org> + + * info.el (Info-unescape-quotes, Info-split-parameter-string) + (Info-goto-emacs-command-node): Doc fixes. + +2003-12-03 Kenichi Handa <handa@m17n.org> + + * language/cyrillic.el: Register "microsoft-cp1251" in + ctext-non-standard-encodings-alist. + ("Bulgarian"): Add ctext-non-standard-encodings. + ("Belarusian"): Likewise. + + * international/mule-conf.el (compound-text-with-extensions): + Change the type to 2 (iso-2022 base). + + * international/mule.el (ctext-non-standard-encodings-alist): + Change the format. + (ctext-non-standard-encodings): New variable. + (ctext-post-read-conversion): Fully re-written. + (ctext-non-standard-designations-alist): Delete it. + (ctext-non-standard-encodings-table): New function. + (ctext-pre-write-conversion): Fully re-written. + 2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk> * cus-edit.el (custom-add-parent-links): Add documentation links diff --git a/lisp/comint.el b/lisp/comint.el index 8405e8afcb6..5509e71d984 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2625,11 +2625,13 @@ Magic characters are those in `comint-file-name-quote-list'." (if (null comint-file-name-quote-list) filename (let ((regexp - (format "\\(^\\|[^\\]\\)\\([%s]\\)" + (format "[%s]" (mapconcat 'char-to-string comint-file-name-quote-list "")))) (save-match-data - (while (string-match regexp filename) - (setq filename (replace-match "\\1\\\\\\2" nil nil filename))) + (let ((i 0)) + (while (string-match regexp filename i) + (setq filename (replace-match "\\\\\\&" nil nil filename)) + (setq i (1+ (match-end 0))))) filename)))) (defun comint-unquote-filename (filename) diff --git a/lisp/complete.el b/lisp/complete.el index 130d0ecb31f..d3c5de459d5 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -368,7 +368,7 @@ of `minibuffer-completion-table' and the minibuffer contents.") ;; Check if buffer contents can already be considered complete (if (and (eq mode 'exit) - (PC-is-complete-p str table pred)) + (test-completion str table pred)) 'complete ;; Do substitutions in directory names @@ -641,7 +641,7 @@ of `minibuffer-completion-table' and the minibuffer contents.") (if improved ;; We changed it... would it be complete without the space? - (if (PC-is-complete-p (buffer-substring 1 (1- end)) + (if (test-completion (buffer-substring 1 (1- end)) table pred) (delete-region (1- end) end))) @@ -649,7 +649,7 @@ of `minibuffer-completion-table' and the minibuffer contents.") ;; We changed it... enough to be complete? (and (eq mode 'exit) - (PC-is-complete-p (field-string) table pred)) + (test-completion (field-string) table pred)) ;; If totally ambiguous, display a list of completions (if (or (eq completion-auto-help t) @@ -680,20 +680,6 @@ of `minibuffer-completion-table' and the minibuffer contents.") (car poss))))) t))))) - -(defun PC-is-complete-p (str table pred) - (let ((res (if (listp table) - (assoc str table) - (if (vectorp table) - (or (equal str "nil") ; heh, heh, heh - (intern-soft str table)) - (funcall table str pred 'lambda))))) - (and res - (or (not pred) - (and (not (listp table)) (not (vectorp table))) - (funcall pred res)) - res))) - (defun PC-chop-word (new old) (let ((i -1) (j -1)) diff --git a/lisp/ffap.el b/lisp/ffap.el index 668700a5c1f..b249ce8daa0 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1216,7 +1216,7 @@ which may actually result in an url rather than a filename." 'ffap-read-file-or-url-internal dir nil - (if dir (cons guess (length dir)) guess) + (if dir (cons guess (1+ (length dir))) guess) (list 'file-name-history)))) ;; Do file substitution like (interactive "F"), suggested by MCOOK. (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess))) diff --git a/lisp/fringe.el b/lisp/fringe.el index 039a41e5adc..16a21752b58 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el @@ -119,7 +119,7 @@ If ALL-FRAMES, the negation of the fringe values in Otherwise the negation of the fringe value in the currently selected frame parameter is used." (let ((mode (intern (completing-read - "Select fringe mode for all frames (SPACE for list): " + "Select fringe mode for all frames (type ? for list): " '(("none") ("default") ("left-only") ("right-only") ("half") ("minimal")) nil t)))) diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index 8166edd83c7..2c9b3390b58 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el @@ -35,16 +35,15 @@ ;; Start the debugger with M-x gdba. -;; This file is based on gdba.el from GDB 5.0 written by Tom Lord and Jim +;; This file has evolved from gdba.el from GDB 5.0 written by Tom Lord and Jim ;; Kingdon and uses GDB's annotation interface. You don't need to know about ;; annotations to use this mode as a debugger, but if you are interested ;; developing the mode itself, then see the Annotations section in the GDB -;; info manual. +;; info manual. Some GDB/MI commands are also used through th CLI command +;; 'interpreter mi <mi-command>'. ;; ;; Known Bugs: -;; Does not auto-display arrays of structures or structures containing arrays. -;; On MS Windows, Gdb 5.1.1 from MinGW 2.0 does not flush the output from the -;; inferior. +;; ;;; Code: @@ -121,7 +120,7 @@ The following interactive lisp functions help control operation : (set (make-local-variable 'gud-minor-mode) 'gdba) (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) ;; - (gud-def gud-break (if (not (string-equal mode-name "Assembler")) + (gud-def gud-break (if (not (string-equal mode-name "Machine")) (gud-call "break %f:%l" arg) (save-excursion (beginning-of-line) @@ -129,7 +128,7 @@ The following interactive lisp functions help control operation : (gud-call "break *%a" arg))) "\C-b" "Set breakpoint at current line or address.") ;; - (gud-def gud-remove (if (not (string-equal mode-name "Assembler")) + (gud-def gud-remove (if (not (string-equal mode-name "Machine")) (gud-call "clear %f:%l" arg) (save-excursion (beginning-of-line) @@ -137,7 +136,7 @@ The following interactive lisp functions help control operation : (gud-call "clear *%a" arg))) "\C-d" "Remove breakpoint at current line or address.") ;; - (gud-def gud-until (if (not (string-equal mode-name "Assembler")) + (gud-def gud-until (if (not (string-equal mode-name "Machine")) (gud-call "until %f:%l" arg) (save-excursion (beginning-of-line) @@ -175,15 +174,23 @@ The following interactive lisp functions help control operation : ;; (run-hooks 'gdba-mode-hook)) +(defcustom gdb-use-colon-colon-notation t + "Non-nil means use FUNCTION::VARIABLE format to display variables in the +speedbar." + :type 'boolean + :group 'gud) + (defun gud-watch () "Watch expression at point." (interactive) (let ((expr (tooltip-identifier-from-point (point)))) - (if (string-equal gdb-current-language "c") + (if (and (string-equal gdb-current-language "c") + gdb-use-colon-colon-notation) (setq expr (concat gdb-current-frame "::" expr))) (catch 'already-watched (dolist (var gdb-var-list) (if (string-equal expr (car var)) (throw 'already-watched nil))) + (set-text-properties 0 (length expr) nil expr) (gdb-enqueue-input (list (concat "server interpreter mi \"-var-create - * " expr "\"\n") `(lambda () (gdb-var-create-handler ,expr)))))) @@ -197,10 +204,10 @@ The following interactive lisp functions help control operation : (goto-char (point-min)) (if (re-search-forward gdb-var-create-regexp nil t) (let ((var (list expr - (match-string-no-properties 1) - (match-string-no-properties 2) - (match-string-no-properties 3) - nil))) + (match-string 1) + (match-string 2) + (match-string 3) + nil nil))) (push var gdb-var-list) (speedbar 1) (if (equal (nth 2 var) "0") @@ -208,13 +215,13 @@ The following interactive lisp functions help control operation : (list (concat "server interpreter mi \"-var-evaluate-expression " (nth 1 var) "\"\n") `(lambda () (gdb-var-evaluate-expression-handler - ,(nth 1 var))))) + ,(nth 1 var) nil)))) (setq gdb-var-changed t))) (if (re-search-forward "Undefined command" nil t) (message "Watching expressions requires gdb 6.0 onwards") (message "No symbol %s in current context." expr))))) -(defun gdb-var-evaluate-expression-handler (varnum) +(defun gdb-var-evaluate-expression-handler (varnum changed) (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) (goto-char (point-min)) (re-search-forward ".*value=\"\\(.*?\\)\"" nil t) @@ -223,7 +230,8 @@ The following interactive lisp functions help control operation : (dolist (var gdb-var-list) (if (string-equal varnum (cadr var)) (progn - (setcar (nthcdr 4 var) (match-string-no-properties 1)) + (if changed (setcar (nthcdr 5 var) t)) + (setcar (nthcdr 4 var) (match-string 1)) (setcar (nthcdr num gdb-var-list) var) (throw 'var-found nil))) (setq num (+ num 1)))))) @@ -247,10 +255,11 @@ The following interactive lisp functions help control operation : (progn (push var var-list) (while (re-search-forward gdb-var-list-children-regexp nil t) - (let ((varchild (list (match-string-no-properties 2) - (match-string-no-properties 1) - (match-string-no-properties 3) - (match-string-no-properties 4) + (let ((varchild (list (match-string 2) + (match-string 1) + (match-string 3) + (match-string 5) + (match-string 4) nil))) (dolist (var1 gdb-var-list) (if (string-equal (cadr var1) (cadr varchild)) @@ -263,7 +272,7 @@ The following interactive lisp functions help control operation : "server interpreter mi \"-var-evaluate-expression " (nth 1 varchild) "\"\n") `(lambda () (gdb-var-evaluate-expression-handler - ,(nth 1 varchild))))))))) + ,(nth 1 varchild) nil)))))))) (push var var-list))) (setq gdb-var-list (nreverse var-list)))))) @@ -281,12 +290,12 @@ The following interactive lisp functions help control operation : (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) (goto-char (point-min)) (while (re-search-forward gdb-var-update-regexp nil t) - (let ((varnum (match-string-no-properties 1))) + (let ((varnum (match-string 1))) (gdb-enqueue-input (list (concat "server interpreter mi \"-var-evaluate-expression " varnum "\"\n") `(lambda () (gdb-var-evaluate-expression-handler - ,varnum))))))) + ,varnum t))))))) (gdb-set-pending-triggers (delq 'gdb-var-update (gdb-get-pending-triggers)))) @@ -299,7 +308,7 @@ The following interactive lisp functions help control operation : (var (assoc expr gdb-var-list)) (varnum (cadr var))) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-delete " varnum "\"\n") + (list (concat "server interpreter mi \"-var-delete " varnum "\"\n") 'ignore)) (setq gdb-var-list (delq var gdb-var-list)) (dolist (varchild gdb-var-list) @@ -307,6 +316,23 @@ The following interactive lisp functions help control operation : (setq gdb-var-list (delq varchild gdb-var-list))))) (setq gdb-var-changed t))) +(defun gdb-edit-value (text token indent) + "Assign a value to a variable displayed in the speedbar" + (interactive) + (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) + (varnum (cadr var)) (value)) + (setq value (read-string "New value: ")) + (gdb-enqueue-input + (list (concat "server interpreter mi \"-var-assign " + varnum " " value "\"\n") + 'ignore)))) + +(defcustom gdb-show-changed-values t + "Non-nil means use font-lock-warning-face to display values that have +recently changed in the speedbar." + :type 'boolean + :group 'gud) + (defun gdb-speedbar-expand-node (text token indent) "Expand the node the user clicked on. TEXT is the text of the button we clicked on, a + or - item. @@ -732,6 +758,11 @@ output from the current command if that happens to be appropriate." (gdb-invalidate-registers) (gdb-invalidate-locals) (gdb-invalidate-threads) + (dolist (frame (frame-list)) + (when (string-equal (frame-parameter frame 'name) "Speedbar") + (setq gdb-var-changed t) ; force update + (dolist (var gdb-var-list) + (setcar (nthcdr 5 var) nil)))) (gdb-var-update))) (let ((sink (gdb-get-output-sink))) (cond @@ -822,7 +853,7 @@ output from the current command if that happens to be appropriate." (defun gdb-clear-partial-output () (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) - (delete-region (point-min) (point-max)))) + (erase-buffer))) (defun gdb-append-to-inferior-io (string) (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io) @@ -833,7 +864,7 @@ output from the current command if that happens to be appropriate." (defun gdb-clear-inferior-io () (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io) - (delete-region (point-min) (point-max)))) + (erase-buffer))) ;; One trick is to have a command who's output is always available in a buffer @@ -883,7 +914,7 @@ output from the current command if that happens to be appropriate." (with-current-buffer buf (let ((p (point)) (buffer-read-only nil)) - (delete-region (point-min) (point-max)) + (erase-buffer) (insert-buffer-substring (gdb-get-create-buffer 'gdb-partial-output-buffer)) (goto-char p))))) @@ -1258,7 +1289,7 @@ the source buffer." (def-gdb-auto-updated-buffer gdb-threads-buffer gdb-invalidate-threads - "info threads\n" + "server info threads\n" gdb-info-threads-handler gdb-info-threads-custom) @@ -1308,7 +1339,6 @@ the source buffer." (re-search-backward "^\\s-*\\([0-9]*\\)" nil t) (match-string-no-properties 1))) - (defun gdb-threads-select () "Make the thread on the current line become the current thread and display the source in the source buffer." @@ -1506,7 +1536,7 @@ the source buffer." (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer)) (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) -; (define-key menu [assembler] '("Assembler" . gdb-frame-assembler-buffer)) +; (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer)) ) (let ((menu (make-sparse-keymap "GDB-Windows"))) @@ -1518,7 +1548,7 @@ the source buffer." (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer)) (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) -; (define-key menu [assembler] '("Assembler" . gdb-display-assembler-buffer)) +; (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer)) ) (let ((menu (make-sparse-keymap "View"))) @@ -1527,7 +1557,7 @@ the source buffer." ; (define-key menu [both] '(menu-item "Both" gdb-view-both ; :help "Display both source and assembler" ; :button (:radio . (eq gdb-selected-view 'both)))) - (define-key menu [assembler] '(menu-item "Assembler" gdb-view-assembler + (define-key menu [assembler] '(menu-item "Machine" gdb-view-assembler :help "Display assembler only" :button (:radio . (eq gdb-selected-view 'assembler)))) (define-key menu [source] '(menu-item "Source" gdb-view-source-function @@ -1829,7 +1859,7 @@ BUFFER nil or omitted means use the current buffer." \\{gdb-assembler-mode-map}" (setq major-mode 'gdb-assembler-mode) - (setq mode-name "Assembler") + (setq mode-name "Machine") (setq left-margin-width 2) (setq fringes-outside-margins t) (setq buffer-read-only t) @@ -1910,7 +1940,8 @@ BUFFER nil or omitted means use the current buffer." (gdb-get-create-buffer 'gdb-assembler-buffer)) ;;update with new frame for machine code if necessary (gdb-invalidate-assembler)))))) - (if (looking-at "source language \\(\\S-*\\)") + (forward-line) + (if (looking-at " source language \\(\\S-*\\)\.") (setq gdb-current-language (match-string 1)))) (provide 'gdb-ui) diff --git a/lisp/info.el b/lisp/info.el index 47af5bb8154..9616dbb1feb 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1086,7 +1086,7 @@ a case-insensitive match is tried." (+ (- nodepos lastfilepos) (point))))) (defun Info-unescape-quotes (value) - "Unescape double quotes and backslashes in VALUE" + "Unescape double quotes and backslashes in VALUE." (let ((start 0) (unquote value)) (while (string-match "[^\\\"]*\\(\\\\\\)[\\\\\"]" unquote start) @@ -1099,10 +1099,9 @@ a case-insensitive match is tried." ;; into the Info file for handling images. (defun Info-split-parameter-string (parameter-string) "Return alist of (\"KEY\" . \"VALUE\") from PARAMETER-STRING; a - whitespace separated list of KEY=VALUE pairs. If VALUE - contains whitespace or double quotes, it must be quoted in - double quotes and any double quotes or backslashes must be - escaped (\\\",\\\\)." +whitespace separated list of KEY=VALUE pairs. If VALUE contains +whitespace or double quotes, it must be quoted in double quotes and +any double quotes or backslashes must be escaped (\\\",\\\\)." (let ((start 0) (parameter-alist)) (while (string-match @@ -2683,12 +2682,12 @@ The locations are of the format used in `Info-history', i.e. "Go to the Info node in the Emacs manual for command COMMAND. The command is found by looking up in Emacs manual's indices or in another manual found via COMMAND's `info-file' property or -the variable `Info-file-list-for-emacs'. COMMAND must be a symbol -or string." +the variable `Info-file-list-for-emacs'. +COMMAND must be a symbol or string." (interactive "CFind documentation for command: ") ;; If command is given as a string, convert it to a symbol. (if (stringp command) - (setq command (intern command))) + (setq command (intern command))) (or (commandp command) (signal 'wrong-type-argument (list 'commandp command))) (let ((where (Info-find-emacs-command-nodes command))) @@ -2785,9 +2784,9 @@ Preserve text properties." (setq mb (match-beginning 0) me (1+ mb) m (substring string mb me) - matches (cons m - (cons m - (cons (substring string start mb) + matches (cons m + (cons m + (cons (substring string start mb) matches))) start me)) (push (substring string start end) matches) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index a9ed8299ad9..5e957d6b8ab 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -321,6 +321,11 @@ This also sets the following values: o default value for the command `set-keyboard-coding-system'." (check-coding-system coding-system) (setq-default buffer-file-coding-system coding-system) + (if (fboundp 'ucs-set-table-for-input) + (dolist (buffer (buffer-list)) + (or (local-variable-p 'buffer-file-coding-system buffer) + (ucs-set-table-for-input buffer)))) + (if default-enable-multibyte-characters (setq default-file-name-coding-system coding-system)) ;; If coding-system is nil, honor that on MS-DOS as well, so diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el index 53a02e5caef..d160e4107f0 100644 --- a/lisp/international/mule-conf.el +++ b/lisp/international/mule-conf.el @@ -442,12 +442,16 @@ Like `compound-text', but does not produce escape sequences for compositions." '((safe-charsets . t))) (make-coding-system - 'compound-text-with-extensions 5 ?x + 'compound-text-with-extensions 2 ?x "Compound text encoding with extended segments. +See the variable `ctext-non-standard-encodings-alist' for the +detail about how extended segments are handled. + This coding system should be used only for X selections. It is inappropriate for decoding and encoding files, process I/O, etc." - nil + '((ascii t) (latin-iso8859-1 katakana-jisx0201 t) t t + nil ascii-eol ascii-cntl) '((post-read-conversion . ctext-post-read-conversion) (pre-write-conversion . ctext-pre-write-conversion))) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 2c7160b381b..1674f7bf61a 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1330,12 +1330,42 @@ ARG is a list of coding categories ordered by priority." ;;; X selections (defvar ctext-non-standard-encodings-alist - '(("ISO8859-15" . iso-8859-15) - ("ISO8859-14" . iso-8859-14) - ("KOI8-R" . koi8-r) - ("BIG5-0" . big5)) - "Alist of non-standard encoding names vs Emacs coding systems. -This alist is used to decode an extened segment of a compound text.") + '(("big5-0" big5 2 (chinese-big5-1 chinese-big5-2)) + ("ISO8859-14" iso-8859-14 1 latin-iso8859-14) + ("ISO8859-15" iso-8859-15 1 latin-iso8859-15)) + "Alist of non-standard encoding names vs the corresponding usages in CTEXT. + +It controls how extended segments of a compound text are handled +by the coding system `compound-text-with-extensions'. + +Each element has the form (ENCODING-NAME CODING-SYSTEM N-OCTET CHARSET). + +ENCODING-NAME is an encoding name of an \"extended segments\". + +CODING-SYSTEM is the coding-system to encode (or decode) the +characters into (or from) the extended segment. + +N-OCTET is the number of octets (bytes) that encodes a character +in the segment. It can be 0 (meaning the number of octets per +character is variable), 1, 2, 3, or 4. + +CHARSET is a charater set containing characters that are encoded +in the segment. It can be a list of character sets. It can also +be a char-table, in which case characters that have non-nil value +in the char-table are the target. + +On decoding CTEXT, all encoding names listed here are recognized. + +On encoding CTEXT, encoding names in the variable +`ctext-non-standard-encodings' (which see) and in the information +listed for the current language environment under the key +`ctext-non-standard-encodings' are used.") + +(defvar ctext-non-standard-encodings + '("big5-0") + "List of non-standard encoding names used in extended segments of CTEXT. +Each element must be one of the names listed in the variable +`ctext-non-standard-encodings-alist' (which see).") (defvar ctext-non-standard-encodings-regexp (string-to-multibyte @@ -1347,13 +1377,9 @@ This alist is used to decode an extened segment of a compound text.") "\\(\e%G[^\e]*\e%@\\)"))) ;; Functions to support "Non-Standard Character Set Encodings" defined -;; by the COMPOUND-TEXT spec. -;; We support that by decoding the whole data by `ctext' which just -;; pertains byte sequences belonging to ``extended segment'', then -;; decoding those byte sequences one by one in Lisp. -;; This function also supports "The UTF-8 encoding" described in the -;; section 7 of the documentation fo COMPOUND-TEXT distributed with -;; XFree86. +;; by the COMPOUND-TEXT spec. They also support "The UTF-8 encoding" +;; described in the section 7 of the documentation of COMPOUND-TEXT +;; distributed with XFree86. (defun ctext-post-read-conversion (len) "Decode LEN characters encoded as Compound Text with Extended Segments." @@ -1365,7 +1391,6 @@ This alist is used to decode an extened segment of a compound text.") pos bytes) (or in-workbuf (narrow-to-region (point) (+ (point) len))) - (decode-coding-region (point-min) (point-max) 'ctext) (if in-workbuf (set-buffer-multibyte t)) (while (re-search-forward ctext-non-standard-encodings-regexp @@ -1376,11 +1401,14 @@ This alist is used to decode an extened segment of a compound text.") (let* ((M (char-after (+ pos 4))) (L (char-after (+ pos 5))) (encoding (match-string 2)) - (coding (or (cdr (assoc-ignore-case - encoding - ctext-non-standard-encodings-alist)) - (coding-system-p - (intern (downcase encoding)))))) + (encoding-info (assoc-ignore-case + encoding + ctext-non-standard-encodings-alist)) + (coding (if encoding-info + (nth 1 encoding-info) + (setq encoding (intern (downcase encoding))) + (and (coding-system-p encoding) + encoding)))) (setq bytes (- (+ (* (- M 128) 128) (- L 128)) (- (point) (+ pos 6)))) (when coding @@ -1388,66 +1416,39 @@ This alist is used to decode an extened segment of a compound text.") (forward-char bytes) (decode-coding-region (- (point) bytes) (point) coding))) ;; ESC % G --UTF-8-BYTES-- ESC % @ - (setq bytes (- (point) pos)) - (decode-coding-region (- (point) bytes) (point) 'utf-8)))) + (delete-char -3) + (delete-region pos (+ pos 3)) + (decode-coding-region pos (point) 'utf-8)))) (goto-char (point-min)) (- (point-max) (point))))) -;; From X registry 2001/06/01 -;; 20. NON-STANDARD CHARACTER SET ENCODINGS - -;; See Section 6 of the Compound Text standard. - -;; Name Reference -;; ---- --------- -;; "DEC.CNS11643.1986-2" [53] -;; CNS11643 2-plane using the recommended -;; internal representation scheme -;; "DEC.DTSCS.1990-2" [54] -;; DEC Taiwan Supplemental Character Set -;; "fujitsu.u90x03" [87] -;; "ILA" [62] -;; registry prefix -;; "IPSYS" [59] -;; registry prefix -;; "omron_UDC" [45] -;; omron User Defined Charset -;; "omron_UDC_ja" [45] -;; omron User Defined Charset for Japanese -;; "omron_UDC_zh" [45] -;; omron User Defined Charset for Chinese(Main land) -;; "omron_UDC_tw" [45] -;; omron User Defined Charset for Chinese(Taiwan) - -;; If you add charsets here, be sure to modify the regexp used by -;; ctext-pre-write-conversion to look up non-standard charsets. -(defvar ctext-non-standard-designations-alist - '(("$(0" . (big5 "big5-0" 2)) - ("$(1" . (big5 "big5-0" 2)) - ;; The following are actually standard; generating extended - ;; segments for them is wrong and screws e.g. Latin-9 users. - ;; 8859-{10,13,16} aren't Emacs charsets anyhow. -- fx -;; ("-V" . (t "iso8859-10" 1)) -;; ("-Y" . (t "iso8859-13" 1)) -;; ("-_" . (t "iso8859-14" 1)) -;; ("-b" . (t "iso8859-15" 1)) -;; ("-f" . (t "iso8859-16" 1)) - ) - "Alist of ctext control sequences that introduce character sets which -are not in the list of approved encodings, and the corresponding -coding system, identifier string, and number of octets per encoded -character. - -Each element has the form (CTLSEQ . (ENCODING CHARSET NOCTETS)). CTLSEQ -is the control sequence (sans the leading ESC) that introduces the character -set in the text encoded by compound-text. ENCODING is a coding system -symbol; if it is t, it means that the ctext coding system already encodes -the text correctly, and only the leading control sequence needs to be altered. -If ENCODING is a coding system, we need to re-encode the text with that -coding system. CHARSET is the name of the charset we need to put into -the leading control sequence. NOCTETS is the number of octets (bytes) that -encode each character in this charset. NOCTETS can be 0 (meaning the number -of octets per character is variable), 1, 2, 3, or 4.") +;; Return a char table of extended segment usage for each character. +;; Each value of the char table is nil, one of the elements of +;; `ctext-non-standard-encodings-alist', or the symbol `utf-8'. + +(defun ctext-non-standard-encodings-table () + (let ((table (make-char-table 'translation-table))) + (aset table (make-char 'mule-unicode-0100-24ff) 'utf-8) + (aset table (make-char 'mule-unicode-2500-33ff) 'utf-8) + (aset table (make-char 'mule-unicode-e000-ffff) 'utf-8) + (dolist (encoding (reverse + (append + (get-language-info current-language-environment + 'ctext-non-standard-encodings) + ctext-non-standard-encodings))) + (let* ((slot (assoc encoding ctext-non-standard-encodings-alist)) + (charset (nth 3 slot))) + (if charset + (cond ((charsetp charset) + (aset table (make-char charset) slot)) + ((listp charset) + (dolist (elt charset) + (aset table (make-char elt) slot))) + ((char-table-p charset) + (map-char-table #'(lambda (k v) + (if (and v (> k 128)) (aset table k slot))) + charset)))))) + table)) (defun ctext-pre-write-conversion (from to) "Encode characters between FROM and TO as Compound Text w/Extended Segments. @@ -1470,47 +1471,56 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place." (insert-buffer-substring buf from to)))) ;; Now we can encode the whole buffer. - (let ((case-fold-search nil) + (let ((encoding-table (ctext-non-standard-encodings-table)) last-coding-system-used - pos posend desig encode-info encoding chset noctets textlen) - (goto-char (point-min)) - ;; At first encode the whole buffer. - (encode-coding-region (point-min) (point-max) 'ctext-no-compositions) - ;; Then replace ISO-2022 charset designations with extended - ;; segments, for those charsets that are not part of the - ;; official X registry. The regexp below finds the leading - ;; sequences for big5. - (while (re-search-forward "\e\\(\$([01]\\)" nil 'move) - (setq pos (match-beginning 0) - posend (point) - desig (match-string 1) - encode-info (cdr (assoc desig - ctext-non-standard-designations-alist)) - encoding (car encode-info) - chset (cadr encode-info) - noctets (car (cddr encode-info))) - (skip-chars-forward "^\e") - (cond - ((eq encoding t) ; only the leading sequence needs to be changed - (setq textlen (+ (- (point) posend) (length chset) 1)) - ;; Generate the control sequence for an extended segment. - (replace-match (format "\e%%/%d%c%c%s" - noctets - (+ (/ textlen 128) 128) - (+ (% textlen 128) 128) - chset) - t t)) - ((coding-system-p encoding) ; need to recode the entire segment... - (decode-coding-region pos (point) 'ctext-no-compositions) - (encode-coding-region pos (point) encoding) - (setq textlen (+ (- (point) pos) (length chset) 1)) - (save-excursion - (goto-char pos) - (insert (format "\e%%/%d%c%c%s" - noctets - (+ (/ textlen 128) 128) - (+ (% textlen 128) 128) - chset)))))) + last-pos last-encoding-info + encoding-info end-pos) + (goto-char (setq last-pos (point-min))) + (setq end-pos (point-marker)) + (while (re-search-forward "[^\000-\177]+" nil t) + ;; Found a sequence of non-ASCII characters. + (setq last-pos (match-beginning 0) + last-encoding-info (aref encoding-table (char-after last-pos))) + (set-marker end-pos (match-end 0)) + (goto-char (1+ last-pos)) + (catch 'tag + (while t + (setq encoding-info + (if (< (point) end-pos) + (aref encoding-table (following-char)))) + (unless (eq last-encoding-info encoding-info) + (cond ((consp last-encoding-info) + ;; Encode the previous range using an extended + ;; segment. + (let ((encoding-name (car last-encoding-info)) + (coding-system (nth 1 last-encoding-info)) + (noctets (nth 2 last-encoding-info)) + len) + (encode-coding-region last-pos (point) coding-system) + (setq len (+ (length encoding-name) 1 + (- (point) last-pos))) + (save-excursion + (goto-char last-pos) + (insert (string-to-multibyte + (format "\e%%/%d%c%c%s" + noctets + (+ (/ len 128) 128) + (+ (% len 128) 128) + encoding-name)))))) + ((eq last-encoding-info 'utf-8) + ;; Encode the previous range using UTF-8 encoding + ;; extention. + (encode-coding-region last-pos (point) 'mule-utf-8) + (save-excursion + (goto-char last-pos) + (insert "\e%G")) + (insert "\e%@"))) + (setq last-pos (point) + last-encoding-info encoding-info)) + (if (< (point) end-pos) + (forward-char 1) + (throw 'tag nil))))) + (set-marker end-pos nil) (goto-char (point-min)))) ;; Must return nil, as build_annotations_2 expects that. nil) diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el index d91a4b9fbf2..476c8dfc191 100644 --- a/lisp/international/ucs-tables.el +++ b/lisp/international/ucs-tables.el @@ -2507,6 +2507,8 @@ BUFFER defaults to the current buffer." (coding-system-base default-buffer-file-coding-system)))) (when cs (setq table (coding-system-get cs 'translation-table-for-encode)) + (if (and table (symbolp table)) + (setq table (get table 'translation-table))) (unless (char-table-p table) (setq table (coding-system-get cs 'translation-table-for-input))) (when (char-table-p table) diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el index ad3ab940492..19ff671834b 100644 --- a/lisp/language/cyrillic.el +++ b/lisp/language/cyrillic.el @@ -465,9 +465,17 @@ Support for Russian using koi8-r and the russian-computer input method.") (define-coding-system-alias 'cp1251 'windows-1251) +(let ((elt `("microsoft-cp1251" windows-1251 1 + ,(get 'encode-windows-1251 'translation-table))) + (slot (assoc "microsoft-cp1251" ctext-non-standard-encodings-alist))) + (if slot + (setcdr slot (cdr elt)) + (push elt ctext-non-standard-encodings-alist))) + (set-language-info-alist "Bulgarian" `((coding-system windows-1251) - (coding-priority windows-1251) + (coding-priority windows-1251) + (ctext-non-standard-encodings "microsoft-cp1251") (nonascii-translation . ,(get 'decode-windows-1251 'translation-table)) (input-method . "bulgarian-bds") @@ -479,6 +487,7 @@ Support for Russian using koi8-r and the russian-computer input method.") (set-language-info-alist "Belarusian" `((coding-system windows-1251) (coding-priority windows-1251) + (ctext-non-standard-encodings "microsoft-cp1251") (nonascii-translation . ,(get 'decode-windows-1251 'translation-table)) (input-method . "belarusian") diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 61fa0fad845..1d58bcd732c 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -326,7 +326,7 @@ off the specialized speedbar mode." (goto-char (point-min)) (let ((case-fold-search t)) (looking-at "Watch Expressions:"))))) - (erase-buffer) + (erase-buffer) (insert "Watch Expressions:\n") (let ((var-list gdb-var-list)) (while var-list @@ -337,17 +337,21 @@ off the specialized speedbar mode." start (1+ (match-beginning 0)))) (if (equal (nth 2 var) "0") (speedbar-make-tag-line 'bracket ?? nil nil - (concat (car var) " " (nth 4 var)) - 'gdb-var-delete - nil 'speedbar-directory-face depth) + (concat (car var) "\t" (nth 4 var)) + 'gdb-edit-value + nil + (if (and (nth 5 var) + gdb-show-changed-values) + 'font-lock-warning-face + nil) depth) (if (and (cadr var-list) (string-match varnum (cadr (cadr var-list)))) (setq char ?-)) (speedbar-make-tag-line 'bracket char 'gdb-speedbar-expand-node varnum - (concat (car var) " " (nth 3 var)) + (concat (car var) "\t" (nth 3 var)) 'gdb-var-delete - nil 'speedbar-directory-face depth))) + nil nil depth))) (setq var-list (cdr var-list)))) (setq gdb-var-changed nil))) (t (if (and (save-excursion diff --git a/lisp/shell.el b/lisp/shell.el index c9191bc1648..cc83dcf1429 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -177,7 +177,7 @@ This is a fine thing to set in your `.emacs' file.") (defvar shell-file-name-quote-list (if (memq system-type '(ms-dos windows-nt)) nil - (append shell-delimiter-argument-list '(?\ ?\* ?\! ?\" ?\' ?\` ?\#))) + (append shell-delimiter-argument-list '(?\ ?\* ?\! ?\" ?\' ?\` ?\# ?\\))) "List of characters to quote when in a file name. This variable is used to initialize `comint-file-name-quote-list' in the shell buffer. The value may depend on the operating system or shell. diff --git a/lisp/vc.el b/lisp/vc.el index 77ec540bae4..79ce8594599 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -7,7 +7,7 @@ ;; Maintainer: Andre Spiegel <spiegel@gnu.org> ;; Keywords: tools -;; $Id: vc.el,v 1.360 2003/09/01 15:45:17 miles Exp $ +;; $Id: vc.el,v 1.361 2003/12/24 23:18:10 uid66361 Exp $ ;; This file is part of GNU Emacs. @@ -2144,7 +2144,7 @@ Called by dired after any portion of a vc-dired buffer has been read in." ;; We cannot remove the top level directory. ;; Just make it look a little nicer. (forward-line 1) - (kill-line) + (or (eobp) (kill-line)) (if (not (dired-next-subdir 1 t)) (goto-char (point-max)))))) (goto-char (point-min))) |