From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Emacs Mac port Date: Sat, 23 Apr 2016 08:51:45 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1461370056 15002 80.91.229.3 (23 Apr 2016 00:07:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2016 00:07:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 23 02:07:28 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1atl6c-0001vJ-SK for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2016 02:07:27 +0200 Original-Received: from localhost ([::1]:42089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atl6c-0008G8-3A for ged-emacs-devel@m.gmane.org; Fri, 22 Apr 2016 20:07:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atkrd-0001Bi-07 for emacs-devel@gnu.org; Fri, 22 Apr 2016 19:51:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atkrY-0007Le-Cq for emacs-devel@gnu.org; Fri, 22 Apr 2016 19:51:56 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:59768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atkrX-0007LF-LV for emacs-devel@gnu.org; Fri, 22 Apr 2016 19:51:52 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 923BBF08E7 for ; Sat, 23 Apr 2016 08:51:45 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203196 Archived-At: The ninth update of the Mac port based on Emacs 24.5 is available from ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-24.5-mac-5.16.tar.gz and Git repository is also available at https://bitbucket.org/mituharu/emacs-mac.git A bare development branch (no documentation updates yet) based on the pretest versions of Emacs 25.1 is also available from the "work" branch of the above repository. ** Fixed bugs *** M-x tool-bar-mode RET for a fullheight/maximized frame fails on its first invocation. *** Wrong size calculations for 2x genuine imagemagick images. For example, (image-size (create-image "splash.png" 'imagemagick nil :max-height 300)) is larger than the one without the :max-height property if the frame is on a Retina display. ** Improvements *** For frames on a Retina display, image-io/imagemagick image descriptors involving non-integral transformations such as shrinking or rotation are now processed with 2x pixel buffer even if the source image file/data is for 1x. For example, (insert-image (create-image "gnus/gnus.png" 'imagemagick nil :max-height 100)) now looks crisper. *** Org mode LaTeX fragments preview may also create 2x images. The patch below is a quick hack (see the "XXX" comment below) for PDF Tools to display 2x images on Retina display. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el index 32cb237..bb63a71 100644 --- a/lisp/pdf-annot.el +++ b/lisp/pdf-annot.el @@ -921,6 +921,7 @@ other annotations." (pdf-cache-renderpage-highlight page (car size) `("white" "steel blue" 0.35 ,@edges)) + :width (car size) :map (pdf-view-apply-hotspot-functions window page size)))) (pdf-util-scroll-to-edges diff --git a/lisp/pdf-info.el b/lisp/pdf-info.el index 6a5edb8..62da214 100644 --- a/lisp/pdf-info.el +++ b/lisp/pdf-info.el @@ -1514,7 +1514,15 @@ Return the data of the corresponding PNG image." 'renderpage (pdf-info--normalize-file-or-buffer file-or-buffer) page - width + (* width + ;; XXX This does not give optimal results when you have both + ;; Retina and non-Retina displays connected. For true + ;; high-resolution support, one should use either TIFF, "@2x" + ;; convention, or resolution-independent formats such as PDF. + (or (and (memq (pdf-view-image-type) '(imagemagick image-io)) + (fboundp 'frame-monitor-attributes) + (cdr (assq 'backing-scale-factor (frame-monitor-attributes)))) + 1)) (let (transformed) (while (cdr commands) (let ((kw (pop commands)) diff --git a/lisp/pdf-isearch.el b/lisp/pdf-isearch.el index bffbd3b..674d295 100644 --- a/lisp/pdf-isearch.el +++ b/lisp/pdf-isearch.el @@ -728,7 +728,7 @@ MATCH-BG LAZY-FG LAZY-BG\)." occur-hack-p) (eq page (pdf-view-current-page))) (pdf-view-display-image - (pdf-view-create-image data)))))))) + (pdf-view-create-image data :width width)))))))) (pdf-info-renderpage-text-regions page width t nil `(,fg1 ,bg1 ,@(pdf-util-scale-pixel-to-relative diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el index 555032e..406ab98 100644 --- a/lisp/pdf-view.el +++ b/lisp/pdf-view.el @@ -725,7 +725,7 @@ See also `pdf-view-set-slice-from-bounding-box'." "Return the image-type which should be used. The return value is either imagemagick (if available and wanted -or if png is not available) or png. +or if png is not available), image-io (on the Mac port), or png. Signal an error, if neither imagemagick nor png is available. @@ -733,6 +733,8 @@ See also `pdf-view-use-imagemagick'." (cond ((and pdf-view-use-imagemagick (fboundp 'imagemagick-types)) 'imagemagick) + ((image-type-available-p 'image-io) + 'image-io) ((image-type-available-p 'png) 'png) ((fboundp 'imagemagick-types) @@ -741,8 +743,8 @@ See also `pdf-view-use-imagemagick'." (error "PNG image supported not compiled into Emacs")))) (defun pdf-view-use-scaling-p () - (and (eq 'imagemagick - (pdf-view-image-type)) + (and (memq (pdf-view-image-type) + '(imagemagick image-io)) pdf-view-use-scaling)) (defmacro pdf-view-create-image (data &rest props) @@ -1195,7 +1197,8 @@ This is more useful for commands like `(,(car colors) ,(cdr colors) 0.35 ,@region)) (pdf-info-renderpage-text-regions page width nil nil - `(,(car colors) ,(cdr colors) ,@region))))))) + `(,(car colors) ,(cdr colors) ,@region))) + :width width)))) (defun pdf-view-kill-ring-save () "Copy the region to the `kill-ring'."