texts: Is there a package for supporting two types of comments?

texts:
So, you would be able to setup it like this

(setq
  one-line-comment "//"
  multi-line-comment-start "/*"
  multi-line-comment-end "*/")

And use one command to comment anything. If nothing is selected it would comment one line otherwise it would use multi line comment. And most important if you inside a comment it would uncomment both types of comments. I know about newcomment.el but I cannot figure out if it's possible to configure it in such way, especially for uncommenting multi line comments.


texts:
this is slightly embarrassing, but i'm confused about it so:

i run emacs 26.1, org 9.3.

when i use the org exporter to export a file to odt format, tramp fires up and runs on the newly created file. after the .odt is created, in messages i get a message like, "Tramp: Opening connection for file /path/to/new/file.odt" and i have a buffer (and tramp process?) named *tramp/archive file /path/to/new/file.odt*. the new odt file is 'mounted'. when i exit emacs, it first has to 'unmount' the file. it also shows up as a mounted 'drive' in my file manager. i find this very bizarre.

the only things in my init file about tramp are:

tramp-backup-directory-alist (set to a file path)
tramp-default-method (set to "ssh")
tramp-mode-hook auto-sudoedit

my only org-export conf in my init it:

require 'ox
require 'ox extra
ox-extras-activate '(ignore-headlines)

*

if this is too weird to help me troubleshoot: is there a way to just block/disable tramp? i very rarely use it, and use the odt exporter much more often.


texts: How to force the user to comply with a command?

texts:
First, here is the full source code of my package.

Requirement

Currently I'm working on a package that provides a feature which upon the user invoking several times in a row certain command in a short amount of time, an alternative command is invoke instead. The assumption is made on the basis that the user has forgotten that the alternative command exist and that it is better/more efficient to achieve what he wants to achieve than the command he is using now.

Example use case

many invocations of next-line or previous-line through its bindings (either , C-n or , C-p), instead of letting the user keep invoking those two commands many more times, my package comes in and calls avy-goto-line (because that's how the user previously configured it to work).

The problem

I want to force the user to comply with whatever input a command request, right now if the user fall asleep on any binding for next-line, the alternative command goto-line never executes, or at least that's how it looks. If the alternative command were avy-goto-line it will throw an wrong-type-argument rendering my feature useless for next invocations if I don't ignore-errors.

I tried something like this:

(let* ((exit nil))
  (while (not exit)
    (setf exit (ignore-errors (avy-goto-line)))))

And it works, it does what I want to achieve. But for functions like goto-line or even avy-goto-word-0 Emacs gets freeze and the mini-buffer never popups asking something to the user.

the code

Here is the relevant parts of my code:

(setf schrute-shortcuts-commands '((goto-char  (left-char right-char))
                                   (goto-line  (next-line previous-line))))

(defun schrute--run-command ()
  "Helper that will run an alternative-command."
  (let* ((alternative-command)
         (command-list))
    (dolist (elem schrute-shortcuts-commands)
      (setf alternative-command (car elem))
      (setf command-list (cadr elem))
      (when (or (member this-command command-list)
               (eq this-command command-list))
        (funcall-interactively alternative-command)))))

