{{ message }}

# Generalize counsel-outline to handle major modes and display styles - cont'd#1684

Closed
wants to merge 8 commits into from
Closed

# Generalize counsel-outline to handle major modes and display styles - cont'd#1684

wants to merge 8 commits into from

## Conversation

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

### ericdanan commented Jul 26, 2018

Re #1681

added 4 commits Jul 26, 2018
 counsel.el (counsel-outline): correct and clarify docstrings 
 4995b13 
 counsel.el (counsel-outline): support built-in latex mode 
 c46b743 
 counsel.el (counsel-outline): simplify lisp outline-level fn 
 dd03fa2 
 counsel.el (counsel-outline): clean docstring 
 ea30d50 
reviewed
counsel.el Outdated
 adequate or optimal, these variables can be rebound locally in the major mode hook. Replacements are provided for some such modes. To set them up, add this to your init file:" This command's behavior can be customized based on the current buffer's major mode. See variable counsel-outline-settings'."

### basil-conto Jul 26, 2018

Needs more filling! :)

### ericdanan Jul 28, 2018

Not sure what you mean. I agree the sentence is not very informative, but on the other hand I didn't want to duplicate the information of counsel-outline-settings's docstring.

So I just removed the sentence. This actually seems in line with many counsel commands that have short docstrings not mentioning the corresponding custom variables.

But of course if you have suggestions, @abo-abo will make the decision.

counsel.el Outdated
 ;; \end{document}', in which case we simply return that. (if (and (assoc (match-string 1) (if (boundp 'LaTeX-section-list) LaTeX-section-list latex-section-alist)) ; section macro

### basil-conto Jul 26, 2018

(or (bound-and-true-p LaTeX-section-list)
(bound-and-true-p latex-section-alist)))

This removes the need for (defvar LaTeX-section-list) or (defvar latex-section-alist) and makes the function a tiny bit less mode/package-dependent (not that this is particularly important).

### ericdanan Jul 28, 2018

Thanks, done

added 4 commits Jul 27, 2018
 counsel.el (counsel-outline-title-latex): use bound-and-true-p 
 a93539e 
 counsel.el (counsel-outline): add :history and :caller 
 7e95c78 
Also allow to set them in counsel-outline-settings', and update
default org-mode setting to reflect counsel-org-goto'.
 counsel.el (counsel-org-goto, counsel-outline): make aliases 
 c0344ab 
 counsel.el (counsel-outlilne): shorten docstring 
 920e57d 

### ericdanan commented Jul 28, 2018

 In the last batch of 4 commits, the first and fourth follow @basil-conto 's comments. The second one add :history and :caller to counsel-outline and make them customizable in counsel-outine-settings. This allows in particular to perfectly replicate counsel-org-goto for org-mode buffers, and can be useful more generally I think. The third one transforms the counsel-org-goto-XXX custom variables into counsel-outline-XXX, makes them customizables in counsel-outline-settings, and makes aliases from the former to the latter. Also counsel-org-goto becomes an alias to counsel-outline, counsel-org-goto--get-headlines to counsel-outline-candidates, and counsel-org-goto--add-face to counsel-outline--add-face. This looks more consistent to me and I think it shouldn't alter anyone's setting, but you may of course think otherwise. Perhaps the alias is not needed for the latter two functions (in which case counsel-outline--add-face could be simplified slightly by making the two new optional args required). I don't plan to push more commits for now, unless you suggest me to do so.

closed this Jul 30, 2018

### abo-abo commented Jul 30, 2018

 Thanks.

pushed a commit that referenced this issue Jul 30, 2018
 counsel.el (counsel-outline): shorten docstring 
 29cd688 
Fixes #1684

### basil-conto commented Jul 30, 2018 • edited

 Not sure what you mean. Sorry @ericdanan, I didn't see your reply to my comment. I was referring to what Emacs calls filling, by which all I meant was that the docstring line was too long and should be wrapped at ~65 columns, as is customary in Elisp.

### ericdanan commented Jul 31, 2018

 I see, thanks for clarifying. Basil L. Contovounesios writes: … Not sure what you mean. Sorry @ericdanan, I didn't see your reply to my comment. I was referring to what Emacs calls filling, by which all I meant was that the docstring line was too long and should be wrapped at ~65 columns, as is customary in Elisp. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

reviewed
 If verbatim, the face used in the buffer is applied. For simple headlines in org-mode buffers, this is usually the same as org except that it depends on how much of the buffer has been completely loaded. If your buffer exceeds a certain size,

### basil-conto Aug 2, 2018 • edited

I know the wording wasn't touched by this PR, but since I'm working on improving these docs, I'd like to clarify: instead of "loaded", should this say "fontified" or similar instead? Because I don't understand how a buffer can be partially loaded.

mentioned this pull request Aug 5, 2018
deleted the out branch May 6, 2019