aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-29 20:45:02 +0000
committerKaroly Lorentey2004-04-29 20:45:02 +0000
commite6da77e898ea743bc416517542eae446e573b6b5 (patch)
tree47df1c81621f456f688132b822fb6f51087b9822 /lisp
parent9a3ab26af39540424723a27ab3a7f3cd204660c8 (diff)
parent016b8f71efe187f403913d47890c8e0408472617 (diff)
downloademacs-e6da77e898ea743bc416517542eae446e573b6b5.tar.gz
emacs-e6da77e898ea743bc416517542eae446e573b6b5.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-259 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-260 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-261 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-155
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog43
-rw-r--r--lisp/comint.el31
-rw-r--r--lisp/ielm.el55
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/gdb-ui.el14
-rw-r--r--lisp/progmodes/gud.el4
-rw-r--r--lisp/thumbs.el24
7 files changed, 103 insertions, 70 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9922778a5c8..8a1bba88874 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,46 @@
12004-04-28 Luc Teirlinck <teirllm@auburn.edu>
2
3 * comint.el (comint-prompt-read-only): New variable.
4 (comint-output-filter): Implement it.
5
6 * ielm.el (ielm-prompt-read-only, ielm-prompt): Update docstring.
7 (ielm-prompt-internal): New variable.
8 (ielm-font-lock-keywords): Remove irrelevant ielm-prompt keyword.
9 (ielm-send-input): Delete unused variable `buf'.
10 (ielm-eval-input): Use `ielm-prompt-internal'.
11 (inferior-emacs-lisp-mode): Use new variables
12 `comint-prompt-read-only' and `ielm-prompt-internal'.
13 Get rid of obsolete variable `directory-sep-char'.
14 (ielm): Use `zerop'.
15
162004-04-29 John Paul Wallington <jpw@gnu.org>
17
18 * thumbs.el (toplevel): Require cl at compile time.
19 Remove conditional definitions of `ignore-errors' and `caddar'
20 because they occur at run time.
21
222004-04-28 Nick Roberts <nickrob@gnu.org>
23
24 * progmodes/gdb-ui.el (gdb-frame-breakpoints-buffer)
25 (gdb-frame-stack-buffer, gdb-frame-threads-buffer)
26 (gdb-frame-registers-buffer, gdb-frame-locals-buffer)
27 (gdb-frame-gdb-buffer, gdb-frame-assembler-buffer): Use
28 selected-window.
29
30 * progmodes/gud.el (gud-common-init): Throw an error if program is
31 already running under gdb.
32
332004-04-28 John Paul Wallington <jpw@gnu.org>
34
35 * thumbs.el (thumbs-delete-images): Fix formatting of prompt.
36 (thumbs-show-image-num): Move assignment of
37 `thumbs-current-image-filename' within scope of `i'.
38 (thumbs-emboss-image): Don't use `evenp'.
39
402004-04-28 Richard M. Stallman <rms@gnu.org>
41
42 * progmodes/compile.el (compilation-context-lines): Default now 0.
43
12004-04-28 Juanma Barranquero <lektu@terra.es> 442004-04-28 Juanma Barranquero <lektu@terra.es>
2 45
3 Use `time-less-p' from calendar/time-date.el instead of defining 46 Use `time-less-p' from calendar/time-date.el instead of defining
diff --git a/lisp/comint.el b/lisp/comint.el
index 7766307f156..52217fa8ad6 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -171,6 +171,14 @@ Good choices:
171 171
172This is a good thing to set in mode hooks.") 172This is a good thing to set in mode hooks.")
173 173
174(defcustom comint-prompt-read-only nil
175 "If non-nil, the comint prompt is read only.
176This does not affect existing prompts.
177Certain derived modes may override this option."
178 :type 'boolean
179 :group 'comint
180 :version "21.4")
181
174(defvar comint-delimiter-argument-list () 182(defvar comint-delimiter-argument-list ()
175 "List of characters to recognise as separate arguments in input. 183 "List of characters to recognise as separate arguments in input.
176Strings comprising a character in this list will separate the arguments 184Strings comprising a character in this list will separate the arguments
@@ -1687,16 +1695,25 @@ Make backspaces delete the previous character."
1687 (let ((inhibit-read-only t)) 1695 (let ((inhibit-read-only t))
1688 (add-text-properties comint-last-output-start (point) 1696 (add-text-properties comint-last-output-start (point)
1689 '(rear-nonsticky t 1697 '(rear-nonsticky t
1690 field output 1698 field output
1691 inhibit-line-move-field-capture t)))) 1699 inhibit-line-move-field-capture t))))
1692 1700
1693 ;; Highlight the prompt, where we define `prompt' to mean 1701 ;; Highlight the prompt, where we define `prompt' to mean
1694 ;; the most recent output that doesn't end with a newline. 1702 ;; the most recent output that doesn't end with a newline.
1695 (unless (and (bolp) (null comint-last-prompt-overlay)) 1703 (let ((prompt-start (save-excursion (forward-line 0) (point)))
1696 ;; Need to create or move the prompt overlay (in the case 1704 (inhibit-read-only t))
1697 ;; where there is no prompt ((bolp) == t), we still do 1705 (when comint-prompt-read-only
1698 ;; this if there's already an existing overlay). 1706 (or (= (point-min) prompt-start)
1699 (let ((prompt-start (save-excursion (forward-line 0) (point)))) 1707 (get-text-property (1- prompt-start) 'read-only)
1708 (put-text-property
1709 (1- prompt-start) prompt-start 'read-only 'fence))
1710 (add-text-properties
1711 prompt-start (point)
1712 '(read-only t rear-non-sticky t front-sticky (read-only))))
1713 (unless (and (bolp) (null comint-last-prompt-overlay))
1714 ;; Need to create or move the prompt overlay (in the case
1715 ;; where there is no prompt ((bolp) == t), we still do
1716 ;; this if there's already an existing overlay).
1700 (if comint-last-prompt-overlay 1717 (if comint-last-prompt-overlay
1701 ;; Just move an existing overlay 1718 ;; Just move an existing overlay
1702 (move-overlay comint-last-prompt-overlay 1719 (move-overlay comint-last-prompt-overlay
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 0a249f65095..53e3d83cdaa 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -52,34 +52,19 @@
52(defcustom ielm-prompt-read-only t 52(defcustom ielm-prompt-read-only t
53 "If non-nil, the IELM prompt is read only. 53 "If non-nil, the IELM prompt is read only.
54Setting this variable does not affect existing IELM runs. 54Setting this variable does not affect existing IELM runs.
55 55This works by setting the buffer-local value of `comint-prompt-read-only'.
56You can give the IELM prompt more highly customized read-only 56Setting that value directly affects new prompts in the current buffer."
57type properties, by setting this option to nil, and then setting
58`ielm-prompt', outside of Custom, to a string with the desired
59text properties.
60
61Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob],
62and then restarting it using \\[ielm], makes the then current
63default value affect _new_ prompts. However, executing \\[ielm]
64does not have this effect on *ielm* buffers with a running process.
65For IELM buffers that are not called `*ielm*', you can execute
66\\[inferior-emacs-lisp-mode] in that IELM buffer to update the value,
67for new prompts. This works even if the buffer has a running process."
68 :type 'boolean 57 :type 'boolean
69 :group 'ielm 58 :group 'ielm
70 :version "21.4") 59 :version "21.4")
71 60
72(defcustom ielm-prompt "ELISP> " 61(defcustom ielm-prompt "ELISP> "
73 "Prompt used in IELM. 62 "Prompt used in IELM.
74Setting the default value does not affect existing IELM runs. 63Setting this variable does not affect existing IELM runs.
75`inferior-emacs-lisp-mode' converts this into a buffer-local
76variable in IELM buffers. The buffer-local value is meant for
77internal use by IELM. Do not try to set the buffer-local value
78yourself in any way, unless you really know what you are doing.
79 64
80Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob], 65Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob],
81and then restarting it using \\[ielm], makes the then current 66and then restarting it using \\[ielm], makes the then current
82_default_ value affect _new_ prompts. Unless the new prompt 67default value affect _new_ prompts. Unless the new prompt
83differs only in text properties from the old one, IELM will no 68differs only in text properties from the old one, IELM will no
84longer recognize the old prompts. However, executing \\[ielm] 69longer recognize the old prompts. However, executing \\[ielm]
85does not update the prompt of an *ielm* buffer with a running process. 70does not update the prompt of an *ielm* buffer with a running process.
@@ -89,6 +74,12 @@ for new prompts. This works even if the buffer has a running process."
89 :type 'string 74 :type 'string
90 :group 'ielm) 75 :group 'ielm)
91 76
77(defvar ielm-prompt-internal "ELISP> "
78 "Stored value of `ielm-prompt' in the current IELM buffer.
79This is an internal variable used by IELM. Its purpose is to
80prevent a running IELM process from being messed up when the user
81customizes `ielm-prompt'.")
82
92(defcustom ielm-dynamic-return t 83(defcustom ielm-dynamic-return t
93 "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. 84 "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM.
94If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline 85If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline
@@ -178,9 +169,7 @@ This variable is buffer-local.")
178 (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer)) 169 (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
179 170
180(defvar ielm-font-lock-keywords 171(defvar ielm-font-lock-keywords
181 (list 172 '(("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
182 (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face)
183 '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
184 (1 font-lock-comment-face) 173 (1 font-lock-comment-face)
185 (2 font-lock-constant-face))) 174 (2 font-lock-constant-face)))
186 "Additional expressions to highlight in ielm buffers.") 175 "Additional expressions to highlight in ielm buffers.")
@@ -283,8 +272,7 @@ simply inserts a newline."
283(defun ielm-send-input nil 272(defun ielm-send-input nil
284 "Evaluate the Emacs Lisp expression after the prompt." 273 "Evaluate the Emacs Lisp expression after the prompt."
285 (interactive) 274 (interactive)
286 (let ((buf (current-buffer)) 275 (let (ielm-input) ; set by ielm-input-sender
287 ielm-input) ; set by ielm-input-sender
288 (comint-send-input) ; update history, markers etc. 276 (comint-send-input) ; update history, markers etc.
289 (ielm-eval-input ielm-input))) 277 (ielm-eval-input ielm-input)))
290 278
@@ -407,7 +395,7 @@ simply inserts a newline."
407 (setq ** *) 395 (setq ** *)
408 (setq * ielm-result)) 396 (setq * ielm-result))
409 (setq ielm-output (concat ielm-output "\n")))) 397 (setq ielm-output (concat ielm-output "\n"))))
410 (setq ielm-output (concat ielm-output ielm-prompt)) 398 (setq ielm-output (concat ielm-output ielm-prompt-internal))
411 (comint-output-filter (ielm-process) ielm-output))) 399 (comint-output-filter (ielm-process) ielm-output)))
412 400
413;;; Process and marker utilities 401;;; Process and marker utilities
@@ -478,20 +466,13 @@ Customized bindings may be defined in `ielm-map', which currently contains:
478 (setq comint-input-sender 'ielm-input-sender) 466 (setq comint-input-sender 'ielm-input-sender)
479 (setq comint-process-echoes nil) 467 (setq comint-process-echoes nil)
480 (make-local-variable 'comint-dynamic-complete-functions) 468 (make-local-variable 'comint-dynamic-complete-functions)
481 (set (make-local-variable 'ielm-prompt) 469 (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
482 (if ielm-prompt-read-only 470 (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only)
483 (propertize ielm-prompt
484 'read-only t
485 'rear-nonsticky t
486 'front-sticky '(read-only))
487 ielm-prompt))
488 (setq comint-dynamic-complete-functions 471 (setq comint-dynamic-complete-functions
489 '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol)) 472 '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol))
490 (setq comint-get-old-input 'ielm-get-old-input) 473 (setq comint-get-old-input 'ielm-get-old-input)
491 (make-local-variable 'comint-completion-addsuffix) 474 (make-local-variable 'comint-completion-addsuffix)
492 (setq comint-completion-addsuffix 475 (setq comint-completion-addsuffix '("/" . ""))
493 (cons (char-to-string directory-sep-char) ""))
494
495 (setq major-mode 'inferior-emacs-lisp-mode) 476 (setq major-mode 'inferior-emacs-lisp-mode)
496 (setq mode-name "IELM") 477 (setq mode-name "IELM")
497 (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer)))) 478 (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer))))
@@ -541,7 +522,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
541 (add-text-properties 522 (add-text-properties
542 (point-min) (point-max) 523 (point-min) (point-max)
543 '(rear-nonsticky t field output inhibit-line-move-field-capture t)))) 524 '(rear-nonsticky t field output inhibit-line-move-field-capture t))))
544 (comint-output-filter (ielm-process) ielm-prompt) 525 (comint-output-filter (ielm-process) ielm-prompt-internal)
545 (set-marker comint-last-input-start (ielm-pm)) 526 (set-marker comint-last-input-start (ielm-pm))
546 (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter)) 527 (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter))
547 528
@@ -568,7 +549,7 @@ Switches to the buffer `*ielm*', or creates it if it does not exist."
568 (let (old-point) 549 (let (old-point)
569 (unless (comint-check-proc "*ielm*") 550 (unless (comint-check-proc "*ielm*")
570 (with-current-buffer (get-buffer-create "*ielm*") 551 (with-current-buffer (get-buffer-create "*ielm*")
571 (unless (eq (buffer-size) 0) (setq old-point (point))) 552 (unless (zerop (buffer-size)) (setq old-point (point)))
572 (inferior-emacs-lisp-mode))) 553 (inferior-emacs-lisp-mode)))
573 (pop-to-buffer "*ielm*") 554 (pop-to-buffer "*ielm*")
574 (when old-point (push-mark old-point)))) 555 (when old-point (push-mark old-point))))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 2c8ead87000..d85bb79064f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1472,7 +1472,7 @@ region and the first line of the next region."
1472 (setcdr loc (list line file marker))) 1472 (setcdr loc (list line file marker)))
1473 loc)) 1473 loc))
1474 1474
1475(defcustom compilation-context-lines next-screen-context-lines 1475(defcustom compilation-context-lines 0
1476 "*Display this many lines of leading context before message." 1476 "*Display this many lines of leading context before message."
1477 :type 'integer 1477 :type 'integer
1478 :group 'compilation 1478 :group 'compilation
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index fb5a6757a49..2e836fb82b2 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1152,7 +1152,7 @@ static char *magick[] = {
1152 (interactive) 1152 (interactive)
1153 (select-frame (make-frame gdb-frame-parameters)) 1153 (select-frame (make-frame gdb-frame-parameters))
1154 (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer)) 1154 (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))
1155 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1155 (set-window-dedicated-p (selected-window) t))
1156 1156
1157(defvar gdb-breakpoints-mode-map 1157(defvar gdb-breakpoints-mode-map
1158 (let ((map (make-sparse-keymap)) 1158 (let ((map (make-sparse-keymap))
@@ -1274,7 +1274,7 @@ current line."
1274 (interactive) 1274 (interactive)
1275 (select-frame (make-frame gdb-frame-parameters)) 1275 (select-frame (make-frame gdb-frame-parameters))
1276 (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer)) 1276 (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer))
1277 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1277 (set-window-dedicated-p (selected-window) t))
1278 1278
1279(defvar gdb-frames-mode-map 1279(defvar gdb-frames-mode-map
1280 (let ((map (make-sparse-keymap))) 1280 (let ((map (make-sparse-keymap)))
@@ -1351,7 +1351,7 @@ the source buffer."
1351 (interactive) 1351 (interactive)
1352 (select-frame (make-frame gdb-frame-parameters)) 1352 (select-frame (make-frame gdb-frame-parameters))
1353 (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer)) 1353 (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer))
1354 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1354 (set-window-dedicated-p (selected-window) t))
1355 1355
1356(defvar gdb-threads-mode-map 1356(defvar gdb-threads-mode-map
1357 (let ((map (make-sparse-keymap))) 1357 (let ((map (make-sparse-keymap)))
@@ -1433,7 +1433,7 @@ the source buffer."
1433 (interactive) 1433 (interactive)
1434 (select-frame (make-frame gdb-frame-parameters)) 1434 (select-frame (make-frame gdb-frame-parameters))
1435 (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer)) 1435 (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer))
1436 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1436 (set-window-dedicated-p (selected-window) t))
1437 1437
1438;; 1438;;
1439;; Locals buffer. 1439;; Locals buffer.
@@ -1505,7 +1505,7 @@ the source buffer."
1505 (interactive) 1505 (interactive)
1506 (select-frame (make-frame gdb-frame-parameters)) 1506 (select-frame (make-frame gdb-frame-parameters))
1507 (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer)) 1507 (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer))
1508 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1508 (set-window-dedicated-p (selected-window) t))
1509 1509
1510 1510
1511;;;; Window management 1511;;;; Window management
@@ -1604,7 +1604,7 @@ the source buffer."
1604 (interactive) 1604 (interactive)
1605 (select-frame (make-frame gdb-frame-parameters)) 1605 (select-frame (make-frame gdb-frame-parameters))
1606 (switch-to-buffer (gdb-get-create-buffer 'gdba)) 1606 (switch-to-buffer (gdb-get-create-buffer 'gdba))
1607 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1607 (set-window-dedicated-p (selected-window) t))
1608 1608
1609(defun gdb-display-gdb-buffer () 1609(defun gdb-display-gdb-buffer ()
1610 (interactive) 1610 (interactive)
@@ -1935,7 +1935,7 @@ BUFFER nil or omitted means use the current buffer."
1935 (interactive) 1935 (interactive)
1936 (select-frame (make-frame gdb-frame-parameters)) 1936 (select-frame (make-frame gdb-frame-parameters))
1937 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer)) 1937 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))
1938 (set-window-dedicated-p (get-buffer-window (current-buffer)) t)) 1938 (set-window-dedicated-p (selected-window) t))
1939 1939
1940;; modified because if gdb-current-address has changed value a new command 1940;; modified because if gdb-current-address has changed value a new command
1941;; must be enqueued to update the buffer with the new output 1941;; must be enqueued to update the buffer with the new output
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index bdf8c93f900..9cb3ae26c3b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2384,8 +2384,10 @@ comint mode, which see."
2384 (if (file-name-directory file-subst) 2384 (if (file-name-directory file-subst)
2385 (expand-file-name file-subst) 2385 (expand-file-name file-subst)
2386 file-subst))) 2386 file-subst)))
2387 (filepart (and file-word (concat "-" (file-name-nondirectory file))))) 2387 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
2388 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
2388 (pop-to-buffer (concat "*gud" filepart "*")) 2389 (pop-to-buffer (concat "*gud" filepart "*"))
2390 (if existing-buffer (error "This program is already running under gdb"))
2389 ;; Set the dir, in case the buffer already existed with a different dir. 2391 ;; Set the dir, in case the buffer already existed with a different dir.
2390 (setq default-directory dir) 2392 (setq default-directory dir)
2391 ;; Set default-directory to the file's directory. 2393 ;; Set default-directory to the file's directory.
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 8bba647a2ad..206492dee08 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -56,6 +56,8 @@
56 56
57;;; Code: 57;;; Code:
58 58
59(eval-when-compile
60 (require 'cl))
59(require 'dired) 61(require 'dired)
60 62
61;; Abort if in-line imaging isn't supported (i.e. Emacs-20.7) 63;; Abort if in-line imaging isn't supported (i.e. Emacs-20.7)
@@ -182,18 +184,6 @@ see some of your images."
182 (make-directory thumbs-thumbsdir) 184 (make-directory thumbs-thumbsdir)
183 (message "Creating thumbnails directory"))) 185 (message "Creating thumbnails directory")))
184 186
185(when (not (fboundp 'ignore-errors))
186 (defmacro ignore-errors (&rest body)
187 "Execute FORMS; if anz error occurs, return nil.
188Otherwise, return result of last FORM."
189 (let ((err (thumbs-gensym)))
190 (list 'condition-case err (cons 'progn body) '(error nil)))))
191
192(when (not (fboundp 'caddar))
193 (defun caddar (x)
194 "Return the `car' of the `cdr' of the `cdr' of the `car' of X."
195 (car (cdr (cdr (car x))))))
196
197(defvar thumbs-gensym-counter 0) 187(defvar thumbs-gensym-counter 0)
198 188
199(defun thumbs-gensym (&optional arg) 189(defun thumbs-gensym (&optional arg)
@@ -504,7 +494,7 @@ Open another window."
504 "Delete the image at point (and it's thumbnail) (or marked files if any)." 494 "Delete the image at point (and it's thumbnail) (or marked files if any)."
505 (interactive) 495 (interactive)
506 (let ((f (or thumbs-markedL (list (cdr (assoc (point) thumbs-fileL)))))) 496 (let ((f (or thumbs-markedL (list (cdr (assoc (point) thumbs-fileL))))))
507 (if (yes-or-no-p "Really delete %d files?" (length f)) 497 (if (yes-or-no-p (format "Really delete %d files? " (length f)))
508 (progn 498 (progn
509 (mapcar (lambda (x) 499 (mapcar (lambda (x)
510 (setq thumbs-fileL (delete (rassoc x thumbs-fileL) thumbs-fileL)) 500 (setq thumbs-fileL (delete (rassoc x thumbs-fileL) thumbs-fileL))
@@ -529,9 +519,9 @@ Open another window."
529 (rename-buffer (concat "*Image: " 519 (rename-buffer (concat "*Image: "
530 (file-name-nondirectory i) 520 (file-name-nondirectory i)
531 " - " 521 " - "
532 (number-to-string num) "*"))) 522 (number-to-string num) "*"))
533 (setq thumbs-image-num num 523 (setq thumbs-image-num num
534 thumbs-current-image-filename i))) 524 thumbs-current-image-filename i))))
535 525
536(defun thumbs-next-image () 526(defun thumbs-next-image ()
537 "Show next image." 527 "Show next image."
@@ -597,7 +587,7 @@ ACTION and ARG should be legal convert command."
597(defun thumbs-emboss-image (emboss) 587(defun thumbs-emboss-image (emboss)
598 "Emboss the image with value EMBOSS." 588 "Emboss the image with value EMBOSS."
599 (interactive "nEmboss value: ") 589 (interactive "nEmboss value: ")
600 (if (or (< emboss 3)(> emboss 31)(evenp emboss)) 590 (if (or (< emboss 3) (> emboss 31) (zerop (logand emboss 1)))
601 (error "Arg must be a odd number between 3 and 31")) 591 (error "Arg must be a odd number between 3 and 31"))
602 (thumbs-modify-image "emboss" (number-to-string emboss))) 592 (thumbs-modify-image "emboss" (number-to-string emboss)))
603 593