all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12236: 24.2.50; hideshow.el: missing a `make-variable-buffer-local'
@ 2012-08-20  1:42 Michael Heerdegen
  2012-08-20 15:27 ` Dan Nicolaescu
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Heerdegen @ 2012-08-20  1:42 UTC (permalink / raw)
  To: 12236

Hi,

please look at these lines in hideshow.el:

  (defvar hs-c-start-regexp nil
    "Regexp for beginning of comments.
  Differs from mode-specific comment regexps in that
  surrounding whitespace is stripped.")
  (make-variable-buffer-local 'hs-c-start-regexp)
  
  (defvar hs-block-start-regexp nil
    "Regexp for beginning of block.")
  (make-variable-buffer-local 'hs-block-start-regexp)
  
  (defvar hs-block-start-mdata-select nil
    "Element in `hs-block-start-regexp' match data to consider as block start.
  The internal function `hs-forward-sexp' moves point to the beginning of this
  element (using `match-beginning') before calling `hs-forward-sexp-func'.")
  (make-variable-buffer-local 'hs-block-start-mdata-select)
  
  (defvar hs-block-end-regexp nil
    "Regexp for end of block.")
  
  (defvar hs-forward-sexp-func 'forward-sexp
    "Function used to do a `forward-sexp'.
  Should change for Algol-ish modes.  For single-character block
  delimiters -- ie, the syntax table regexp for the character is
  either `(' or `)' -- `hs-forward-sexp-func' would just be
  `forward-sexp'.  For other modes such as simula, a more specialized
  function is necessary.")
  (make-variable-buffer-local 'hs-forward-sexp-func)

I think it is obvious that `hs-block-end-regexp' must be declared as
buffer local as well.

Currently, if you invoke hs-minor-mode in two different buffers with
different major-modes, the setting of the second buffer overwrites the
value of `hs-block-end-regexp' in the first one, making hideshow
malfunctioning there.


Thanks,

Michael.


In GNU Emacs 24.2.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2012-08-15 on dex, modified by Debian
 (emacs-snapshot package, version 2:20120815-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11203000
Configured using:
 `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.2.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2.50/site-lisp:/usr/share/emacs/site-lisp'
 '--without-compress-info' '--with-crt-dir=/usr/lib/i386-linux-gnu/'
 '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu'
 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g
 -Wl,--as-needed -znocombreloc' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''






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

* bug#12236: 24.2.50; hideshow.el: missing a `make-variable-buffer-local'
  2012-08-20  1:42 bug#12236: 24.2.50; hideshow.el: missing a `make-variable-buffer-local' Michael Heerdegen
@ 2012-08-20 15:27 ` Dan Nicolaescu
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Nicolaescu @ 2012-08-20 15:27 UTC (permalink / raw)
  To: michael_heerdegen; +Cc: 12236

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hi,
>
> please look at these lines in hideshow.el:
>
>   (defvar hs-c-start-regexp nil
>     "Regexp for beginning of comments.
>   Differs from mode-specific comment regexps in that
>   surrounding whitespace is stripped.")
>   (make-variable-buffer-local 'hs-c-start-regexp)
>   
>   (defvar hs-block-start-regexp nil
>     "Regexp for beginning of block.")
>   (make-variable-buffer-local 'hs-block-start-regexp)
>   
>   (defvar hs-block-start-mdata-select nil
>     "Element in `hs-block-start-regexp' match data to consider as block start.
>   The internal function `hs-forward-sexp' moves point to the beginning of this
>   element (using `match-beginning') before calling `hs-forward-sexp-func'.")
>   (make-variable-buffer-local 'hs-block-start-mdata-select)
>   
>   (defvar hs-block-end-regexp nil
>     "Regexp for end of block.")
>   
>   (defvar hs-forward-sexp-func 'forward-sexp
>     "Function used to do a `forward-sexp'.
>   Should change for Algol-ish modes.  For single-character block
>   delimiters -- ie, the syntax table regexp for the character is
>   either `(' or `)' -- `hs-forward-sexp-func' would just be
>   `forward-sexp'.  For other modes such as simula, a more specialized
>   function is necessary.")
>   (make-variable-buffer-local 'hs-forward-sexp-func)
>
> I think it is obvious that `hs-block-end-regexp' must be declared as
> buffer local as well.

Yes, that existed, but it got lost at some point.
I fixed this in the emacs-24 branch which will get propagated to the
trunk at some point.

     



> Currently, if you invoke hs-minor-mode in two different buffers with
> different major-modes, the setting of the second buffer overwrites the
> value of `hs-block-end-regexp' in the first one, making hideshow
> malfunctioning there.
>
>
> Thanks,
>
> Michael.
>
>
> In GNU Emacs 24.2.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
>  of 2012-08-15 on dex, modified by Debian
>  (emacs-snapshot package, version 2:20120815-1)
> Windowing system distributor `The X.Org Foundation', version 11.0.11203000
> Configured using:
>  `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu'
>  '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
>  '--localstatedir=/var' '--infodir=/usr/share/info'
>  '--mandir=/usr/share/man' '--with-pop=yes'
>  '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.2.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2.50/site-lisp:/usr/share/emacs/site-lisp'
>  '--without-compress-info' '--with-crt-dir=/usr/lib/i386-linux-gnu/'
>  '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
>  'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu'
>  'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g
>  -Wl,--as-needed -znocombreloc' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''





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

end of thread, other threads:[~2012-08-20 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-20  1:42 bug#12236: 24.2.50; hideshow.el: missing a `make-variable-buffer-local' Michael Heerdegen
2012-08-20 15:27 ` Dan Nicolaescu

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.