diff --git a/yatexadd.el b/yatexadd.el index da3392d..065bbec 100644 --- a/yatexadd.el +++ b/yatexadd.el @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.20 ;;; (c)1991-2012 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Feb 9 09:33:55 2012 on firestorm +;;; Last modified Fri Feb 10 09:50:00 2012 on firestorm ;;; $Id$ ;;; @@ -1225,17 +1225,11 @@ (format "New %s name: " (or labname "label")) (cons dlab 1)))) (if (string< "" label) - (let ((refstr (format "\\%s{%s}" (or refname "ref") label)) - (key (key-description (where-is-internal 'yank nil t))) - (msg - (if YaTeX-japan - "��kill-ring�ɓ���܂����Byank(%s)�Ŏ��o���܂��B" - " is stored into kill-ring. Paste it by yank(%s)."))) - (kill-new refstr) + (let ((refstr (format "\\%s{%s}" (or refname "ref") label))) + (YaTeX-push-to-kill-ring refstr) (and chmode (not (equal old label)) - (YaTeX::label-rename-refs old label)) - (message (concat "`%s'" msg) refstr key))) + (YaTeX::label-rename-refs old label)))) label)))) @@ -1897,7 +1891,19 @@ (defun YaTeX::includegraphics (argp) "Add-in for \\includegraphics" - (YaTeX::include argp "Image File: ")) + (let ((imgfile (YaTeX::include argp "Image File: ")) + (case-fold-search t) info bb) + (and (string-match "\\.\\(jpe?g\\|png\\|gif\\|bmp\\)$" imgfile) + (file-exists-p imgfile) + (or (fboundp 'yahtml-get-image-info) + (progn + (load "yahtml" t) (featurep 'yahtml))) ;(require 'yahtml nil t) + (setq info (yahtml-get-image-info imgfile)) + (car info) ;if has width value + (car (cdr info)) ;if has height value + (setq bb (format "bb=%d %d %d %d" 0 0 (car info) (car (cdr info)))) + (YaTeX-push-to-kill-ring bb)) + imgfile)) (defun YaTeX::verbfile (argp) "Add-in for \\verbfile" diff --git a/yatexlib.el b/yatexlib.el index 42ed867..321451e 100644 --- a/yatexlib.el +++ b/yatexlib.el @@ -2,7 +2,7 @@ ;;; YaTeX and yahtml common libraries, general functions and definitions ;;; yatexlib.el ;;; (c)1994-2012 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Feb 9 08:32:18 2012 on firestorm +;;; Last modified Fri Feb 10 12:30:49 2012 on firestorm ;;; $Id$ ;; General variables @@ -1523,6 +1523,17 @@ (throw 'found (car alist))) (setq alist (cdr alist)))))) +(defun YaTeX-push-to-kill-ring (string) + "Push STRING to kill-ring, then show guidance message." + (and (stringp string) (string< "" string) + (let ((key (key-description (where-is-internal 'yank nil t))) + (msg + (if YaTeX-japan + " ��kill-ring�ɓ���܂����B����yank(%s)�œ\�t�ł��܂�" + " is stored into kill-ring. Paste it by yank(%s)."))) + (kill-new string) + (message (concat "`%s'" msg) string key)))) + ;;; ;; Functions for the Installation time ;;;