unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6255: the notation of AF_LOCAL sockets in list-process
@ 2010-05-24  6:45 Masatake YAMATO
  2010-05-24 20:47 ` Stefan Monnier
  2010-05-27 14:53 ` bug#6279: Resolve alias face in htmlfontify.el Masatake YAMATO
  0 siblings, 2 replies; 4+ messages in thread
From: Masatake YAMATO @ 2010-05-24  6:45 UTC (permalink / raw)
  To: 6255

This is a bug report with a patch. Please include the patch
if appreciated.

When `local' is given as :family keyword arugment of `make-network-process',
AF_LOCAL(also known as AF_UNIX) socket is created. This behavior is not changed
even if :host keyword arugment is given. This is O.K. But `list-process' doesn't 
work as we expected.

I'll explain the detail with example:

    (let ((port "/dev/log"))
      (make-network-process :name "syslog"
			    :host "127.0.0.1"
			    :noquery t
			    :service port
			    :family 'local
			    :type 'datagram))

Although "127.0.0.1" is specified at :host but `local' is
specified at :family, so `make-network-process' creates AF_LOCAL socket.
But M-x list-process tells

    Proc	  Status   Buffer Command
    ----	  ------   ------ -------
    syslog        open	   (none) (network datagram connection to 127.0.0.1)

This should be 


    Proc	  Status   Buffer Command
    ----	  ------   ------ -------
    syslog        open	   (none) (network datagram connection to /dev/log)


2010-05-23  Masatake YAMATO  <yamato@redhat.com>

	* process.c (Fmake_network_process): Reset `host'
	property if family is AF_LOCAL.

