unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* One example of code I can't understand
@ 2009-07-19 23:21 Richard Stallman
  0 siblings, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2009-07-19 23:21 UTC (permalink / raw)
  To: emacs-devel

Here's more code from mm-util.el that I don't understand.
I don't know what this function is supposed to do
or how it works.


(defun mm-iso-8859-x-to-15-region (&optional b e)
  (if (fboundp 'char-charset)
      (let (charset item c inconvertible)
	(save-restriction
	  (if e (narrow-to-region b e))
	  (goto-char (point-min))
	  (skip-chars-forward "\0-\177")
	  (while (not (eobp))
	    (cond
	     ((not (setq item (assq (char-charset (setq c (char-after)))
				    mm-iso-8859-x-to-15-table)))
	      (forward-char))
	     ((memq c (cdr (cdr item)))
	      (setq inconvertible t)
	      (forward-char))
	     (t
	      (insert-before-markers (prog1 (+ c (car (cdr item)))
				       (delete-char 1)))))
	    (skip-chars-forward "\0-\177")))
	(not inconvertible))))




^ permalink raw reply	[flat|nested] 19+ messages in thread
* One example of code I can't understand
@ 2009-07-19 23:21 Richard Stallman
  2009-07-20  3:13 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2009-07-19 23:21 UTC (permalink / raw)
  To: emacs-devel

Here's more code from mm-util.el that I don't understand.

    ;; We are in a unibyte buffer or XEmacs non-mule, so we futz around a bit.
    (save-excursion
      (save-restriction
	(narrow-to-region b e)
	(goto-char (point-min))
	(skip-chars-forward "\0-\177")
	(if (eobp)
	    '(ascii)
	  (let (charset)
	    (setq charset
		  (and (boundp 'current-language-environment)
		       (car (last (assq 'charset
					(assoc current-language-environment
					       language-info-alist))))))
	    (if (eq charset 'ascii) (setq charset nil))
	    (or charset
		(setq charset
		      (car (last (assq mail-parse-charset
				       mm-mime-mule-charset-alist)))))
	    (list 'ascii (or charset 'latin-iso8859-1)))))))))




^ permalink raw reply	[flat|nested] 19+ messages in thread
* One example of code I can't understand
@ 2009-07-19 23:21 Richard Stallman
  2009-07-20 18:13 ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2009-07-19 23:21 UTC (permalink / raw)
  To: emacs-devel

Here's some code from mm-util.el that I don't understand.
Well, I can understand the first 6 lines, but after that
I am stumped.  The doc string gives no details of what the
value should look like or what it means.


(defvar mm-iso-8859-x-to-15-table
  (and (fboundp 'coding-system-p)
       (mm-coding-system-p 'iso-8859-15)
       (mapcar
	(lambda (cs)
	  (if (mm-coding-system-p (car cs))
	      (let ((c (string-to-char
			(decode-coding-string "\341" (car cs)))))
		(cons (char-charset c)
		      (cons
		       (- (string-to-char
			   (decode-coding-string "\341" 'iso-8859-15)) c)
		       (string-to-list (decode-coding-string (car (cdr cs))
							     (car cs))))))
	    '(gnus-charset 0)))
	mm-iso-8859-15-compatible))
  "A table of the difference character between ISO-8859-X and ISO-8859-15.")




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-07-22 22:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 23:21 One example of code I can't understand Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2009-07-19 23:21 Richard Stallman
2009-07-20  3:13 ` Eli Zaretskii
2009-07-20 19:01   ` Richard Stallman
2009-07-21  0:51     ` Kenichi Handa
2009-07-21  3:07       ` Eli Zaretskii
2009-07-21  4:10         ` Kenichi Handa
2009-07-21 14:41       ` Richard Stallman
2009-07-22  6:58       ` Stephen J. Turnbull
2009-07-21  0:59     ` Stefan Monnier
2009-07-21 14:41       ` Richard Stallman
2009-07-19 23:21 Richard Stallman
2009-07-20 18:13 ` Stefan Monnier
2009-07-20 20:50   ` Reiner Steib
2009-07-21 14:41     ` Richard Stallman
2009-07-21 17:34       ` Reiner Steib
2009-07-22 22:21         ` Richard Stallman
2009-07-21 14:42   ` Richard Stallman
2009-07-21 18:21     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).