(defun schrute-check-last-command ()
  "Check what command was used last time.

It also check the time between the last two invocations of the
same command and use the alternative command instead."
  (when (eq this-command last-command)
    (if (member this-command schrute--interesting-commands)
        (let* ((time-passed (float-time (time-subtract (current-time) schrute--time-last-command))))
          (if (<= time-passed 1.0)
              (setf schrute--times-last-command (1+ schrute--times-last-command)))
          (setf schrute--time-last-command (current-time)))))
  (when (> schrute--times-last-command 2)
    (setf schrute--times-last-command 0)
    ;; Call the alternative command for `this-command'
    (ignore-errors (schrute--run-command))))


texts: How to get entry text and property value in agenda?

texts:
What is the lisp function to get some entry text (excluding descendant items) for the highlighted item in the org-agenda?

org-agenda-get-some-entry-text seems to be promising. I have called it like this via a key in org-agenda-mode-map:

(org-agenda-get-some-entry-text (point-marker) 6)

but it always returns empty string and no error. What gives?

Also, there is a function to set an entry property in Agenda, org-agenda-set-property. Is there a counterpart for getting a property?

Is there anything like org-agenda-get-property out there?


texts: When closing spacemacs, I get the message "Saving clipboard to x clipboard manager...". The saving process ends up taking so much time that I have to kill emacs from the terminal. How can I disable emacs from doing this process upon quitting? Or at least how can I figure out what emacs function is responsible for displaying this message?


texts: When using lsp server, symbol highlighting obscures the highlighting done by region selection.  I can toggle this behavior per-buffer with lsp-toggle-symbol-highlight, but cannot permanently disable it for all buffers.  Is there a workaround to fix the current lack of a configuration setting?


texts: Force append to buffer instead of at point

texts: Is it possible to force an Emacs buffer to place any new text it receives at the end of the buffer, instead of at the mouse point? I mean all of: keystrokes, yanks, mouse paste. I'm thinking in particular of buffers such as *IPython*, where the moment you press enter, the line is actually echoed and executed at the end of the buffer. But in general, the issue applies to all terminal-like buffers, where it doesn't make sense to paste text anywhere but at the end.


texts: How to exit arbitrary mode x, as it seams for my particular case undo-tree-mode there is no undo-tree-mode related option for undoing it, it there a general solution?


texts: Turning active M-! into M-& (a'ka emacs equiv to bash Ctrl-Z)

texts:
From time to time I happen to M-! some_command just to find that the command runs longer than I expected and keeps my emacs frozen for long seconds. So I glaze at my frozen emacs and kick myself for not using M-& some_command and promise myself to use M-& next time. But M-! is in my muscle memory for decades…
And of course there is Ctrl-G, but there are cases when breaking command and re-running it is not preferable (mayhaps it may break sth, mayhaps would be costly to rerun…).

Similar mistake in shell konsole is trivial to correct, Ctrl-Z, bg and job is running in the background.

Does there exist some similar trick in emacs -  a way to turn currently running foreground (synchronous) command into backgroundized (asynchronous) one?

Note: in case it is impossible for default M-!, I am open to suggestions of how to rebind M-! into something else (what would be functionally equivalent apart from this trick).


texts: What does "(#o4, #x4, ?\C-d)" mean here?

texts:
I use m-x eval-expression to evaluate a very simple lisp code:

 ( + 1 3)

And I got my result like this

What does the symbols (#o4, #x4, ?\C-d) mean in this context?


texts: auto-loading ruler-mode while in text-mode

texts:
I have configured evolution to use Emacs for me to edit my replies to emails I receive.  However, I need to limit my line length to around 72 characters to avoid the odd-ball line wrapping by the mailer (MicroSoft EWS).

I currently have the following line in my .emacs:

(add-to-list 'auto-mode-alist (quote("/tmp/evo*\\'" . text-mode))

So that the files are put in text-mode.  However, I would also like to invoke ruler-mode automatically instead of having to do it manually.

But I cannot seem to figure this one out.  Is there a text hook I can add a custom function on to deal with this?

(GNU Emacs 24.5.1 on Ubuntu 16.04 and GNU Emacs 24.3.1 on private red-hat like distro)


texts: How to show appointments in org-agenda in Org v.8?

texts:
This entry was showing alright in org-agenda in Org 7.8, if I remember correctly.

** Dinner
<2016-02-26 Fri 12:00-13:30>

Not any more in Org 8.2.
Now, it seems I need to have it this way to show up in org-agenda:

** TODO Dinner
<2016-02-26 Fri 12:00-13:30>

How could I show appointments (items without a TODO keyword) in new versions of org-agenda?


texts: How do I track the number of lines added/deleted in an emacs session?

texts:
I am looking towards tracking the number of lines of text that I have added or removed in a session of emacs, is there any simple way to do this?

If not what would be the right direction towards writing a plugin that would help me do this?


texts:
Any experts in the unicode-fonts package out there?

What I am trying to do is set the font for CJK characters and not use the default.

This seems very tough! Using the customize interface injected the usual mumbo jumbo into my .emacs file which I edited by hand to put my preferred font first in the appropriate block.

Source Han Serif SC is the font I want to use:-

'(unicode-fonts-block-font-mapping
;; blah blah
     ("CJK Compatibility"
      ("Source Han Serif SC" "SimHei" "FangSong" "SimSun" "MingLiU" "Meiryo" "Microsoft JhengHei" "Microsoft JhengHei UI" "Lantinghei SC" "Lantinghei TC" "HAN NOM A" "Arial Unicode MS" "WenQuanYi Zen Hei
;; blah blah

When Emacs reloads This change was reflected in the UI but the original font is still used for these characters.

I can get my preferred font to work if I crow bar it using set-fontset-font...

Has anybody got this to work in unicode-font?

I don't want to give up on this package because it seems very popular but there seems to be a paucity of tutorial information about it!

To illustrate this; I type the first character of the "CJK Compatibility" block: "㌀". Then type "Ctrl+U+X =" to get the character information. This is the truncated output:-

            character: ㌀ (displayed as ㌀) (codepoint 13056, #o31400, #x3300)
          charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))
          code point in charset: 0x3300
           script: han
           syntax: w    which means: word
         category: .:Base, L:Left-to-right (strong), |:line breakable
         to input: type "C-x 8 RET 3300" or "C-x 8 RET SQUARE APAATO"
          display: by this font (glyph code)
xft:-PfEd-HanaMinA-normal-normal-normal-*-42-*-*-*-d-0-iso10646-1 (#x15E3)

I would not expect the font to be HanaMinA. I would expect it to be Source Han Serif SC.

I think there is something fundamentally wrong in my understanding of how to over-ride the unicode-fonts defaults!


texts: Wrong number of arguments on lambda key binding

texts:
I am not able to figure out what is wrong in this elisp form:

(define-key ggtags-mode-map (kbd "M-.")
  (lambda ()
    (interactive)
    (ggtags-find-tag-dwim)
    (recenter)))

I keep getting this message:

Wrong number of arguments: (1 . 2), 0

The debugger message:

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0)
  ggtags-find-tag-dwim()
  (lambda nil (interactive) (ggtags-find-tag-dwim) (recenter))()
  funcall-interactively((lambda nil (interactive) (ggtags-find-tag-dwim) (recenter)))
  call-interactively((lambda nil (interactive) (ggtags-find-tag-dwim) (recenter)) nil nil)
  command-execute((lambda nil (interactive) (ggtags-find-tag-dwim) (recenter)))


texts:
Here is a snapshot of my list-package result related to magit:

Question:

There's nothing in my init.el on marmalade, why the package from marmalade are also listed?
If I run M-xpackage-installRETmagitRET, which version am I installing?


texts: How to get helm completion for an arbitrary function such as dired or magit-branch?

texts: I would like to use helm completion for something that is not directly supported via function like helm-M-x or helm-mini. An example would be magit-branch, which would really benefit from helm.


texts: Generic method to customize indentation?

texts:
Is there some method to customize indentation in various Emacs modes, possibly on a per-project level?

Projects can have widely different indentation styles, which can make automatic indentation inconvenient. For instance, one project may use a style

result = function(
    first_argument, second_argument,
    third_argument, fourth_argument)
....^ (four characterss)

while another with the same language may prefer

result = function(
        first_argument, second_argument,
        third_argument, fourth_argument)
........^ (eight characters)

for clearer distinction from code flow constructs, and another

result = function(first_argument, second_argument,
                  third_argument, fourth_argument)
..................^ (aligned with parentheses).

It seems, that how or whether both styles, or any other given style, can be supported by automatic indentation depends strongly on the language mode;

In Python-mode the first and third style are supported by default settings, but the second one would require customizing functions.

In Fortran, the first and second style are supported by changing customization variables, but the third would require writing a custom indent function. Instead of it, the builtin f90-mode would produce something like

result = function(first_argument, second_argument, &
        third_argument, fourth_argument)
........^ (customizable indent, but no option for aligning to parentheses)

More commonly, I resort to using manual indenting and M-x indent-rigidly (aka C-x TAB).

Is there any method to cleanly and reliably change indentation styles across modes?


texts:
The purpose of digit-argument and how to use them is described in Emacs manual.
Also read a question that asks how to disable them.

Even though have not disabled them, I have changed M-1, M-2, M-3 'cause I prefer to use them for delete-other-window, split-windows-right and slit-window-below, which I find more handy.

I also bound M-0 to delete-window, and just wondered...
In which case someone would be interested in using M-0 or C-0?
I cannot think any use case...


texts: Wrap one line of text into a multiple line block

texts:
I have a very long line of text (8000 characters). I would like to format this nicely so it splits across multiple lines in a block. Where the line breaks occurs does not matter for this purpose.

before:

aaaaaaaabbbbbbbbccccccccdddddddd

after:

aaaaaaaa
bbbbbbbb
cccccccc
dddddddd

I chose eight characters before a line-break, but that number does not matter either- it could be 8 or 80. fill-paragraph does not seem to work for me- nothing happens.

N.B. I'm not asking about Line Wrapping, or how the text is displayed.


texts: How to use an Easy PG encrypted custom-file?

texts:
So, inspired by this article. I decided to try adding the following to my init.el:

 (setq custom-file (expand-file-name "secret.el" user-emacs-directory))
 (load custom-file)

Where the file in question (secret.el) has:

# -*- epa-file-encrypt-to: ("kramer@example.com") -*-
(setq jabber-account-list ...)
(setq my-secret-password "rosebud")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(abbrev-mode t)
'(auto-save-default nil)
'(comment-column 2)
 )

Along with necessary variables. However I can't seem to work with this. Inspite of having my password authentication set such that I can use gpg -d from the commandline without a password prompt, and am able to edit it transparently without the line.

My precise error is:

Debugger entered--Lisp error: (void-variable \205)
  eval-buffer(#<buffer  *load*-77127> nil "/home/haozeke/.config/doom/local/private.el.gpg" nil t)  ; Reading at buffer position 2
  load-with-code-conversion("/home/haozeke/.config/doom/local/private.el.gpg" "/home/haozeke/.config/doom/local/private.el.gpg" nil n$
  load("/home/haozeke/.config/doom/local/private.el.gpg")
  eval-buffer(#<buffer  *load*-596012> nil "/home/haozeke/.config/doom/config.el" nil t)  ; Reading at buffer position 12972
  load-with-code-conversion("/home/haozeke/.config/doom/config.el" "/home/haozeke/.config/doom/config.el" t nil)
  load("/home/haozeke/.config/doom/config" t nil)
  (condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug e$
  (if noninteractive nil (if doom-modules (progn (maphash (function (lambda (key plist) (let (... ...) (condition-case e ... ... ...)$
  (progn (if doom-modules (progn (maphash (function (lambda (key plist) (let (... ...) (condition-case e ... ... ...)))) doom-modules$
  (if (condition-case e (load (expand-file-name "init" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug$
Quit

Now, I realized I might need to actually load the right packages before, so I amended my init.el to :

(require 'epa-file)
(epa-file-enable)
(setq custom-file (expand-file-name "secret.el" user-emacs-directory))
(load custom-file)

So that changes the error to:

Debugger entered--Lisp error: (invalid-read-syntax "#")
  read(#<buffer  *load*-61450>)
  eval-buffer(#<buffer  *load*-61450> nil "/home/haozeke/.config/doom/local/private.el.gpg" nil t)  ; Reading at buffer position 66
  load-with-code-conversion("/home/haozeke/.config/doom/local/private.el.gpg" "/home/haozeke/.config/doom/local/private.el.gpg" nil n$
  load("/home/haozeke/.config/doom/local/private.el.gpg")
  eval-buffer(#<buffer  *load*-27802> nil "/home/haozeke/.config/doom/config.el" nil t)  ; Reading at buffer position 13010
  load-with-code-conversion("/home/haozeke/.config/doom/config.el" "/home/haozeke/.config/doom/config.el" t nil)
  load("/home/haozeke/.config/doom/config" t nil)
  (condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug e$
  (if noninteractive nil (if doom-modules (progn (maphash (function (lambda (key plist) (let (... ...) (condition-case e ... ... ...)$
  (progn (if doom-modules (progn (maphash (function (lambda (key plist) (let (... ...) (condition-case e ... ... ...)))) doom-modules$


texts:
I am using org-mode to track effort. I would like to be able to see, in column view, the sum total of time remaining on a project (that is, Effort - CLOCKSUM).

I haven't had much luck so far. This provides some code but requires a lot of dependencies I haven't been able to track down.

There is a very old discussion of how to use custom formulas for columns in org-mode here. However, perhaps this pertains to org tables, rather than column view, since I can't get even the example in the email to work:

:COLUMNS:  %25ITEM %2d{`(,(or curval 0) 0)} %f{`(,(or curval 0) 0)}

%2fd{`(,(+ $f $d) 0)}

More generally, something like %f{FUBAR} returns the value of property 'f' regardless of what code I replace FUBAR with.


texts: Looking for a better way of tweaking rainbow delimiters

texts:
I'm a big fan of rainbow-delimiters. Even when I do not code in Lisp I can quickly and easily find matching bracket just looking at the code. My method works better on dark backgrounds, but can be tweaked to work on light backgrounds as well. The thing that still needs doing is automatic change of bracket colours after the theme change.

My code so far:

(require 'color)
(defun hsl-to-hex (h s l)
  "Convert H S L to hex colours."
  (let (rgb)
    (setq rgb (color-hsl-to-rgb h s l))
    (color-rgb-to-hex (nth 0 rgb)
                      (nth 1 rgb)
                      (nth 2 rgb))))

(defun bracket-colors ()
  "Calculate the bracket colours based on background."
  (let (hexcolors lightvals)
    (if (>= (color-distance  "white"
                             (face-attribute 'default :background))
            (color-distance  "black"
                             (face-attribute 'default :background)))
        (setq lightvals (list 0.65 0.55))
      (setq lightvals (list 0.35 0.30)))

    (concatenate 'list
                 (dolist (n'(.71 .3 .11 .01))
                   (push (hsl-to-hex (+ n 0.0) 1.0 (nth 0 lightvals)) hexcolors))
                 (dolist (n '(.81 .49 .17 .05))
                   (push (hsl-to-hex (+ n 0.0) 1.0 (nth 1 lightvals)) hexcolors)))
    (reverse hexcolors)))

(defun colorise-brackets ()
  "Apply my own colours to rainbow delimiters."
  (require 'rainbow-delimiters)
  (custom-set-faces
   ;; or use (list-colors-display)
   `(rainbow-delimiters-depth-1-face ((t (:foreground "#888"))))
   `(rainbow-delimiters-depth-2-face ((t (:foreground ,(nth 0 (bracket-colors))))))
   `(rainbow-delimiters-depth-3-face ((t (:foreground ,(nth 1 (bracket-colors))))))
   `(rainbow-delimiters-depth-4-face ((t (:foreground ,(nth 2 (bracket-colors))))))
   `(rainbow-delimiters-depth-5-face ((t (:foreground ,(nth 3 (bracket-colors))))))
   `(rainbow-delimiters-depth-6-face ((t (:foreground ,(nth 4 (bracket-colors))))))
   `(rainbow-delimiters-depth-7-face ((t (:foreground ,(nth 5 (bracket-colors))))))
   `(rainbow-delimiters-depth-8-face ((t (:foreground ,(nth 6 (bracket-colors))))))
   `(rainbow-delimiters-depth-9-face ((t (:foreground ,(nth 7 (bracket-colors))))))
   `(rainbow-delimiters-unmatched-face ((t (:foreground "white" :background "red"))))
   `(highlight ((t (:foreground "#ff0000" :background "#888"))))
   ))

(colorise-brackets)

After changing from dark to light theme, or vice versa I need to manually eval following in the scratch buffer:

(colorise-brackets)

How do I make it automatic? What other improvements would you suggest?


texts: Change mode-line size without changing header line

texts:
There are several posts and information around for changing the mode-line face properties, like size. I tried them for a smaller mode-line, using:

(set-face-attribute 'mode-line nil  :height 100)

This works fine, but I've just realized that this also changes the top (header?) line that I use for sticky-func-mode, which is unfortunate because it is smaller than my buffer face and disrupts the visual structure of the code.

How can I change the mode-line size without affecting the header line (I'm not sure how its called)?


texts: Emacs not loading org-agenda-files on startup

texts:
So i've put this in my emacs.org:

(setq org-agenda-files (list
        "~/todo.org"))

But whenever i close and reopen Emacs, my org-agenda is empty until i reload my config-File.
Is there anything that i've missed? Also i've tried some "eval-after-load 'org" combinations but none of them have worked for me so far.
Some help or guidance in the right direction would be appreciated.


texts: Emacs subshell: how to select options by moving up and down arrow keys?

texts:
I open a subshell session using M + x shell and I create a Nuxt.js application using: yarn create nuxt-app myproject.

During the installation process, I am suggested which packages/frameworks/libraries/tools to use for my development process as shown on this screenshot:

On Ubuntu's Terminal I just press the arrows down or up to select what I want. But with the subshell session these arrows do not work. How to achieve my goal?


texts: Why is emacs freezing and how can I prevent it? (likely involving org agenda)

texts:
What would cause emacs to "mostly" freeze when creating an org agenda?

I say "mostly" because when you type C-g, it does show "Quit" in the minibuffer, and the time logging number in the minibuffer still increments. Nothing else seems to respond though that I could think of.

I was only able to get emacs to respond by getting the emacs pid with ps aux | grep emacs and then running kill -SIGUSR2 {PID}.

After that, emacs opened a buffer with:

Debugger entered--Lisp error: (quit)
  redisplay_internal\ \(C\ function\)()

What can I do to prevent this behavior?


texts:
I can see many image formats in orgmode, but not SVG.

I get the error Invalid image type 'svg' when I run org-display-inline-images.

It should be possible given this question exists: https://www.reddit.com/r/emacs/comments/2o21gf/orgmode_svg_rendering/

I didn't see an obvious package to install, or other way to fix this.

EDIT: This is on Mac OS X 10.9.5, Emacs 24.4.1 (installed via homebrew), Org 8.3.2. (image-type-available-p 'svg) returns nil.


texts: Org Mode: Where are `previousset`, `nextset` etc defined?

texts:
I am doing a bit of keyboard rebinding and I have found that:

(org-todo "DONE")
(org-todo "TODO")
(org-todo "")

all work, but in the documentation, it says that I should be able to also use the symbols nextset and previousset as such:

(org-todo 'nextset)
(org-todo 'previousset)

I have searched the source code of org-mode.el and some of the require files too, but I cannot find the definition of nextset or previousset.

Below is my code:

(setq org-support-shift-select 'always)

(defun org-mode-todo-done-cycling-replacements ()
  (define-key org-mode-map (kbd "M-9") (lambda ()
                     (interactive)
                     (org-call-with-arg 'org-todo 'previousset)))
  (define-key org-mode-map (kbd "M-0") 'org-todo))

(add-hook 'org-mode-hook 'org-mode-todo-done-cycling-replacements)

M-0 works but M-9 does not.

Am I supposed to require a library before? (Org-mode version is 8.3.3).


texts: How can I display the parent directory of the current file in the modeline?

texts: I would like to be able to see the location of the current file's parent directory, independent of the current buffer name.


texts: org-mode capture click event within org-babel code block

texts:
I wish to run C-c C-c, then click any code line to trigger my code (print "clicked" in this demo)

#+BEGIN_SRC elisp :results output
(defun myclick(n)
  (interactive "p")
  (print "clicked")
  )

(add-hook 'org-mode-hook
             '(lambda ()
                (local-set-key (kbd "<mouse-1>") #'myclick)))

#+END_SRC

But it doesn't print out anything now.


texts: How can I automatically change a TODO agenda item/task to PROGRESS when clocking in?

texts: Is there a way to automatically change the TODO keyword into PROGRESS when I clock in to an agenta item/task?  If so, how?  (OK, this isn't a big deal, I currently press I t p to achieve this, but it would be nice to have (and save 50% on keystrokes when including the Shift for I).)


texts: How can I hide unwanted buffers when cycling with C-x

texts:
I often have various files open and cycle through them using C-x <left> and C-x <right>. However, this means I also need to cycle through various "informative" buffers that I really don't care about. For example, at work I connect to a remote machine (call it foo) via tramp and edit files there. This opens various buffers such as *debug tramp/sshx foo* *tramp/sshx foo*. Then, we have *Messages*, *Completions*, *scratch* etc, etc.

So, how can I define a list of buffers that are never shown when cycling through the open buffers with C-x <left> and C-x <right>? Ideally, these would still be shown in the buffer drop-down menu in the GUI and in Ibuffer so I can switch to them if I ever want to, but they will be hidden when cycling through open buffers.


texts: How can I prevent flycheck-mode from checking certain files?

texts:
I've configured Emacs to open files named *.cfg in shell-script-mode.  These are config files, of course, rather than shell scripts, but 90% of the time it does what I want (mainly, good guesses about faces for comments and variable assignment).  I use flycheck-mode, and I like it enough to have global-flycheck-mode enabled.  The problem is that, in the case of *.cfg files, flycheck-mode suggests lots of errors that aren't relevant.

Is there a way to disable flycheck-mode automagically based on either file name or the path to the file?  The closest I've seen is flycheck-before-syntax-check-hook...I could imagine sticking in a check for path or filename, but it runs before each syntax check (rather than disabling checks entirely).


texts: How to correctly configure Flow backend for LSP mode?

texts:
I'm using spacemacs @develop (branch). I can't use lsp and lsp-ui. In vscode everything works (using flow lsp mode). With company-flow I can also make it working.

When opening a .js file with // @flow comment the lsp mode is activating automatically and tries to run the flow server and crashes:

Server flow-ls:7818 status:starting exited with status exit. Do you want to restart it? (y or n) y

Each time I'm trying to restart I see the same thing. So the type inspection and type checks doesn't work.
Syntax is highlighted but I think it doesn't work (when I set js2-mode-show-parse-errors nil variable in the layers variable I see different view (eg the import type is not highlighted in red).

I'm running the latest version of flow, and have flow-bin installed (same version) in the package (node_modules) and globally. flow binary is in the PATH.


texts:
Is it possible to tangle #+RESULTS: block? For example,

#+BEGIN_SRC rst :tangle ./test.txt :noweb yes
<<Tangle_Test>>
#+END_SRC

#+BEGIN_SRC python :exports results :results output raw
print("Results")
#+END_SRC

#+RESULTS:
Results

And I want to tangle #+RESULTS: part, not the actual Python source code.

Following radebrecht's answer, here is a working example:

#+BEGIN_SRC rst :tangle  ./test.txt :noweb yes
<<Tangle_Test>>
#+END_SRC

#+BEGIN_SRC python :results output code :tangle no :results_switches ":tangle no :noweb-ref Tangle_Test"
print("Print Results")
#+END_SRC

If you evaluate the code block (C-c C-c), then the following #+RESULTS block will be generated:

#+RESULTS:
#+BEGIN_SRC python :tangle no :noweb-ref Tangle_Test
Print Results
#+END_SRC

Then you can tangle the file (org-babel-tangle) and the resulting test.txt will contain Print Results only.


texts: Create an org-journal template for daily journal entry

texts:
I was just wondering if there is a way to create a standard set of sections for my daily journal entry. So if I want a section for Todos, and another section for meetings, etc. Is it possible to just create a standard template in emacs that gets built when a new journal file is created?

UPDATED TO CLARIFY:

I just wanted to clarify any ambiguity. Org-journal will create a new empty journal file for each day. The file is usually named with the date, so "20151106". The file is empty when it is created.

So I wanted to create a set of org bulletted sections that were created in the new file. So they should include:

Tasks
Exercise
Meal Plan

That way I don't have to manually create these each time a new journal entry is created.


texts:
I am able to set the date language with (setq system-time-locale "LOCALE") but it doesn't affect the calendar.

How can I change the language of calendar?


texts: How can I close the current frame upon killing a buffer if that frame was only opened for it?

texts: When I open a file in Emacs.app, via Finder, via the edit-server or during merging on an SVN update, it shows up in a new frame. When I kill that buffer, I pretty much always also want close the frame that came with it. Is there a way to easily recognize such situations and add an appropriate advice to kill-buffer? Is there perhaps a buffer history for each frame? If that history only contains one buffer, and the frame is not the last remaining one, it would be safe to close.


texts:
I'm new to emacs (3 days), learning the basics of the ecosystem. I brew installed emacs, and after that I'm wanting to enable evil mode. Here is my init.el

(require 'package)
(setq package-list '(evil))

(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                (not (gnutls-available-p))))
   (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))

;; Activate all packages in particular autoloads
(package-initialize)

(unless package-archive-contents
  (package-refresh-contents))

;; Install all missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

(require 'evil)
(evil-mode t)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (evil))))
 (custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
)

And I'm getting the following Warning. Looks like it's something related with some lisp coding stile guide but not sure.

Compiling no file at Sat Dec 30 16:12:10 2017
Warning (bytecomp): assignment to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘buffer-undo-tree’
Warning (bytecomp): the following functions are not known to be defined:
undo-tree-current, undo-tree-node-undo, undo-tree-node-previous
Warning (bytecomp): reference to free variable ‘undo-tree-mode’
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]
Warning (bytecomp): ‘undo-elt-crosses-region’ is an obsolete function (as of 25.1). [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [7 times]
Warning (bytecomp): reference to free variable ‘undo-tree-visualizer-selection-mode’ [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]
Warning (bytecomp): ‘find-tag’ is an obsolete function (as of 25.1); use ‘xref-find-definitions’ instead. [2 times]
Warning (bytecomp): function evil-mode used to take 0+ arguments, now takes 0-1

I want to point out that this a fresh installation of emacs 25.3 and the only package I'm trying to install for now is evil, I haven't done anything yet with emacs.

This is something I should worry about?
It's a way to fix it?


texts: Evil key bindings with evil-define-key do opposite of what I want?

texts:
Below is the entirety of my Evil key bindings in init.el:

(evil-define-key 'normal 'global (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal 'global (kbd "SPC TAB") #'ivy-switch-buffer)
(evil-define-key 'normal 'Info-mode-map (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal 'Info-mode-map (kbd "SPC SPC") #'Info-scroll-up)

The end result of this is as follows:

In Emacs-Lisp mode, SPC TAB is bound to ivy-switch-buffer; this is expected.
In Emacs-Lisp mode, SPC SPC is bound to Info-scroll-up; this is unexpected.
In Info mode, SPC TAB is undefined; this is unexpected.
In Info mode, SPC SPC is bound to Info-scroll-up; this is expected.

It seems to me (in one sentence) that the global config is not global and the local config is global. This is the opposite of what I would expect.

The Info-scroll-up binding is defined on Info-mode-map and has effect even when Info mode is not active. Why?

The ivy-switch-buffer binding is defined globally, but does not work when I am in Info mode. Not only does it not work, but it is undefined. It's not that SPC TAB has been replaced by another command, SPC TAB is undefined (and SPC is a prefix key). Why?

I can't form any mental model of why Evil / Emacs is behaving this way. Why is it behaving this way?


texts: Why does org mode elisp evaluation not print text properties?

texts:
With no special header argument values, I have

#+BEGIN_SRC emacs-lisp
(propertize "abc" 'face 'italic)
#+END_SRC

#+RESULTS:
: abc

whereas C-x C-e on the form gives me

#("abc" 0 3 (face italic))

why is there this discrepancy? Is there a difference between org mode source C-c C-c and C-x C-e?


texts:
From the Emacs Eclim github page:

Install emacs-eclim. You have two options:

Installation from the MELPA package archive.
Just add the archive to package-archives if you
haven't already, and
then install emacs-eclim with the package-install
command.

Manual installation from GitHub.
(git clone git://github.com/senny/emacs-eclim.git)
Add (add-to-list 'load-path "/path/to/emacs-eclim/") to your
startup script.

If followed the first option and:

Added the following package-archives to my ~/.emacs.d/init.el file:
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")
                         ("melpa" . "http://melpa.milkbox.net/packages/")))

Then typed M-xpackage-install and hit RET and the following message poped up:
Install package: emacs-eclim [No Match]

Why does this error pop up?
Thanks in advance.


texts: Different summaries at different levels in org-columns

texts:
I'm trying to use org-mode for keeping track of my grades in university. My grades are all numerical from 0 to 10. I want the column view to output my average score and the final grade of each subject, but there is one subject where the final grade is calculated by summing instead of averaging. I want to get something like this

|Item         | Grade|
|-------------|------|
|* My degree  | 6.88 |
|** Subject 1 | 8.25 |
|*** Exam 1   | 9.5  |
|*** Exam 2   | 7    |
|** Subject 2 | 5.5  |
|*** Exam 1   | 3    |
|*** Exam 2   | 2.5  |

I tried setting the GRADE column but it did nothing:

* My degree
  :PROPERTIES:
  :COLUMNS: %ITEM %GRADE{mean;%.2f}
  :END:
** Subject 1
*** Exam 1
    :PROPERTIES:
    :GRADE: 9.5
    :END:
*** Exam 2
    :PROPERTIES:
    :GRADE: 7
    :END:
** Subject 2
   :PROPERTIES:
   :COLUMNS+: %GRADE{+;%.2f}
   :END:
*** Exam 1
    :PROPERTIES:
    :GRADE: 3
    :END:
*** Exam 2
    :PROPERTIES:
    :GRADE: 2.5
    :END:

I also tried using an Elisp sexp inside the properties as a workaround to get the sum by averaging scaled values, like this

:GRADE: %(* 2 2.5)

But the sexp doesn't get evaluated and the summary treats it as 0.

Is there an easy way to achieve what I want?


texts: How to temporarily disable flycheck while running an elisp function that inserts a large amount of text into the buffer

texts:
I often write elisp functions for large sections of boilerplate code.  I am currently writing some Java and using Meghanda mode which uses Flycheck.  However, when inserting these large chunks of text, I often break the Java syntax checker temporarily, so I would like to bind some variable in my Elisp code (or call some "toggle" function) to suppress flychecking on the code.  Currently the code dies because flycheck throws an error (and I don't care about that error until I am done).
(defun insert-foo (param)
  (interactive "sparam:")
  (let ((turn-fly-check-off t))
    (insert "20 lines of code substituting param")))


texts:
I would like shackle.el to manage the buffers created by WoMan.
Here's the configuration I'm using:
(use-package shackle
  :config
  (setq shackle-rules '((woman-mode :select t :align below :size 0.5)))
  (shackle-mode 1))

This should make WoMan buffers to appear on the bottom half of the screen.
But for some reason, shackle does not seem to work with the buffers created by WoMan (it works fine with other buffers, e.g., those that use help-mode).  Any workaround?


texts: show full file path in helm-buffers-list and helm-mini

texts:
I'd like to show the full file path (if available) for Buffers in helm-buffers-list and helm-mini, just like it shows in the Recentf section of helm-mini.

How can I do this?

The reason is that I often filter by segments of the file path to find the buffer I want to open.


texts:
I am working on a very old Emacs version (23.2.1). I am trying to  bind C-C C-i to an interactive command without luck.

The command selects code regions delimited between two lines that start with ##. It works well when I call it interactively (M-x python-select-cell), but the keybinding does not work in Python buffers:

(defun python-inside-comment-p ()
  (save-excursion
    (beginning-of-line 1)
    (looking-at "^#")))

(defun python-select-cell ()
  (interactive)
  (goto-char
   (if (re-search-backward "^\\s-*##[^#]" nil t)
       (match-end 0)
     (point-min)))
  (while (and (python-inside-comment-p)
              (eq 0 (forward-line 1)))
    nil)
  (set-mark (point))
  (goto-char
   (if (re-search-forward "^\\s-*\\(##[^#]\\)" nil t)
       (- (match-beginning 1) 2)
     (point-max))))

Global keybinding:

# Binding
(global-set-key (kbd "C-c C-i") 'python-select-cell)

I have also tried setting up a hook without luck

(add-hook 'python-mode-hook
    #'(lambda ()
          (global-set-key (kbd "C-C C-i") 'python-select-cell)))

What could be going on?


texts:
Gents,

I used several IDEs for Python.  I like Spyder, but I have have been a pretty obsessive Emacs user for a LONG time.  I install ELPY.  It works very well for my needs.  However, I cannot get code folding to work.  Whenever I click on anything and then choose EPLY->Code folding->Hide/show at point (through the menu system), I get the following error:

  Debugger entered--Lisp error: (void-variable hs-minor-mode)
    elpy-folding-toggle-at-point()
    funcall-interactively(elpy-folding-toggle-at-point)
    call-interactively(elpy-folding-toggle-at-point nil nil)
    command-execute(elpy-folding-toggle-at-point)

Does anybody know how to get this working?  It does not matter much where I click on a function or pretty much anything.


texts:
I'm playing around with developing and publishing an Emacs package, very simple stuff, just trying things out before I commit to a bigger project. The problem that I'm having is that after I've made a MELPA package (as per this tutorial) and try the package-install-file command I'm greeted with the "Package lacks a file header" error message, even though as far as I can see my package contains all of the required header information (as you can see here). My source file looks like this:

;;; header-tracker.el --- Easy switching between header and source files.

;; Copyright (C) 2019 Nathan Campos

;; Author: Nathan Campos <nathan@innoveworkshop.com>
;; Homepage: http://github.com/nathanpc/header-tracker.el
;; Version: 1.0.0
;; Keywords: convenience, usability
;; Package-Requires: ((emacs "24.1"))

;; This file is NOT part of GNU Emacs.

;;; License:

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Quickly and easily keep track and switch between header and source files
;; using this handy package.

;; This package exports a interactive function `header-tracker-toggle-header`
;; which can be binded to a key to seamlessly switch between source and header
;; files. This can be accomplished by adding the following lines to your
;; configuration file:

;; (add-hook 'c-mode-common-hook
;;           (lambda ()
;;             (local-set-key (kbd "C-c h") 'header-tracker-toggle-header)))

;; For more information about this package please consult the README file.

;;; Code:

;; Some code here...

(provide 'header-tracker)
;;; header-tracker.el ends here

Also, when I run (package-buffer-info) in the source buffer this is what I get in return, so apparently the header is valid:

(package-desc header-tracker (1 0 0) "Easy switching between header and source files." ((emacs (24 1))) single nil nil ((:authors ("Nathan Campos" . "nathan@innoveworkshop.com")) (:maintainer "Nathan Campos" . "nathan@innoveworkshop.com") (:url . "http://github.com/nathanpc/header-tracker.el")) nil)

Running checkdoc yields:

Buffer comments and tags:  Ok
Documentation style:       Ok
Message/Query text style:  Ok
Unwanted Spaces:           Ok

Another interesting thing that is happening is that if I run package-install-from-buffer in my package (not in the MELPA fork) it installs without any issues.

How can I debug this error since apparently it doesn't give any indication of what made it happen in the first place.


texts: How to trigger function on particularly named buffer creation?

texts:
How does one trigger a function to run when a buffer of a particular name is created?

My use case is connecting to freenode with ERC for Emacs related channels. I manually call a function to create a new frame with a window layout specific to the channels I auto join, #emacs #org-mode #erc & #gnus. I'd like the function to automatically kick off after the last channel, in this case '#gnus', is created.


texts:
when to use cl-block over the most common let scoping?

When a form is expected to return multiple possible values, is cl-block the choice over let?


texts: With org-babel how can I read a result block and pass arguments?

texts:
I asked a similar question a few years ago but I never did figure out how to proceed. I ended up aborting my excursion into org-babel.  However, I can see how this would be really valuable, to intermix a basic org file with scripts and results.  Unfortunately, it seems either groovy support in org-babel doesn't have all the bells or whistles or I just don't know the workarounds.  I think it's an element of both.

I want to do something like this:

#+NAME: do_something
#+BEGIN_SRC groovy  :results output
  // do something groovy to generate results
#+END_SRC

#+NAME: process_something
#+BEGIN_SRC groovy :results output :vars mylist=do_something
  // now process all those groovy things
  mylist.each{ thing ->
      println thing
  }
#+END_SRC

However, it seems groovy doesn't have vars (see original question, above).

I also tried this:

#+NAME: process_something(mylist=do_something)
#+BEGIN_SRC groovy :results output
  mylist.each{ thing ->
      println thing
  }
#+END_SRC

Which also doesn't work.  Additionally, ideally I would like to reuse a code block which again means somehow getting an argument into the code block.

So what it comes down to is:

How can I process a result block with groovy?
How can I pass an argument into a groovy block?


texts: Is there any way to write html code inside org table that properly be exported as html?

texts:
I want to put one line html code inside org table. I wrote following text(see Input below) in org-mode and exported it to html and opened in my browser(see Output below). But the output is not what I expected.

Input(sample.org):

| No | html code           | desc |
|  1 | #+HTML:
hoge
 | hoge |

Output(sample.html):

My expected output is below.

Expected output(sample.html):

Is there any way to do this?


texts: How to disable a keybind to allow shift selection with custom cursor keybind

texts:
I have back-to-indentation bound to M-u.

When I hold Shift with M-u I'm unable to select the text because M-U (note the capital 'U') is bound to upcase-word

So I disabled that bind by putting: (global-set-key (kbd "M-U") 'ignore) in my init file.

But by doing so, holding Shift with M-u now does nothing.

So how can I disable a keybind getting in the way of shift selecting with my custom cursor moving keybind?


texts:
I normally use emacs (on Linux) running in windowing mode. I have bound a number of functions to special keypresses such as <C-return> and <kp-add>.

Ocasionally, I'm forced to run emacs in a text console, where some of the keypresses cannot be detected.

Is there a way I can tell a console-based emacs, "Pretend I just pressed <kp-add>"?


texts: Viewing & editing Excel spreadsheets and csv files in Emacs


texts: Emacs shortcuts in Mac are worse than in Ubuntu?

texts:
I just moved from Ubuntu to Mac. Maybe I'm wrong but I found the shortcuts in Mac Emacs is harder to use than in ubuntu. Such as I have to frequently use the "Arrow" in Mac to select texts while in Ubuntu I only need to keep my fingers in main area of keyboards. Specifically, I have two questions:

How to select all text in a file? In Ubuntu Emacs, the shortcut is Ctrl-x + h which does not work in Mac Emacs.
Or anyone know how to config the shortcuts in Mac Emacs to be the same in Ubuntu?

Thanks a lot!


texts:
I'm using emacs' gnus to connect to a gmail and a hotmail account, I'm currently unable to split email into specific groups. All of my email is collecting in their respective inboxes, regardless of my efforts to split it.    How can I ensure that I can write rules that will split mail coming to my gmail account and my hotmail account? I've read the gnus documentation for splitting mail several times, but my code is not working.  Here's what I've got written down:

  (setq gnus-secondary-select-methods '((nntp "news.gwene.org")
                                  (nnimap "hotmail"
                                          (nnimap-address "imap-mail.outlook.com")
                                          (nnimap-server-port 993)
                                          (nnimap-stream ssl)
                                          (nnimap-streaming t)
                                          (nnimap-split-method default)
                                          (nnir-search-engine imap))))

 (setq gnus-select-method
  '(nnimap "gmail"
           (nnimap-inbox "Google")
           (nnimap-address "imap.gmail.com")
           (nnimap-server-port "993")
           (nnimap-stream ssl)
           (nnimap-split-method default)))

   (setq nnimap-split-methods
       '(("Accrisoft Support" "^From:.*support@accrisoft.com.*")
         ("Basecamp" "^From:.*notifications@basecamp.com.*")
         ("arch" "^To:.*arch-general@archlinux.org.*$")
         ("emacs devel" "^To:.*emacs-devel@gnu.org.*")
         ("emacs devel" "^CC:.*emacs-devel@gnu.org.*")
         ("bug-hurd" "^To:.*bug-hurd@gnu.org.*")
         ("bug-hurd" "^Cc:.*bug-hurd@gnu.org.*")))

What am I doing wrong?


texts: How to change the reminder/announcement times for `appt`?

texts:
I want to change the reminder/announcement times that appt uses.  I know I can do things like:

(setq appt-message-warning-time 15)

to start the reminders 15 minutes ahead, but how do I change the interval inbetween?  How to have reminders at 15, 10, 5, and 1 minute(s), for example?


texts: What's the most effective way to modify this internal mode config?

texts:
markdown-mode defines tab-width using a magic number when loaded, overwriting any global settings I have (namely, 2 spaces):

;;;###autoload
(define-derived-mode markdown-mode text-mode "Markdown"
"Major mode for editing Markdown files."
;; Natural Markdown tab width
(setq tab-width 4)

This doesn't seem to be something I can advise on load. A load-hook also seems kind of hacky, and shadowing a specific copy of this file makes it brittle against updates. (Forking and submitting a PR is sort of a roundabout way too.)

What's a set-and-forget way to clobber this setting so that it obeys the global setting?


texts: reopening emacsclient -t with desktop-save-mode doesn't save buffers/frames in place

texts:
I added (desktop-save-mode 1) to my custom.el towards the end to save buffers and frames. But I primarily use emacs --daemon and start an emacsclient -t. For some reason, if I use just Emacs the desktop-save-mode works but if I use the emacsclient, when I exit the client and return the buffers from the previous session load for a split second and are replaced by the *scratch* buffer.

Please let me know what I'm doing wrong or if there's a setting I can add.

Thanks!!

I've read the following posts but it seems the OP below fixed the problem by killing the emacsclient which I don't want to do.
Using desktop-mode with Emacs Daemon


texts: Attempting to use org-babel to write “literate” Rust

texts:
I'm playing around with writing Rust snippets in my editor. I can get org mode to format my things nicely and play nicely with rust-mode. But I can't evaluate my code snippets. I think that may be because Rust isn't strictly a scripting language, as the suggestive error,
"error: no such subcommand: script"
provides, when I try to expand my rust source blocks. I could be just misunderstanding though.

Edit: I figured out how to solve my problem but minutes later, see answer below. I've moved onto a new question though: how I might run a linter or flycheck in org-mode.


texts: Definitive answer to org-mode export HTML versus LaTeX

texts:
I keep being stymied by the apparent incompatibility of HTML and LaTeX export. Here's what I have in my .org file header:

#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [american]
#+LATEX_HEADER: \usepackage{tikz}
#+LATEX_HEADER: \usepackage{commath}
#+LATEX_HEADER: \usepackage{stackengine}
#+LaTeX_HEADER: \usepackage{pgfplots}
#+LaTeX_HEADER: \usepackage{sansmath}
#+LATEX_HEADER: \usepackage{mathtools}
#+LaTeX_HEADER: \usepackage{amsmath}

In reality, I don't know if this gets seen by orgmode export to HTML, perhaps by export to LaTeX? So to start, here is working piece of markup that displays great in both HTML and LaTeX:

#+begin_src latex :packages '(("" "tikz")) :exports results :results output raw :file other12.png :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 500

\usetikzlibrary{decorations.pathreplacing}

  \begin{tikzpicture}[scale=1]
    \draw[step=1cm,thin,gray!60] (-6,-6) grid (6,6);
    \draw[<->] (-6,0)--(6,0) node[right]{$x$};
    \draw[<->] (0,-6)--(0,6) node[above]{$y$};
    \draw[line width=2pt,blue,-stealth](0,0)--(4,-3) node[anchor=south west]{$\boldsymbol{(4,-3)}$};
    \draw[line width=2pt,gray,-stealth](2,3)--(6,0) node[anchor=south west];
    \draw[line width=2pt,gray,-stealth](-5,4)--(-1,1) node[anchor=south west];
    \draw[line width=2pt,gray,-stealth](-3,-1)--(1,-4) node[anchor=south west];
\draw [decorate,color=red,decoration={brace,amplitude=10pt},xshift=-0pt,yshift=0pt] (-5.0,1.0) -- (-5.0,4.0) node [red,midway,xshift=-0.65cm]
{\footnotesize $-3$};
    \draw [decorate,color=red,decoration={brace,amplitude=10pt,mirror,raise=1pt},xshift=-0pt,yshift=0pt] (-5,1) -- (-1,1) node [red,midway,yshift=-0.6cm] {\footnotesize $4$};
  \end{tikzpicture}

#+end_src

This also displays in both HTML and LaTeX correctly:

\begin{align*}
\|x\|&=\sqrt{4^2+(-3)^2} \\
&= \sqrt{25} \\
&= 5
\end{align*}

as well as this:

\begin{equation*}
    x = \begin{pmatrix}
        \phantom{-} 4 \\
           -3 \\
        \end{pmatrix}
 \end{equation*}

but this on the HTML side

\setstackEOL{\\}
\begin{equation*}
x=\parenVectorstack[r]{4\\-3\\2}
\end{equation*}

doesn't know what \setstackEOL{\\} is, nor \parenVectorstack[r] and displays mangled. The LaTeX export looks fine, though. And if I put it in a LaTeX babel code block, it disappears from the HTML entirely, while, again, the LaTeX export displays just fine. Confusing is how the Tikz code block is displayed in both HTML and LaTeX, but any other attempt at a LaTeX code block is ignored and left completely out of the HTML export.

My educated guess is that the org-mode HTML export processes is handled by MathJax, which is a subset of LaTeX. But then I'd like to know definitively what can be done and what cannot be done LaTeX-wise for the HTML export.


texts:
I've been using org-mode everyday at work for 3 years and recommend that everyone to do the same.

But today, I unintentionally triggered a column function which replaced the cell value with an elisp statement.

Original Table

| Column1 | Column2                                           |
|---------+---------------------------------------------------|
| Task1   | Map =LDAPGroupA= group to =ApplicationRoleA= role |

Removed Map + space from cell

| Column1 | Column2                                           |
|---------+---------------------------------------------------|
| Task1   | =LDAPGroupA= group to =ApplicationRoleA= role     |

Out of habit, did C-c C-c to reformat table.
Result

| Column1 | Column2                                          |
|---------+--------------------------------------------------|
| Task1   | eq(LDAPGroupA, group to, ApplicationRoleA, role) |
#+TBLFM: $2=LDAPGroupA= group to =ApplicationRoleA= role

Why did cell in org table turn into elisp statement and column TBLFM?

  GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10) of 2017-04-21
   Org mode version 9.0.9 (9.0.9-elpa)


texts: Emacs PDE seems to ignore PERL5LIB environmet variable to use @INC

texts:
I'm using emacs 26.3 under FreeBSD 12 environment and try to use PDE. My problem is that in the runtime environment the modules (@INC array) are properly addressed by the PERL5LIB variable. But using emacs and PDE or flycheck, flymake the local PERL5LIB is ignored. What do I've to do to get the emacs setup running?

Details:

For my own perl5modules, I've a special place in my home directory ~/lib/perl5, which is addressed by the enviromnent variable

export PERL5LIB=$HOME/lib/perl5

by my bash shell resource script .bashrc. Modules from project directories are soft linked from the project directory into the perl5 library location. For an example I've a project in $HOME/project/daisi-lts with a perl5 module repository in it, under

$HOME/project/daisi-lts/lib/perl5/Daisi

. It is soft linked by

$ ln -s $HOME/project/daisi-lts/lib/perl5/Daisi $HOMElib/perl5/Daisi
$ ls lib/perl5/Daisi/
Common.pm   Parser Progress.pm

$ head lib/perl5/Daisi/Common.pm
# =====================================================================
# Package Common.pm  utils, dictioaries and constants for the
# daisi backup suite
# =====================================================================
package Daisi::Common;
use v5.20.1;
use strict;
...
1

So the file is present. To test the strange behavoir I've written the following program:

#!/usr/bin/env perl
use strict;
BEGIN {
    print " --- MODULE PATH --- \n";
    for my $path (@INC) {
        my $status = -e $path ? 'OK' : 'MISSING';
        print "PATH: $path $status\n";
    }
    print " ------- EOF ------- \n\n";
}

END {
    print " --- TEST VERSION --- \n";
    use Daisi::Common;
    my $APP_DICT = Daisi::Common::createAppDict(
        'VERSION 1.0','2020-01-23', 'user@host',  'user');
    Daisi::Common::version($APP_DICT, $0, 1 );
    print " ------- EOF ------- \n\n";
}

If try to use the PDE for syntax check I get the error!

Can't locate Daisi/Common.pm in
@INC (you may need to install the Daisi::Common module) \
(@INC contains: /usr/local/lib/perl5/site_perl/mach/5.30 \
               /usr/local/lib/perl5/site_perl \
               /usr/local/lib/perl5/5.30/mach \
               /usr/local/lib/perl5/5.30) at test-inc line 14.\
 BEGIN failed--compilation aborted at test-inc line 14.

If I using the shell environment everything is fine:

$/usr/bin/env perl test-inc
--- MODULE PATH ---
PATH: /home/i4w/lib/perl5 OK
PATH: /usr/local/lib/perl5/site_perl/mach/5.30 OK
PATH: /usr/local/lib/perl5/site_perl OK
PATH: /usr/local/lib/perl5/5.30/mach OK
PATH: /usr/local/lib/perl5/5.30 OK
 ------- EOF -------

 --- TEST VERSION ---
STATUS: INFO INTERNAL
test-inc VERSION: VERSION 1.0 DATE: 2020-01-23 CONTACT: <user> user@host

What info do I've to give emacs to get it work?

For the PDE the setup I use following elisp settings:

(add-to-list 'load-path "~/lib/emacs/pde")
(load "pde-load")

(require 'flycheck)
(global-flycheck-mode t)

EDIT and some tests after the advice of Stephan:

It is a little bits scatter over the config variables.

The vaue of the perl environment (query in elisp) is empty.

(getenv "PERL5LIB") is nil
Setting the shell environment according to Keith Flower
"I think both M-x shell-command and M-x compile execute commands in an inferior shell via call-process." via elisp

(setq shell-file-name (getenv "SHELL"))

(setq shell-command-switch "-ic")

will correct the wrong behavior of PDE Check syntax (C-c s) but not for flycheck.

Duplicate explicitly the setup of PERL5LIB via elisp:

(setenv "PERL5LIB" (concat (getenv "HOME") "/lib/perl5"))

will work for the PDE and for flymake, flycheck too.

But why does emacs bypasses/ ignores the user shell settings?


texts: How to re-evaluate transparency when frame-alpha-lower-limit changes?

texts:
I configured emacs to be slightly transparent in my init.el

(set-frame-parameter (selected-frame) 'alpha '(97 . 85))
(add-to-list 'default-frame-alist   '(alpha . (97 . 85)))

I wanted to be able to toggle transparency on/off, and I saw this in the documentation for Font and Color Parameters:

  To prevent the frame from disappearing completely from view, the variable frame-alpha-lower-limit defines a lower opacity limit. If the value of the frame parameter is less than the value of this variable, Emacs uses the latter.  By default,frame-alpha-lower-limit is 20.

Flipping frame-alpha-lower-limit between 100 and its default 20 seemed like a good way to implement the toggle without having to hard-code my alpha settings into it or record any previous values.

(defun ivan/toggle-transparency ()
  (interactive)
  (setq frame-alpha-lower-limit
        (if (eql frame-alpha-lower-limit 100) 20 100)))

But changing the lower limit doesn't trigger any re-evaluation of the relationship between the alpha parameter and its lower limit. I tried (redraw-frame) and (sit-for 0), but the only thing that worked was using set-frame-parameter to set the alpha to it's current setting.

(defun ivan/toggle-transparency ()
  (interactive)
  (setq frame-alpha-lower-limit
        (if (eql frame-alpha-lower-limit 100) 20 100))
  (set-frame-parameter (selected-frame)
                       'alpha
                       (frame-parameter (selected-frame) 'alpha)))

Is there any other way to do this?


texts: Cannot capture notes into separate org file when entering reference into Bibtex with ivy

texts:
I am using emacs 27.1-4.1 with Spacemacs v.o.200.13 Ivy and vims. I am relatively new to emacs and am expanding into bibtex with ivy-bibtex. in my .spacemacs file is:
(autoload 'ivy-bibtex "ivy-bibtex" "" t)
(setq ivy-re-builders-alist
  '((ivy-bibtex . ivy--regex-ignore-order)
    (t . ivy--regex-plus)))

(setq bibtex-completion-bibliography '("/home/rherbert/Documents/Library/Bib_Files/FN_Rights.bib")
  bibtex-completion-library-path '("/home/rherbert/Documents/Library/Bib_PDFs/")
  bibtex-completion-notes-path "/home/rherbert/Documents/Library/Bib_Files/FN_Quotes.org")

(setq bibtex-completion-additional-search-fields '(keywords))
(setq bibtex-completion-format-citation-functions
  '((org-mode      . bibtex-completion-format-citation-org-title-link-to-PDF)
    (latex-mode    . bibtex-completion-format-citation-cite)
    (markdown-mode . bibtex-completion-format-citation-pandoc-citeproc)
    (default       . bibtex-completion-format-citation-default)))

(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
I have no problem entering references in the bib file. After filing in the bibtex template I C-c to cleanit up and then :w to save. There is no problem searching the bib file with ivy-bibtex. However, bibtex does not capture a note and send it into the .org file set to receive it.
Any suggestions for why the capture is not working?
[note that the symbol for notes does not work either, but that is a minor problem]


texts:
I tried M-x po-mode, but it is not installed. I have tried to find a gettext or po-mode package under M-x list-packages as well as M-x package-install, but I couldn't find either. I have gettext and relevant libraries, as shown here:

[my-pc]/home/lucas$ whereis gettext
gettext: /usr/bin/gettext /usr/bin/gettext.sh /usr/lib/gettext /usr/share/gettext /usr/share/man/man1/gettext.1.gz /usr/share/man/man3/gettext.3.gz /usr/share/info/gettext.info.gz
[my-pc]/home/lucas$ whereis poedit
poedit: /usr/bin/poedit /usr/lib/poedit /usr/share/poedit /usr/share/man/man1/poedit.1.gz

I have reviewed the emacs PO mode docs and relevant install instructions, but I still cannot find a way to install po-mode on emacs. Any suggestions?

Here is more system info, if interested:

[my-pc]/home/lucas$ uname -a
Linux my-pc 4.2.2-1-ARCH #1 SMP PREEMPT Tue Sep 29 22:21:33 CEST 2015 x86_64 GNU/Linux
'M-x version'
GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis

Update

It looks like the elisp files should be installed with the gettext package on my OS, but I don't think my installation includes them. I searched /usr/share/gettext but did not find anything:

[my-pc]/home/lucas$ tree /usr/share/gettext/ | grep emacs
    ├── po-emacs-x.css
    ├── po-emacs-xterm16.css
    ├── po-emacs-xterm256.css
    ├── po-emacs-xterm.css
[my-pc]/home/lucas$ tree /usr/share/gettext/
├── ABOUT-NLS
├── archive.dir.tar.xz
├── config.rpath
├── gettext.h
├── intl
│   ├── bindtextdom.c
│   ├── config.charset
│   ├── COPYING.LIB
│   ├── dcgettext.c
│   ├── dcigettext.c
│   ├── dcngettext.c
│   ├── dgettext.c
│   ├── dngettext.c
│   ├── eval-plural.h
│   ├── explodename.c
│   ├── export.h
│   ├── finddomain.c
│   ├── gettext.c
│   ├── gettextP.h
│   ├── gmo.h
│   ├── hash-string.c
│   ├── hash-string.h
│   ├── intl-compat.c
│   ├── intl-exports.c
│   ├── l10nflist.c
│   ├── langprefs.c
│   ├── libgnuintl.in.h
│   ├── libintl.rc
│   ├── loadinfo.h
│   ├── loadmsgcat.c
│   ├── localcharset.c
│   ├── localcharset.h
│   ├── locale.alias
│   ├── localealias.c
│   ├── localename.c
│   ├── lock.c
│   ├── lock.h
│   ├── log.c
│   ├── Makefile.in
│   ├── ngettext.c
│   ├── os2compat.c
│   ├── os2compat.h
│   ├── osdep.c
│   ├── plural.c
│   ├── plural-exp.c
│   ├── plural-exp.h
│   ├── plural.y
│   ├── printf-args.c
│   ├── printf-args.h
│   ├── printf.c
│   ├── printf-parse.c
│   ├── printf-parse.h
│   ├── ref-add.sin
│   ├── ref-del.sin
│   ├── relocatable.c
│   ├── relocatable.h
│   ├── setlocale.c
│   ├── textdomain.c
│   ├── threadlib.c
│   ├── tsearch.c
│   ├── tsearch.h
│   ├── vasnprintf.c
│   ├── vasnprintf.h
│   ├── vasnwprintf.h
│   ├── verify.h
│   ├── VERSION
│   ├── version.c
│   ├── wprintf-parse.h
│   ├── xsize.c
│   └── xsize.h
├── javaversion.class
├── msgunfmt.tcl
├── po
│   ├── boldquot.sed
│   ├── en@boldquot.header
│   ├── en@quot.header
│   ├── insert-header.sin
│   ├── Makefile.in.in
│   ├── Makevars.template
│   ├── quot.sed
│   ├── remove-potcdate.sin
│   └── Rules-quot
├── projects
│   ├── GNOME
│   │   ├── team-address
│   │   ├── teams.html
│   │   ├── teams.url
│   │   └── trigger
│   ├── index
│   ├── KDE
│   │   ├── team-address
│   │   ├── teams.html
│   │   ├── teams.url
│   │   └── trigger
│   ├── team-address
│   └── TP
│       ├── team-address
│       ├── teams.html
│       ├── teams.url
│       └── trigger
└── styles
    ├── po-default.css
    ├── po-emacs-x.css
    ├── po-emacs-xterm16.css
    ├── po-emacs-xterm256.css
    ├── po-emacs-xterm.css
    └── po-vim.css

7 directories, 100 files

It also seems like the archlinux gettext package does not include any elisp files, shown here: https://www.archlinux.org/packages/core/x86_64/gettext/ (file list is at the bottom)

For the meantime, I may just manually install the source elsewhere.


texts: How do I install `mmm-mode` (through MELPA)?

texts:
mmm-mode is available on Melpa.

Yet both

`M-x` `list-packages` `C-s` `mmm-mode`

and

`M-x` `package-install` `mmm-mode`

suggest that it's not.

How do I install mmm-mode (through MELPA)?


texts: Need help with JavaScript `{` indentation

texts:
I'd need some guidance with adjusting my indentation settings for js-mode (JavaScript).  It should basically look like C/C++'s Stroustrup mode. Most of it works as expected, however there are some cases that are not indented as expected:

Indentation of multi-line initialiters { should start at column of declaration (var or const):

function make_curve (id, color, fillColor)
{                         // correct
    const en =            // correct
    {                     // desired
          {               // current, wrong

The indentation does match with const en = {but I very much prefer to put { in an extra line and align { with the matching }.
Opening brace of function body should be aligned with function keyword. Example:

window.animate
    = (window.requestAnimationFrame
       || window.webkitRequestAnimationFrame
       || ...
       || function (callback)
          {           // desired
       {              // current wrong

My current setup is:

(defun my-js-mode-hook ()
  (interactive)
  (setq tab-width 4
        ;; this will make sure TABs are used instead of spaces
        indent-tabs-mode t)
  )

(add-hook 'js-mode-hook 'my-js-mode-hook)


texts: Custom sort order based on certain elements of a list

texts:
Q:  Each sub-list within the main list contains one of five possible categories.  How can I customize the sort in the following order:

CUSTOM SORT ORDER:

1.  TASKS

2.  EVENTS

3.  UNDATED

4.  CONTACTS

5.  DONE

BEGIN WITH:

'((("id" . "005") ("folder" . "EVENTS") ("misc" . "apples") ("foo" . "1"))
  (("id" . "123") ("folder" . "CONTACTS") ("misc" . "oranges") ("foo" . "3"))
  (("id" . "975") ("folder" . "UNDATED") ("misc" . "figs") ("foo" . "7"))
  (("id" . "456") ("folder" . "TASKS") ("misc" . "bananas") ("foo" . "5"))
  (("id" . "871") ("folder" . "DONE") ("misc" . "pears") ("foo" . "2"))
  (("id" . "045") ("folder" . "EVENTS") ("misc" . "plums") ("foo" . "8"))
  (("id" . "172") ("folder" . "CONTACTS") ("misc" . "avocados") ("foo" . "4"))
  (("id" . "843") ("folder" . "UNDATED") ("misc" . "nectarines") ("foo" . "6"))
  (("id" . "523") ("folder" . "TASKS") ("misc" . "onions") ("foo" . "10"))
  (("id" . "278") ("folder" . "DONE") ("misc" . "coconuts") ("foo" . "9")))

END-WITH:  (a secondary sort, after sorting by 5 categories is not required in this example).

'((("id" . "523") ("folder" . "TASKS") ("misc" . "onions") ("foo" . "10"))
  (("id" . "456") ("folder" . "TASKS") ("misc" . "bananas") ("foo" . "5"))
  (("id" . "005") ("folder" . "EVENTS") ("misc" . "apples") ("foo" . "1"))
  (("id" . "045") ("folder" . "EVENTS") ("misc" . "plums") ("foo" . "8"))
  (("id" . "975") ("folder" . "UNDATED") ("misc" . "figs") ("foo" . "7"))
  (("id" . "843") ("folder" . "UNDATED") ("misc" . "nectarines") ("foo" . "6"))
  (("id" . "172") ("folder" . "CONTACTS") ("misc" . "avocados") ("foo" . "4"))
  (("id" . "123") ("folder" . "CONTACTS") ("misc" . "oranges") ("foo" . "3"))
  (("id" . "871") ("folder" . "DONE") ("misc" . "pears") ("foo" . "2"))
  (("id" . "278") ("folder" . "DONE") ("misc" . "coconuts") ("foo" . "9")))


texts: Why is Org mode converting spaces in links to HTML entities?

texts:
I store a link such as [[file:~/path/to/dir/some file.txt::# heading]], either manually or through org-capture. A few days later, Org has converted all spaces to the HTML entity %20: [[file:~/path/to/dir/some%20file.txt::#%20heading]], and the link now fails.
The file on disk does not change, rather Org (or some other process) changes the link to that file, replacing spaces with %20.
Why is this happening, and how can I prevent it?


texts: Jumping to a Heading from Org-Agenda view

texts:
I'm trying to jump from Agenda view to a particular Heading in an org file. The Heading has nothing to do with the items currently displayed in the Agenda.

If my buffer was an org file, I'd simply use C-u C-c C-w (refile to hop to a sub-tree without moving current subtree). However, this key binding does not work from Agenda view. I tried M-x org-goto-interface. However, the command org-goto-interface was not available when in Agenda view.


texts: Flycheck Python introspection into modules?

texts:
I have flycheck working seemingly as advertised with Python on Emacs 25.2.1.

The configuration check shows all dependencies are satisfied and enabled. It does handle introspection within the same file, but for my imports it does not introspect into those objects to verify if the attributes exist in that object.  For example:

from modules import some_module

some_module.some_function(some_arg) # some_function does not exist, should highlight

The jedi-youcompleteme is able to drill down into those imported objects to get the docstrings, and I am wondering if flycheck is capable of drilling down as well.

I have tried the advice to run M-x flycheck-select-checker then 'python-pylint' as recommended at Flycheck- check python module import but it had no effect.

I'm a daily IdeaUltimate user but have also used Emacs for some time when in a terminal and want to use it on the desktop as well.


texts: `org-re-reveal` custom slide keyboard bindings

texts:
Per the reveal.js docs on keyboard bindings, I'd like to find a way to configure the keyboard bindings in the following way:

Reveal.configure({
  keyboard: {
    // left, down -> next
    40: 'next', // ↓
    39: 'next', // ->
    // right, up -> prev
    37: 'prev', // <-
    38: 'prev', // ↑
    // return, space -> down
    13: 'down', // <RET>
    32: 'down', // <SPC>
    // backspace -> up
    8:  'up' // <BSPC>
  }
});

with org-re-reveal, but I'm stuck on how to actually do that either on a per-file (which is preferred) or global basis. I tried saving the above javascript as kbd-config.js in the same directory as my presentation.org and putting

#+REVEAL_INIT_SCRIPT: kbd-config.js

on a line towards with the top of presentation.org (along with #+OPTIONS: ...), but that lead to a blank presentation.

(Context: this would be a useful customization because my presentation remote only has buttons that correspond to ArrowUp and ArrowDown. I'm not sure what a better work-around would be, especially because this at least gives me the option of going over to the computer and navigating up and down if I really want to.)

Edit:

I renamed kbd-config.js to kbd.js and updated it in the following manner:

function () {
  return { keyboard: {
    // left, down -> next
    40: 'next', // ↓
    39: 'next', // ->
    // right, up -> prev
    37: 'prev', // <-
    38: 'prev', // ↑
    // return, space -> down
    13: 'down', // <RET>
    32: 'down', // <SPC>
    // backspace -> up
    8:  'up' // <BSPC>
  }}};

and included the line #+REVEAL_INIT_SCRIPT:./kbd.js in presentation.org, which produced the same blank slideshow. My browser's console had two errors:

presentation.html:115 GET file:///Users/matlock/technical/install/reveal.js/lib/js/head.min.js net::ERR_FILE_NOT_FOUND
presentation.html:147 Uncaught SyntaxError: Unexpected token .

The second error pointed to this block

<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({

controls: true,
progress: true,
history: false,
center: true,
slideNumber: 'c',
rollingLinks: false,
keyboard: true,
mouseWheel: false,
fragmentInURL: false,
pdfSeparateFragments: true,

overview: true,

theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'slide', // see README of reveal.js for options
transitionSpeed: 'default',

// Optional libraries used to extend on reveal.js
dependencies: [
 { src: 'file:///path/to/reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
 { src: 'file:///path/to/reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
 { src: 'file:///path/to/reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
 { src: 'file:///path/to/reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
 { src: 'file:///path/to/reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }]

,./kbd.js});
</script>

which is where the problem seems to occur. Clearly there's an issue with the way I'm trying to include JavaScript, but I simply don't know how to do it.


texts: Fail to start Python Language Server when Python virtual env is activated from .dir-locals.el

texts:
I have the following in a .dir-locals.el

((python-mode . ((pyvenv-workon . "3.7")
     (projectile-project-compilation-cmd . "python -m unittest fixcompdb_test.py"))))

I use lsp-mode and the Pyls Python Language Server which is installed in the virtual environment labeled "3.7". I expect that when I open a Python file in the directory containing the .dir-locals.el, lsp-mode should be able to start Pyls. This doesn't work, lsp-mode reports that the Pyls server is not accessible. If I instead do "pyvenv-workon" and select "3.7" before opening a Python file it works, lsp-mode can start Pyls and I have a fully working lsp-mode session.

In the case when I do not explicitly do "pyvenv-workon" and lsp-mode is unable to start Pyls the virtual environment still works; all buffers in emacs use the correct virtual env and it is reported correctly in my doom-modeline.

It seems like lsp-mode is trying to start Pyls before Emacs has activated the virtual env. How do I set this up so that lsp-mode will try to start Pyls when the virtual env is up and running?


texts: Replacing buffer content without losing point

texts:
I looking into extending atomic-chrome to work with text areas that can be modified from the server side, such as site providing collaborative LaTeX editing. The plugin provides updates containing the full text of the modified buffer as a string whenever it changes in the browser window, but it currently performs the update by erasing the buffer and reinserting the full text. As a consequence, the position of point is lost each time changes are made on the browser side.

I believe it might be possible to work around this using a similar mechanism to that which revert-buffer uses behind the scenes to update the buffer contents, which is to call insert-file-contents with the REPLACE argument. Unfortunately, using this function directly would require writing the updated state to a file first, which seems hacky to me.

Is there a way to replicate the behavior of insert-file-contents with a string instead of file contents, or some other way of achieving the same goal?


texts:
Only when rust-mode is enabled, what is the best way to insert a newline after a press on the ; key? This is what I have actually:

(defun my-rust-lang-mode-config ()
   (local-set-key (kbd ";") (lambda () (interactive) (insert ";")(newline-and-indent))))
(add-hook 'rust-mode-hook 'my-rust-lang-mode-config)


texts: Is it possible to disable automatic "mark"ing in emacs?

texts:
I would like to set the marks myself, rather than emacs doing it automatically for me. I've experienced emacs setting the mark automatically when I search, or move to the top/bottom of the buffer. None of that. I would like to set the mark myself.

I just want to define my own interface on what goes in the mark ring.


texts:
For instance, I have the following habit "sleep before 23h"

** TODO sleep before 23h
   SCHEDULED: <2019-09-07 sam. 23:00 +1d>
   :PROPERTIES:
   :STYLE: habit
   :END:

And I mark it as DONE on my agenda each time I'm going to sleep. However, whether or not I've done it before 23h, org-habit considered it as done in time since it's day-based. Is there a trick to change its behaviour so that "sleeping after 23h" in this case is considered overdue?


texts: How can I edit the beginning of the counsel-find-file filename whilst preserving the rest

texts:
I work on projects with deep directory structures and have several copies in different top-level directories. I sometimes find myself wanting to open the corresponding file in one of the other directories.
For example, I might have ~/tree1/a/deep/directory/structure/file.txt open and want to open ~/tree2/a/deep/directory/structure/file.txt. When I press C-x C-f counsel-find-file I'm unable to move my cursor back to the 1 to change it to a 2 - I need to use backspace to delete each path component which I'll need to re-enter (with completion to help me) afterwards. This is a pain for long path names.
Something I used previously (perhaps ido or helm, but I can't seem to find it now) let me press C-x C-f again whilst in the minibuffer to go back to stock find-file, which was sufficient to solve this problem.
I've read the ivy documentation, but I've been unable to find a way to edit the start of the filename with counsel-find-file. Is there something I've missed?


texts: Emacs Compile Mode: Extra characters before filename result in bad match

texts:
In the compile buffer of Emacs 25.3.1, I am getting the following compilation error using Clang (the error message is given as it appears in the compile buffer line by line) :

src/platform/linux/linux.c:668:70: error: no member named 'buffer_size_' in 'struct
      OpenGL_State::(anonymous at src/platform/linux/opengl.c:8:5)'
        init_data->render_command_buffer_size_in_bytes = gl->command.buffer_size_;

Emacs correctly matches src/platform/linux/linux.c:668:70 to be a filepath in the first line; however, in the second line, it matches with OpenGL_State::(anonymous at src/platform/linux/opengl.c:8:5)' instead of src/platform/linux/opengl.c:8:5 which means that when I click on the error, Emacs can not find the file.

How can I make Emacs not start matching the file name from the beginning of the line?


texts:
Right now, I am documenting a larger LaTeX package project by converting the files into DocStrip files.  Therefore I am currently creating a lot of .ins and .dtx-files in Emacs.

Actually I am using AUCTeX, but its support for this tasks lacks a lot of the usual comfort.

For example: in the .ins-batchfiles, I very often need to insert constructs as

\generate{%
  \usepreamble\stonepreamble%
  \file{tuc-stone.sty}{%
    \from{tuc-version.dtx}{package}%
    \from{tuc-fonts.dtx}{package,tuc-stone}%
    \from{tuc-options.dtx}{default,tuc-stone}%
    \from{tuc-fonts.dtx}{tuc-stone}}%
}%

I can of course type C-cRET to insert the macro \file.  But in that case, only \file{} is inserted.  As you can see, \file originally uses two arguments, and I would like Emacs/AUCTeX to ask me for the file name to generate and---ideally---also to ask my from which sources and optionally guards to use, before inserting

\file{<filename>}{%
   \from{<sourcefile>}{<guard>}}

as result in the current buffer.

Same applies to the \generate-macro.

I haven't found any clues on the internet.  Are there any packages, which support this behaviour or do I need to code them myself?


texts: Multicursor - not select all word in all lines?

texts:
Here is my text:

Now I want to select text after "=" and move it to beginning of word "1111"

M-x mark-sexp

And here is my result:

But I need to select the next words on 4 lines:

1111

aaaaaaaaaaaaa

11111

eeeeeddddd

How I can do this?


texts:
Running org-capture crashes my Emacs (both 24.3 and 24.4 for Linux).

This thread reports the problem is due to cdlatex not being installed.  But installing it does not solve the problem on my computer.

Does anyone know how to solve this problem?


texts: Byte-compile org-babel code blocks when tangled

texts:
I want to override org-babel-tangle-file to byte compile any org-babel code block where a compile: t flag is set in header-args. Here is the idea:

* Sample code block
  :PROPERTIES:
  :header-args: :tangle ~/code.el :compile t
  :END:

  #BEGIN_SRC emacs-lisp
  (insert "Hello world!")
  #END_SRC

and ideal, this would also work at the block level:

* Sample code block

  #BEGIN_SRC emacs-lisp :tangle ~/code.el :compile t
  (insert "Hello world!")
  #END_SRC

and globally as well:

#+TITLE: Sample org file
#+PROPERTY: header-args :tangle "~/code.el" :compile t

* Sample code block

  #BEGIN_SRC emacs-lisp
  (insert "Hello world!")
  #END_SRC

Any thoughts?


texts: No such file or directory error on executing script

texts:
I use GNU Emacs 24.3.1 on Ubuntu 14.04 and I have a bash script: ~/path/to the/script/test.sh. As you see the path has space character. Script has a simple content:

ENTRY=`zenity --password --username`

When I try to run script from Emacs by C-c C-x(execute script option from Sh-Script menu), without marking any region, I got this error:

/bin/bash: ~/path/to: No such file or directory

Comint exited abnormally with code 127 ...

But when I try to run that from bash, it runs normally:

~/path/to\ the/script/test.sh

So I'm sure the problem is in about space character in path of script. Also I do not want to change the path (by removing space and for example replacing it by '_') because it is a part of a nested/linked content manager system and changing it may cause a big problem. Is there a way to solve this problem without changing path of script?


texts: describe-package commentary for non built-in packages

texts:
Currently, it seems like describe-package will only show the contents of the 'commentary' section for packages that are builtin. For example (describe-package 'python) show a detailed description of the package, however (describe-package 'persp-mode) only shows the small amount of meta data present for all packages. This despite the fact that it has a "Commentary" section: link

Reading the source of package.el, this seems to be intentional: package.el link, however the GNU docs certainly suggest that the usage of the commentary section as the long description is not specific to built-in packages. Specifically, "If the file has a ‘;;; Commentary:’ section, this section is used as the long description."

Can anyone explain what's going on here?


texts: Insert byte without overwrite in Hexl mode

texts: The funtion hexl-insert-hex-char in Hexl mode only allows you to replace a byte. How can I insert a new byte between two existing bytes?


texts: is it possible to set linum-mode at startup of buffer?

texts: I wonder if it is possible to set #+STARTUP: linum-mode t or similar at the start of the buffer (not interested in the global mode). I have tried this but it won't work. Any solution? Thanks!


texts: emacs doesn't backwards delete words with M-Del

texts:
I'm using iTerm2 and have my left option key set to +Esc. I can backwards delete words in bash with M-Del (option-Del) but in emacs, M-Del doesn't backwards delete words, it just changes the location of the cursor/point ~150 lines down in the text and then displays Mark set in the echo area.

Anyone know what's going on?


texts:
I'm trying to find a way to run .rb files that are in the $PATH in Eshell by following the solution here. I added ".rb" to exec-suffixes, set eshell-force-execution to t and customized eshell-interpreter-alist like this:

Regexp: \.rb
String: c:/programs/rails/Ruby1.9.3/bin/ruby.exe

But when I run an .rb file in eshell I get an error:

c:\programs\rails\Ruby1.9.3\bin\ruby.exe: No such file or directory -- bill.rb (LoadError)

However it works if I run the file in the directory where it is located or with a full path.
Seems like it is necessary to make interpreter in eshell-interpreter-alist expand bill.rb to its full path somehow to make it work, but I couldn't find a way to do that.


texts: Evil: how to execute multiple commands at command line?

texts:
I want to execute a list of commands all at once in the evil's command line. In vim, you can use the pipe to execute multiple commands, like this:

%s/ó/o/g|%s/ç/c/g

How can I do this in evil?


texts: Is it possible to keep window set up when connecting via emacsclient?

texts:
I love using Emacsserver and Emacsclient, as it saves all of my buffers so that if I log in via ssh and then log out, all of my buffers are saved.

However, when I log into Emacsserver after quitting from another session, the layout (for instance how many windows I have and how they are set up) is gone, and I always start from a Scratch buffer.

In the past I have used TMUX to make it so that when I reconnect to a terminal session, my Emacs session was identical to how I left it.

Even if I minimize Emacsserver before exiting ^z upon reconnecting all of my window set up information is lost.

Is there a way to have Emacsserver remember all your window placement options?


texts: How to show a tooltip for the mode-line that displays the full buffer name

texts: Is there a way to show a tooltip that contains the full buffer name when I hover over the buffer name part of the mode line? I'd like to quickly check the full buffer name when I have a narrow frame that only shows the beginning of the buffer name in the mode line. Currently it only displays a tooltip that says "Buffer name".


texts: How to introspect function & macro arguments in elisp?

texts:
Is there a programmatic way to access function/macro arguments,

Something like this, which returns the the arg count and true if it accepts any number of additional arguments.

eg:

(number-of-arguments-and-rest "if") -> '(2, t)
(number-of-arguments-and-rest "progn") -> '(0, t)
(number-of-arguments-and-rest "null") -> '(1, nil)


texts:
There are two other questions asking this, but one accepted an answer that didn't help, and the other lacked detail.

To reproduce:

Ubuntu 14.04 running emacs-snapshot from ppa.launchpad.net/ubuntu-elisp/ppa/ubuntu
Fire up emacs -Q.
M-x org-version => Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.50/lisp/org/)
M-x emacs-version => GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-10-26
eval (setq org-src-fontify-natively 't)

Then make a tiny example:

* Simple Program
#+BEGIN_EXAMPLE ruby
  puts("foo")
#+END_EXAMPLE

Voila: in the message buffer org-mode fontification error [15 times].

How can I fix the fontification, so my buffers look pretty and my exports work?


texts: Move folder using spacemacs with emacs command

texts:
I am a beginner using spacemacs and also new to emacs.
What I try is to use the command M-x R new RET (dired-do-rename).
Though everytime I type M-x, which is the same as SPC : I end up with helm-M-x. My problem is that I would like to use just the letter R now instead of typing e.g. renam to get the dired-do-rename command.
Is there a possibility to avoid helm-M-x when I know the shortcut (M-x R new RETin this case)?


texts: Differences between cmdproxy.exe and cmd.exe

texts:
What is the difference between:

(call-process "cmdproxy"  nil "foo" nil "/c"  "dir")
(call-process "cmd"  nil "foo" nil "/c"  "dir")

?

I seem to get exactly the same results in Emacs 25.1 on Windows 10, except  cmdproxy  works with the -c switch too.

Update

Probably not everyone knows that Microsoft (Windows) has nothing to do with cmdproxy.exe. It is a binary part of Emacs distribution (i.e. made by Emacs developers) in order to call Windows subprocesses. As noted above, I don't see  any sensible benefit over cmd.exe.
Hence this question belongs here,  not Windows forums.


texts: How to enable paredit mode on all clojure, closurescript and elisp buffers automatically?

texts:
I want to enable paredit-mode on all clojure, cljs and elisp buffers by default, which is probably going to happen through the .spacemacs file. This is what I have so far in the user-config function of my .spacemacs:

;; paredit autoload
  (autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
  (add-hook 'clojure-mode #'enable-paredit-mode)
  (add-hook 'clojurescript-mode #'enable-paredit-mode)

But it doesn't really work. What am I doing wrong?


texts:
My user-config looks following:

(defun dotspacemacs/user-config ()
  (setq-default dotspacemacs-configuration-layers
   '((erc :variables
      erc-server-list
      '(("chat.freenode.net"
         :port "6697"
         :ssl t
         :nick "siulkilulki")))))
)

According to point 3.4 in http://spacemacs.org/layers/+chat/erc/README.html
it should set default servers, but when I press <leader>aiD I get you must define erc-server-list. What did I do wrong?


texts: how to quote parameters in source blocks

texts:
I have two (org-mode) source blocks, both with parameters:

select-union(tbl=a_table)

and

column-names(tbl=a_table)

Both produce SQL artifacts from the table data.
Now I want to write a new source block which calls both of these.

#+BEGIN_SRC sql :var tab=an_example_table
;with src as (
  select * from (
    <<select-union(tbl=tab)>>
  ) X(<<column-names(tbl=tab)>>)
)
select * from src
#+END_SRC

This errors at me in a somewhat unfriendly manner, something about tab not being a valid block name. So here's my question:

In a source block A, how do I call another source block B with one of A's parameters as parameter value?


texts: How to start two ordered lists one right after the other in org-mode?

texts:
So, I want to have two numbered list one immediately after the other, but when I add new items to the second list with M-RET, or do anything else org-mode-ish in the vicinity of the lists, the second list gets renumbered as if part of the first one.

So, I want them to be:

1. first list, item one
2. first list, item two
1. second list, item one
2. second list, item two

How do I do that without "mangling" them when adding new items?


texts: AUCTeX: 'reftex-cleveref-cref' inserts '\eqref' instead of '\cref' for equations

texts:
When I run 'reftex-cleveref-cref', which is supposed to insert a '\cref' command in my LaTeX file, I get the expected behaviour for figures and sections, but not for equations: I get the '\eqref' command for equations.

What is making the function insert '\eqref' instead of '\cref', only for equations?

'reftex-cleveref-cref' is a function in `reftex-ref.el', but I did not find the solution by looking at this file.


texts: Command to apply invisible property to selection

texts:
I would like to have a command that makes selected text invisible, and another to make selected text visible.  Currently I have

(buffer-invisibility-spec '(a . t))

(global-set-key (kbd "C-c i") (add-text-properties (region-beginning) (region-end) '(invisible a)))
(global-set-key (kbd "C-c v") (add-text-properties (region-beginning) (region-end) '(invisible nil)))

which works if I run the first line in a buffer, but (buffer-invisibility-spec '(a . t)) throws a void-function error when placed in the init file, (I believe) because there is no buffer yet.  I couldn't find any global version of invisibility spec, how would I go about having this load in for every buffer?


texts: cant connect with TRAMP (tramp-file-name-handler: Couldn’t find local shell prompt for /bin/sh)

texts:
I have a weird issue in emacs with TRAMP. i can ssh via M-x ssh to a machine (zlap) from within emacs with no issue. yet when i try to use C-x C-f (find file) it hangs after i enter the passphrase. looking at the message buffer i see this:

    Tramp: Opening connection for 132.72.154.204 using ssh...
Tramp: Sending command ‘exec ssh   -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none 132.72.154.204’
Tramp: Waiting for prompts from remote shell...
Timeout reached, see buffer ‘*tramp/ssh 132.72.154.204*’ for details
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for 132.72.154.204 using ssh...failed
Tramp: Opening connection for 132.72.154.204 using ssh...
Couldn’t find local shell prompt for /bin/sh
Tramp: Opening connection for 132.72.154.204 using ssh...failed
tramp-file-name-handler: Couldn’t find local shell prompt for /bin/sh
Invalid face reference: quote [21 times]

looking at the ‘tramp/ssh 132.72.154.204’ buffer shows this

    tramp_exit_status 0
$fg[magenta]zeltak$reset_color$fg[cyan]@$reset_color$fg[yellow]zx1voics$reset_color$fg[red]:$reset_color$fg[cyan]~$reset_color$fg[red]|$reset_color$fg[cyan]⇒$reset_color  #$

im at loss here, any clue how to resolve this?


texts: `which-key` or similar, to show doc strings of commands bound to keys?

texts: which-key package is very useful to show the list of command names. Could it (or any other package) also show the doc string of those commands?


texts: TeXStudio profile for emacs keybindings?

texts:
Does any have a TeXStudio profile for setting basic emacs keybindings (C-p, C-n, C-b, C-f, etc.)? I know I can manually set them myself, but TeXStudio doesn't deconflict hotkeys and the work would be rather tedious (I'm lazy and would rather use someone else's work than do it myself :) ).
Also, I'm aware this question might not fit exactly in this forum, since it's focus is working in TexStudio (not emacs), but I figured fellow emacs-ers might be aware of the solution I'm seeking.


texts: mixing automatic abbrev expansions with explicit-only expansions?

texts:
Q: can I mix abbrev expansions such that some expand automatically, and some only with an explicit call?

When abbrev-mode is enabled, an abbrev expands whenever typing a self-inserting whitespace or punctuation character.  However, expand-abbrev will expand the abbrev at point even when abbrev-mode is disabled.

Is it possible to enable abbrev-mode and have some expansions happen automatically (ie, after whitespace and punctuation), but others expand only when I explicitly call expand-abbrev?

Rationale:

I'd like to use abbrevs automatically to correct common mistyped words (eg, teh => the)...
... but would like to have explicit control of others that I use for shorthand (eg, sometimes I want to leave dem as dem, and other times I'd like it to expand to democracy).

(I know I could type dem C-q <space>, but it's awkward to do so and I usually want to use the shorthand rather than the expansion.)

To forestall well-intentioned "why not use yasnippet?" inquiries:

I'm experimenting with a combination of abbrev-mode and yasnippet, and would prefer to use the latter for complicated expansions and the former for simple ones.


texts: Filtering tasks based on inherited SCHEDULED

texts:
The SCHEDULED property does not respect task inheritance. This is a notable omission but is known. For task prioritization, I have a helper function which performs inheritance manually:

;;; called with `property=SCHEDULED' in `user-defined-up'
(defun task-inherited-property (org-marker property)
  (save-window-excursion
    (switch-to-buffer (marker-buffer org-marker))
    (goto-char org-marker)
    (until-nil org-up-heading-safe)
    (org-entry-get (point) property)))

;;; helper macros
(defmacro until-nil (action)
  `(until (null (,action)) nil))
(defmacro until (test &rest body)
  (declare (indent defun))
  `(while (not ,test) ,@body))

However, I do not know how to apply this in filtering. Right now I use (setq org-agenda-todo-ignore-scheduled 'future) but I want something that respects SCHEDULED inheritance too. How can I do this?