Code Monkey home page Code Monkey logo

hideshowvis's People

Contributors

sheijk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hideshowvis's Issues

Add to MELPA

Since 2015 there were talks in MELPA about depreciating all 'emacswiki' packages because "anyone can edit your package(s) on the Emacswiki and that poses a security risk".

Finally on 24 Jan, @milkipostman "inadvertently deleted all emacswiki packages", which was probably a good thing.

The problem is that I'm very fond of 'hideshowvis', and I have an automated emacs install that is failing because hideshowvis can't be found (obviously I'm installing it by hand).

Could you add this library to MELPA (or ELPA)?

How to diminish hs-minor-mode

I couldn't find it anywhere until somebody showed me the lambda function to make it happen, so I figured I'd put it in the official git repo so that if somebody needs to find it, they don't need to dig through Reddit.

Put this in your init.el file.

 (add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))

If you're using use-package

:config
 (add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))

only "-" markers shown

I'm using Emacs 27, but also tested with Emacs 26 and I can only see the - markers for closed and opened folds. Doesn't depend on a major mode.

Symbol's function definition is void: hideshowvis-symbols

When I place the following code in my init.el file:

(autoload 'hideshowvis-enable "hideshowvis" "Highlight foldable regions")

(autoload 'hideshowvis-minor-mode
   "hideshowvis"
   "Will indicate regions foldable with hideshow in the fringe."
   'interactive)

(dolist (hook (list 
  'emacs-lisp-mode-hook
	'json-mode-hook
  'c++-mode-hook
  'python-mode ;; doesn't work?
  'perl-mode ;; doesn't work?
  ))
  (add-hook hook 'hideshowvis-enable))
(hideshowvis-symbols)

I get the following error:
Symbol's function definition is void: hideshowvis-symbols

If I remove that line and run hideshowvis-symbols interactively, it works.

How come it doesn't work when run in init.el?

indent-region with hideshowvis-symbols changes code

If I have hideshowvis-symbols enabled, and the regions are hidden and showing the yellow rectangle on the right, if I select a region (say, the whole buffer) and then press TAB (for indent-for-tab-command ) the code is changed, with parts of it removed (parentheses or even complete expressions).

This is code to show the problem:

  • Start emacs -Q and evaluate this code:
(add-hook 'prog-mode-hook 'hs-minor-mode)
(add-to-list 'load-path "wherever-hideshowsivis-is")
(require 'hideshowvis)

(add-hook 'emacs-lisp-mode-hook 'hideshowvis-enable)
;; the next line is the culprit
(add-hook 'emacs-lisp-mode-hook 'hideshowvis-symbols)

Now, in that same emacs, open a file like, for example, this one:

(defun a ()
  (setq b 93))


(defun a2 ()
  (setq b 93
	))

Now, in the file hs-hide-all. It will show this:
hs1

Then, mark the whole buffer and press TAB (or M-x indent-region). And notice the modeline shows the buffer has been changed (indent-region could do that, but it should not have changed anything in this buffer)

hs2

In fact, this is how the code looks if we hs-show-all:

hs3

In the first block, (setq b 93) has been erased and in the second block one closing parenthesis has been erased.

If we do not enable hideshow-symbols none of this happens, as far as I can tell.

EDIT: a simple, though brutal and ugly, way of dealing with this for now is advicing indent-region:

(advice-add 'indent-region :before (lambda (&rest args) (hs-show-all)))

I do not know if there is a better way.

how to display yellow box on the right of also for comments

This is a question, not a bug.

I'd like to have, for comments, a similar visual indication as that provided by hideshowvis-symbols. As far as I can tell, this is not customizable, and I guess I'd need to modify the function hideshowvis-symbols, starting on the line with (when (eq 'code (overlay-get ov 'hs)). The display of the number of lines hidden is not the most important; it is the visual indicator that stuff is hidden. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.