=== modified file 'src/process.c'
*** src/process.c	2010-05-04 04:00:10 +0000
--- src/process.c	2010-05-23 17:52:30 +0000
***************
*** 3352,3357 ****
--- 3352,3359 ----
      {
        /* Host is not used.  */
        host = Qnil;
+       contact = Fplist_put (contact, QChost, Qnil);
+       
        CHECK_STRING (service);
        bzero (&address_un, sizeof address_un);
        address_un.sun_family = AF_LOCAL;






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

* bug#6255: the notation of AF_LOCAL sockets in list-process
  2010-05-24  6:45 bug#6255: the notation of AF_LOCAL sockets in list-process Masatake YAMATO
@ 2010-05-24 20:47 ` Stefan Monnier
  2010-05-27 14:53 ` bug#6279: Resolve alias face in htmlfontify.el Masatake YAMATO
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2010-05-24 20:47 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: 6255

> When `local' is given as :family keyword arugment of
> `make-network-process', AF_LOCAL(also known as AF_UNIX) socket is
> created. This behavior is not changed even if :host keyword arugment
> is given. This is O.K. But `list-process' doesn't  work as
> we expected.

I installed a slightly different patch that also outputs a message
warning about the ignored argument.


        Stefan





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

* bug#6279: Resolve alias face in htmlfontify.el
  2010-05-24  6:45 bug#6255: the notation of AF_LOCAL sockets in list-process Masatake YAMATO
  2010-05-24 20:47 ` Stefan Monnier
@ 2010-05-27 14:53 ` Masatake YAMATO
  2010-05-27 15:30   ` Chong Yidong
  1 sibling, 1 reply; 4+ messages in thread
From: Masatake YAMATO @ 2010-05-27 14:53 UTC (permalink / raw)
  To: 6279

This is a bug report with a patch. Please review the patch and
merge it to the emacs official source tree if appreciated.


To reproduce a bug:

1. Make a new verilog-mode buffer and put following small code to the buffer:
--------------------------------<cut begin>-
// -*- verilog -*-
function x;
endfunction
--------------------------------<cut end>---

2. M-x toggle-debug-on-error
3. M-x htmlfontify-buffer

You will get following backtrace.
--------------------------------<cut begin>-
Debugger entered--Lisp error: (wrong-type-argument listp font-lock-reference-face)
  car(font-lock-reference-face)
  (let ((key ...) (val ...) (next ...) (that nil) (this nil) \
(parent nil)) (if (eq key :inherit) (let ... ...) (setq this ...)) \
(setq that (hfy-face-to-style-i next)) (nconc this that parent))
  (progn (let (... ... ... ... ... ...) (if ... ... ...) (setq that ...) (nconc this that parent)))
  (if fn (progn (let ... ... ... ...)))
  (when fn (let (... ... ... ... ... ...) (if ... ... ...) (setq that ...) (nconc this that parent)))
  hfy-face-to-style-i(font-lock-reference-face)
  (hfy-flatten-style (hfy-face-to-style-i face-def))
  (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def)))
  (let ((face-def ...) (final-style nil)) (setq final-style (hfy-flatten-style ...)) \
(if (not ...) (progn ...)) final-style)
  hfy-face-to-style(font-lock-reference-face)
  (setq css-list (hfy-face-to-style fn))
  (let ((css-list nil) (css-text nil) (seen nil)) (setq css-list (hfy-face-to-style fn)) \
(setq css-text (mapcar ... css-list)) (cons (hfy-css-name fn) (format "{%s}" ...)))
  hfy-face-to-css(font-lock-reference-face)
  (cons fn (hfy-face-to-css fn))
  (cons (cons fn (hfy-face-to-css fn)) style)
  (setq style (cons (cons fn ...) style))
  (push (cons fn (hfy-face-to-css fn)) style)
  (if (and (setq fn ...) (not ...)) (push (cons fn ...) style))
  (while (< pt (point-max)) (if (and ... ...) (push ... style)) (setq pt (next-char-property-change pt)))
  (save-excursion (goto-char pt) (while (< pt ...) (if ... ...) (setq pt ...)))
  (let ((pt ...) (fn nil) (style nil)) (save-excursion (goto-char pt) (while ... ... ...)) (push (cons ... ...) style))
  hfy-compile-stylesheet()
  (setq css-sheet (hfy-compile-stylesheet) css-map (hfy-compile-face-map) invis-ranges (hfy-find-invisible-ranges))
  (let* ((html-buffer ...) (css-sheet nil) (css-map nil) (invis-ranges nil) (rovl nil) \
(orig-ovls ...) (rmin ...) (rmax ...)) (when (and mark-active transient-mark-mode) \
...
  hfy-fontify-buffer(nil "foo.v")
  (switch-to-buffer (hfy-fontify-buffer srcdir file))
  (if (interactive-p) (switch-to-buffer (hfy-fontify-buffer srcdir file)) (hfy-fontify-buffer srcdir file))
  htmlfontify-buffer()
  call-interactively(htmlfontify-buffer t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)
--------------------------------<cut end>---
(Some newlines are inserted. A line started with `...' is truncated.)

It seems that htmlfontify.el doesn't consider face alias which
is used to mark obsolete face like `font-lock-reference-face'.


2010-05-27  Masatake YAMATO  <yamato@redhat.com>

	* htmlfontify.el (hfy-face-resolve-face): New function to
	resolve alias faces.
	(hfy-face-to-style): Use `hfy-face-resolve-face'

=== modified file 'lisp/htmlfontify.el'
*** lisp/htmlfontify.el	2010-04-24 02:36:43 +0000
--- lisp/htmlfontify.el	2010-05-27 14:42:16 +0000
***************
*** 1026,1039 ****
      (setq  n (apply '* m))
      (nconc r (hfy-size (if x (round n) (* n 1.0)))) ))
  
  (defun hfy-face-to-style (fn)
    "Take FN, a font or `defface' style font specification,
  \(as returned by `face-attr-construct' or `hfy-face-attr-for-class')
  and return a `hfy-style-assoc'.\n
  See also `hfy-face-to-style-i', `hfy-flatten-style'."
    ;;(message "hfy-face-to-style");;DBUG
!   (let ((face-def (if (facep fn)
!                       (hfy-face-attr-for-class fn hfy-display-class) fn))
          (final-style nil))
  
      (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def)))
--- 1030,1057 ----
      (setq  n (apply '* m))
      (nconc r (hfy-size (if x (round n) (* n 1.0)))) ))
  
+ (defun hfy-face-resolve-face (fn)
+   (cond
+    ((facep fn)
+     (hfy-face-attr-for-class fn hfy-display-class))
+    ((symbolp fn)
+     ;; Obsolte face like `font-lock-reference-face' is defined
+     ;; as an alias for another face. Following
+     ;; expression tries to resolve the alias.
+     (let ((new-fn (symbol-value fn)))
+       (if (eq new-fn fn)
+ 	  fn
+ 	(hfy-face-resolve-face new-fn))))
+    (t
+     fn)))
+ 
  (defun hfy-face-to-style (fn)
    "Take FN, a font or `defface' style font specification,
  \(as returned by `face-attr-construct' or `hfy-face-attr-for-class')
  and return a `hfy-style-assoc'.\n
  See also `hfy-face-to-style-i', `hfy-flatten-style'."
    ;;(message "hfy-face-to-style");;DBUG
!   (let ((face-def (hfy-face-resolve-face fn))
          (final-style nil))
  
      (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def)))






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

* bug#6279: Resolve alias face in htmlfontify.el
  2010-05-27 14:53 ` bug#6279: Resolve alias face in htmlfontify.el Masatake YAMATO
@ 2010-05-27 15:30   ` Chong Yidong
  0 siblings, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2010-05-27 15:30 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: 6279-done

Masatake YAMATO <yamato@redhat.com> writes:

> This is a bug report with a patch. Please review the patch and
> merge it to the emacs official source tree if appreciated.
>
> It seems that htmlfontify.el doesn't consider face alias which
> is used to mark obsolete face like `font-lock-reference-face'.

Thanks, I've applied your patch.





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

end of thread, other threads:[~2010-05-27 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24  6:45 bug#6255: the notation of AF_LOCAL sockets in list-process Masatake YAMATO
2010-05-24 20:47 ` Stefan Monnier
2010-05-27 14:53 ` bug#6279: Resolve alias face in htmlfontify.el Masatake YAMATO
2010-05-27 15:30   ` Chong Yidong

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).