help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outline-minor-mode and org-mode capabilities for programming languag


From: Jean Louis
Subject: Re: outline-minor-mode and org-mode capabilities for programming languages
Date: Mon, 10 May 2021 14:53:51 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Christopher Dimech <dimech@gmx.com> [2021-05-10 13:28]:
> (add-hook 'emacs-lisp-mode-hook #'outline-minor-mode)
> (add-hook 'emacs-lisp-mode-hook
>       (lambda ()
>           (outline-minor-mode 1)))

I am not sure why you need to call 2 times, isn't once just enough?

I have tried this:

> (add-hook 'emacs-lisp-mode-hook #'outline-minor-mode)

and it works. I try that with this function here, could be
interesting. It creates new temporary buffers. C-u F5 and I choose the
favorite mode, and the above hook worked just well.

I think there is no need for second line above.

(defvar rcd-temp-buffer-mode-history nil)

(defun rcd-temp-buffer (&optional name mode)
  (interactive "p")
  (let* ((format "*RCD TEMPORARY BUFFER%s%s*")
         (buffer (if name (format format ": " name) (format format "" ""))))
    (switch-to-buffer (generate-new-buffer "*RCD TEMPORARY BUFFER*"))
    (if current-prefix-arg
        (let* ((modes '("adoc-mode" "emacs-lisp-mode" "lisp-mode" 
"markdown-mode"
                         "org-mode" "sql-mode" "fundamental-mode" "html-mode"))
               (mode (completing-read "Mode: " modes nil t nil 
'rcd-temp-buffer-mode-history)))
          (funcall (intern mode)))
    (funcall (intern (or mode "fundamental-mode"))))))

> (highlight-regexp "^;;;;;.*$" 'hi-yellow)

I don't think that is right place to define highlighting. Please first
verify options of outline-minor-mode-highlight (I did not yet).

> (setq outline-heading-alist
>       '((";; * " . 1) (";; ** " . 2) (";; *** " . 3)) )
> 
> ((emacs-lisp-mode .
>     ((outline-heading-alist .
>         '( (";; * " . 1)
>            (";; ** " . 2)
>            (";; *** " . 3) )  ))))
> 
> Still want to ask example code for hon to change the outline-minor-mode 
> keybindings to something else.

I have tried that, does it work on your side? Not on mine, I don't
know why.

I have made new prefix: outline-minor-mode-prefix is C-c C-d ""

But TAB works automatically when you set headings.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]